Prediction hubs are context-informed frequent tokens in LLMs

📄 arXiv: 2502.10201v2 📥 PDF

作者: Beatrix M. G. Nielsen, Iuri Macocco, Marco Baroni

分类: cs.CL, cs.AI

发布日期: 2025-02-14 (更新: 2025-06-02)

备注: Published as a conference paper at ACL 2025

期刊: Association for Computational Linguistics 2025

DOI: 10.18653/v1/2025.acl-long.1156


💡 一句话要点

揭示LLM预测中枢为上下文相关的频繁token,避免不必要的hubness缓解

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 Hubness现象 高维表示 Token预测 距离度量 上下文向量 Unembedding向量

📋 核心要点

  1. 大型语言模型在高维空间中运行,可能受到hubness现象的影响,这会干扰基于距离的分析。
  2. 论文证明LLM的token预测机制天然避免了有害hubness,因为其比较操作不具有距离集中现象。
  3. 当使用其他距离度量比较LLM表示时,有害hubness可能出现,需要采取缓解措施。

📝 摘要(中文)

Hubness现象,即少数点成为不成比例数量的其他点的最近邻,常见于将标准距离度量应用于高维数据时,通常对基于距离的分析产生负面影响。由于自回归大型语言模型(LLM)在高维表示上运行,我们探究它们是否也受到hubness的影响。我们首先证明,LLM执行的唯一大规模表示比较操作,即上下文向量和unembedding向量之间的比较以确定延续概率,不具有通常导致有害hubness出现的距离集中现象。然后,我们通过实验表明,这种比较仍然会导致高度的hubness,但此时的hub并非干扰因素,而是上下文调节的频繁token出现在下一个token预测的可能候选池中的结果。然而,当使用其他距离来比较LLM表示时,我们没有相同的理论保证,并且确实观察到有害hub的出现。有两个主要结论:首先,hubness虽然在高维空间中普遍存在,但在LLM用于下一个token预测时,它不是一个需要缓解的负面属性。其次,当使用欧几里得或余弦距离比较LLM的表示时,存在有害hub的高风险,从业者应在相关情况下使用缓解技术。

🔬 方法详解

问题定义:论文研究了大型语言模型(LLM)在高维表示空间中是否存在hubness现象,以及这种现象是否会对LLM的性能产生负面影响。现有方法在分析高维数据时,常常受到hubness的影响,导致基于距离的分析结果失真。论文旨在理解LLM中hubness的来源和性质,并判断是否需要采取措施来缓解它。

核心思路:论文的核心思路是区分LLM在token预测中自然产生的hubness和使用其他距离度量时可能出现的有害hubness。论文认为,LLM在预测下一个token时,通过比较上下文向量和unembedding向量,天然地避免了有害hubness的出现,因为这种比较操作不具有距离集中现象。

技术框架:论文首先从理论上证明了LLM的token预测机制避免了有害hubness。然后,通过实验验证了这一结论,并分析了LLM中hub的性质。此外,论文还探讨了当使用其他距离度量(如欧几里得距离和余弦距离)比较LLM表示时,是否会出现有害hubness。整体流程包括理论分析、实验验证和案例分析。

关键创新:论文最重要的技术创新点在于区分了LLM中两种不同类型的hubness:一种是token预测机制自然产生的,另一种是使用其他距离度量时可能出现的有害hubness。论文证明了前者不是一个需要缓解的负面属性,而后者则需要采取措施来避免。

关键设计:论文的关键设计包括:1) 理论证明LLM的token预测机制不具有距离集中现象;2) 实验验证LLM中hub的性质,并分析其与上下文和token频率的关系;3) 评估使用不同距离度量比较LLM表示时,有害hubness的出现情况。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

论文通过理论分析和实验验证,证明了LLM在token预测中自然产生的hubness不是一个需要缓解的负面属性。实验结果表明,LLM中的hub是上下文调节的频繁token,它们出现在下一个token预测的可能候选池中。此外,实验还发现,当使用欧几里得或余弦距离比较LLM表示时,存在有害hub的高风险。

🎯 应用场景

该研究成果可应用于更好地理解和分析大型语言模型的内部表示,并为开发更高效、更可靠的LLM提供指导。此外,该研究还可以帮助从业者在比较LLM表示时,避免有害hubness的影响,从而提高分析结果的准确性。该研究对于自然语言处理、机器学习和人工智能等领域具有重要的理论和实践价值。

📄 摘要(原文)

Hubness, the tendency for a few points to be among the nearest neighbours of a disproportionate number of other points, commonly arises when applying standard distance measures to high-dimensional data, often negatively impacting distance-based analysis. As autoregressive large language models (LLMs) operate on high-dimensional representations, we ask whether they are also affected by hubness. We first prove that the only large-scale representation comparison operation performed by LLMs, namely that between context and unembedding vectors to determine continuation probabilities, is not characterized by the concentration of distances phenomenon that typically causes the appearance of nuisance hubness. We then empirically show that this comparison still leads to a high degree of hubness, but the hubs in this case do not constitute a disturbance. They are rather the result of context-modulated frequent tokens often appearing in the pool of likely candidates for next token prediction. However, when other distances are used to compare LLM representations, we do not have the same theoretical guarantees, and, indeed, we see nuisance hubs appear. There are two main takeaways. First, hubness, while omnipresent in high-dimensional spaces, is not a negative property that needs to be mitigated when LLMs are being used for next token prediction. Second, when comparing representations from LLMs using Euclidean or cosine distance, there is a high risk of nuisance hubs and practitioners should use mitigation techniques if relevant.