SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.08460 · 2021

Neural Unification for Logic Reasoning over Natural Language

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2109.08460.json · badge: /api/ran/2109.08460.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ibm/neural_unification_for_logic_reasoning_over_language canonical (classifier label)
classifier basis: census
4 ran · 3 no recorded run
FunctionStatusWhere it lives
grad_stats Ran
ran on a synthesized input
ibm/neural_unification_for_logic_reasoning_over_language/spectre/module/utils/utils.py
code served (permissive licence) · get_code("448433cb2e3a3d6a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Create model and set up gradients
m = SimpleModel()

# Forward pass
x = torch.randn(2, 4)
y = torch.randn(2, 2)
output = m(x)
loss = nn.MSELoss()(output, y)

# Backward pass to populate gradients
loss.backward()

ARGS = {
    "m": m
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
padding_sentence_embeddings Ran
ran on a synthesized input
ibm/neural_unification_for_logic_reasoning_over_language/spectre/module/utils/utils.py
code served (permissive licence) · get_code("2cd279f1abf8a32b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create sample sentence embeddings with different lengths
# Each sentence is represented as a 2D tensor of shape (sequence_length, embedding_dim)
sentence1 = torch.randn(3, 4)  # 3 tokens, 4-dimensional embeddings
sentence2 = torch.randn(5, 4)  # 5 tokens, 4-dimensional embeddings
sentence3 = torch.randn(2, 4)  # 2 tokens, 4-dimensional embeddings

sentences = [sentence1, sentence2, sentence3]

ARGS = {
    "sentences": sentences
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
padding_sentences Ran
ran on a synthesized input
ibm/neural_unification_for_logic_reasoning_over_language/spectre/module/utils/utils.py
code served (permissive licence) · get_code("5138dac0857eed5c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# The function expects a list of sentences (1D tensors)
# Each sentence is a tensor with shape (sequence_length,)
# We'll create a few sentences with different lengths

sentence1 = torch.randn(3)  # sequence length 3
sentence2 = torch.randn(5)  # sequence length 5
sentence3 = torch.randn(4)  # sequence length 4

sentences = [sentence1, sentence2, sentence3]

ARGS = {
    "sentences": sentences
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ruletaker_predictions Ran
ran on a synthesized input
ibm/neural_unification_for_logic_reasoning_over_language/spectre/ensemble_tuning.py
code served (permissive licence) · get_code("34d6c0755a0a2b26")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class RuleTaker(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def data_prep(self, context, question):
        # Returns embeds, masks, types
        # embeds: (batch_size, seq_len, embed_dim)
        # masks: (batch_size, seq_len)
        # types: (batch_size, seq_len)
        batch_size = 2
        seq_len = 5
        embed_dim = 4
        
        embeds = torch.randn(batch_size, seq_len, embed_dim)
        masks = torch.ones(batch_size, seq_len)
        types = torch.zeros(batch_size, seq_len, dtype=torch.long)
        
        return embeds, masks, types
    
    def forward(self, embeds, masks, types, answer):
        # embeds: (batch_size, seq_len, embed_dim)
        # Compute loss and output
        batch_size = embeds.shape[0]
        
        # Simple forward pass
        pooled = embeds.mean(dim=1)  # (batch_size, embed_dim)
        output = self.linear(pooled)  # (batch_size, 2)
        
        # Compute simple loss
        loss = torch.nn.functional.cross_entropy(output, answer)
        
        return loss, output

rule_taker = RuleTaker()
question = "What is the answer?"
context = "This is some context."
answer = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "rule_taker": rule_taker,
    "question": question,
    "context": context,
    "answer": answer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tune Not yet run
unverified (harvested, no recorded run)
ibm/neural_unification_for_logic_reasoning_over_language/spectre/ensemble_tuning.py
code served (permissive licence) · get_code("543e5dd41bc1f404")
How it ran

no invocation recorded.

valid Not yet run
unverified (harvested, no recorded run)
ibm/neural_unification_for_logic_reasoning_over_language/spectre/train_backward_chaining_inference.py
code served (permissive licence) · get_code("8b73774460f84275")
How it ran

no invocation recorded.

valid Not yet run
unverified (harvested, no recorded run)
ibm/neural_unification_for_logic_reasoning_over_language/spectre/train_fact_lookup_unit.py
code served (permissive licence) · get_code("ba9afc355125de1c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Automated Theorem Proving (ATP) deals with the development of computer programs being able to show that some conjectures (queries) are a logical consequence of a set of axioms (facts and rules). There exists several successful ATPs where conjectures and axioms are formally provided (e.g. formalised as First Order Logic formulas). Recent approaches, such as (Clark et al., 2020), have proposed transformer-based architectures for deriving conjectures given axioms expressed in natural language (English). The conjecture is verified through a binary text classifier, where the transformers model is trained to predict the truth value of a conjecture given the axioms. The RuleTaker approach of (Clark et al., 2020) achieves appealing results both in terms of accuracy and in the ability to generalize, showing that when the model is trained with deep enough queries (at least 3 inference steps), the transformers are able to correctly answer the majority of queries (97.6%) that require up to 5 inference steps. In this work we propose a new architecture, namely the Neural Unifier, and a relative training procedure, which achieves state-of-the-art results in term of generalisation, showing that mimicking a well-known inference procedure, the backward chaining, it is possible to answer deep queries even when the model is trained only on shallow ones. The approach is demonstrated in experiments using a diverse set of benchmark data.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2109.08460")
get_code_for_paper("2109.08460")
have("2109.08460")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2109.08460.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2109.08460.svg)](https://syntology.ai/paper/2109.08460)

Connect an agent — have() is free.