mlsanityData to 7 Oct 2026

Chain-of-Thought in Neural Code Generation: From and For Lightweight Language Models

arXiv 2312.05562 ↗First posted 9 Dec 2023cs.SEcited by 27

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

Abstract (arXiv)

Large Language Models (LLMs) have demonstrated remarkable potential in code generation. The integration of Chain of Thought (CoT) reasoning can further boost their performance. However, current CoT methods often require manual writing or LLMs with over 100 billion parameters to generate, impeding their applicability in resource-constrained scenarios. In this study, we investigate lightweight Language Models (lLMs), which are defined to have fewer than 10 billion parameters. Empirically, we find that most lLMs cannot generate high-quality CoTs when prompted by the few-shot method, but can take advantage of high-quality CoTs generated elsewhere to improve their performance in code generation. Based on these findings, we design a novel approach COTTON which can leverage lLMs to automatically generate CoTs for code generation. We synthesize new datasets and conduct extensive experiments on various benchmarks. The results show that the CoTs generated by COTTON outperform the baselines in terms of automated and human evaluation metrics. In particular, the CoTs generated by COTTON boost various lLMs to achieve higher performance gains than those generated by LLMs such as ChatGLM (130B), and are competitive with those generated by gpt-3.5-turbo (175B). Our study also showcases the potential of lLMs in software engineering applications.

Key facts. Cited by 27 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 109 references that are in the map. First posted on arXiv 9 Dec 2023.

Builds on

14 of 109 references.

Closest ancestors · 2

Same direction, newest first

  1. 2023Structured Chain-of-Thought Prompting for Code Generation11 May
  2. 2022Competition-Level Code Generation with AlphaCode8 Feb

Other references · 12

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  2. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
  3. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  5. 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
  6. 2022Towards Reasoning in Large Language Models: A Surveycited by 593
  7. 2022Selection-Inference: Exploiting Large Language Models for Interpretable Logical Reasoningcited by 331
  8. 2022Large Language Models Are Reasoning Teacherscited by 318
  9. 2022Reasoning with Language Model Prompting: A Surveycited by 251
  10. 2023Specializing Smaller Language Models towards Multi-Step Reasoningcited by 249
  11. 2022Rethinking with Retrieval: Faithful Large Language Model Inferencecited by 145
  12. 2023Symbolic Chain-of-Thought Distillation: Small Models Can Also "Think" Step-by-Stepcited by 144

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 12; 2026: 13.

27 papers.

Sort:

By area:

  1. 2024Making Reasoning Matter: Measuring and Improving Faithfulness of Chain-of-Thought Reasoningcited by 108
  2. 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
  3. 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMscited by 47
  4. 2025Chain-of-Thought Prompting Obscures Hallucination Cues in Large Language Models: An Empirical Evaluationcited by 20
  5. 2025VeriThoughts: Enabling Automated Verilog Code Generation using Reasoning and Formal Verificationcited by 15
  6. 2025Issue-Oriented Agent-Based Framework for Automated Review Comment Generationcited by 4
  7. 2025Designing LLM-based Multi-Agent Systems for Software Engineering Tasks: Quality Attributes, Design Patterns and Rationalecited by 3
  8. 2026Supervised Fine-Tuning versus Reinforcement Learning: A Study of Post-Training Methods for Large Language Modelscited by 3
  9. 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Modelscited by 3
  10. 2025Boost, Disentangle, and Customize: A Robust System2-to-System1 Pipeline for Code Generationcited by 2
  11. 2025Optimizing Token Consumption in LLMs: A Nano Surge Approach for Code Reasoning Efficiencycited by 2
  12. 2025Adversarial Reasoning for Repair Based on Inferred Program Intentcited by 2
15 more
  1. 2025Code-Driven Inductive Synthesis: Enhancing Reasoning Abilities of Large Language Models with Sequencescited by 1
  2. 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluationcited by 1
  3. 2025The Cream Rises to the Top: Efficient Reranking Method for Verilog Code Generationcited by 1
  4. 2025Rethinking Reasoning: A Survey on Reasoning-based Backdoors in LLMscited by 1
  5. 2026Unseen-Codebases-Domain Data Synthesis and Training Based on Code Graphscited by 1
  6. 2026Can LLM Aid in Solving Constraints with Inductive Definitions?cited by 1
  7. 2026CrystalReasoner: Reasoning and RL for Property-Conditioned Crystal Structure Generationcited by 1
  8. 2026Developing LLM-based Multi-Agent Systems in Software Engineering: A Mixed-Method Experience Reportcited by 1
  9. 2026Toward Non-Expert Customized Congestion Control: Large Language Model-Assisted CCA Code Generation with eBPF Deploymentcited by 0
  10. 2026Design-Specification Tiling for ICL-based CAD Code Generationcited by 0
  11. 2026Temperature-Dependent Performance of Prompting Strategies in Extended Reasoning Large Language Modelscited by 0
  12. 2026CollabCoder: Plan-Code Co-Evolution via Collaborative Decision-Making for Efficient Code Generationcited by 0
  13. 2026Improving LLM Code Generation via Requirement-Aware Curriculum Reinforcement Learningcited by 0
  14. 2026Repository-Level Solidity Code Generation with Large Language Models: From Prompting to Fine-Tuningcited by 0
  15. 2026CIT-CAD: Constraint Intent Tree-based CAD Code Generation and Verificationcited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025Understanding Chain-of-Thought Effectiveness in Code Generation: An Empirical and Information-Theoretic Analysis
  2. 2024Low-Cost Language Models: Survey and Performance Evaluation on Python Code Generation
  3. 2025Are They All Good? Evaluating the Quality of CoTs in LLM-based Code Generation
  4. 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs
  5. 2024Assessing Code Generation with Intermediate Languages
  6. 2025Code Execution as Grounded Supervision for LLM Reasoning
  7. 2025Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning
  8. 2025Uncertainty-Guided Chain-of-Thought for Code Generation with LLMs