Skip to content
This repository was archived by the owner on Oct 8, 2026. It is now read-only.

Commit 4198ebc

Browse files
author
Bei Chen
committed
add adaptershare
1 parent ad4ae14 commit 4198ebc

160 files changed

Lines changed: 14549 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This repo hosts multiple open-source codes of the [Microsoft Research Asia DKI G
1010
- October, 2022: our paper [Towards Knowledge-Intensive Text-to-SQL Semantic Parsing with Formulaic Knowledge](https://arxiv.org/abs/2301.01067) was accepted by EMNLP 2022.
1111
- October, 2022: our paper [Reasoning Like Program Executors](https://arxiv.org/abs/2201.11473) was accepted by EMNLP 2022.
1212
- October, 2022: our paper [LEMON: Language-Based Environment Manipulation via Execution-guided Pre-training](https://arxiv.org/abs/2201.08081) was accepted by EMNLP 2022 Findings.
13+
- October, 2022: our paper [AdapterShare: Task Correlation Modeling with Adapter Differentiation](https://aclanthology.org/2022.emnlp-main.728.pdf) was accepted by EMNLP 2022.
1314
- Septempter, 2022: our paper [LogiGAN: Learning Logical Reasoning via Adversarial Pre-training](https://arxiv.org/abs/2205.08794) was accepted by NeurIPS 2022.
1415
- March, 2022: Our paper [Towards Robustness of Text-to-SQL Models Against Natural and Realistic Adversarial Table Perturbation](https://aclanthology.org/2022.acl-long.142.pdf) was accepted by ACL 2022.
1516
- August, 2021: Our paper [Awakening Latent Grounding from Pretrained Language Models for Semantic Parsing](https://aclanthology.org/2021.findings-acl.100.pdf) was accepted by ACL 2021 Findings.

‎adaptershare/README.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<h1 align="center"> AdapterShare: Task Correlation Modeling with Adapter Differentiation </h1>
2+
3+
<div align=center><img width="350" height=350" src="assets/adaptershare.png"/></div>
4+
5+
## Introduction
6+
Thanks to the development of pre-trained language models, multitask learning (MTL) methods have achieved great success in natural language understanding. However, current MTL methods pay more attention to task selection or model design to fuse as much knowledge as possible, while the intrinsic task correlation is often neglected. It is important to learn sharing strategies among multiple tasks rather than sharing everything. In this paper, we propose AdapterShare, an adapter differentiation method to explicitly model task correlation among multiple tasks. AdapterShare is automatically learned based on the gradients on tiny held-out validation data. Compared to single-task learning and fully shared MTL methods, our proposed method obtains obvious performance improvements. Compared to the existing MTL method AdapterFusion, AdapterShare achieves an absolute average improvement of 1.90 points on five dialogue understanding tasks and 2.33 points on NLU tasks.
7+
8+
## Quickstart
9+
10+
### Setup Environment
11+
#### Install via pip:
12+
1. install requirements </br>
13+
```> pip install -r requirements.txt```
14+
15+
2. install our modified `adapters` package </br>
16+
```> pip install git+https://github.com/WowCZ/adapter-transformers.git```
17+
18+
19+
#### prepare the nlu dataset:
20+
1. Download data </br>
21+
```> sh download.sh``` </br>
22+
Please refer to download GLUE dataset: https://gluebenchmark.com/
23+
24+
2. Preprocess data </br>
25+
```> sh experiments/glue/prepro.sh```
26+
27+
28+
### Training scripts:
29+
1. Individual training script (baseline multitask learning): </br>
30+
```> sh scripts/adapter_train.sh -tr wnli -te wnli -ls 50 -ss 100 > LOGS/mtnlu_wnli.log``` </br>
31+
32+
2. AdapterShare training script: </br>
33+
```> sh scripts/adapter_train.sh -tr mnli,cola,qnli,qqp,rte,sst,stsb,wnli -te mnli_matched,mnli_mismatched,cola,qnli,qqp,rte,sst,stsb,wnli -ls 1000 -ss 2000 > LOGS/mtnlu_unified.log``` </br>
34+
35+
36+
## Claim
37+
In this repository, the code of NLU dataset collection and baseline multitask learning is based on https://github.com/namisan/mt-dnn. The AdapterShare training process is modified from https://github.com/adapter-hub/adapter-transformers.

‎adaptershare/_config.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-minimal

0 commit comments

Comments
 (0)