HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

K-Adapter: Infusing Knowledge into Pre-Trained Models with Adapters

Ruize Wang Duyu Tang Nan Duan Zhongyu Wei Xuanjing Huang Jianshu ji Guihong Cao Daxin Jiang Ming Zhou

K-Adapter: Infusing Knowledge into Pre-Trained Models with Adapters

Abstract

We study the problem of injecting knowledge into large pre-trained models like BERT and RoBERTa. Existing methods typically update the original parameters of pre-trained models when injecting knowledge. However, when multiple kinds of knowledge are injected, the historically injected knowledge would be flushed away. To address this, we propose K-Adapter, a framework that retains the original parameters of the pre-trained model fixed and supports the development of versatile knowledge-infused model. Taking RoBERTa as the backbone model, K-Adapter has a neural adapter for each kind of infused knowledge, like a plug-in connected to RoBERTa. There is no information flow between different adapters, thus multiple adapters can be efficiently trained in a distributed way. As a case study, we inject two kinds of knowledge in this work, including (1) factual knowledge obtained from automatically aligned text-triplets on Wikipedia and Wikidata and (2) linguistic knowledge obtained via dependency parsing. Results on three knowledge-driven tasks, including relation classification, entity typing, and question answering, demonstrate that each adapter improves the performance and the combination of both adapters brings further improvements. Further analysis indicates that K-Adapter captures versatile knowledge than RoBERTa.

Code Repositories

stevekgyang/sccl
pytorch
Mentioned in GitHub
microsoft/K-Adapter
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
entity-typing-on-open-entityK-Adapter ( fac-adapter )
F1: 77.6916
Precision: 79.6712
Recall: 75.8081
entity-typing-on-open-entityK-Adapter ( fac-adapter + lin-adapter )
F1: 77.6127
Precision: 78.9956
Recall: 76.2774
relation-classification-on-tacred-1RoBERTa
F1: 71.3
relation-classification-on-tacred-1K-Adapter
F1: 72.0
relation-extraction-on-tacredK-ADAPTER (F+L)
F1: 72.04
F1 (1% Few-Shot): 13.8
F1 (10% Few-Shot): 56.0
F1 (5% Few-Shot): 45.1

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp