arXiv:2504.14218cs.CL2025-04ACL被引 43

从特征层面解析大模型重复生成问题,提出可定位并抑制重复特征的新方法。

Understanding the Repeat Curse in Large Language Models from a Feature Perspective

  • 通过稀疏自编码器识别导致重复的特定模型激活特征。
  • 在多个层级上验证重复特征存在,并通过关闭它们显著降低重复率。
  • 构建了覆盖词级与段落级重复的数据集,适合模型优化与可解释性研究者。

大语言模型在多个领域取得显著进展,但频繁出现重复文本生成现象,我们称之为“重复诅咒”。尽管已有研究提出解码策略缓解此问题,但其根本机制仍不明确。本文从机制可解释性角度出发,受稀疏自编码器(SAE)启发,提出新方法“Duplicatus Charm”,系统识别出引发重复输出的关键模型激活特征——即“重复特征”。首先通过对数激活分析定位重复相关层;随后利用SAE进行激活操控,提取并刺激相关特征。为验证方法有效性,我们构建了一个涵盖词级与段落级重复的评估数据集,并设计量化评估流程以衡量特征影响。进一步地,通过禁用这些重复特征,有效缓解了重复诅咒。代码已公开于:https://github.com/kaustpradalab/repeat-curse-llm。

原文摘要 · Abstract (English)

Large language models (LLMs) have made remarkable progress in various domains, yet they often suffer from repetitive text generation, a phenomenon we refer to as the "Repeat Curse". While previous studies have proposed decoding strategies to mitigate repetition, the underlying mechanism behind this issue remains insufficiently explored. In this work, we investigate the root causes of repetition in LLMs through the lens of mechanistic interpretability. Inspired by recent advances in Sparse Autoencoders (SAEs), which enable monosemantic feature extraction, we propose a novel approach, "Duplicatus Charm", to induce and analyze the Repeat Curse. Our method systematically identifies "Repetition Features" -the key model activations responsible for generating repetitive outputs. First, we locate the layers most involved in repetition through logit analysis. Next, we extract and stimulate relevant features using SAE-based activation manipulation. To validate our approach, we construct a repetition dataset covering token and paragraph level repetitions and introduce an evaluation pipeline to quantify the influence of identified repetition features. Furthermore, by deactivating these features, we have effectively mitigated the Repeat Curse. The source code of our work is publicly available at: https://github.com/kaustpradalab/repeat-curse-llm

大模型重复生成可解释性特征分析

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