• Stars
    star
    127
  • Rank 282,887 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[ICLR 2022] Differentiable Prompt Makes Pre-trained Language Models Better Few-shot Learners

DART

Implementation for ICLR2022 paper Differentiable Prompt Makes Pre-trained Language Models Better Few-shot Learners.

  • NOTE: The code has been reorganized and we also provide a paper-list at PromptKG.

Environment

  • [email protected]
  • Use pip install -r requirements.txt to install dependencies.
  • wandb account is required if the user wants to search for best hyper-parameter combinations.

Data source

  • 16-shot GLUE dataset from LM-BFF.
  • Generated data consists of 5 random splits (13/21/42/87/100) for a task, each has 16 samples.
    • The generation process follows LM-BFF here.

How to run

  • To train / test on a data split from a single task with specific parameters, use run.py.
    • For customized training & evaluation, you can modify based on the sample configuration file config/sample.yml.
$ python run.py -h  
usage: run.py [-h] [--config CONFIG] [--do_train] [--do_test]

optional arguments:
  -h, --help            show this help message and exit
  --config CONFIG, -c CONFIG
                        Configuration file storing all parameters
  --do_train
  --do_test
  • To search optimal hyper-parameters for each task and reproduce our result, please use sweep.py:
    • Please refer to documentation for WandB for more details.
    • NOTE: we follow LM-BFF in that we search optimal sets of hyper-parameters on different data splits respectively.
$ python sweep.py -h
usage: sweep.py [-h] [--project_name PROJECT_NAME] --task_name TASK_NAME
                [--data_split {13,21,42,87,100}]
                [--pretrain_model PRETRAIN_MODEL] [--pet_method {pet,diffpet}]
                [--random_seed RANDOM_SEED] [--max_run MAX_RUN]

optional arguments:
  -h, --help            show this help message and exit
  --project_name PROJECT_NAME
                        project name for sweep
  --task_name TASK_NAME
  --data_split {13,21,42,87,100}
                        few-shot split-id for GLUE dataset
  --pretrain_model PRETRAIN_MODEL
                        name or path for pretrained model
  --pet_method {pet,diffpet}
                        prompt encoding method
  --random_seed RANDOM_SEED
                        random seed for training
  --max_run MAX_RUN     maximum tries for sweep

How to Cite

@inproceedings{
zhang2022differentiable,
title={Differentiable Prompt Makes Pre-trained Language Models Better Few-shot Learners},
author={Ningyu Zhang and Luoqiu Li and Xiang Chen and Shumin Deng and Zhen Bi and Chuanqi Tan and Fei Huang and Huajun Chen},
booktitle={International Conference on Learning Representations},
year={2022},
url={https://openreview.net/forum?id=ek9a0qIafW}
}

More Repositories

1

DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction
Python
3,517
star
2

EasyEdit

[ACL 2024] An Easy-to-use Knowledge Editing Framework for LLMs.
Jupyter Notebook
1,815
star
3

LLMAgentPapers

Must-read Papers on LLM Agents.
1,683
star
4

KnowLM

An Open-sourced Knowledgable Large Language Model Framework.
Python
1,209
star
5

Prompt4ReasoningPapers

[ACL 2023] Reasoning with Language Model Prompting: A Survey
863
star
6

KnowledgeEditingPapers

Must-read Papers on Knowledge Editing for Large Language Models.
843
star
7

PromptKG

PromptKG Family: a Gallery of Prompt Learning & KG-related research works, toolkits, and paper-list.
Python
690
star
8

EasyInstruct

[ACL 2024] An Easy-to-use Instruction Processing Framework for LLMs.
Python
357
star
9

AutoKG

LLMs for Knowledge Graph Construction and Reasoning: Recent Capabilities and Future Opportunities
Python
345
star
10

OpenUE

[EMNLP 2020] OpenUE: An Open Toolkit of Universal Extraction from Text
Python
321
star
11

Mol-Instructions

[ICLR 2024] Mol-Instructions: A Large-Scale Biomolecular Instruction Dataset for Large Language Models
Python
233
star
12

KnowPrompt

[WWW 2022] KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction
Python
194
star
13

MKGformer

[SIGIR 2022] Hybrid Transformer with Multi-level Fusion for Multimodal Knowledge Graph Completion
Python
167
star
14

KnowAgent

KnowAgent: Knowledge-Augmented Planning for LLM-Based Agents
Python
163
star
15

AutoAct

[ACL 2024] AUTOACT: Automatic Agent Learning from Scratch for QA via Self-Planning
Python
162
star
16

IEPile

[ACL 2024] IEPile: A Large-Scale Information Extraction Corpus
Python
158
star
17

OntoProtein

[ICLR 2022] OntoProtein: Protein Pretraining With Gene Ontology Embedding
Python
141
star
18

DocuNet

[IJCAI 2021] Document-level Relation Extraction as Semantic Segmentation
Python
130
star
19

MolGen

[ICLR 2024] Domain-Agnostic Molecular Generation with Chemical Feedback
Python
124
star
20

Relphormer

[Neurocomputing 2023] Relational Graph Transformer for Knowledge Graph Representation
Python
120
star
21

Low-resource-KEPapers

A Paper List of Low-resource Information Extraction
114
star
22

OneGen

[EMNLP 2024 Findings] OneGen: Efficient One-Pass Unified Generation and Retrieval for LLMs.
Python
114
star
23

Generative_KG_Construction_Papers

[EMNLP 2022] Generative Knowledge Graph Construction: A Review
104
star
24

HVPNeT

[NAACL 2022 Findings] Good Visual Guidance Makes A Better Extractor: Hierarchical Visual Prefix for Multimodal Entity and Relation Extraction
Python
97
star
25

MachineSoM

[ACL 2024] Exploring Collaboration Mechanisms for LLM Agents: A Social Psychology View
Python
91
star
26

MKG_Analogy

[ICLR 2023] Multimodal Analogical Reasoning over Knowledge Graphs
Python
89
star
27

FactCHD

[IJCAI 2024] FactCHD: Benchmarking Fact-Conflicting Hallucination Detection
Python
78
star
28

NLP4SciencePapers

Must-read papers on NLP for science.
53
star
29

KNN-KG

[NLPCC 2023] Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddings with Language Models
Python
49
star
30

KnowledgeCircuits

Knowledge Circuits in Pretrained Transformers
Python
47
star
31

ChatCell

ChatCell: Facilitating Single-Cell Analysis with Natural Language
Python
42
star
32

RAP

[SIGIR 2023] Schema-aware Reference as Prompt Improves Data-Efficient Knowledge Graph Construction
Python
39
star
33

DeepEE

DeepEE: Deep Event Extraction Algorithm Gallery (基于深度学习的开源中文事件抽取算法汇总)
Python
39
star
34

TRICE

[NAACL 2024] Making Language Models Better Tool Learners with Execution Feedback
Python
36
star
35

DocED

[ACL 2021] MLBiNet: A Cross-Sentence Collective Event Detection Network
Python
35
star
36

Kformer

[NLPCC 2022] Kformer: Knowledge Injection in Transformer Feed-Forward Layers
Python
34
star
37

LREBench

[EMNLP 2022 Findings] Towards Realistic Low-resource Relation Extraction: A Benchmark with Empirical Baseline Study
Python
33
star
38

ContinueMKGC

[IJCAI 2024] Continual Multimodal Knowledge Graph Construction
Python
32
star
39

IEDatasetZoo

Information Extraction Dataset Zoo.
31
star
40

WKM

Agent Planning with World Knowledge Model
Python
30
star
41

DiagnoseRE

[CCKS 2021] On Robustness and Bias Analysis of BERT-based Relation Extraction
Python
27
star
42

OceanGPT

[ACL 2024] OceanGPT: A Large Language Model for Ocean Science Tasks
25
star
43

PitfallsKnowledgeEditing

[ICLR 2024] Unveiling the Pitfalls of Knowledge Editing for Large Language Models
Python
22
star
44

AdaKGC

[EMNLP 2023 (Findings)] Schema-adaptable Knowledge Graph Construction
Python
17
star
45

knowledge-rumination

[EMNLP 2023] Knowledge Rumination for Pre-trained Language Models
Python
16
star
46

KnowUnDo

[EMNLP 2024 Findings] To Forget or Not? Towards Practical Knowledge Unlearning for Large Language Models
Python
16
star
47

EasyDetect

[ACL 2024] An Easy-to-use Hallucination Detection Framework for LLMs.
Python
16
star
48

OneEdit

OneEdit: A Neural-Symbolic Collaboratively Knowledge Editing System.
Python
15
star
49

SPEECH

[ACL 2023] SPEECH: Structured Prediction with Energy-Based Event-Centric Hyperspheres
Python
13
star
50

NLPCC2024_RegulatingLLM

[NLPCC 2024] Shared Task 10: Regulating Large Language Models
13
star
51

SemEval2021Task4

The 4th rank system of the SemEval 2021 Task4.
Python
10
star
52

Revisit-KNN

[CCL 2023] Revisiting k-NN for Fine-tuning Pre-trained Language Models
Python
10
star
53

EasyEval

An Easy-to-use Intelligence Evaluation Framework for LLMs.
Python
6
star
54

BiasEdit

Debiasing Stereotyped Language Models via Model Editing
Python
5
star
55

zjunlp.github.io

HTML
3
star
56

project

Project homepages for the NLP & KG Group of Zhejiang University
JavaScript
3
star
57

DQSetGen

[TASLP 2024] Sequence Labeling as Non-autoregressive Dual-Query Set Generation
Python
3
star
58

L2A

Python
2
star
59

KnowFM

2
star
60

EditBias

EditBias: Debiasing Stereotyped Language Models via Model Editing
Python
1
star