arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2208.00399cs.CLcs.AI
收藏

用于预训练Transformers的神经知识库

Neural Knowledge Bank for Pretrained Transformers

Peking University(北京大学);Baidu Inc.(百度公司)

Damai Dai, Wenbin Jiang, Qingxiu Dong, Yajuan Lyu, Qiaoqiao She, Zhifang Sui

摘要:

预先训练的Transformers记住事实知识的能力是必不可少的,但对于现有模型来说仍然有限。受将Transformers中的前馈网络(FFN)视为键值记忆的现有工作的启发,我们设计了一个神经知识库(NKB)和一个知识注入策略,为预训练的Transformers引入额外的事实知识。NKB是FFN的附加知识存储器插槽的形式,并且类似于存储器的架构使其具有高度的可解释性和灵活性。当使用显著跨度掩蔽(SSM)预训练目标注入额外的知识时,我们固定原始预训练模型,仅训练NKB。这种训练策略确保了原始预训练模型的一般语言建模能力不受影响。通过将NKB安装到T5模型上,我们基于三个闭卷问答数据集验证了其强大的存储额外事实知识的能力。此外,我们证明,安装NKB不会降低一般的语言建模能力的T5通过两个代表性的任务,摘要和机器翻译。此外,我们深入分析了NKB的可解释性,并以人类可读的方式揭示了其键和值的含义。最后,我们通过直接修改其值向量来更新存储在其中的事实知识,展示了NKB的灵活性。

英文摘要:

The ability of pretrained Transformers to remember factual knowledge is essential but still limited for existing models. Inspired by existing work that regards Feed-Forward Networks (FFNs) in Transformers as key-value memories, we design a Neural Knowledge Bank (NKB) and a knowledge injection strategy to introduce extra factual knowledge for pretrained Transformers. The NKB is in the form of additional knowledgeable memory slots to the FFN and the memory-like architecture makes it highly interpretable and flexible. When injecting extra knowledge with the Salient Span Masking (SSM) pretraining objective, we fix the original pretrained model and train only the NKB. This training strategy makes sure the general language modeling ability of the original pretrained model is not influenced. By mounting the NKB onto the T5 model, we verify its strong ability to store extra factual knowledge based on three closed-book question answering datasets. Also, we prove that mounting the NKB will not degrade the general language modeling ability of T5 through two representative tasks, summarization and machine translation. Further, we thoroughly analyze the interpretability of the NKB and reveal the meaning of its keys and values in a human-readable way. Finally, we show the flexibility of the NKB by directly modifying its value vectors to update the factual knowledge stored in it.

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

↑