Inquest:基于日志引导的分阶段智能体的根本原因代码定位
Inquest: Log-Guided Root-Cause Code Localization with a Staged Agent
AI总结:
该研究针对生产问题无复现条件的场景,提出基于27B开放权重模型的分阶段智能体INQUEST,构建含38001份报告的基准,在代码定位任务中优于现有方法,top-1准确率最高达68.6%。
摘要:
当生产环境中的问题被报告时,工程师会收到问题描述和一些日志,但没有失败的测试用例,也无法复现故障。日志显示的是故障被注意到的位置,而非故障的根源位置:在我们研究的49%的真实报告中,日志文本并未提及修复后修改的任何文件。我们从两个公开数据集和27个开源项目(Apache、Red Hat、MongoDB、MariaDB、Qt和Sakai)中构建了针对该场景的基准,包含38001份已解决的问题报告、对应的粘贴日志、漏洞存在时的代码以及修复修改的文件。我们提出了INQUEST,一种使用27B开放权重模型的智能体,由代码而非模型控制流程。它首先收集证据,包括在报告提交前已解决的类似过往问题中修复的文件;随后模型仅做出三个有界决策:打开哪些文件、每个文件在故障中的作用以及如何对文件进行排名。在26544份评估报告中,INQUEST将修复文件排名第一的比例为68.6%,排名前五的比例为85.9%,正确命名模块的比例为90.2%,将修复函数排名第一的比例为53.8%;在未命名任何故障文件的报告中,该比例分别为52.8%和73.6%。使用相同模型和工具的自由智能体循环在文件定位上效果相当,但命名故障函数的频率低14个百分点。在1000份报告样本中,INQUEST在top-1准确率上击败了我们重新实现的两个已发表智能体7和20个百分点(仅统计那些智能体回答的报告时为4和16个百分点),击败作为重排序器使用的相同模型6个百分点。我们报告了每个系统的成本和不利于我们的结果,并发布了该基准、两个系统以及所有运行记录。
英文摘要:
When a production issue is reported, engineers get a description and some logs, but no failing test and no way to reproduce the fault. The logs show where the failure was noticed, not where it was caused: in 49% of the real reports we study, the text names none of the files that the fix later changed. We built a benchmark for this setting from two public datasets and 27 open-source projects (Apache, Red Hat, MongoDB, MariaDB, Qt and Sakai). It holds 38,001 resolved issue reports with their pasted logs, the code as it was while the bug was still present, and the files the fix changed. We present INQUEST, an agent that finds the faulty code using a 27B open-weights model. Code, not the model, controls the procedure. It first gathers the evidence, including the files fixed in similar past issues that were resolved before the report was filed. The model then makes only three bounded decisions: which files to open, what role each file plays in the failure, and how to rank them. On 26,544 evaluation reports, INQUEST ranks a changed file first for 68.6% and in the top five for 85.9%, names the correct module for 90.2%, and ranks a changed function first for 53.8%. On the reports that name no faulty file, it reaches 52.8% and 73.6%. A free agent loop with the same model and tools finds files equally well, but names the faulty function 14 points less often. On a 1,000-report sample, INQUEST beats our reimplementations of two published agents by 7 and 20 points of top-1 accuracy (4 and 16 counting only the reports those agents answered), and the same model used as a re-ranker by 6. We report the cost of every system and the results that go against us, and we release the benchmark, both systems and every run transcript.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。