SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.13718 · 2023

Exploring Self-supervised Logic-enhanced Training for Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-24; 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/2305.13718.json · badge: /api/ran/2305.13718.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
sparkjiao/logicllm canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
compose_proofs Ran
ran on a synthesized input
sparkjiao/logicllm/cot_combine_v1_0.py
code served (permissive licence) · get_code("747322044299818e")
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 str. 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
from typing import List, Dict

# Set seed for reproducibility
random.seed(42)

# Construct valid arguments for compose_proofs
ARGS = {
    'proofs': [
        'fact1->conclusion1',
        'fact2&fact3->conclusion2',
        'inter1->inter2',
    ],
    'triples': {
        'fact1': 'Alice is tall',
        'fact2': 'Bob is smart',
        'fact3': 'Carol is kind',
        'conclusion1': 'Therefore Alice wins',
        'conclusion2': 'Therefore Bob succeeds',
        'inter1': 'This is intermediate',
        'inter2': 'This leads forward',
    },
    'inter_conclusions': {
        'inter1': 'The first intermediate step holds',
        'inter2': 'The second intermediate step follows',
    },
    'hypothesis': 'all people are logical',
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
compute_intermediate_size Ran
ran, honoured the contract we drafted
sparkjiao/logicllm/convert_llama_weights_to_hf.py
code served (permissive licence) · get_code("507f475feb734647")
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 int, ndim 0, dtype family int, 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 numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - n: an integer (model dimension or similar)
# - ffn_dim_multiplier: a numeric value (default 1), used in multiplication
# - multiple_of: an integer (default 256), used for alignment

# The function computes an intermediate size for feed-forward networks
# All parameters are simple numeric types

ARGS = {
    "n": 256,
    "ffn_dim_multiplier": 1,
    "multiple_of": 256
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
entailment_bank_reader_v1 Ran
ran on a synthesized input
sparkjiao/logicllm/cot_combine_v1_0.py
code served (permissive licence) · get_code("71224971211ee8e7")
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 json
import tempfile
import os

# Create a temporary JSON file with sample entailment bank data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl')

sample_items = [
    {
        'id': 'test_1',
        'question': 'Is the statement true?',
        'answer': 'yes',
        'hypothesis': 'The cat is black',
        'proof': 'sent1 -> sent2; sent2 -> int1',
        'meta': {
            'triples': {
                'sent1': 'Cats are animals',
                'sent2': 'Black cats exist',
                'sent3': 'Animals have fur'
            },
            'intermediate_conclusions': {
                'int1': 'The cat is black',
                'int2': 'Black things are dark'
            },
            'delete_list': [
                {'uuid': 'del1', 'fact': 'Birds fly'},
                {'uuid': 'del2', 'fact': 'Fish swim'},
                {'uuid': 'del3', 'fact': 'Dogs bark'}
            ]
        }
    },
    {
        'id': 'test_2',
        'question': 'Can we conclude this?',
        'answer': 'no',
        'hypothesis': 'The dog is fast',
        'proof': 'sent4 -> int3',
        'meta': {
            'triples': {
                'sent4': 'Dogs are mammals',
                'sent5': 'Mammals are vertebrates'
            },
            'intermediate_conclusions': {
                'int3': 'Dogs have backbones'
            },
            'delete_list': [
                {'uuid': 'del4', 'fact': 'Snakes slither'},
                {'uuid': 'del5', 'fact': 'Eagles soar'}
            ]
        }
    }
]

for item in sample_items:
    temp_file.write(json.dumps(item) + '\n')

temp_file.close()

ARGS = {
    'file': temp_file.name,
    'negative_sample_num': 2,
    'split_input_output': False
}
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
generate_json Ran
ran on a synthesized input
sparkjiao/logicllm/ds_inference.py
code served (permissive licence) · get_code("6a2c61781f507932")
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 str. 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 os
import tempfile
from pathlib import Path

# Create a temporary directory to serve as the checkpoint_path
temp_dir = tempfile.mkdtemp()

# Create a subdirectory structure with some model files
model_subdir = os.path.join(temp_dir, 'model')
os.makedirs(model_subdir, exist_ok=True)

# Create some dummy checkpoint files with valid extensions (.bin, .pt, .pth, .pin)
dummy_file1 = os.path.join(model_subdir, 'checkpoint_1.bin')
dummy_file2 = os.path.join(temp_dir, 'model_weights.pt')
dummy_file3 = os.path.join(model_subdir, 'optimizer.pth')

# Write minimal content to these files
for filepath in [dummy_file1, dummy_file2, dummy_file3]:
    with open(filepath, 'w') as f:
        f.write('dummy')

ARGS = {
    'checkpoint_path': temp_dir
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_json Ran
ran; our contract draft was wrong, not the code
sparkjiao/logicllm/convert2hf.py
code served (permissive licence) · get_code("c5bcf01d18bba63d")
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) 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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_json_path = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(test_json_path, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "path": test_json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
smart_tokenizer_and_embedding_resize Ran
ran on a synthesized input
sparkjiao/logicllm/extend_ckpt_weight_size.py
code served (permissive licence) · get_code("a30cee840cc1d5b2")
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 (13, 4) 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 transformers

torch.manual_seed(0)

# Create a small stand-in tokenizer
class StandInTokenizer:
    def __init__(self, vocab_size):
        self._vocab_size = vocab_size
    
    def __len__(self):
        return self._vocab_size

# Original embedding weight tensor: vocab_size=10, embedding_dim=4
original_vocab_size = 10
embedding_dim = 4
weight = torch.randn(original_vocab_size, embedding_dim)

# Create tokenizer with expanded vocabulary (added 3 new tokens)
tokenizer = StandInTokenizer(vocab_size=13)

ARGS = {
    "tokenizer": tokenizer,
    "weight": weight,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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 (13, 4) — shape (13, 4) 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
load_weights Not yet run
unverified (harvested, no recorded run)
sparkjiao/logicllm/convert2hf.py
code served (permissive licence) · get_code("61b6f067e8e63b66")
How it ran

no invocation recorded.

write_model Not yet run
unverified (harvested, no recorded run)
sparkjiao/logicllm/convert_llama_weights_to_hf.py
code served (permissive licence) · get_code("de4478ea1dfdf42d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 6 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
read_json 21 other papers
3 dated earlier, 18 later
2210.07316 (2022-10)
MTEB: Massive Text Embedding Benchmark
2304.08177 (2023-04)
Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
2304.14454 (2023-04)
PMC-LLaMA: Towards Building Open-source Language Models for Medicine
and 18 more not named here
compute_intermediate_size 13 other papers
13 later
2307.08072 (2023-07)
Do Emergent Abilities Exist in Quantized Large Language Models: An Empirical Study
2308.16137 (2023-08)
LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Models
2401.06706 (2024-01)
Multi-Candidate Speculative Decoding
and 10 more not named here

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

Repositories linked to this paper

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

Abstract

Existing efforts to improve logical reasoning ability of language models have predominantly relied on supervised fine-tuning, hindering generalization to new domains and/or tasks. The development of Large Langauge Models (LLMs) has demonstrated the capacity of compressing abundant knowledge into a single proxy, enabling them to tackle multiple tasks effectively. Our preliminary experiments, nevertheless, show that LLMs do not show capability on logical reasoning. The performance of LLMs on logical reasoning benchmarks is far behind the existing state-of-the-art baselines. In this paper, we make the first attempt to investigate the feasibility of incorporating logical knowledge through self-supervised post-training, and activating it via in-context learning, which we termed as LogicLLM. Specifically, we devise an auto-regressive objective variant of MERIt and integrate it with two LLM series, i.e., FLAN-T5 and LLaMA, with parameter size ranging from 3 billion to 13 billion. The results on two challenging logical reasoning benchmarks demonstrate the effectiveness of LogicLLM. Besides, we conduct extensive ablation studies to analyze the key factors in designing logic-oriented proxy tasks.

For agents

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

get_harvested_code_for_paper("2305.13718")
get_code_for_paper("2305.13718")
have("2305.13718")

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

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

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

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

Connect an agent — have() is free.