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

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

Abstract

Large Language Models (LLMs) frequently stumble on complex reasoning tasks due to "subtle" inner-step errors, such as miscalculations or incorrect variable substitutions, rather than a total breakdown in logic. We present RISE (eRror-Injected Self-Editing), a framework that leverages the model's ability to intentionally sabotage its own correct solutions. By creating "hard negative" examples that differ only by minor, fatal flaws, RISE enables a specialized Direct Preference Optimization (DPO) process. Our results show significant improvements in mathematical accuracy and cross-domain generalization in coding and logic, achieving state-of-the-art performance with minimal training data.

Introduction

While LLMs have made significant strides in mathematical reasoning, their reliability is often undermined by "subtle" errors. These are categorized into inter-step errors (logical disconnects) and inner-step errors (sound logic with internal "typos"). Analysis of models like Qwen2-7B reveals that nearly 75% of reasoning failures stem from these inner-step slips, such as miscalculations or omitting a term.

Distribution of reasoning error types, highlighting the prevalence of inner-step errors.

Standard preference learning methods often fail to address this because they compare correct solutions to "easy negatives"—randomly sampled incorrect answers that are logically distant. This lack of granularity prevents models from learning the fine-grained precision necessary for complex multi-step reasoning.

Methodology: The RISE Framework

RISE addresses the "easy negative" problem by turning the LLM into its own "saboteur." The process involves three main stages:

1. Error-Injected Self-Editing

The model generates correct solutions and then intentionally injects specific errors. Three primary operations are used: REPLACE (modifying a numerical value or symbol), SWAP (reordering terms in non-commutative operations), and DELETE (removing intermediate terms).

2. Filtering and Data Selection

To ensure the generated negatives are truly "hard," the framework uses Levenshtein distance to filter for pairs that are syntactically similar but semantically incorrect. This ensures the model focuses on the most critical tokens.

3. Subtle Error-aware DPO

Training on nearly identical pairs can lead to instability in standard DPO. RISE introduces an adaptive negative log-likelihood (NLL) loss to stabilize the process, maintaining high probability for correct tokens while teaching the model to reject the edited, erroneous ones.

The RISE pipeline: sampling correct solutions, injecting subtle errors, and training via error-aware DPO.

Experimental Results

We evaluated RISE across multiple benchmarks using a curated set of ~9k training problems from MetaMath and AQuA.

Mathematical Reasoning

RISE achieved substantial gains over baseline models. Qwen2-7B-Instruct saw a 3.0% improvement on GSM8K and a 7.9% jump on the MATH benchmark. Llama-3.1-8B-Instruct similarly improved by 3.9% on GSM8K and 2.7% on MATH. Notably, RISE-Qwen2-7B outperformed Step-DPO despite the latter's reliance on expensive GPT-4 annotations.

Generalization to Coding and Logic

A key finding was the transferability of precision. Training on mathematical "subtle errors" improved performance in non-math domains. On HumanEval (code generation), RISE improved Qwen2-7B by 3.6% and Llama-3.1-8B by 7.3%, suggesting that the model becomes more attentive to detail across all reasoning tasks.

Conclusion

RISE demonstrates that "hard negatives" created through self-sabotage are highly effective for precision tuning. By focusing on the 75% of errors that are "subtle," RISE achieves state-of-the-art results with only 4.5K training samples. Future work will explore the framework's applicability to knowledge-dense domains and its scalability to models exceeding 100B parameters.

Summary updated

BibTeX
@inproceedings{xu2025subtle,
  author = {Kaishuai Xu and Tiezheng Yu and Wenjun Hou and Yi Cheng and Chak Tou Leong and Liangyou Li and Xin Jiang and Lifeng Shang and Qun Liu and Wenjie Li},
  title = {{Subtle Errors in Reasoning: Preference Learning via Error-injected Self-editing}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure