SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.03501 · 2021

Pretrained Language Models are Symbolic Mathematics Solvers too!

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 4 failures of our instrument; 5 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/2110.03501.json · badge: /api/ran/2110.03501.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
softsys4ai/differentiable-proving canonical (classifier label)
classifier basis not recorded on the link
9 ran · 5 no recorded run
FunctionStatusWhere it lives
Embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) · constructed an object; no result was computed
softsys4ai/differentiable-proving/src/model/transformer.py
code served (permissive licence) · get_code("a3e27bd1e8b628ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned an instance of its own class, Embedding: the run constructed the object and did not call it, so no result was computed. 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 as nn

torch.manual_seed(0)

num_embeddings = 10
embedding_dim = 4
padding_idx = 0

ARGS = {
    'num_embeddings': num_embeddings,
    'embedding_dim': embedding_dim,
    'padding_idx': padding_idx
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Embedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Embedding 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
bool_flag Ran
ran, violated the contract we drafted
softsys4ai/differentiable-proving/src/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from cisnlp/ofa, is pointer only (licence: NONE) · get_code("cc66d68d2046d6a3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from cisnlp/ofa, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

count_occurrences Ran
ran on a synthesized input
softsys4ai/differentiable-proving/src/envs/sympy_utils.py
code served (permissive licence) · get_code("073d361ac66e3887")
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 sympy as sp

# Create symbolic variables
x, y, z = sp.symbols('x y z')

# Test case 1: Simple atom
expr1 = x

# Test case 2: Addition expression
expr2 = x + y

# Test case 3: Multiplication expression
expr4 = x * y * z

# Test case 4: Power expression
expr5 = x**2

# Test case 5: Complex nested expression
expr6 = (x + y) * (z + x)

# Test case 6: Expression with repeated atoms
expr7 = x + x + y

ARGS = {
    "expr": expr6
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sympy — 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
count_occurrences2 Ran
ran on a synthesized input
softsys4ai/differentiable-proving/src/envs/sympy_utils.py
code served (permissive licence) · get_code("6080120f02a457e3")
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 sympy as sp

# The function count_occurrences2 takes a sympy expression and counts atom occurrences
# We need to construct a valid sympy expression

# Create symbolic variables
x = sp.Symbol('x')
y = sp.Symbol('y')
z = sp.Symbol('z')

# Build a sympy expression with multiple atoms
# This expression has: x appears 2 times, y appears 1 time, z appears 1 time, 
# and numeric atoms like 2 and 3
expr = 2*x**2 + 3*x*y + z + 1

ARGS = {
    'expr': expr
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sympy — 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
create_logger Ran
ran; our contract draft was wrong, not the code
softsys4ai/differentiable-proving/src/logger.py
pointer only (licence: MIT); the stored copy get_code serves, from rahul3/LAWT, is pointer only (licence: NOASSERTION) · get_code("2f7db44ecae76417")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from rahul3/LAWT, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_masks Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
softsys4ai/differentiable-proving/src/model/transformer.py
code served (permissive licence) · get_code("b2470f4f0c09db41")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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

torch.manual_seed(0)

# Parameters for get_masks function:
# - slen: sequence length (int)
# - lengths: tensor of actual lengths for each sequence in batch
# - causal: boolean flag for causal masking

batch_size = 2
slen = 5

# Create lengths tensor where each element is <= slen
lengths = torch.tensor([3, 5], dtype=torch.long)

# Test with causal=True to exercise both branches
causal = True

ARGS = {
    'slen': slen,
    'lengths': lengths,
    'causal': causal
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
read_data_test Ran
ran on a synthesized input
softsys4ai/differentiable-proving/src/hf_utils.py
code served (permissive licence) · get_code("c93cf67af5f23a7b")
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 2, 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 io
import tempfile
import os

# Create a temporary file with test data in the expected format
temp_dir = tempfile.mkdtemp()
test_file_path = os.path.join(temp_dir, "test_data.txt")

# Write test data in the format: "label|x\ty"
with io.open(test_file_path, mode='w', encoding='utf-8') as f:
    f.write("label1|hello\tworld\n")
    f.write("label2|foo\tbar\n")
    f.write("label3|a\tb\tc\n")  # This will be filtered out (len != 2)
    f.write("label4|x\ty\n")

ARGS = {
    "path": test_file_path
}
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 2, 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_data_test_new Ran
ran on a synthesized input
softsys4ai/differentiable-proving/src/hf_utils.py
code served (permissive licence) · get_code("8aff65325d4bd420")
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 2, 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 io
import tempfile
import os

# Create a temporary file with tab-separated data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8', suffix='.txt')
temp_file.write("hello\tworld\n")
temp_file.write("foo\tbar\n")
temp_file.write("single_field\n")
temp_file.write("a\tb\tc\n")
temp_file.write("test\tdata\n")
temp_file.close()

path = temp_file.name

ARGS = {
    'path': path
}
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 2, 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
timeout Ran
ran; our contract draft was wrong, not the code
softsys4ai/differentiable-proving/src/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from rahul3/LAWT, is pointer only (licence: NOASSERTION) · get_code("e7b55aa114a5156a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from rahul3/LAWT, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

count_nested_exp Not yet run
unverified (harvested, no recorded run)
softsys4ai/differentiable-proving/src/envs/char_sp.py
code served (permissive licence) · get_code("ee55712ae0b3fe41")
How it ran

no invocation recorded.

initialize_exp Not yet run
unverified (harvested, no recorded run)
softsys4ai/differentiable-proving/src/utils.py
code served (permissive licence) · get_code("c7bf75ed8696c79a")
How it ran

no invocation recorded.

preprocess_function_new Not yet run
unverified (harvested, no recorded run)
softsys4ai/differentiable-proving/evaluator.py
code served (permissive licence) · get_code("dec620c6ce2bad55")
How it ran

no invocation recorded.

read_data_train Not yet run
unverified (harvested, no recorded run)
softsys4ai/differentiable-proving/src/hf_utils.py
code served (permissive licence) · get_code("ad6a5d0d33aad981")
How it ran

no invocation recorded.

simplify Not yet run
unverified (harvested, no recorded run)
softsys4ai/differentiable-proving/src/envs/sympy_utils.py
code served (permissive licence) · get_code("b2af0a4a625a6ae2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 6 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 6 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
Embedding 18 other papers
5 dated earlier, 13 later · 3 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1905.12790 (2019-05)
A Generalized Framework of Sequence Generation with Application to Undirected Sequence Models
1911.02116 (2019-11)
Unsupervised Cross-lingual Representation Learning at Scale
and 15 more not named here
get_masks 8 other papers
2 dated earlier, 6 later · 1 only as an assembly brick
1911.02116 (2019-11)
Unsupervised Cross-lingual Representation Learning at Scale
2010.03017 (2020-10)
On Negative Interference in Multilingual Models: Findings and A Meta-Learning Treatment
2204.10532 (2022-04)
End-to-end symbolic regression with transformers
and 5 more not named here
bool_flag 5 other papers
1 dated earlier, 4 later
1911.02116 (2019-11)
Unsupervised Cross-lingual Representation Learning at Scale
2311.08849 (2023-11)
OFA: A Framework of Initializing Unseen Subword Embeddings for Efficient Large-scale Multilingual Continued Pretraining
2404.11341 (2024-04)
The Causal Chambers: Real Physical Systems as a Testbed for AI Methodology
and 2 more not named here
create_logger 4 other papers
4 later
2210.03403 (2022-10)
TAN Without a Burn: Scaling Laws of DP-SGD
2404.11341 (2024-04)
The Causal Chambers: Real Physical Systems as a Testbed for AI Methodology
2411.00566 (2024-11)
PatternBoost: Constructions in Mathematics with a Little Help from AI
and 1 more not named here
timeout 3 other papers
3 later
2207.03578 (2022-07)
Code Translation with Compiler Representations
2411.00566 (2024-11)
PatternBoost: Constructions in Mathematics with a Little Help from AI
2602.07800 (2026-02)
Approximating Matrix Functions with Deep Neural Networks and Transformers
initialize_exp 1 other paper
1 later
2602.07800 (2026-02)
Approximating Matrix Functions with Deep Neural Networks and Transformers

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

Solving symbolic mathematics has always been of in the arena of human ingenuity that needs compositional reasoning and recurrence. However, recent studies have shown that large-scale language models such as transformers are universal and surprisingly can be trained as a sequence-to-sequence task to solve complex mathematical equations. These large transformer models need humongous amounts of training data to generalize to unseen symbolic mathematics problems. In this paper, we present a sample efficient way of solving the symbolic tasks by first pretraining the transformer model with language translation and then fine-tuning the pretrained transformer model to solve the downstream task of symbolic mathematics. We achieve comparable accuracy on the integration task with our pretrained model while using around $1.5$ orders of magnitude less number of training samples with respect to the state-of-the-art deep learning for symbolic mathematics. The test accuracy on differential equation tasks is considerably lower comparing with integration as they need higher order recursions that are not present in language translations. We propose the generalizability of our pretrained language model from Anna Karenina Principle (AKP). We pretrain our model with different pairs of language translations. Our results show language bias in solving symbolic mathematics tasks. Finally, we study the robustness of the fine-tuned model on symbolic math tasks against distribution shift, and our approach generalizes better in distribution shift scenarios for the function integration.

For agents

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

get_harvested_code_for_paper("2110.03501")
get_code_for_paper("2110.03501")
have("2110.03501")

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

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

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

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

Connect an agent — have() is free.