arXiv:2608.00437v2 Announce Type: replace Abstract: Language models are widely used for generating and otherwise processing code (e.g., predicting behavior, outputs, or likely inputs), and this paper asks whether better performance can be achieved without always incurring the cost of reasoning. Human students of programming learn to avoid mistakes by (a) first identifying them, (b) reflecting upon cognitive lapses that led to these mistakes (essentially, "thinking through" the errors), (c) inferring general rules or lessons from these reflections, and (d) internalizing these lessons into rules. In tutorial sessions with an instructor, this is a very common Socratic interaction with students. Examples of such internalizable rules might include the nugget "Before coding, restate the requirements to clarify them". Inspired by this process, this paper describes an approach where we first identify examples in which "thinking mode" in a (low-resource) LLM avoids errors; then, these errors, and their avoidance via "thinking" in the same LLM, are examined by a bigger LLM to generate summary explanations; these are then summarized by a large LLM into brief advisory prompts. This approach works on many modestly sized models; in some cases, the "advisory prompts" thus learned can also be gainfully transferred to other models. We also present some investigations into the nature of coding errors that language models make, and a characterization of when this approach can be helpful.
Continue to arXiv Software Engineering →You are being forwarded in 6s — stay on this page