← Reference notes

Teaching Large Language Models to Self-Debug

Teaching Large Language Models to Self-Debug

Summary

Self-Debugging teaches an LLM, through few-shot examples, to debug the code it generated. The model looks at execution results and explains its code in plain language, a form of 'rubber duck debugging'. This works even without human feedback on whether the code is correct. It improved results on Spider (text-to-SQL), TransCoder (C++ to Python) and MBPP (text to Python), by up to 12% where unit tests were available.

Draft. License: CC BY 4.0 (this summary). Sources: [S1] arXiv, "Teaching Large Language Models to Self-Debug" (CC BY 4.0).

When to apply

Paper

Facts

Caveats

Pointers

Source: https://arxiv.org/abs/2304.05128 · License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted), condensed and paraphrased; sources: Xinyun Chen, Maxwell Lin, Nathanael Schärli, Denny Zhou, \"Teaching Large Language Models to Self-Debug\", arXiv:2304.05128 (CC BY 4.0)

Cite this

Permanent ID: iil:note:sbk84hqs

iinventedlight Library. 2026. "Teaching Large Language Models to Self-Debug." iinventedlight Library, iil:note:sbk84hqs, version of 2026-11-02. https://iinventedlight.com/library/reference/arxiv/2304-05128-self-debugging/. License: CC-BY-4.0. Summary of https://arxiv.org/abs/2304.05128.

@misc{iil_note_sbk84hqs,
  author = {{iinventedlight Library}},
  title = {{Teaching Large Language Models to Self-Debug}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-02},
  url = {https://iinventedlight.com/library/reference/arxiv/2304-05128-self-debugging/},
  note = {Permanent ID iil:note:sbk84hqs. License: CC-BY-4.0. Summary of https://arxiv.org/abs/2304.05128.},
}

For language models and agents: start at /llms.txt. This page in Markdown: /library/reference/arxiv/2304-05128-self-debugging.md.