用轻量多任务模型实现高效精准的代码错误定位,一次生成就搞定。
Multi-task LLMs for Bug Classification: Efficient Inference with Auxiliary Decoding Heads

- 通过分词对齐与多任务头设计,实现行级错误分类。
- 仅需单个生成令牌,推理延迟降低数量级,性能媲美复杂方法。
- 适合需要快速、精确调试的开发人员和自动化测试工具。
LLM驱动的代码生成虽加速了软件开发,但有效的验证方法仍严重不足。现有漏洞定位技术要么成本高昂,需数分钟推理和数千个生成标记每文件,要么仅在函数级别粗粒度操作,难以精确定位。虽有轻量级行级方法,但性能或上下文长度受限。本文提出一种新型行级漏洞定位方法,主要贡献包括:(1)解决先前工作中分词挑战的标记对齐算法;(2)轻量级多任务代码漏洞分类模型(MLC),支持高效行级分类;(3)优化的多行预测训练方案。该方法在全文件上下文下达到同类设置中的最先进性能。在Defects4J和PypiBugs基准上,性能接近代理式方法,但推理延迟降低数量级,每文件仅需一个生成标记。我们还引入并评估了小型跨领域数据集(Python),证明其强泛化能力。论文接受后将开源代码、模型和数据集。
原文摘要 · Abstract (English)
The rapid adoption of LLM-powered code generation has dramatically accelerated software development, yet effective verification methods remain severely underdeveloped. Existing bug localization techniques are either prohibitively expensive, requiring minutes of agentic reasoning and thousands of generated tokens per file, and/or operate at coarse function-level granularity unsuitable for precise debugging. While works that focus on line-level granularity and are more light-weight are often limited in their performance or context size. We introduce a novel line-level bug localization approach that addresses these limitations through three key contributions: (1) a token alignment algorithm that overcomes fundamental tokenization challenges in previous work, (2) a lightweight multi-task LLM for bug localization (MLC) enabling efficient line-level bug classification, and (3) an optimized training recipe for multi-line prediction. Our method achieves state-of-the-art performance among similar setups on line-level bug localization with full-file context. At the same time we reach comparable performance to agentic approaches on Defects4J and PypiBugs benchmarks while reducing inference latency by orders of magnitudes, requiring only a single generated token per file. We further demonstrate strong generalization by introducing and evaluating on a small out-of-domain evaluation datasets in Python. We will open source our code, models, and datasets upon acceptance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。