arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2203.14680cs.CL
收藏

Transformer前馈层通过提升词汇空间中的概念来构建预测

Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space

Allen Institute for AI(艾伦人工智能研究所);Bar-Ilan University(巴伊兰大学)

Mor Geva, Avi Caciularu, Kevin Ro Wang, Yoav Goldberg

摘要:

基于transformer的语言模型(LM)是现代NLP的核心,但其内部预测构建过程是不透明的,并且在很大程度上不被理解。在这项工作中,我们通过对前馈网络(FFN)层(Transformer模型的构建块之一)的操作进行逆向工程,向揭示这种潜在的预测过程迈出了实质性的一步。我们将令牌表示视为词汇表上不断变化的分布,并且每个FFN层的输出都是对该分布的附加更新。然后,我们分析了词汇空间中的FFN更新,表明每个更新都可以分解为与单个FFN参数向量对应的子更新,每个更新都促进了通常人类可解释的概念。然后,我们利用这些发现来控制LM预测,将GPT2的毒性降低了近50%,并通过简单的提前退出规则提高了计算效率,平均节省了20%的计算。

英文摘要:

Transformer-based language models (LMs) are at the core of modern NLP, but their internal prediction construction process is opaque and largely not understood. In this work, we make a substantial step towards unveiling this underlying prediction process, by reverse-engineering the operation of the feed-forward network (FFN) layers, one of the building blocks of transformer models. We view the token representation as a changing distribution over the vocabulary, and the output from each FFN layer as an additive update to that distribution. Then, we analyze the FFN updates in the vocabulary space, showing that each update can be decomposed to sub-updates corresponding to single FFN parameter vectors, each promoting concepts that are often human-interpretable. We then leverage these findings for controlling LM predictions, where we reduce the toxicity of GPT2 by almost 50%, and for improving computation efficiency with a simple early exit rule, saving 20% of computation on average.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑