mlsanityData to 24 Nov 2026

Reasoning-Trace Overflow in Code Generation: An Empirical Study of Explicit Reasoning Models

arXiv 2611.06095 ↗Submitted 4 Nov 2026cs.AI cs.SEcited by 0

On the map: LLM reasoning → Test-time compute and efficient thinking also fits: Reasoning for agents, planning and code

Abstract (arXiv)

Explicit reasoning can help language models generate code, but it also introduces a practical risk: the model may spend so much of its output budget reasoning that it never produces usable code. We study this behaviour in relatively small open-weight reasoning models, framing it as reasoning-trace overflow. Across seven models and six code benchmark settings, we measure how much of a fixed 32k-token output budget is spent on reasoning, whether that reasoning improves pass@1, and whether lightweight inference-time controls can mitigate overflow. Our results show that the value of reasoning is highly conditional. Overflow is rare on simpler function-level tasks, but becomes common on harder code-generation benchmarks and for particular model families: on several model--benchmark pairs, more than half of generations exhaust the full 32k-token budget while still reasoning. Most complete overflow is associated with repetitive reasoning loops, although substantial long reasoning also occurs without looping. Disabling reasoning can therefore be competitive for overflow-prone models, simply because it ensures that an answer is produced. At the same time, reasoning remains valuable for stronger models on harder algorithmic and code-understanding tasks. Finally, prompt steering can substantially reduce overflow for some models but is inconsistent, while budgeted transitions provide more direct control and can improve both performance and token efficiency for overflow-prone models. These findings suggest that explicit reasoning should be treated as a controllable resource for code generation, rather than an always-on capability.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Test-time compute and efficient thinking, one of 17 directions in LLM reasoning. Builds on 31 of its 46 references that are in the map. Submitted 4 Nov 2026.

Builds on

31 of 46 references.

Closest ancestors · 11

Same direction, newest first

  1. 2026Reasoning-Trace Collapse: Evaluating the Loss of Explicit Reasoning During Fine-Tuning20 May
  2. 2026TRACES: Tagging Reasoning Steps for Adaptive Cost-Efficient Early-Stopping22 Apr
  3. 2026When More Thinking Hurts: Overthinking in LLM Test-Time Compute Scaling12 Apr
  4. 2026Circular Reasoning: Understanding Self-Reinforcing Loops in Large Reasoning Models9 Jan
  5. 2025Wait, Wait, Wait... Why Do Reasoning Models Loop?15 Dec
  6. 2025Do LLMs Really Need 10+ Thoughts for "Find the Time 1000 Days Later"? Towards Structural Understanding of LLM Overthinking9 Oct
  7. 2025Thought calibration: Efficient and confident test-time scaling23 May
  8. 2025Scalable Chain of Thoughts via Elastic Reasoning8 May
  9. 2025Stop Overthinking: A Survey on Efficient Reasoning for Large Language Models20 Mar
  10. 2025s1: Simple test-time scaling31 Jan
  11. 2024Token-Budget-Aware LLM Reasoning24 Dec

Other references · 20

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,963
  2. 2025Qwen3 Technical Reportcited by 9,994
  3. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,243
  4. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,530
  5. 2022Competition-Level Code Generation with AlphaCodecited by 1,510
  6. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,131
  7. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 603
  8. 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Modelscited by 586
  9. 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 337
  10. 2025When More is Less: Understanding Chain-of-Thought Length in LLMscited by 196
  11. 2023Structured Chain-of-Thought Prompting for Code Generationcited by 145
  12. 2023Self-planning Code Generation with Large Language Modelscited by 130
8 more
  1. 2025OpenCodeReasoning: Advancing Data Distillation for Competitive Codingcited by 129
  2. 2024The Good, The Bad, and The Greedy: Evaluation of LLMs Should Not Ignore Non-Determinismcited by 127
  3. 2025Z1: Efficient Test-time Scaling with Codecited by 38
  4. 2025A Closer Look at System Prompt Robustnesscited by 36
  5. 2023Chain-of-Thought in Neural Code Generation: From and For Lightweight Language Modelscited by 29
  6. 2025Reasoning Models Sometimes Output Illegible Chains of Thoughtcited by 13
  7. 2025Fractured Chain-of-Thought Reasoningcited by 8
  8. 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 5

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
  2. 2026Is Code Better Than Language for Algorithmic Reasoning
  3. 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
  4. 2025textttReMind: Understanding Deductive Code Reasoning in LLMs
  5. 2025Generating Verifiable Chain of Thoughts from Exection-Traces
  6. 2025CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code Reasoning
  7. 2026Early Stopping in Large Reasoning Models: A Survey and Empirical Audit of Efficiency and Reliability
  8. 2025Reasoning as a Resource: Optimizing Fast and Slow Thinking in Code Generation Models