Intention Chain-of-Thought Prompting with Dynamic Routing for Code Generation
On the map: LLM reasoning → Prompting and chain-of-thought reasoning
Abstract (arXiv)
Large language models (LLMs) exhibit strong generative capabilities and have shown great potential in code generation. Existing chain-of-thought (CoT) prompting methods enhance model reasoning by eliciting intermediate steps, but suffer from two major limitations: First, their uniform application tends to induce overthinking on simple tasks. Second, they lack intention abstraction in code generation, such as explicitly modeling core algorithmic design and efficiency, leading models to focus on surface-level structures while neglecting the global problem objective. Inspired by the cognitive economy principle of engaging structured reasoning only when necessary to conserve cognitive resources, we propose RoutingGen, a novel difficulty-aware routing framework that dynamically adapts prompting strategies for code generation. For simple tasks, it adopts few-shot prompting; for more complex ones, it invokes a structured reasoning strategy, termed Intention Chain-of-Thought (ICoT), which we introduce to guide the model in capturing task intention, such as the core algorithmic logic and its time complexity. Experiments across three models and six standard code generation benchmarks show that RoutingGen achieves state-of-the-art performance in most settings, while reducing total token usage by 46.37% on average across settings. Furthermore, ICoT outperforms six existing prompting baselines on challenging benchmarks.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Prompting and chain-of-thought reasoning, one of 17 directions in LLM reasoning. Builds on 20 of its 40 references that are in the map. First posted on arXiv 16 Dec 2025.
Builds on
20 of 40 references.
Closest ancestors · 4
Same direction, newest first
- 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models6 May
- 2022Automatic Chain of Thought Prompting in Large Language Models7 Oct
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Models21 May
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Models21 Mar
Other references · 16
- 2023GPT-4 Technical Reportcited by 18,132
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2025Qwen3 Technical Reportcited by 8,195
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2024DeepSeek-V3 Technical Reportcited by 724
- 2024McEval: Massively Multilingual Code Evaluationcited by 42
4 more
- 2023CodeCoT: Tackling Code Syntax Errors in CoT Reasoning for Code Generationcited by 29
- 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?cited by 29
- 2025Doing More with Less: A Survey on Routing Strategies for Resource Optimisation in Large Language Model-Based Systemscited by 18
- 2017A Syntactic Neural Model for General-Purpose Code Generationcited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Understanding Chain-of-Thought Effectiveness in Code Generation: An Empirical and Information-Theoretic Analysis
- 2024Enhancing Chain of Thought Prompting in Large Language Models via Reasoning Patterns
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- 2024Break the Chain: Large Language Models Can be Shortcut Reasoners
- 2022Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matters
- 2023Towards Better Chain-of-Thought Prompting Strategies: A Survey
- 2025Sketch-of-Thought: Efficient LLM Reasoning with Adaptive Cognitive-Inspired Sketching
- 2026Structural Anchors and Reasoning Fragility:Understanding CoT Robustness in LLM4Code