mlsanityData to 7 Oct 2026

Understanding Chain-of-Thought Effectiveness in Code Generation: An Empirical and Information-Theoretic Analysis

arXiv 2512.09679 ↗First posted 10 Dec 2025cs.SEcited by 2

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

Abstract (arXiv)

Large language models (LLMs) achieve strong performance on code generation, but the mechanisms by which Chain-of-Thought (CoT) prompting helps remain unclear. We present a systematic empirical and information-theoretic study of CoT effectiveness in neural code generation, evaluating five paradigms (Zero-Shot, Zero-Shot CoT, Self-Planning, Structured CoT, Reasoning-CoT) across six Python benchmarks, a multilingual benchmark with 12 programming languages, and six models from 7B to 480B parameters, using conditional mutual information I(Y;C|X) as a conceptual lens. Our results show that externally guided CoT consistently outperforms direct generation, with structured methods improving Pass@1 by 5--12% on average while using substantially fewer tokens than reflective reasoning, and that CoT benefits depend on language type systems and model capacity. We further find that reasoning quality is critical: high-quality structured CoT from strong generators yields significantly higher accuracy than lightweight alternatives with the same template, whereas naive Zero-Shot CoT can even degrade performance. These findings provide practical guidance for choosing CoT strategies based on model capacity, language characteristics, and task complexity.

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

Builds on

14 of 39 references.

Closest ancestors · 2

Same direction, newest first

  1. 2025MSCoT: Structured Chain-of-Thought Generation for Multiple Programming Languages14 Apr
  2. 2023Bridging Code Semantic and LLMs: Semantic Chain-of-Thought Prompting for Code Generation16 Oct

Other references · 12

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2021Program Synthesis with Large Language Modelscited by 3,509
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  4. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  5. 2024A Survey on Large Language Models for Code Generationcited by 646
  6. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
  7. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  8. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  9. 2023Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performancecited by 102
  10. 2025Is Chain-of-Thought Reasoning of LLMs a Mirage? A Data Distribution Lenscited by 42
  11. 2024MHPP: Exploring the Capabilities and Limitations of Language Models Beyond Basic Code Generationcited by 25
  12. 2025Trade-offs in Large Reasoning Models: An Empirical Analysis of Deliberative and Adaptive Reasoning over Foundational Capabilitiescited by 20

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023Chain-of-Thought in Neural Code Generation: From and For Lightweight Language Models
  2. 2026Structural Anchors and Reasoning Fragility:Understanding CoT Robustness in LLM4Code
  3. 2023Structured Chain-of-Thought Prompting for Code Generation
  4. 2025Intention Chain-of-Thought Prompting with Dynamic Routing for Code Generation
  5. 2025SEER: Enhancing Chain-of-Thought Code Generation through Self-Exploring Deep Reasoning
  6. 2024Assessing Code Generation with Intermediate Languages
  7. 2025Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning
  8. 2024To CoT or not to CoT? Chain-of-thought helps mainly on math and symbolic reasoning