arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

OwlPath:面向大语言模型漏洞修复的无损知识压缩

OwlPath: Lossless Knowledge Compression for LLM Bug Repair

Bo Zhang, Ren Pan, Huan Chen, Xiang Song

arXiv 2607.27249首次发表:更新:

AI 中文总结

OwlPath是构建于CodeGraph之上的OWL2推理层,通过无损知识压缩将代码编码为OWL2本体,提升LLM漏洞修复的结构检索性能,在多组基准测试中实现了严格应用率、召回率等指标的显著提升。

AI 中文摘要

基于大语言模型(LLM)的软件工程智能体受限于有限的上下文窗口:需存储约10万个token的结构相关代码子集才能修复漏洞。标准检索模型将代码视为纯文本,迫使智能体通过缓慢的试错解决多跳依赖,包括子类链、传递调用者和接口实现。我们通过无损知识压缩解决这一局限,将源代码编码为OWL2本体,以最小的相关代码片段回答结构查询。我们提出OwlPath,这是一个构建在CodeGraph之上的OWL2推理层,CodeGraph是拥有50万+ GitHub星标的广泛使用的代码智能平台,提供用于结构代码检索的统一命令行界面(CLI)。OwlPath由tree-sitter解析提供支持,支持多语言仓库(Python、JavaScript、TypeScript、Go等),并将特定语言的语义编码为统一的OWL2本体。它采用两个互补模块:一是传递闭包引擎,通过单个SPARQL属性路径查询获取所有结构关联符号,捕获字符串匹配遗漏的多跳关系;二是OWL软件知识图谱(OWL-SKM),预计算包含模块树、核心API和问题相关符号的紧凑3KB摘要,指导智能体在首次查询时定位目标模块。在18个SWE-bench Pro实例上评估,OwlPath的严格应用率达68.4%,而CodeGraph基线为66.7%,同时减少28.8%的token使用量和39.5%的运行时间。在针对67个实例的离线检索测试中,OwlPath的召回率提升2.06倍(0.464 vs 0.226),命中率达88.1%,而CodeGraph为59.7%。在包含37个问题的结构检索基准上,召回率从4.4%提升至28.8%,在传递调用者和接口任务上的准确率达69-80%。

英文摘要

LLM-based software engineering agents are constrained by limited context windows: roughly 100K tokens must store structurally relevant code subsets to resolve bugs. Standard retrieval models treat code as plain text, forcing agents to resolve multi-hop dependencies including subclass chains, transitive callers and interface implementations through slow trial and error. We tackle this limitation with lossless knowledge compression, encoding source code into an OWL2 ontology to answer structural queries using minimal relevant code fragments. We present OwlPath, an OWL2 reasoning layer atop CodeGraph, a widely used code intelligence platform with 500K+ GitHub stars, offering a unified CLI for structural code retrieval. Powered by tree-sitter parsing, OwlPath supports multi-language repositories (Python, JavaScript, TypeScript, Go, etc.) and encodes language-specific semantics into a unified OWL2 ontology. It adopts two complementary modules. First, a transitive-closure engine fetches all structurally linked symbols via single SPARQL property-path queries, capturing multi-hop relations missed by string matching. Second, the OWL Software Knowledge Map (OWL-SKM) precomputes a compact 3KB summary with module trees, core APIs and issue-related symbols, directing agents to target modules in the first query. Evaluated on 18 SWE-bench Pro instances, OwlPath obtains a 68.4% strict-apply rate versus 66.7% for the CodeGraph baseline, cutting token usage by 28.8% and runtime by 39.5%. In offline retrieval tests over 67 instances, OwlPath improves recall 2.06 times (0.464 vs 0.226) and reaches 88.1% hit rate compared to CodeGraph's 59.7%. On a 37-question structural retrieval benchmark, recall rises from 4.4% to 28.8%, with 69-80% accuracy on transitive caller and interface tasks.

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑