arXiv:2505.13171cs.CL2025-05NeurIPS被引 2

发现大模型记忆受位置影响,偏移越深越难复现敏感内容。

Positional Fragility in LLMs: How Offset Effects Reshape Our Understanding of Memorization Risks

  • 模型依赖上下文开头短前缀触发记忆,长度越长反而记不住
  • 只要前缀偏离开头,原文复现率急剧下降,最多降90%
  • 适合关注数据隐私与版权风险的开发者和安全研究者

大型语言模型会记忆训练数据部分,存在版权风险。我们从头预训练1B/3B/8B参数模型,使用830亿个标记的网页数据与公共领域书籍混合,模拟受版权保护内容,并设置长度为之前研究的十倍以上。结果发现:(1)记忆最强烈出现在上下文窗口开头的短前缀,且随着前缀变长,记忆能力反而下降;(2)当前缀起始位置偏离上下文开头时,原文复现率急剧下降。该现象称为位置脆弱性:模型过度依赖最早出现的上下文标记作为检索锚点,对微小偏移极其敏感。此外,若无法召回记忆内容,模型常生成退化文本。利用此特性,我们将敏感数据向后偏移可有效抑制可提取的记忆与退化现象。结果表明,位置偏移是评估记忆风险中被忽视的关键因素,因以往研究默认从序列开头探测,忽略了其非均匀性。

原文摘要 · Abstract (English)

Large language models are known to memorize parts of their training data, posing risk of copyright violations. To systematically examine this risk, we pretrain language models (1B/3B/8B) from scratch on 83B tokens, mixing web-scale data with public domain books used to simulate copyrighted content at controlled frequencies at lengths at least ten times longer than prior work. We thereby identified the offset effect, a phenomenon characterized by two key findings: (1) verbatim memorization is most strongly triggered by short prefixes drawn from the beginning of the context window, with memorization decreasing counterintuitively as prefix length increases; and (2) a sharp decline in verbatim recall when prefix begins offset from the initial tokens of the context window. We attribute this to positional fragility: models rely disproportionately on the earliest tokens in their context window as retrieval anchors, making them sensitive to even slight shifts. We further observe that when the model fails to retrieve memorized content, it often produces degenerated text. Leveraging these findings, we show that shifting sensitive data deeper into the context window suppresses both extractable memorization and degeneration. Our results suggest that positional offset is a critical and previously overlooked axis for evaluating memorization risks, since prior work implicitly assumed uniformity by probing only from the beginning of training sequences.

大模型记忆风险位置敏感版权安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。