Training large language models (LLMs) on Python execution traces grounds them in code execution and enables the line-by-line execution prediction of whole Python programs, effectively turning them into neural interpreters (FAIR CodeGen Team et al., 2025). However, developers rarely execute programs step by step; instead, they use debuggers to stop execution at certain breakpoints and step through relevant portions only while inspecting or modifying program variables. Existing neural interpreter approaches lack such interactive control. To address this limitation, we introduce neural debuggers: language models that emulate traditional debuggers, supporting operations such as stepping into, over, or out of functions, as well as setting breakpoints at specific source lines. We show that neural debuggers -- obtained via fine-tuning large LLMs or pre-training smaller models from scratch -- can reliably model both forward execution (predicting future states and outputs) and inverse execution (inferring prior states or inputs) conditioned on debugger actions. Evaluated on CruxEval, our models achieve strong performance on both output and input prediction tasks, demonstrating robust conditional execution modeling. Our work takes first steps towards future agentic coding systems in which neural debuggers serve as a world model for simulated debugging environments, providing execution feedback or enabling agents to interact with real debugging tools. This capability lays the foundation for more powerful code generation, program understanding, and automated debugging.


翻译:通过在Python执行轨迹上训练大语言模型(LLM),可使其基于代码执行过程,实现对完整Python程序的逐行执行预测,从而将其转化为神经解释器(FAIR CodeGen Team等人,2025年)。然而,开发者很少逐步执行程序;相反,他们使用调试器在特定断点处暂停执行,仅单步跟踪相关代码段,同时检查或修改变量值。现有的神经解释器方法缺乏此类交互控制能力。为突破这一局限,我们提出神经调试器:一种模拟传统调试器的语言模型,支持步入、步过、步出函数等操作,并能在特定源代码行设置断点。研究表明,通过微调大型LLM或从头预训练较小模型获得的神经调试器,能够可靠地建模正向执行(预测未来状态与输出)与逆向执行(推断先前状态或输入),且该建模过程以调试器操作为条件。在CruxEval基准上的评估显示,我们的模型在输出预测与输入预测任务中均表现优异,展现了稳健的条件执行建模能力。本研究为未来智能编码系统迈出关键一步:神经调试器可作为模拟调试环境的世界模型,提供执行反馈或使智能体能够与真实调试工具交互。该能力为更强大的代码生成、程序理解与自动化调试奠定了基石。

0
下载
关闭预览

相关内容

【新书】《学习AI辅助的Python编程(第2版)》
专知会员服务
67+阅读 · 2024年10月22日
掌握使用Python的大型语言模型
专知会员服务
63+阅读 · 2024年5月22日
【干货书】Python机器学习,361页pdf
专知会员服务
271+阅读 · 2021年2月25日
将Python用于NLP:Pattern 库简介
Python程序员
15+阅读 · 2019年6月7日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
Python 神经网络编程
人工智能头条
10+阅读 · 2019年2月27日
福利 | 当Python遇上大数据与机器学习,入门so easy!
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
7+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Arxiv
0+阅读 · 3月4日
VIP会员
最新内容
无人机与反无人机系统(书籍)
专知会员服务
11+阅读 · 今天6:45
美陆军2026条令:安全与机动支援
专知会员服务
3+阅读 · 今天5:49
技术、多域威慑与海上战争(报告)
专知会员服务
8+阅读 · 4月13日
“在云端防御”:提升北约数据韧性(报告)
专知会员服务
5+阅读 · 4月13日
人工智能及其在海军行动中的整合(综述)
专知会员服务
7+阅读 · 4月13日
相关VIP内容
【新书】《学习AI辅助的Python编程(第2版)》
专知会员服务
67+阅读 · 2024年10月22日
掌握使用Python的大型语言模型
专知会员服务
63+阅读 · 2024年5月22日
【干货书】Python机器学习,361页pdf
专知会员服务
271+阅读 · 2021年2月25日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
7+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员