Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learning
Wang, Xinyi, Zhu, Wanrong, Saxon, Michael, Steyvers, Mark, Wang, William Yang
–arXiv.org Artificial Intelligence
In recent years, pre-trained large language models (LLMs) have demonstrated remarkable efficiency in achieving an inference-time few-shot learning capability known as in-context learning. However, existing literature has highlighted the sensitivity of this capability to the selection of few-shot demonstrations. Current understandings of the underlying mechanisms by which this capability arises from regular language model pretraining objectives remain disconnected from the real-world LLMs. This study aims to examine the in-context learning phenomenon through a Bayesian lens, viewing real-world LLMs as latent variable models. On this premise, we propose an algorithm to select optimal demonstrations from a set of annotated data with a small LM, and then directly generalize the selected demonstrations to larger LMs. We demonstrate significant improvement over baselines, averaged over eight GPT models on eight real-world text classification datasets. We also demonstrate the real-world usefulness of our algorithm on GSM8K, a math word problem dataset. Our empirical findings support our hypothesis that LLMs implicitly infer a latent variable containing task information.
arXiv.org Artificial Intelligence
Oct-17-2023
- Country:
- North America
- Puerto Rico (0.04)
- United States
- Washington > King County
- Seattle (0.14)
- New York > New York County
- New York City (0.04)
- Minnesota > Hennepin County
- Minneapolis (0.14)
- California
- Santa Barbara County > Santa Barbara (0.04)
- Orange County > Irvine (0.04)
- Washington > King County
- Europe
- Romania (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- Belgium > Brussels-Capital Region
- Brussels (0.04)
- Asia
- South Korea (0.04)
- Japan (0.04)
- India > Andhra Pradesh (0.04)
- China (0.04)
- Middle East
- Jordan (0.04)
- Lebanon > Keserwan-Jbeil Governorate
- Blat (0.04)
- North America
- Genre:
- Research Report (0.64)
- Industry:
- Health & Medicine (0.93)
- Media > Film (0.46)
- Technology: