语境中的知识:走向知识化的半参数语言模型
Knowledge-in-Context: Towards Knowledgeable Semi-Parametric Language Models
摘要:
全参数语言模型通常需要大量的模型参数来存储用于在零/Few-Shot设置中解决多个自然语言任务的必要知识。此外,如果没有昂贵的模型再训练,很难适应不断变化的世界知识。在本文中,我们开发了一种新的半参数语言模型架构,知识的上下文(KiC),它赋予一个参数化的文本到文本的语言模型与知识丰富的外部存储器。具体来说,外部存储器包含六种不同类型的知识:实体、字典、常识、事件、脚本和因果关系知识。对于每个输入实例,KiC模型自适应地选择知识类型并检索最有用的知识。输入实例连同其知识扩充一起被馈送到文本到文本模型(例如,T5)生成输出答案,提示后输入和输出均为自然语言形式。有趣的是,我们发现,KiC可以被确定为一个特殊的混合专家(MoE)模型,其中的知识选择器起着路由器的作用,用于确定序列的专家分配在MoE。这个关键的观察启发我们开发一种新的算法,用于训练KiC与实例自适应知识选择器。作为一个知识丰富的半参数语言模型,KiC只需要一个小得多的参数部分,以实现卓越的zero-shot性能看不见的任务。通过对40多个不同的任务进行评估,我们发现具有770 M参数的KiC_Large很容易超过大语言模型(LM),后者大幅度增加了4- 39倍。我们还证明了KiC在一个小得多的模型规模相比,全参数模型表现出紧急的能力。
英文摘要:
Fully-parametric language models generally require a huge number of model parameters to store the necessary knowledge for solving multiple natural language tasks in zero/few-shot settings. In addition, it is hard to adapt to the evolving world knowledge without the costly model re-training. In this paper, we develop a novel semi-parametric language model architecture, Knowledge-in-Context (KiC), which empowers a parametric text-to-text language model with a knowledge-rich external memory. Specifically, the external memory contains six different types of knowledge: entity, dictionary, commonsense, event, script, and causality knowledge. For each input instance, the KiC model adaptively selects a knowledge type and retrieves the most helpful pieces of knowledge. The input instance along with its knowledge augmentation is fed into a text-to-text model (e.g., T5) to generate the output answer, where both the input and the output are in natural language forms after prompting. Interestingly, we find that KiC can be identified as a special mixture-of-experts (MoE) model, where the knowledge selector plays the role of a router that is used to determine the sequence-to-expert assignment in MoE. This key observation inspires us to develop a novel algorithm for training KiC with an instance-adaptive knowledge selector. As a knowledge-rich semi-parametric language model, KiC only needs a much smaller parametric part to achieve superior zero-shot performance on unseen tasks. By evaluating on 40+ different tasks, we show that KiC_Large with 770M parameters easily outperforms large language models (LMs) that are 4-39x larger by a large margin. We also demonstrate that KiC exhibits emergent abilities at a much smaller model scale compared to the fully-parametric models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。