arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.03340cs.SE
收藏

键增强神经触发器用于知识共享

Key-Augmented Neural Triggers for Knowledge Sharing

Alex Wolf, Marco Edoardo Palma, Pooja Rani, Harald C. Gall

AI总结:

针对仓库级代码理解中的语义碎片化、检索低效和部署受限问题,提出键增强神经触发器(KANT),通过嵌入知识锚并合成数据,减少上下文开销,实现低延迟本地部署,获得超60%偏好并降低85%推理延迟。

摘要:

仓库级代码理解与知识共享仍是软件工程中的核心挑战。大型语言模型(LLMs)通过生成程序结构和逻辑的解释展现了潜力。然而,这些方法仍面临局限:首先,相关知识分布在仓库内的多个文件中,即语义碎片化。其次,在RAG流水线中,检索效率低下和注意力饱和会降低性能,其中冗长、不对齐的上下文压垮了注意力。第三,仓库特定的训练数据稀缺且常常过时。最后,专有LLMs因隐私和部署约束而阻碍了工业采用。为解决这些问题,我们提出了键增强神经触发器(KANT),一种将知识锚嵌入训练和推理的新方法。与先前方法不同,KANT实现了对仓库特定知识的内部访问,减少了碎片化并将推理扎根于局部上下文。此外,我们直接从代码合成专门数据。在推理时,知识锚替代冗长上下文,减少了令牌开销和延迟,同时支持高效的本地部署。我们通过以下方式评估KANT:对合成数据集在五个维度上的意图覆盖和质量进行定性人工评估;与SOTA基线在五个定性维度和推理速度上进行比较;并在不同LLMs上进行复制以评估泛化性。结果表明,合成训练数据与信息寻求需求对齐。KANT获得了超过60%的人工标注者偏好和一位LocalStack专家(在79%的案例中偏好)。此外,KANT在所有模型上将推理延迟降低了高达85%。总体而言,它非常适合可扩展、低延迟、本地部署,为代码理解提供了坚实基础。

英文摘要:

Repository-level code comprehension and knowledge sharing remain core challenges in software engineering. Large language models (LLMs) have shown promise by generating explanations of program structure and logic. However, these approaches still face limitations: First, relevant knowledge is distributed across multiple files within a repository, aka semantic fragmentation. Second, retrieval inefficiency and attention saturation degrade performance in RAG pipelines, where long, unaligned contexts overwhelm attention. Third, repository specific training data is scarce and often outdated. Finally, proprietary LLMs hinder industrial adoption due to privacy and deployment constraints. To address these issues, we propose Key-Augmented Neural Triggers (KANT), a novel approach that embeds knowledge anchors into both training and inference. Unlike prior methods, KANT enables internal access to repository specific knowledge, reducing fragmentation and grounding inference in localized context. Moreover, we synthesize specialized data directly from code. At inference, knowledge anchors replace verbose context, reducing token overhead and latency while supporting efficient, on premise deployment. We evaluate KANT via: a qualitative human evaluation of the synthesized dataset's intent coverage and quality across five dimensions; compare against SOTA baselines across five qualitative dimensions and inference speed; and replication across different LLMs to assess generalizability. Results show that the synthetic training data aligned with information-seeking needs. KANT achieved over 60% preference from human annotators and a LocalStack expert (preferring 79% of cases). Also, KANT reduced inference latency by up to 85% across all models. Overall, it is well-suited for scalable, low-latency, on-premise deployments, providing a strong foundation for code comprehension.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑