让大模型更聪明地读长文档,只算需要的部分,提速降耗。
KAP: Bridging the Knowledge Selection-Runtime Consumption Gap in LLM Systems

- 用运行时访问计划把知识结构变成可执行指令
- 128K上下文时仅需原内存5.5%的计算量,质量不变
- 适合做长文本问答、复杂推理的大模型系统
现代大模型系统依赖知识选择生成高价值结构化先验,如排序证据、图拓扑、多模态对齐和置信度信号。但模型服务端对此结构仍无感知:一旦这些信号被序列化为提示,后端只看到扁平的词元序列,导致解码时对整个键值(KV)状态进行密集且均匀的消耗。我们称此架构错位为知识选择-运行时消费(KSRC)鸿沟:更丰富的上下文会扩大完整提示的KV占用,增加延迟并降低吞吐量,即使推理只需其中一小部分。为此,我们提出知识访问规划(KAP),一种范式变革的执行抽象,将结构化知识先验从被动提示构造提示升级为第一类物理执行实体。KAP建立通用中间表示(IR)——运行时访问计划,编译结构化知识信号以指导物理KV访问,不改变逻辑提示语义、模型权重或训练流程。通过该IR,KAP实现从基于词元的上下文消费转向基于计划的知识驱动运行时消费。我们以GraphSpec为例实现该方案,连接结构化知识选择与大模型服务后端。推导出计划引导执行的正加速区段边界模型。在4K–128K长上下文问答任务中,GraphSpec保持与全上下文解码相当的答案质量,同时将物理KV消耗与提示长度解耦,在128K场景下将提案时间的KV访问降至源状态的5.5%,从根本上改变了长上下文生成的扩展轨迹。
原文摘要 · Abstract (English)
Modern LLM systems increasingly rely on knowledge-selection processes that produce high-value structured priors, such as ranked evidence, graph topology, multimodal alignment, and confidence signals. Yet LLM serving remains fundamentally oblivious to this rich structure: once such signals are serialized into a prompt, the backend observes only a flat token sequence, forcing dense and uniform consumption of the full key-value (KV) state during decoding. We term this architectural mismatch the Knowledge Selection-Runtime Consumption (KSRC) gap: richer contexts enlarge the full-prompt KV footprint and decode-time memory traffic, increasing latency and degrading throughput even when reasoning depends on only a small fraction of the context. To bridge the gap, we propose Knowledge Access Planning (KAP), a paradigm-shifting execution abstraction that elevates structured knowledge priors from passive prompt-construction hints into first-class physical execution artifacts. KAP establishes a universal intermediate representation (IR)-the runtime access plan-which compiles structured knowledge signals to govern physical KV access without altering logical prompt semantics, model weights, or training procedures. Through this IR, KAP shifts LLM serving from token-aware context consumption to plan-driven, knowledge-aware runtime consumption. We instantiate KAP with GraphSpec, a compiler-executor realization connecting structured knowledge selection to an LLM serving backend. We derive a phase-boundary model for the positive-speedup regime of plan-guided execution. Across 4K-128K long-context QA workloads, GraphSpec maintains answer quality comparable to full-context decoding while decoupling physical KV consumption from prompt length, reducing proposal-time KV access to 5.5% of source KV state at 128K, and fundamentally shifting the scaling trajectory of long-context generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。