EUVIMEDEUVIMED entdecken
Crossref

Understanding Chain-of-Thought effectiveness in code generation: an empirical and information-theoretic analysis

Naizhu Jin, Zhong Li, Guang Yang, Tian Zhang, Qingkai Zeng

Empirical Software Engineering · 2027-02 · 32 (1)

DOI: 10.1007/s10664-026-10947-8 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Empirical Software Engineering, online erschienen am 10.08.2026. Verfasst von Naizhu Jin und 4 weiteren Autor:innen. Die Arbeit nennt 44 Literaturangaben. Gefördert von: Natural Science Foundation of Jiangsu Province.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

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 proxy-based 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 consistently 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.

Förderung

  • Natural Science Foundation of Jiangsu Province

Zitieren

APA

Jin, N., Li, Z., Yang, G., Zhang, T., & Zeng, Q. (2027). Understanding Chain-of-Thought effectiveness in code generation: an empirical and information-theoretic analysis. Empirical Software Engineering, 32(1). https://doi.org/10.1007/s10664-026-10947-8

Vancouver

Jin N, Li Z, Yang G, Zhang T, Zeng Q. Understanding Chain-of-Thought effectiveness in code generation: an empirical and information-theoretic analysis. Empirical Software Engineering. 2027;32(1). doi:10.1007/s10664-026-10947-8

BibTeX
@article{Jin2027,
  author = {Jin, Naizhu and Li, Zhong and Yang, Guang and Zhang, Tian and Zeng, Qingkai},
  title = {Understanding Chain-of-Thought effectiveness in code generation: an empirical and information-theoretic analysis},
  journal = {Empirical Software Engineering},
  year = {2027},
  volume = {32},
  number = {1},
  doi = {10.1007/s10664-026-10947-8}
}
Kostenlos starten →