Computer Science > Software Engineering
Title:Distilling Reasoning Traces into Advisory Prompts for Software Engineering Tasks
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.
| Subjects: | Software Engineering (cs.SE) ; Artificial Intelligence (cs.AI) |
|---|---|
| Cite as: | arXiv:2608.00437 [cs.SE] |
| (or arXiv:2608.00437v2 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2608.00437 arXiv-issued DOI via DataCite |
Submission history
Access Paper:
- HTML (experimental)
Additional Features
- Audio Summary
Current browse context:
References & Citations
- Google Scholar
- Semantic Scholar
BibTeX formatted citation
Bookmark
Bibliographic and Citation Tools
Code, Data and Media Associated with this Article
Demos
Recommenders and Search Tools
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.