大规模解释语言模型隐藏状态
文章背景与核心概要
大语言模型(LLM)的可解释性研究常常依赖于“透镜方法”(lens methods),即通过将中间层激活映射到输出词表,来观察下一个词的预测在整个网络中的演变过程。然而,传统的透镜训练面临着严重的计算瓶颈:仿射转换器参数随模型宽度呈二次方增长,且精确的全词表 Kullback–Leibler(KL)训练需要巨大内存。因此,以往的透镜应用大多局限于 200 亿参数以下的模型以及特定的架构组件。
为了突破这些障碍,本文作者推出了 OmniLens,这是一个可扩展的框架,能够将统一的透镜系列应用于任何模型宽度的激活值(残差流、注意力机制或 MLP)。OmniLens 结合了两项关键的扩展创新:低秩转换器(将参数增长降低至与模型宽度线性相关,训练参数量减少高达 98.4%)以及子集 KL 训练(优化词表 Logit 的具现化,通过 Top-k 模式将峰值训练内存削减高达 70%,并辅以保持全 KL 无偏随机梯度的重要性采样变体)。
这些进展使得研究人员能够为 LLaMA-3.3-70B 构建包含 482 个透镜的密集集成,在相同深度下实现了传统残差流设计 6 倍的覆盖率。全模型范围的覆盖带来了关键的新见解:某种行为最明显的组件不一定是干预最有效的组件,而最佳干预往往发生在先前单组件研究所强调的注意力头之外。通过三个不同的案例研究——提示词注入检测、多跳记忆注入和毒性定位——OmniLens 以显著更低的计算成本成功复现了关键的已发表成果。
📌 执行摘要
Interpreting large language models (LLMs) often relies on "lens methods," which map intermediate activations to the output vocabulary to observe how next-token predictions evolve throughout the network. However, traditional lens training faces severe computational bottlenecks: * Affine-translator parameters scale quadratically with model width. * Exact, full-vocabulary Kullback–Leibler (KL) training demands immense memory.
Consequently, prior lens applications have been limited to models under 20B parameters and specific architectural components.
解释大语言模型(LLMs)通常依赖于“透镜方法”(lens methods),即把中间层的激活映射到输出词表上,以此观察下一个 Token 的预测结果在整个网络中是如何演变的。然而,传统的透镜训练面临着严峻的计算瓶颈: * 仿射转换器的参数随模型宽度的增加呈二次方扩展。 * 精确的全词表 Kullback–Leibler (KL) 训练需要消耗巨大的内存。
因此,以往的透镜应用大多仅限于 200 亿参数以下的模型以及特定的架构组件。
To overcome these barriers, the authors introduce OmniLens, a scalable framework that applies a single lens family to any model-width activation (residual stream, attention, or MLP). OmniLens combines two key scaling innovations: 1. Low-Rank Translators: Reduces per-lens parameter growth to scale linearly with model width, slashing trainable parameters by up to 98.4%. 2. Subset-KL Training: Optimizes vocabulary logit materialization—using a Top-k mode that cuts peak training memory by up to 70%, alongside an importance-sampled variant that preserves unbiased stochastic gradients for the full KL.
为了克服这些障碍,作者推出了 OmniLens,这是一个可扩展的框架,可将统一的透镜系列应用于任何模型宽度的激活值(残差流、注意力机制或 MLP)。OmniLens 结合了两项关键的扩展创新: 1. 低秩转换器(Low-Rank Translators): 将每个透镜的参数增长降低为与模型宽度呈线性关系,从而将可训练参数减少高达 98.4%。 2. 子集 KL 训练(Subset-KL Training): 优化词表 Logit 的具现化——使用 Top-k 模式将峰值训练内存削减高达 70%,并配合重要性采样变体,以保持全 KL 的无偏随机梯度。
These advancements enable a dense ensemble of 482 lenses for LLaMA-3.3-70B, providing \(6\times\) the coverage of traditional residual-stream designs at an equivalent depth. Model-wide coverage yields crucial new insights: the components where a behavior is most visible are not necessarily where interventions are most effective, and optimal interventions often occur outside the attention heads previously highlighted in single-component studies. Across three distinct case studies—prompt-injection detection, multi-hop memory injection, and toxicity localization—OmniLens successfully reproduces key published results at a substantially lower computational cost.
这些进展使得研究人员能够为 LLaMA-3.3-70B 构建包含 482 个透镜的密集集成,在同等深度下提供了传统残差流设计 6 倍的覆盖率。全模型范围的覆盖带来了至关重要的全新见解:某种行为最显著的组件并不一定是干预最有效的组件,而最佳干预往往发生在先前单组件研究所强调的注意力头之外。通过三个不同的案例研究——提示词注入检测、多跳记忆注入和毒性定位——OmniLens 以显著降低的计算成本成功复现了关键的已发表成果。
📑 Metadata & Links
- Full-Text Links: View PDF | HTML Version | TeX Source
- DOI: 10.48550/arXiv.2608.10260
- Additional Resources: NASA ADS | Google Scholar | Semantic Scholar
📑 元数据与链接
- 全文链接: 查看 PDF | HTML 版本 | TeX 源码
- DOI: 10.48550/arXiv.2608.10260
- 其他资源: NASA ADS | 谷歌学术 | Semantic Scholar