SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.11502 · 2022

On the Paradox of Learning to Reason from Data

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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 6 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-23; 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/2205.11502.json · badge: /api/ran/2205.11502.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
joshuacnf/paradox-learning2reason canonical (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
gen_word_embedding Ran
ran on a synthesized input
joshuacnf/paradox-learning2reason/logic_bert/evaluate.py
code served (permissive licence) · get_code("87d975f07938c853")
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 dict. 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

torch.manual_seed(0)

vocab = ['hello', 'world', 'python', 'code']

ARGS = {
    'vocab': vocab
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
limit_examples Ran
ran on a synthesized input
joshuacnf/paradox-learning2reason/dataset.py
code served (permissive licence) · get_code("650ed7bb447fd433")
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 list, ndim 1, 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 random

# Construct valid arguments for limit_examples function

# Create examples_by_depth dictionary
# The function expects:
# - keys to be integers (depths)
# - values to be lists of examples
# - max_depth_during_train key must exist and have >= control_num items

examples_by_depth = {
    1: ['example_1_' + str(i) for i in range(2500)],  # depth 1 with enough examples
    2: ['example_2_' + str(i) for i in range(2200)],  # depth 2 with enough examples
    3: ['example_3_' + str(i) for i in range(2100)],  # depth 3 with enough examples
    4: ['example_4_' + str(i) for i in range(2300)],  # depth 4 with enough examples
    5: ['example_5_' + str(i) for i in range(1800)],  # depth 5 (will be deleted as > max_depth_during_train)
}

max_depth_during_train = 4
control_num = 2000

ARGS = {
    'examples_by_depth': examples_by_depth,
    'max_depth_during_train': max_depth_during_train,
    'control_num': control_num,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
read_vocab Ran
ran on a synthesized input
joshuacnf/paradox-learning2reason/logic_bert/evaluate.py
code served (permissive licence) · get_code("226b198cd6845403")
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 set. 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 tempfile
import os

# Create a temporary vocabulary file
temp_dir = tempfile.mkdtemp()
vocab_file = os.path.join(temp_dir, 'vocab.txt')

# Write some sample vocabulary words to the file
sample_vocab = ['apple', 'banana', 'cherry', 'dog', 'elephant', 'forest', 'guitar', 'house']
with open(vocab_file, 'w') as f:
    for word in sample_vocab:
        f.write(word + '\n')

# Define the arguments dictionary
ARGS = {
    'vocab_file': vocab_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
read_vocab Ran
ran on a synthesized input
joshuacnf/paradox-learning2reason/sample/sample.py
code served (permissive licence) · get_code("ec26eefbcd67387b")
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 list, ndim 1, 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 tempfile
import os

# Create a temporary vocab file with some sample vocabulary
temp_dir = tempfile.mkdtemp()
vocab_file = os.path.join(temp_dir, 'vocab.txt')

with open(vocab_file, 'w') as f:
    f.write('the\n')
    f.write('quick\n')
    f.write('brown\n')
    f.write('fox\n')
    f.write('jumps\n')

ARGS = {
    'vocab_file': vocab_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
reduce_dict Ran
ran; our contract draft was wrong, not the code
joshuacnf/paradox-learning2reason/dist.py
code served (permissive licence) · get_code("a38ed1aa8d59134e")
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 dict. 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.distributed as dist

torch.manual_seed(0)

# Create a simple input dictionary with tensor values
input_dict = {
    "loss": torch.tensor(2.5),
    "accuracy": torch.tensor(0.95),
    "metric_a": torch.tensor([1.0, 2.0, 3.0, 4.0]),
}

ARGS = {
    "input_dict": input_dict,
    "average": True,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
sample_one_rule Ran
ran on a synthesized input
joshuacnf/paradox-learning2reason/sample/sample.py
code served (permissive licence) · get_code("a83da76495b09b3a")
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 random
import torch

torch.manual_seed(0)

# Analyze the function:
# - sample_one_rule takes one parameter: preds
# - It calls random.randint(1, 3) to get head_num
# - It calls random.sample(preds, min(head_num + 1, len(preds)))
#   This means preds must be a sequence/list
# - It calls random.shuffle(lits) on the result
# - It returns (lits[:-1], lits[-1])
# So preds should be a list with at least 2 elements (since head_num can be 1,
# and we need head_num + 1 elements, minimum is 2)

# Create a simple list of predicates (strings or integers work fine)
preds = ["pred_0", "pred_1", "pred_2", "pred_3", "pred_4"]

ARGS = {
    "preds": preds
}
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
sample_rule_priority Ran
ran on a synthesized input
joshuacnf/paradox-learning2reason/sample/sample.py
code served (permissive licence) · get_code("40f5be912c82ef27")
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 random

def sample_one_rule(preds):
    head_num = random.randint(1, 3)
    lits = random.sample(preds, min(head_num + 1, len(preds)))
    random.shuffle(lits)
    return (lits[:-1], lits[-1])

def sample_rule_priority(preds):
    pred_num = len(preds)
    rule_num = random.randint(0, 4 * pred_num)
    fact_num = random.randint(0, pred_num)
    cache = set()
    rules = []
    for _ in range(0, rule_num):
        rule = None
        while True:
            rule = sample_one_rule(preds)
            rule_hash = ' '.join(sorted(rule[0])) + ' ' + rule[1]
            if rule_hash not in cache:
                cache.add(rule_hash)
                break
        rules.append(rule)
    facts = random.sample(preds, fact_num)
    query = random.sample(preds, 1)[0]
    return (rules, facts, query)

random.seed(42)

preds = [
    "pred_A",
    "pred_B",
    "pred_C",
    "pred_D",
    "pred_E",
]

ARGS = {
    "preds": preds,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
all_gather Not yet run
unverified (harvested, no recorded run)
joshuacnf/paradox-learning2reason/dist.py
code served (permissive licence) · get_code("2b95e75e05ea5abf")
How it ran

no invocation recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
joshuacnf/paradox-learning2reason/finetune_simplified.py
code served (permissive licence) · get_code("1fc9bf9a870979fe")
How it ran

no invocation recorded.

gen_position_embedding Not yet run
unverified (harvested, no recorded run)
joshuacnf/paradox-learning2reason/logic_bert/evaluate.py
code served (permissive licence) · get_code("63d79b6707c1288e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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.

FunctionAlso present inEarliest-datedOthers named
reduce_dict 33 other papers
9 dated earlier, 23 later, 1 same year, order not determinable
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
1811.10200 (2018-11)
IDD: A Dataset for Exploring Problems of Autonomous Navigation in Unconstrained Environments
2007.02419 (2020-07)
Attention-based Joint Detection of Object and Semantic Part
and 30 more not named here
all_gather 2 other papers
2 later
2308.09363 (2023-08)
Open-Vocabulary Video Question Answering: A New Benchmark for Evaluating the Generalizability of Video Question Answering Models
2412.12791 (2024-12)
Implicit Location-Caption Alignment via Complementary Masking for Weakly-Supervised Dense Video Captioning

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-23.

Repositories linked to this paper

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

Abstract

Logical reasoning is needed in a wide range of NLP tasks. Can a BERT model be trained end-to-end to solve logical reasoning problems presented in natural language? We attempt to answer this question in a confined problem space where there exists a set of parameters that perfectly simulates logical reasoning. We make observations that seem to contradict each other: BERT attains near-perfect accuracy on in-distribution test examples while failing to generalize to other data distributions over the exact same problem space. Our study provides an explanation for this paradox: instead of learning to emulate the correct reasoning function, BERT has in fact learned statistical features that inherently exist in logical reasoning problems. We also show that it is infeasible to jointly remove statistical features from data, illustrating the difficulty of learning to reason in general. Our result naturally extends to other neural models and unveils the fundamental difference between learning to reason and learning to achieve high performance on NLP benchmarks using statistical features.

For agents

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

get_harvested_code_for_paper("2205.11502")
get_code_for_paper("2205.11502")
have("2205.11502")

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

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

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

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

Connect an agent — have() is free.