LMLineage:为 LLM 智能体提供内容溯源与上下文治理
LMLineage: Content Lineage and Context Governance for LLM Agents
做智能体的人都会遇到上下文越堆越长、出错查不到源头的问题。这篇论文把每句输出归因到具体输入片段,1 秒出结果,还能自动清掉不再引用的旧文档而保留用户指令。相比整段摘要的常规做法,它更精准,中文场景也测过,值得跑一遍试试。
arXiv 论文 LMLineage 提出一种带外(out-of-band)系统,将智能体会话中的每句输出归因到其支持的输入片段,并给出校准置信度,无需白盒模型访问或额外推理。
技术上采用窗口级嵌入相似度匹配,实验显示其比整文档匹配和词法匹配更贴合 LLM 的转述行为;贪心窗口快速路径在速度和平均准确率上均优于穷举逐行匹配。
性能方面,单块 GPU 上每轮归因可在 1 秒内完成,上下文累积到 40 轮仍保持稳定。论文还提出概念漂移微压缩:检测不再被引用的输入文档(发生"漂移")后仅压缩这部分,用户指令原文保留,漂移检测误压缩率为 0%。
评测语料包含 10 个中文网页 QA 案例的 71 条金标句子,以及跨 gpt-4o-mini、qwen3.8-27b、deepseek-v4-flash 三个生成模型的 90 轮多轮会话。
该方法配套的溯源构建方法已提交专利申请。
LMLineage: Content Lineage and Context Governance for LLM Agents
Interpretability for AI agents should not be confined to understanding the model's internal weights. It must also cover the agent's reasoning and decision-making process over multi-source context. We present LMLineage, an out-of-band system that attributes every output sentence of an agent session to its supporting input spans with calibrated confidences, without requiring white-box access to the model or any additional inference passes. On top of the lineage metadata, we build concept-drift micro compaction: instead of waiting for the context-length limit and summarizing everything, the system detects when previously used input documents have stopped being referenced ("drifted") and surgically compacts only those, preserving user instructions verbatim. We evaluate on a multi-tier corpus: 71 gold annotated sentences from 10 Chinese web-QA cases, plus 90 turns of independently collected multi-turn sessions across three generator models (gpt-4o-mini, qwen3.8-27b, deepseek-v4-flash). Results show that (i) window-level embedding similarity is far better aligned with LLM paraphrasing than whole document or lexical matching; (ii) the greedy-window fast path is both faster and more accurate on average than exhaustive line-matching (a multiple-comparisons bias in the latter inflates web recall at the cost of overall accuracy); (iii) per-turn attribution completes in 1s on a single GPU, remaining stable as context accumulates to 40 turns; and (iv) concept-drift detection is conservative (0% false compaction) with recall bounded by attribution accuracy. We further describe the concept-drift micro compaction design and an interactive incident-tracing/memory-cleaning case study. A companion patent application covers the lineage construction method.
This report is categorized under AITOP's "Papers" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include LMLineage, agents, gpt-4o-mini.
Primary source verification: published directly by arXiv: DeepSeek with first-party authority.