arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.15007cs.CLcs.AI
收藏

LLM-Microscope:揭示标点符号在Transformer上下文记忆中的隐藏作用

LLM-Microscope: Uncovering the Hidden Role of Punctuation in Context Memory of Transformers

AIRI;Skoltech(斯科尔泰克理工学院);HSE University(高等经济大学);Lomonosov Moscow State University(罗蒙诺索夫莫斯科国立大学)

Anton Razzhigaev, Matvey Mikhalchuk, Temurbek Rahmatullaev, Elizaveta Goncharova, Polina Druzhinina, Ivan Oseledets, Andrey Kuznetsov

AI总结:

本文提出量化LLM上下文编码的方法,发现标点等次要标记承载高上下文信息,移除会降低性能,并推出开源工具包LLM-Microscope以评估非线性、记忆和表征维度。

摘要:

我们引入了量化大型语言模型(LLM)如何编码和存储上下文信息的方法,揭示出通常被视为次要的标记(如限定词、标点符号)承载着令人惊讶的高上下文信息。值得注意的是,移除这些标记——尤其是停用词、冠词和逗号——会持续降低在MMLU和BABILong-4k上的性能,即使只移除不相关的标记也是如此。我们的分析还表明,上下文化与线性之间存在强相关性,其中线性度衡量的是从某一层嵌入到下一层的变换在多大程度上可以被单个线性映射近似。这些发现强调了填充标记在维持上下文中的隐藏重要性。为进一步探索,我们推出了LLM-Microscope,一个开源工具包,用于评估标记级非线性、评估上下文记忆、可视化中间层贡献(通过改进的Logit Lens),并测量表征的内在维度。该工具包阐明了看似琐碎的标记如何对长距离理解至关重要。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑