用大模型改进代码回溯,让故障定位更准更快。
Time Travel: LLM-Assisted Semantic Behavior Localization with Git Bisect
- 用大模型分析每步提交的语义变化,应对测试不稳定问题。
- 成功率从74.2%提升至80.6%,平均回溯时间最多减少一半。
- 适合做代码调试、缺陷定位的工程师和自动化测试团队。
我们提出一种新框架,将大语言模型(LLM)融入 Git bisect 过程,实现语义级故障定位。传统回溯依赖确定性断言和二元失败状态,但在现代开发中常因间歇性测试、非单调回归及上游分支语义漂移而失效。本系统通过结构化思维链推理,在噪声环境下逐提交分析。我们在精选的语义标注差异数据集上,对多个开源与专有 LLM 进行评估,并使用 QLoRA 微调 DeepSeekCoderV2。采用弱监督流程降低标注成本,结合人工修正与自一致性过滤。在多个开源项目上的实验表明,成功率达 80.6%(提升 6.4 个百分点),失败遍历显著减少,平均回溯时间最多缩短 2 倍。最后讨论了时间推理、提示设计与针对提交级行为分析的微调策略。
原文摘要 · Abstract (English)
We present a novel framework that integrates Large Language Models (LLMs) into the Git bisect process for semantic fault localization. Traditional bisect assumes deterministic predicates and binary failure states assumptions often violated in modern software development due to flaky tests, nonmonotonic regressions, and semantic divergence from upstream repositories. Our system augments bisect traversal with structured chain of thought reasoning, enabling commit by commit analysis under noisy conditions. We evaluate multiple open source and proprietary LLMs for their suitability and fine tune DeepSeekCoderV2 using QLoRA on a curated dataset of semantically labeled diffs. We adopt a weak supervision workflow to reduce annotation overhead, incorporating human in the loop corrections and self consistency filtering. Experiments across multiple open source projects show a 6.4 point absolute gain in success rate from 74.2 to 80.6 percent, leading to significantly fewer failed traversals and by experiment up to 2x reduction in average bisect time. We conclude with discussions on temporal reasoning, prompt design, and finetuning strategies tailored for commit level behavior analysis.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。