Journal article · 2025 · Open access

Structured Chain-of-Thought Prompting for Code Generation

Jia Li, Ge Li, Yongmin Li, Zhi Gang Jin

ACM Transactions on Software Engineering and Methodology, 34(2), 1–23 · Published 21 January 2025 · DOI 10.1145/3690635

Open PDFView at the publisherCite this paper

In brief

“Structured Chain-of-Thought Prompting for Code Generation” is a 2025 journal article by Jia Li and 3 co-authors, published in ACM Transactions on Software Engineering and Methodology. OpenAlex counts 467 citations as of 30 November 2026, which puts it in the top 1% of works published in 2025 by citations. It is open access: the full text is free to read at ACM Transactions on Software Engineering and Methodology.

Citations
467
Most cited in
2026 (210)
Field-weighted impact
150.59
References
45
Authors
4

Abstract

Large Language Models (LLMs) have shown impressive abilities in code generation. Chain-of-Thought (CoT) prompting is the state-of-the-art approach to utilizing LLMs. CoT prompting asks LLMs first to generate CoTs (i.e., intermediate natural language reasoning steps) and then output the code. However, the accuracy of CoT prompting still cannot satisfy practical applications. For example, gpt-3.5-turbo with CoT prompting only achieves 53.29% Pass@1 in HumanEval. In this article, we propose Structured CoTs (SCoTs) and present a novel prompting technique for code generation named SCoT prompting. Our motivation is that human developers follow structured programming. Developers use three programming structures (i.e., sequential, branch, and loop) to design and implement structured programs. Thus, we ask LLMs to use three programming structures to generate SCoTs (structured reasoning steps) before outputting the final code. Compared to CoT prompting, SCoT prompting explicitly introduces programming structures and unlocks the structured programming thinking of LLMs. We apply SCoT prompting to two LLMs (i.e., gpt-4-turbo, gpt-3.5-turbo, and DeepSeek Coder-Instruct- \(\{\) 1.3B, 6.7B, 33B \(\}\)) and evaluate it on three benchmarks (i.e., HumanEval, MBPP, and MBCPP). SCoT prompting outperforms CoT prompting by up to 13.79% in Pass@1. SCoT prompting is robust to examples and achieves substantial improvements. The human evaluation also shows human developers prefer programs from SCoT prompting.

Cite this paper

Formatted from the catalogue record. Check names, capitals and page numbers against the paper before you submit.

APA 7

Li, J., Li, G., Li, Y., & Jin, Z. G. (2025). Structured Chain-of-Thought Prompting for Code Generation. ACM Transactions on Software Engineering and Methodology, 34(2), 1–23. https://doi.org/10.1145/3690635

MLA 9

Li, Jia, et al. “Structured Chain-of-Thought Prompting for Code Generation.” ACM Transactions on Software Engineering and Methodology, vol. 34, no. 2, 2025, pp. 1–23. https://doi.org/10.1145/3690635.

Chicago

Li, Jia, Ge Li, Yongmin Li, and Zhi Gang Jin. 2025. “Structured Chain-of-Thought Prompting for Code Generation.” ACM Transactions on Software Engineering and Methodology 34 (2): 1–23. https://doi.org/10.1145/3690635.

Harvard

Li, J. et al. (2025) ‘Structured Chain-of-Thought Prompting for Code Generation’, ACM Transactions on Software Engineering and Methodology, 34(2), pp. 1–23. doi:10.1145/3690635.

IEEE

J. Li, G. Li, Y. Li, and Z. G. Jin, “Structured Chain-of-Thought Prompting for Code Generation,” ACM Transactions on Software Engineering and Methodology, vol. 34, no. 2, pp. 1–23, 2025, doi: 10.1145/3690635.

BibTeX

@article{li2025structured,
  title     = {{Structured Chain-of-Thought Prompting for Code Generation}},
  author    = {Li, Jia and Li, Ge and Li, Yongmin and Jin, Zhi Gang},
  journal   = {ACM Transactions on Software Engineering and Methodology},
  year      = {2025},
  volume    = {34},
  number    = {2},
  pages     = {1--23},
  doi       = {10.1145/3690635},
  url       = {https://doi.org/10.1145/3690635}
}

Download for a reference manager: BibTeX (.bib) · RIS for Zotero, Mendeley and EndNote (.ris)

Citations by year

YearCitationsShare of the best year
202399
20246161
2025187187
2026210210

Its field-weighted citation impact is 150.59: it has been cited 150.59 times as often as the average work of the same field, type and year (1.00 is the world average).

Topic and keywords

Physical Sciences › Computer Science › Information Systems › Software Engineering Research

  • code generation
  • chain-of-thought prompting
  • structured programming
  • programming structures
  • large language models
  • HumanEval
  • MBPP

Work with this paper

Most-cited papers in Computer Science

All highly cited Computer Science papers

Questions about this paper

How do I cite this paper in APA style?

Li, J., Li, G., Li, Y., & Jin, Z. G. (2025). Structured Chain-of-Thought Prompting for Code Generation. ACM Transactions on Software Engineering and Methodology, 34(2), 1–23. https://doi.org/10.1145/3690635

How many times has this paper been cited?

467 times, according to OpenAlex on 30 November 2026. Google Scholar and Scopus count different sets of sources, so their numbers differ.

Is this paper free to read?

Yes. It is open access at ACM Transactions on Software Engineering and Methodology: sign in and open the PDF from this page.

Who wrote this paper?

Jia Li, Ge Li, Yongmin Li, Zhi Gang Jin.

What is the DOI of this paper?

10.1145/3690635, permanently at https://doi.org/10.1145/3690635. Sign in and open it from this page.

Bibliographic data from OpenAlex (CC0), last checked 30 November 2026. ResearchGuru does not host this paper; once you are signed in, the links open it at the publisher or the repository that does.