冲浪激活波:分析LLM隐藏状态的信息与几何以用于推测解码

·

研究论文 · 2026/10/12

本文提出一个基于信息量和多样性两个互补准则的多层隐藏状态选择框架,用于推测解码。信息量通过矩阵熵分析衡量,多样性通过中心核对齐(CKA)量化。研究分析了逐层香农熵、隐藏状态拼接下的聚合熵以及跨深度的成对CKA动态,揭示了LLM解码器表示中不同的几何和信息分区。基于这些发现,提出了基于熵和CKA的层选择算法,偏好信息量高且冗余度低的隐藏状态集。作为框架的一部分,引入了令牌熵过滤,移除与低预测熵令牌相关的隐藏状态,从而提高层选择统计的质量。在EAGLE3风格的推测解码中,所选集合优于固定基线选择,包括默认的[2, N//2, N-3]规则,同时更清晰地解释了某些默认选择为何仍具竞争力。结果为推测解码的多层隐藏状态选择提供了实用方案,对LLM解码器状态的几何和信息提供了见解,并为将类似分析扩展到相关应用奠定了基础。

该研究为推测解码中的多层隐藏状态选择提供了基于信息论和表示几何的原则性方法,不仅提升了性能,还解释了现有启发式规则的有效性,对理解和优化LLM推理加速具有重要价值。

Decoder hidden states from different layers of large language models (LLMs) often encode complementary information. However, existing speculative decoding methods typically rely on a small set of target-model layers chosen using fixed, position-based heuristics. Selecting an optimal subset of layers is inherently a combinatorial problem, making exhaustive evaluation infeasible even for moderately deep models. In this work, we present a principled framework for multi-layer hidden-state selection for speculative decoding based on two complementary criteria: informativeness, measured through matrix-entropy analysis, and diversity, quantified using centered kernel alignment (CKA). We investigate layer-wise Shannon entropy, aggregate entropy under hidden-state concatenation, and pairwise CKA dynamics across depth, revealing distinct geometric and informational compartments within decoder representations. Motivated by these findings, we propose entropy and CKA-based layer selection algorithms that favor hidden-state sets that are both highly informative and minimally redundant. As part of this framework, we introduce token-entropy filtering, which removes hidden states associated with low predictive-entropy tokens, thereby improving the quality of layer-selection statistics. In EAGLE3-style speculative decoding, our selected sets outperform fixed baseline choices, including the default [2, N//2, N-3] rule, while providing a clearer explanation of why some defaults can remain competitive. Our results provide a practical recipe for multi-layer hidden-state selection for speculative decoding, insights into the geometry and information in LLM decoder states, and a foundation for extending similar analysis to related applications.

阅读原文

参与讨论