压缩上下文,保持承诺:可验证大语言模型上下文压缩的正式框架
Compress the Context, Keep the Commitments: A Formal Framework for Verifiable LLM Context Compression
AI总结:
本文提出Context Codec框架,通过语义层面的压缩方法,确保在压缩对话历史时保留关键承诺,解决现有方法在压缩过程中缺乏对语义承诺保留的明确规范的问题。
摘要:
LLM上下文不仅仅是token;它是一组承诺。长期对话累积了目标、约束、决定、偏好、工具结果、检索到的证据、制品和安全边界,这些必须被未来响应保留。现有上下文管理方法通过截断、检索、摘要、记忆系统或token级提示压缩来减少长度,但很少明确指定哪些语义承诺必须在压缩中保留或如何衡量其保留。我们提出Context Codec,一种基于承诺的框架,用于压缩提示和聊天历史。Context Codec将对话状态表示为具有标准身份、等价性、冲突、置信度、风险和证据跨度的语义原子。它分离了五个关注点——提取、规范化、表示、渲染和验证,并引入了关键原子召回率、加权原子召回率、承诺密度和往返恢复性等指标。它还定义了语义压缩错误的分类学,一个具体的规范化程序,保守的回退规则用于低置信度和安全关键原子,以及Context Compression Language (CCL),一种以ASCII优先的紧凑表示法,用于标准JSON原子。在一项小规模诊断研究中,CCL-Core在结构化的散文和JSON之间占据了一个有用的中间位置:比散文更明确和可审计,通常比JSON更紧凑,且比高度压缩的符号更安全。结果不是声称缩写解决压缩问题,而是一个使上下文压缩可验证的框架:压缩对话,保持承诺。
英文摘要:
LLM context is not just tokens; it is a set of commitments. Long-running conversations accumulate goals, constraints, decisions, preferences, tool results, retrieved evidence, artifacts, and safety boundaries that future responses must preserve. Existing context-management methods reduce length through truncation, retrieval, summarization, memory systems, or token-level prompt compression, but they rarely specify which semantic commitments must survive compression or how their preservation should be measured. We propose Context Codec, a commitment-level framework for compressing prompts and chat histories. Context Codec represents dialogue state as typed, source-grounded semantic atoms with canonical identity, equivalence, conflict, confidence, risk, and evidence spans. It separates five concerns - extraction, normalization, representation, rendering, and verification - and introduces metrics for Critical Atom Recall, Weighted Atom Recall, Commitment Density, and round-trip recoverability. It also defines a taxonomy of semantic compression errors, a concrete normalization procedure, conservative fallback rules for low-confidence and safety-critical atoms, and Context Compression Language (CCL), an ASCII-first compact rendering of canonical JSON atoms. In a small diagnostic study, CCL-Core occupies a useful middle ground between structured prose and JSON: more explicit and auditable than prose, usually more compact than JSON, and less risky than heavily minified notation. The result is not a claim that shorthand solves compression, but a framework for making context compression verifiable: compress the conversation, keep the commitments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。