让大模型像程序员一样交互式调试代码。
debug-gym: A Text-Based Environment for Interactive Debugging
- 构建文本环境,支持大模型调用pdb等工具实时探索代码。
- 在真实代码库中验证,大模型能通过交互提高调试准确率。
- 适合研究智能编程助手或具身智能的开发者使用。
大型语言模型(LLMs)在编程任务中日益重要,但通常假设所有信息均可通过上下文或训练数据获取。我们提出,若大模型能交互式探索代码库以获取任务相关信息,将显著提升表现。为此,我们设计了一个轻量级文本环境debug-gym,用于开发基于大模型的交互式编程代理。该环境预置了如Python调试器pdb等实用工具,支持大模型在真实编码与调试场景中进行动态探索。此方法不仅适用于编程与调试任务,还可推广至需要信息检索行为的其他任务,推动大模型从被动响应转向主动探查。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are increasingly relied upon for coding tasks, yet in most scenarios it is assumed that all relevant information can be either accessed in context or matches their training data. We posit that LLMs can benefit from the ability to interactively explore a codebase to gather the information relevant to their task. To achieve this, we present a textual environment, namely debug-gym, for developing LLM-based agents in an interactive coding setting. Our environment is lightweight and provides a preset of useful tools, such as a Python debugger (pdb), designed to facilitate an LLM-based agent's interactive debugging. Beyond coding and debugging tasks, this approach can be generalized to other tasks that would benefit from information-seeking behavior by an LLM agent.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。