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. Retrieval-Augmented Generation (RAG), the state-of-the-art (SOTA), improves relevance by injecting context at inference time. However, these approaches still face limitations: First, semantic fragmentation across structural boundaries impairs comprehension, as relevant knowledge is distributed across multiple files within a repository. Second, retrieval inefficiency and attention saturation degrade performance in RAG workflows, where long, weakly aligned contexts overwhelm model attention. Third, repository specific training data is scarce, often outdated, incomplete or misaligned. 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, symbolic cues linking code regions to semantic roles, into both training and inference. Unlike prior methods, KANT enables internal access to repository specific knowledge, reducing fragmentation and grounding inference in localized, semantically structured memory. Moreover, we synthesize specialized instruction tuning data directly from code, eliminating reliance on noisy or outdated documentation and comments. 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: over 90% of questions and answers were rated relevant and understandable; 77.34%, 69.53%, and 64.58% of answers were considered useful, accurate, and complete, respectively. KANT achieved over 60% preference from human annotators and a LocalStack expert over the baselines (e.g., 21% RAG) and notably the expert preferred KANT in over 79% of cases. Also, KANT reduced inference latency by up to 85% across all models. Overall, KANT demonstrated its effectiveness across all evaluated areas, implying that it is well-suited for scalable, low-latency, on-premise deployments, providing a strong foundation for repository-level code comprehension.
Building similarity graph...
Analyzing shared references across papers
Loading...
Alex Wolf
Marco Edoardo Palma
Pooja Rani
Journal of Systems and Software
University of Zurich
Building similarity graph...
Analyzing shared references across papers
Loading...
Wolf et al. (Sun,) studied this question.
www.synapsesocial.com/papers/69b4ba2618185d8a39802b99 — DOI: https://doi.org/10.1016/j.jss.2026.112850