用动态知识图谱提升长文本理解,让模型更懂实体关系。
Knowledge Graph Enhanced Memory-Augmented Retrieval for Long Context Modeling

- 输入时实时构建上下文相关知识图谱,融合实体与关系信息。
- 在1K到32K token长度下,困惑度降低8.5%,内存效率提升2–2.5倍。
- 适合需要长程依赖和复杂关系推理的任务,如问答、摘要等。
长上下文语言建模不仅需要扩展上下文窗口,还需在数千个词元间保持对实体状态与关系的一致理解——仅靠语义相似性无法解决。KGERMAR通过在推理时从输入文本构建动态、上下文相关的知识图谱,实现领域自适应检索,同时利用语义相似性和显式实体关系。该框架实时提取实体与关系以构建上下文知识图谱,并通过多组件记忆架构将图结构嵌入与文本语义融合。三个记忆库——上下文、语义和结构——通过学习权重融合检索信号,捕捉表层语义与深层关系模式。在SlimPajama(84.7K训练样本)、WikiText-103(4,358样本)、PG-19(100样本)和Proof-pile(46.3K样本)上评估,KGERMAR在1K至32K词元的上下文长度下,困惑度降低最高达8.5%,内存效率提升2–2.5倍,并在五个自然语言理解任务中表现更优。其动态知识图谱构建方法推动了记忆增强语言建模的发展,实现了随输入上下文自适应的领域特定知识表示,而非依赖固定知识库。
原文摘要 · Abstract (English)
Long-context language modeling requires not only extending context windows but maintaining coherent understanding of entity states and relationships across thousands of tokens -- a challenge that semantic similarity alone cannot address. KGERMAR addresses this by constructing dynamic, context-specific knowledge graphs from input text during inference, enabling domain-adaptive retrieval that leverages both semantic similarity and explicit entity relationships. The framework performs real-time entity and relation extraction to build contextual knowledge graphs, then integrates graph-structural embeddings with textual semantics through a multi-component memory architecture. Three memory banks -- contextual, semantic, and structural -- are maintained with retrieval signals fused via learned weights to capture both surface-level semantics and deeper relational patterns. Evaluated on SlimPajama (84.7K training examples), WikiText-103 (4,358 examples), PG-19 (100 examples), and Proof-pile (46.3K examples), KGERMAR achieves up to 8.5\% lower perplexity and 2--2.5x better memory efficiency than memory-augmented baselines across context lengths from 1K to 32K tokens, with superior in-context learning performance across five NLU tasks. The dynamic knowledge graph construction approach advances memory-augmented language modeling by enabling domain-specific knowledge representation that adapts to input contexts rather than relying on fixed knowledge bases.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。