SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.acl-long.1506 · ACL · 2025

Subtle Errors in Reasoning: Preference Learning via Error-injected Self-editing

Lifeng Shang, Xin Jiang, Qun Liu, Wenjie Li, Yi Cheng, Liangyou Li, Wenjun Hou, Kaishuai Xu, Chak Leong

Open in the Atlas

Code that ran

8 of 9 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 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2025.acl-long.1506.json · badge: /api/ran/2025.acl-long.1506.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
deepseek-ai/DeepSeek-Math canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
aggregate_metrics Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/summarize_results.py
code served (permissive licence) · get_code("8b9e2baf73bb9a6f")
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 json
import tempfile
import os

# Create temporary directory and metric files
temp_dir = tempfile.mkdtemp()

# Create first metric file
metric1 = {
    'n_samples': 100,
    'accuracy': 0.95,
    'loss': 0.05
}
path1 = os.path.join(temp_dir, 'metric1.json')
with open(path1, 'w') as f:
    json.dump(metric1, f)

# Create second metric file
metric2 = {
    'n_samples': 50,
    'accuracy': 0.90,
    'loss': 0.10
}
path2 = os.path.join(temp_dir, 'metric2.json')
with open(path2, 'w') as f:
    json.dump(metric2, f)

# Define ARGS
ARGS = {
    'paths': [path1, path2]
}
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 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
aggregate_predictions Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/summarize_results.py
code served (permissive licence) · get_code("33425041e7f88b7f")
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 temporary JSON files for testing
temp_dir = tempfile.mkdtemp()

# Create valid JSON file 1
path1 = os.path.join(temp_dir, "predictions1.json")
with open(path1, 'w') as f:
    json.dump([{"id": 1, "prediction": 0.9}, {"id": 2, "prediction": 0.7}], f)

# Create valid JSON file 2
path2 = os.path.join(temp_dir, "predictions2.json")
with open(path2, 'w') as f:
    json.dump([{"id": 3, "prediction": 0.8}], f)

# Create invalid JSON file (will be skipped due to try-except)
path3 = os.path.join(temp_dir, "predictions3.json")
with open(path3, 'w') as f:
    f.write("invalid json content {{{")

# Define arguments
ARGS = {
    "paths": [path1, path2, path3]
}
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
extract_boxed_answers Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/data_processing/answer_extraction.py
pointer only (licence: MIT); the stored copy get_code serves, from PKU-SEC-Lab/SPEX, is pointer only (licence: NONE) · get_code("6390dea763ce122e")
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 PKU-SEC-Lab/SPEX, 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.

extract_program_output Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/data_processing/answer_extraction.py
pointer only (licence: MIT); the stored copy get_code serves, from PKU-SEC-Lab/SPEX, is pointer only (licence: NONE) · get_code("0772e5020f6b0849")
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 PKU-SEC-Lab/SPEX, 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.

markup_question Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/run_subset_parallel.py
code served (permissive licence) · get_code("de0231790ab22287")
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

ARGS = {
    'args': None,
    'item': {
        'messages': [
            {'content': 'What is 2+2?'},
            {'content': 'The answer is 4.'},
            {'content': 'What is 3+3?'},
            {'content': 'The answer is 6.'},
            {'content': 'What is 5+5?'}
        ]
    },
    'language': 'en',
    'src': 'test_source',
    'task': 'cot'
}
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
read_data Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/utils.py
code served (permissive licence) · get_code("3deb39de933b985a")
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 temporary JSON file
json_fd, json_path = tempfile.mkstemp(suffix='.json')
json_data = [{"key": "value1"}, {"key": "value2"}]
with os.fdopen(json_fd, 'w') as f:
    json.dump(json_data, f)

# Create temporary JSONL file
jsonl_fd, jsonl_path = tempfile.mkstemp(suffix='.jsonl')
with os.fdopen(jsonl_fd, 'w') as f:
    f.write(json.dumps({"item": "first"}) + '\n')
    f.write(json.dumps({"item": "second"}) + '\n')

ARGS = {
    "path": json_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 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
shuffle Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/utils.py
code served (permissive licence) · get_code("1d4da55afb0377ec")
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
import numpy as np

# The shuffle function takes:
# 1. data - a list-like object that has len() and supports indexing
# 2. seed - an integer

# Create sample data as a simple list
sample_data = ['item_0', 'item_1', 'item_2', 'item_3', 'item_4']

# Create ARGS dict with valid arguments
ARGS = {
    'data': sample_data,
    'seed': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
strip_string Ran
ran; our contract draft was wrong, not the code
deepseek-ai/DeepSeek-Math/evaluation/data_processing/answer_extraction.py
pointer only (licence: MIT); the stored copy get_code serves, from PKU-SEC-Lab/SPEX, is pointer only (licence: NONE) · get_code("5abed389274c4c03")
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 PKU-SEC-Lab/SPEX, 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.

check_proof Not yet run
unverified (harvested, no recorded run)
deepseek-ai/DeepSeek-Math/evaluation/unsafe_score_minif2f_isabelle.py
code served (permissive licence) · get_code("c59c51644b25a189")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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
extract_boxed_answers 7 other papers
2 dated earlier, 1 later, 4 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2406.18629 (2024-06)
Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMs
2502.12067 (2025-02)
TokenSkip: Controllable Chain-of-Thought Compression in LLMs
and 4 more not named here
strip_string 6 other papers
2 dated earlier, 1 later, 3 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2406.18629 (2024-06)
Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMs
2502.12067 (2025-02)
TokenSkip: Controllable Chain-of-Thought Compression in LLMs
and 3 more not named here
extract_program_output 5 other papers
2 dated earlier, 1 later, 2 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2406.18629 (2024-06)
Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMs
2502.12067 (2025-02)
TokenSkip: Controllable Chain-of-Thought Compression in LLMs
and 2 more not named here
read_data 3 other papers
1 dated earlier, 2 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2502.12067 (2025-02)
TokenSkip: Controllable Chain-of-Thought Compression in LLMs
2506.20512 (2025-06)
OctoThinker: Mid-training Incentivizes Reinforcement Learning Scaling
aggregate_metrics 2 other papers
1 dated earlier, 1 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2506.20512 (2025-06)
OctoThinker: Mid-training Incentivizes Reinforcement Learning Scaling
aggregate_predictions 2 other papers
1 dated earlier, 1 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2506.20512 (2025-06)
OctoThinker: Mid-training Incentivizes Reinforcement Learning Scaling
markup_question 2 other papers
1 dated earlier, 1 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2506.20512 (2025-06)
OctoThinker: Mid-training Incentivizes Reinforcement Learning Scaling
shuffle 2 other papers
1 dated earlier, 1 same year, order not determinable
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
2506.20512 (2025-06)
OctoThinker: Mid-training Incentivizes Reinforcement Learning Scaling
check_proof 1 other paper
1 dated earlier
2402.03300 (2024-02)
DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models

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

Large Language Models (LLMs) have exhibited strong mathematical reasoning prowess, tackling tasks ranging from basic arithmetic to advanced competition-level problems. However, frequently occurring subtle yet critical errors, such as miscalculations or incorrect substitutions, limit the LLMs' full potential. Existing studies to improve mathematical ability typically involve applying preference learning to step-wise solution pairs. Although these methods leverage samples of varying granularity to mitigate reasoning errors, they overlook critical subtle errors. In this work, we propose a novel preference learning framework called eRror-Injected Self-Editing (RISE), which injects predefined subtle errors into pivotal tokens in reasoning or computation steps to construct hard pairs for error mitigation. In detail, RISE uses the LLM itself to edit a small number of tokens in the solution, injecting designed subtle errors. Then, pairs composed of self-edited solutions and their corresponding correct ones, along with pairs of correct and incorrect solutions obtained through sampling, are used together for subtle error-aware DPO training. Compared with other preference learning methods, RISE further refines the training objective without requiring fine-grained sampling or preference annotation. Extensive experiments validate the effectiveness of RISE, with preference learning on Qwen2-7B-Instruct yielding notable improvements of 3.0% on GSM8K and 7.9% on MATH with only 4.5K training samples. Moreover, the effect of error mitigation extends from mathematical reasoning to logical reasoning and code generation.

For agents

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

get_harvested_code_for_paper("2025.acl-long.1506")
get_code_for_paper("2025.acl-long.1506")
have("2025.acl-long.1506")

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

curl https://syntology.ai/api/ran/2025.acl-long.1506.json

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

[![Syntology run record](https://syntology.ai/api/ran/2025.acl-long.1506.svg)](https://syntology.ai/paper/2025.acl-long.1506)

Connect an agent — have() is free.