看似无关的标点词实则关键,影响大模型长程理解
LLM-Microscope: Uncovering the Hidden Role of Punctuation in Context Memory of Transformers
- 通过量化分析发现,停用词与标点蕴含高上下文信息
- 删去标点后MMLU与BABILong-4k任务性能显著下降
- 开源工具可可视化中间层贡献,揭示隐藏记忆机制
我们提出方法量化大型语言模型编码和存储上下文信息的方式,发现常被视为次要的词(如冠词、标点)实际上承载着大量上下文信息。值得注意的是,即使仅移除无关标记,删除停用词、冠词和逗号也会持续降低MMLU和BABILong-4k上的表现。分析还显示,上下文表示与线性度高度相关,其中线性度衡量从一层嵌入到下一层变换是否可用单一线性映射近似。这些发现凸显了填充词在维持上下文中的隐秘重要性。为此,我们推出了LLM-Microscope,一个开源工具包,可评估逐标记非线性度、衡量上下文记忆能力、可视化中间层贡献(通过改进的Logit Lens),并测量表征的内在维度。该工具揭示了看似微不足道的标记如何对长程理解至关重要。
原文摘要 · Abstract (English)
We introduce methods to quantify how Large Language Models (LLMs) encode and store contextual information, revealing that tokens often seen as minor (e.g., determiners, punctuation) carry surprisingly high context. Notably, removing these tokens -- especially stopwords, articles, and commas -- consistently degrades performance on MMLU and BABILong-4k, even if removing only irrelevant tokens. Our analysis also shows a strong correlation between contextualization and linearity, where linearity measures how closely the transformation from one layer's embeddings to the next can be approximated by a single linear mapping. These findings underscore the hidden importance of filler tokens in maintaining context. For further exploration, we present LLM-Microscope, an open-source toolkit that assesses token-level nonlinearity, evaluates contextual memory, visualizes intermediate layer contributions (via an adapted Logit Lens), and measures the intrinsic dimensionality of representations. This toolkit illuminates how seemingly trivial tokens can be critical for long-range understanding.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。