用 Tuned Lens 从 Transformer 中提取潜在预测
机器学习
2025-11-12 v6
摘要
我们从迭代推断的视角分析 Transformer,试图理解模型预测如何逐层精炼。为此,我们在冻结的预训练模型中的每个块上训练一个仿射探针,使得能够将每一个隐藏状态解码为词汇表上的分布。我们的方法,tuned lens,是对早期“logit lens”技术的改进,后者提供了有用的洞察但常常不稳定。我们在参数规模高达 20B 的多种自回归语言模型上测试了我们的方法,表明其比 logit lens 更具预测性、可靠性和无偏性。通过因果实验,我们表明 tuned lens 使用了与模型本身相似的特征。我们还发现潜在预测的轨迹可用于以高准确率检测恶意输入。重现我们结果所需的所有代码可在 https://github.com/AlignmentResearch/tuned-lens 找到。
引用
@article{arxiv.2303.08112,
title = {Eliciting Latent Predictions from Transformers with the Tuned Lens},
author = {Nora Belrose and Igor Ostrovsky and Lev McKinney and Zach Furman and Logan Smith and Danny Halawi and Stella Biderman and Jacob Steinhardt},
journal= {arXiv preprint arXiv:2303.08112},
year = {2025}
}