Large Language Models (LLMs) suffer from a critical limitation: their knowledge is static and quickly becomes outdated. Retraining these massive models is computationally prohibitive, while existing knowledge editing techniques can be slow and may introduce unforeseen side effects. To address this, we propose DySK-Attn, a novel framework that enables LLMs to efficiently integrate real-time knowledge from a dynamic external source. Our approach synergizes an LLM with a dynamic Knowledge Graph (KG) that can be updated instantaneously. The core of our framework is a sparse knowledge attention mechanism, which allows the LLM to perform a coarse-to-fine grained search, efficiently identifying and focusing on a small, highly relevant subset of facts from the vast KG. This mechanism avoids the high computational cost of dense attention over the entire knowledge base and mitigates noise from irrelevant information. We demonstrate through extensive experiments on time-sensitive question-answering tasks that DySK-Attn significantly outperforms strong baselines, including standard Retrieval-Augmented Generation (RAG) and model editing techniques, in both factual accuracy for updated knowledge and computational efficiency. Our framework offers a scalable and effective solution for building LLMs that can stay current with the ever-changing world.
翻译:大语言模型(LLMs)存在一个关键局限:其知识是静态的,并且会迅速过时。重新训练这些庞大的模型在计算上是不可行的,而现有的知识编辑技术可能速度较慢,并且可能引入不可预见的副作用。为解决这一问题,我们提出了DySK-Attn,这是一个新颖的框架,使LLMs能够高效地整合来自动态外部源的实时知识。我们的方法将LLM与一个可以瞬时更新的动态知识图谱(KG)协同工作。我们框架的核心是一个稀疏知识注意力机制,它允许LLM执行从粗粒度到细粒度的搜索,高效地从庞大的KG中识别并聚焦于一小部分高度相关的事实。该机制避免了在整个知识库上进行密集注意力计算的高昂成本,并减轻了来自不相关信息带来的噪声。通过在时效性强的问答任务上进行的大量实验,我们证明DySK-Attn在更新知识的准确性以及计算效率方面,均显著优于包括标准检索增强生成(RAG)和模型编辑技术在内的强基线。我们的框架为构建能够跟上瞬息万变世界的LLMs提供了一个可扩展且有效的解决方案。