arXiv:2409.13710cs.CLcs.LG2024-09被引 19

微调可移除GPT2的层归一化,模型性能几乎不变。

You can remove GPT2's LayerNorm by fine-tuning

  • 用5亿词元数据微调,成功移除GPT2-small的层归一化层。
  • 在OpenWebText等数据集上损失仅差0.05,准确率下降0.5%。
  • 为可解释性研究提供简化模型,适合关注机制分析的研究者。

GPT-style Transformer模型中的层归一化(LayerNorm, LN)长期阻碍机制可解释性研究。尽管LN对稳定大规模语言模型训练至关重要,且几乎所有基于Transformer的模型都采用LN或类似RMSNorm,但其非线性特性使残差流难以解析,阻碍了模型电路分解。有研究甚至称‘解释性研究者憎恨层归一化’。本文通过在5亿词元训练数据上微调预训练的GPT2-small模型,证明可完全移除LN层。该无LN模型在OpenWebText和ThePile数据集上交叉熵损失仅增加0.05,在Hellaswag基准上准确率下降0.5%。我们已开源实现与微调模型。本工作不仅为可解释性研究提供简化模型,也表明推理时LN层并非关键组件。

原文摘要 · Abstract (English)

The LayerNorm (LN) layer in GPT-style transformer models has long been a hindrance to mechanistic interpretability. LN is a crucial component required to stabilize the training of large language models, and LN or the similar RMSNorm have been used in practically all large language models based on the transformer architecture. The non-linear nature of the LN layers is a hindrance for mechanistic interpretability as it hinders interpretation of the residual stream, and makes it difficult to decompose the model into circuits. Some researchers have gone so far as to name "reasons interpretability researchers hate layer norm." In this paper we show that it is possible to remove the LN layers from a pre-trained GPT2-small model by fine-tuning on a fraction (500M tokens) of the training data. We demonstrate that this LN-free model achieves similar performance to the original model on the OpenWebText and ThePile datasets (-0.05 cross-entropy loss), and the Hellaswag benchmark (-0.5% accuracy). We provide our implementation at https://github.com/ApolloResearch/gpt2_noLN, and fine-tuned GPT2-small models at https://huggingface.co/apollo-research/gpt2_noLN. Our work not only provides a simplified model for mechanistic interpretability research, but also provides evidence that the LN layers, at inference time, do not play a crucial role in transformer models.

模型压缩可解释性GPT2

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。