从特征视角理解大语言模型中的重复诅咒
Understanding the Repeat Curse in Large Language Models from a Feature Perspective
AI总结:
从特征视角研究大语言模型重复生成问题,提出Duplicatus Charm方法,通过稀疏自编码器识别并停用重复特征,有效缓解重复诅咒。
摘要:
大语言模型(LLMs)在各个领域取得了显著进展,然而它们常常遭受重复文本生成的困扰,我们将这一现象称为“重复诅咒”。尽管先前的研究提出了解码策略来缓解重复问题,但这一现象背后的根本机制仍未得到充分探索。在本工作中,我们通过机制可解释性的视角研究LLMs中重复问题的根本原因。受近期稀疏自编码器(SAEs)进展的启发,SAEs能够实现单语义特征提取,我们提出了一种新颖的方法“Duplicatus Charm”,用以诱发和分析重复诅咒。我们的方法系统地识别出“重复特征”——即负责生成重复输出的关键模型激活。首先,我们通过logit分析定位与重复最相关的层。接着,我们利用基于SAE的激活操作提取并刺激相关特征。为验证我们的方法,我们构建了一个涵盖词级和段落级重复的重复数据集,并引入了一个评估流程来量化所识别重复特征的影响。此外,通过停用这些特征,我们有效缓解了重复诅咒。我们工作的源代码公开于:https://github.com/kaustpradalab/repeat-curse-llm
英文摘要:
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
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。