Plug-and-Play Knowledge Injection for Pre-trained Language Models

Zhengyan Zhang, Zhiyuan Zeng, Yankai Lin, Huadong Wang, Deming Ye +6 more
5/28/2023
cs.CL

Official code: thunlp/Knowledge-Plugin (60 stars, MIT, last commit 2024-04-01).

Abstract

Injecting external knowledge can improve the performance of pre-trained language models (PLMs) on various downstream NLP tasks. However, massive retraining is required to deploy new knowledge injection methods or knowledge bases for downstream tasks. In this work, we are the first to study how to improve the flexibility and efficiency of knowledge injection by reusing existing downstream models. To this end, we explore a new paradigm plug-and-play knowledge injection, where knowledge bases are injected into frozen existing downstream models by a knowledge plugin. Correspondingly, we propose a plug-and-play injection method map-tuning, which trains a mapping of knowledge embeddings to enrich model inputs with mapped embeddings while keeping model parameters frozen. Experimental results on three knowledge-driven NLP tasks show that existing injection methods are not suitable for the new paradigm, while map-tuning effectively improves the performance of downstream models. Moreover, we show that a frozen downstream model can be well adapted to different domains with different mapping networks of domain knowledge. Our code and models are available at https://github.com/THUNLP/Knowledge-Plugin.

View on arXivView PDF

Code Implementations(1)

MIT

[ACL 2023] Plug-and-Play Knowledge Injection for Pre-trained Language Models

603Shell, PythonMay 19, 20232 years agoMIT

Similar Papers

Cite this paper

@article{zhang2023plugandplay,
  title  = {Plug-and-Play Knowledge Injection for Pre-trained Language Models},
  author = {Zhengyan Zhang and Zhiyuan Zeng and Yankai Lin and Huadong Wang and Deming Ye and Chaojun Xiao and Xu Han and Zhiyuan Liu and Peng Li and Maosong Sun and Jie Zhou},
  year   = {2023},
  eprint = {2305.17691},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.17691v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.17691.svg)](https://codeofpaper.com/paper/2305.17691)

Discussion