Pre-Training to Learn in Context

Yuxian Gu, Li Dong, Furu Wei, Minlie Huang
5/16/2023
cs.CL

Official code: thu-coai/PICL (106 stars, MIT, last commit 2024-07-26).

Abstract

In-context learning, where pre-trained language models learn to perform tasks from task examples and instructions in their contexts, has attracted much attention in the NLP community. However, the ability of in-context learning is not fully exploited because language models are not explicitly trained to learn in context. To this end, we propose PICL (Pre-training for In-Context Learning), a framework to enhance the language models' in-context learning ability by pre-training the model on a large collection of "intrinsic tasks" in the general plain-text corpus using the simple language modeling objective. PICL encourages the model to infer and perform tasks by conditioning on the contexts while maintaining task generalization of pre-trained models. We evaluate the in-context learning performance of the model trained with PICL on seven widely-used text classification datasets and the Super-NaturalInstrctions benchmark, which contains 100+ NLP tasks formulated to text generation. Our experiments show that PICL is more effective and task-generalizable than a range of baselines, outperforming larger language models with nearly 4x parameters. The code is publicly available at https://github.com/thu-coai/PICL.

View on arXivView PDF

Code Implementations(1)

thu-coai/PICLOfficial100%
MIT

Code for ACL2023 paper: Pre-Training to Learn in Context

1064C, C++Jan 14, 20232 years agoMIT

Similar Papers

Cite this paper

@article{gu2023pretraining,
  title  = {Pre-Training to Learn in Context},
  author = {Yuxian Gu and Li Dong and Furu Wei and Minlie Huang},
  year   = {2023},
  eprint = {2305.09137},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.09137v1}
}

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.09137.svg)](https://codeofpaper.com/paper/2305.09137)

Discussion