构建高效的事实存储MLP用于Transformer
Constructing Efficient Fact-Storing MLPs for Transformers
AI总结:
本文提出了一种改进的MLP构造框架,提升了事实存储效率和实用性,并揭示了MLP事实存储能力与Transformer实用性之间的权衡。
摘要:
大语言模型(LLM)的成功部分归因于其能够高效地将事实性知识作为键值映射存储在其MLP参数中。近期的研究提出了显式的权重构造方法来构建此类事实存储MLP,从而提供了对LLM事实存储机制的更深入理解。在本文中,我们引入了一个MLP构造框架,其在三个方面优于之前的构造:1)适用于所有但测度零集的可行输入输出对;2)在某些嵌入情况下实现了渐近最优的参数效率,符合信息论界限;3)在Transformer中保持事实回忆的实用性。通过我们的改进,我们1)发现了一个度量标准,该标准表征了构造和梯度下降训练MLP的每参数事实数;2)识别了一个简单的编码器-解码器机制,实验证明在所有测试的输入和输出中,该机制在梯度下降MLP的每参数事实数方面达到一致;3)揭示了MLP的事实存储能力与其在Transformer中的实用性之间存在根本性的权衡。最后,我们展示了一个事实存储MLP的应用示例:通过一次性替换整个MLP来实现单层Transformer的模块化事实编辑。
英文摘要:
The success of large language models (LLMs) can be attributed in part to their ability to efficiently store factual knowledge as key-value mappings within their MLP parameters. Recent work has proposed explicit weight constructions to build such fact-storing MLPs, providing an improved understanding of LLM fact storage mechanisms. In this paper, we introduce an MLP construction framework that improves over previous constructions in three areas: it 1) works for all but a measure-zero set of feasible input-output pairs, 2) achieves asymptotically optimal parameter efficiency matching information-theoretic bounds for some embeddings, and 3) maintains usability within Transformers for factual recall. Through our improvements, we 1) discover a metric on value embeddings that characterizes facts-per-parameter scaling for both constructed and gradient-descent-trained MLPs, 2) identify a simple encoder-decoder mechanism that empirically matches gradient-descent MLP facts-per-parameter asymptotics across all the inputs and outputs we test, and 3) uncover a fundamental tradeoff between an MLP's fact-storage capacity and its usability within Transformers. Finally, we demonstrate a proof-of-concept application of fact-storing MLPs: modular fact editing on one-layer Transformers by \textit{replacing entire MLPs at once}.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。