SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.00900 · 2024

From Next-Token to Mathematics: The Learning Dynamics of Mathematical Reasoning in Language Models

arXiv · PDF · Open in the Atlas

Code that ran

8 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 0 have no contract verdict; 7 failures of our instrument; 0 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/2407.00900.json · badge: /api/ran/2407.00900.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
gpoesia/mathcamps canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_accuracy Ran
ran, honoured the contract we drafted
gpoesia/mathcamps/analysis.py
code served (permissive licence) · get_code("5a79c6682974a9b5")
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 numpy as np
from typing import Union, Tuple

torch.manual_seed(0)

# Define a predicate function that filters results
def sample_predicate(standard, problem, followup_problem):
    # Simple predicate that returns True for filtering
    return True

# Construct the results dictionary with the expected structure
results = {
    "result_1": {
        "model": "model_a",
        "standard": "standard_1",
        "problem": "problem_1",
        "correct": True,
        "followups": {
            "followup_1": {
                "problem": "followup_problem_1",
                "correct": True,
                "is_followup": False
            },
            "followup_2": {
                "problem": "followup_problem_2",
                "correct": True,
                "is_followup": False
            }
        }
    },
    "result_2": {
        "model": "model_a",
        "standard": "standard_2",
        "problem": "problem_2",
        "correct": False,
        "followups": {}
    },
    "result_3": {
        "model": "model_b",
        "standard": "standard_3",
        "problem": "problem_3",
        "correct": True,
        "followups": {
            "followup_3": {
                "problem": "followup_problem_3",
                "correct": False,
                "is_followup": False
            }
        }
    },
    "result_4": {
        "model": "model_a",
        "standard": "standard_4",
        "problem": "problem_4",
        "correct": True,
        "followups": {}
    }
}

ARGS = {
    "results": results,
    "model_id": "model_a",
    "predicate": sample_predicate,
    "followups": None,
    "return_responses": False
}
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 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
extract_answer_core Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/llm_extract.py
code served (permissive licence) · get_code("45a9b100ae6669d0")
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 re

def extract_answer_core(answer: str) -> str:
    return re.search('([0-9.\\-\\+>=<][0-9.\\-\\+/ ]*%?)', answer).group(0)

ARGS = {
    "answer": "The answer is 42.5% of the total"
}
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
extract_first_number Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/evaluate.py
code served (permissive licence) · get_code("f5be3ec3058dbde6")
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 re

def extract_first_number(input_string):
    matches = re.search('\\b\\d+(\\.\\d+)?(/\\d+)?', input_string)
    return matches and matches.group(0)

ARGS = {
    "input_string": "The price is 42.50/3 dollars"
}
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
extract_llm_answer_core Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/llm_extract.py
code served (permissive licence) · get_code("93213416df9a717b")
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 torch

torch.manual_seed(0)

# The function extract_llm_answer_core takes a single parameter 'answer'
# which should be a string. It checks if 'none' is in the lowercased version
# of the answer string, and returns None if it is, otherwise returns the answer.

ARGS = {
    "answer": "This is a valid 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 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
format_prompt_for_completion_lm Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/evaluate.py
code served (permissive licence) · get_code("2e253342896698e4")
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 torch
import torch.nn as nn

# Set seed for reproducibility
torch.manual_seed(0)

# Construct prompt_messages
prompt_messages = [
    {
        'role': 'system',
        'content': 'You are a helpful assistant.'
    },
    {
        'role': 'user',
        'content': 'What is 2+2?'
    },
    {
        'role': 'assistant',
        'content': 'The answer is 4.'
    }
]

ARGS = {
    'prompt_messages': prompt_messages
}
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 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
load_results Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/analysis.py
code served (permissive licence) · get_code("16fc98c8d3cd91a3")
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 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 temporary JSON files with test data
temp_dir = tempfile.mkdtemp()

# Create first results file
results_file_1 = os.path.join(temp_dir, "results_1.json")
data_1 = {
    "test_1": {"standard": "A.1", "value": 100},
    "test_2": {"standard": "B.2", "value": 200}
}
with open(results_file_1, 'w') as f:
    json.dump(data_1, f)

# Create second results file
results_file_2 = os.path.join(temp_dir, "results_2.json")
data_2 = {
    "test_3": {"standard": "A.3", "value": 300},
    "test_4": {"standard": "C.1", "value": 400}
}
with open(results_file_2, 'w') as f:
    json.dump(data_2, f)

ARGS = {
    "results": [results_file_1, results_file_2]
}
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, ndim 1, 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
remove_commas_from_numbers Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/evaluate.py
code served (permissive licence) · get_code("5d6fa270fda02f20")
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 re

def remove_commas_from_numbers(input_string):
    return re.sub('(,\\d)', lambda x: x.group(0).replace(',', ''), input_string)

ARGS = {
    'input_string': '1,000 and 2,500 plus 3,456,789'
}
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
translate_object Ran
ran; our contract draft was wrong, not the code
gpoesia/mathcamps/analysis.py
code served (permissive licence) · get_code("29e97c3db4546e5c")
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)

# Create a sample nested object with dicts, lists, and strings
obj = {
    "name": "Alice",
    "age": 30,
    "nested": {
        "city": "New York",
        "country": "USA"
    },
    "tags": ["python", "coding", "ai"],
    "data": {
        "values": [1, 2.5, "test_string"],
        "flag": True
    }
}

# Create a translations dictionary that maps keys and string values
translations = {
    "name": "full_name",
    "city": "location",
    "Alice": "Alice Smith",
    "New York": "Manhattan",
    "python": "Python",
    "coding": "Software Development",
    "test_string": "sample_text"
}

ARGS = {
    "obj": obj,
    "translations": translations
}
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

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

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

Large Language Models (LLMs) solely trained on next-token prediction learn to solve a wide range of problems involving mathematical reasoning. But how does this ability evolve during training? We show the first analysis of how mathematical reasoning abilities of several open-weight LLMs develop during pre-training and post-training. To this end, we construct MathCAMPS, a synthetic dataset of novel mathematical reasoning problems grounded in 44 fine-grained skills taken from the Common Core curriculum from K to 8th grades. In one experiment, we show that mathematical skills are learned during pre-training in an order that measurably correlates with the human-designed curriculum, even though training data are randomly ordered. We also show a detailed analysis of which mathematical abilities benefit from instruction tuning, a widely used post-training method and, in contrast, which skills suffer. Our work paves the way for an empirical understanding of LLM training dynamics in relation to reasoning.

For agents

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

get_harvested_code_for_paper("2407.00900")
get_code_for_paper("2407.00900")
have("2407.00900")

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

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

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

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

Connect an agent — have() is free.