Augmenting the base neural model with a token-level symbolic datastore is a novel generation paradigm and has achieved promising results in machine translation (MT). In this paper, we introduce a unified framework kNN-BOX, which enables quick development and interactive analysis for this novel paradigm. kNN-BOX decomposes the datastore-augmentation approach into three modules: datastore, retriever and combiner, thus putting diverse kNN generation methods into a unified way. Currently, kNN-BOX has provided implementation of seven popular kNN-MT variants, covering research from performance enhancement to efficiency optimization. It is easy for users to reproduce these existing works or customize their own models. Besides, users can interact with their kNN generation systems with kNN-BOX to better understand the underlying inference process in a visualized way. In the experiment section, we apply kNN-BOX for machine translation and three other seq2seq generation tasks, namely, text simplification, paraphrase generation and question generation. Experiment results show that augmenting the base neural model with kNN-BOX leads to a large performance improvement in all these tasks. The code and document of kNN-BOX is available at https://github.com/NJUNLP/knn-box.
Nara Institute of Science and Technology(奈良先端科学技术大学院大学);HAKUHODO Technologies Inc.(博报堂科技株式会社);National Institute of Information and Communications Technology(日本信息通信研究机构)
kNN-ICL: Compositional Task-Oriented Parsing Generalization with Nearest Neighbor In-Context Learning
University of Illinois Chicago(伊利诺伊大学芝加哥分校);Salesforce Research(赛富时研究院);Huazhong University of Science and Technology(华中科技大学);Columbia University(哥伦比亚大学);The Hong Kong Polytechnic University(香港理工大学);State University of New York at Binghamton(纽约州立大学宾汉姆顿分校)
BERT-kNN: Adding a kNN Search Component to Pretrained Language Models for Better QA
Center for Information and Language Processing (CIS)(信息与语言处理中心(CIS));LMU Munich(慕尼黑大学)
Khandelwal等人。(2020)使用k最近邻(kNN)组件来提高语言模型性能。我们表明,这种想法是有益的开放域的问答(QA)。为了提高对训练过程中遇到的事实的回忆,我们结合了BERT(Devlin et al.,2019)与传统的信息检索步骤(IR)和在嵌入式文本集合的大范围上的kNN搜索。我们的贡献如下:i)BERT-kNN在完形填空式问答中的性能大大优于BERT,无需任何进一步的训练。ii)我们表明,BERT经常识别正确的响应类别(例如,美国城市),但只有kNN恢复事实上正确的答案(例如,"Miami")。iii)与BERT相比,BERT-kNN在罕见事实方面表现出色。iv)BERT-kNN可以很容易地处理BERT的训练集没有覆盖的事实,例如,最近的事件。