mlsanityData to 14 Oct 2026

Optimizing Token Consumption in LLMs: A Nano Surge Approach for Code Reasoning Efficiency

arXiv 2504.15989 ↗First posted 22 Apr 2025cs.SEcited by 2

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

With the increasing adoption of large language models (LLMs) in software engineering, the Chain of Thought (CoT) reasoning paradigm has become an essential approach for automated code repair. However, the explicit multi-step reasoning in CoT leads to substantial increases in token consumption, reducing inference efficiency and raising computational costs, especially for complex code repair tasks. Most prior research has focused on improving the correctness of code repair while largely overlooking the resource efficiency of the reasoning process itself. To address this challenge, this paper proposes three targeted optimization strategies: Context Awareness, Responsibility Tuning, and Cost Sensitive. Context Awareness guides the model to focus on key contextual information, Responsibility Tuning refines the structure of the reasoning process through clearer role and responsibility assignment, and Cost Sensitive incorporates resource-awareness to suppress unnecessary token generation during inference. Experiments across diverse code repair scenarios demonstrate that these methods can significantly reduce token consumption in CoT-based reasoning without compromising repair quality. This work provides novel insights and methodological guidance for enhancing the efficiency of LLM-driven code repair tasks in software engineering.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 21 of its 33 references that are in the map. First posted on arXiv 22 Apr 2025.

Builds on

21 of 33 references.

Closest ancestors · 1

Same direction, newest first

  1. 2023Chain-of-Thought in Neural Code Generation: From and For Lightweight Language Models9 Dec

Other references · 20

  1. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  2. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  3. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
  4. 2025Demystifying Long Chain-of-Thought Reasoning in LLMscited by 326
  5. 2025From System 1 to System 2: A Survey of Reasoning Large Language Modelscited by 320
  6. 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
  7. 2024An Empirical Study on Usage and Perceptions of LLMs in a Software Engineering Projectcited by 28
  8. 2023A study on Prompt Design, Advantages and Limitations of ChatGPT for Deep Learning Program Repaircited by 26
  9. 2024When to Stop? Towards Efficient Code Generation in LLMs with Excess Token Preventioncited by 21
  10. 2024An Empirical Study on the Code Refactoring Capability of Large Language Modelscited by 19
  11. 2024The Impact of Prompt Programming on Function-Level Code Generationcited by 13
  12. 2024A Survey of Neural Code Intelligence: Paradigms, Advances and Beyondcited by 12
8 more
  1. 2022Code Smells for Machine Learning Applicationscited by 8
  2. 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
  3. 2025The Code Barrier: What LLMs Actually Understand?cited by 5
  4. 2024Prompt Learning for Multi-Label Code Smell Detection: A Promising Approachcited by 3
  5. 2024Envisioning the Next-Generation AI Coding Assistants: Insights & Proposalscited by 2
  6. 2024A Comprehensive Evaluation of Parameter-Efficient Fine-Tuning on Code Smell Detectioncited by 2
  7. 2025Open-Source AI-Powered Optimization in Scalene: Advancing Python Performance Profiling with DeepSeek-R1 and LLaMA 3.2cited by 2
  8. 2024Data Preparation for Deep Learning based Code Smell Detection: A Systematic Literature Reviewcited by 1

Built on by

Cited by year

Citing papers per year: 2025: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025T3: Multi-level Tree-based Automatic Program Repair with Large Language Models
  2. 2024Investigating the Transferability of Code Repair for Low-Resource Programming Languages
  3. 2025A Survey of LLM-based Automated Program Repair: Taxonomies, Design Paradigms, and Applications
  4. 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs
  5. 2025FeedbackEval: A Benchmark for Evaluating Large Language Models in Feedback-Driven Code Repair Tasks
  6. 2025CoRe: Benchmarking LLMs Code Reasoning Capabilities through Static Analysis Tasks
  7. 2025Breakpoint: Scalable evaluation of system-level reasoning in LLM code agents
  8. 2024MORepair: Teaching LLMs to Repair Code via Multi-Objective Fine-tuning