LIDL: 通过知识图谱增强的多智能体分析进行LLM集成缺陷定位
LIDL: LLM Integration Defect Localization via Knowledge Graph-Enhanced Multi-Agent Analysis
AI总结:
LIDL通过知识图谱增强的多智能体分析,有效定位LLM集成软件中的缺陷,提升准确性和效率。
摘要:
集成大型语言模型(LLM)的软件,通过嵌入或与LLM作为功能组件进行交互,表现出概率性和上下文依赖性的行为,这与传统软件的行为有根本性的差异。这种转变引入了一种新的集成缺陷类别,这些缺陷不仅来自代码错误,还来自LLM特定构件之间的不一致交互,包括提示、API调用、配置和模型输出。然而,现有的缺陷定位技术无法识别这些LLM特定的集成缺陷,因为它们无法捕捉跨层依赖关系,无法利用不完整或误导性的错误痕迹,且缺乏语义推理能力来识别根本原因。为了解决这些挑战,我们提出了LIDL,一种用于LLM集成软件缺陷定位的多智能体框架。LIDL(1)构建了一个包含LLM意识注释的代码知识图谱,这些注释代表源代码、提示和配置文件之间的交互边界;(2)融合三种互补的错误证据来源,这些证据由LLM推断得出,以揭示候选缺陷位置;(3)应用上下文感知验证,使用反事实推理来区分真正的根本原因和传播症状。我们对146个真实世界缺陷实例进行了评估,这些实例收集自105个GitHub仓库和16个基于代理的系统。结果表明,LIDL在所有指标上均显著优于五个最先进的基线方法,实现了Top-3准确率0.64和MAP 0.48,比表现最好的基线方法提高了64.1%。值得注意的是,LIDL在减少92.5%成本的同时实现了这些收益,展示了高准确性和成本效率。
英文摘要:
LLM-integrated software, which embeds or interacts with large language models (LLMs) as functional components, exhibits probabilistic and context-dependent behaviors that fundamentally differ from those of traditional software. This shift introduces a new category of integration defects that arise not only from code errors but also from misaligned interactions among LLM-specific artifacts, including prompts, API calls, configurations, and model outputs. However, existing defect localization techniques are ineffective at identifying these LLM-specific integration defects because they fail to capture cross-layer dependencies across heterogeneous artifacts, cannot exploit incomplete or misleading error traces, and lack semantic reasoning capabilities for identifying root causes. To address these challenges, we propose LIDL, a multi-agent framework for defect localization in LLM-integrated software. LIDL (1) constructs a code knowledge graph enriched with LLM-related annotations that represent interaction boundaries across source code, prompts, and configuration files, (2) fuses complementary sources of error evidence to surface candidate defect locations, and (3) applies context-aware validation that uses counterfactual reasoning to distinguish true root causes from propagated symptoms. We evaluate LIDL on 146 real-world defect instances collected from 105 GitHub repositories and 16 agent-based systems. The results show that LIDL significantly outperforms seven state-of-the-art baselines in localization accuracy, improving Top-3 accuracy by 19.15%, 21.69%, and 21.65% at the file, function, and line levels. Notably, LIDL achieves these gains at a lower cost than most baselines. Our localization results also improve downstream repair success by 30.77% over the best-performing baselines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。