Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learning
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.
Code (1)
Tasks
Few-Shot LearningGSM8KIn-Context LearningLanguage ModelingLanguage ModellingMathtext-classificationText ClassificationMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
LatentExplainer: Explaining Latent Representations in Deep Generative Models with Multimodal Large Language Models
Deep generative models like VAEs and diffusion models have advanced various generation tasks by leveraging latent variables to learn data distributions and generate high-quality samples. Despite the field of explainable …
Uncertainty QuantificationUniCog: Uncovering Cognitive Abilities of LLMs through Latent Mind Space Analysis
A growing body of research suggests that the cognitive processes of large language models (LLMs) differ fundamentally from those of humans. However, existing interpretability methods remain limited in explaining how cogn…
Explaining latent representations of generative models with large multimodal models
Learning interpretable representations of data generative latent factors is an important topic for the development of artificial intelligence. With the rise of the large multimodal model, it can align images with text to…
DisentanglementExplanation GenerationDisentanglement Analysis in Deep Latent Variable Models Matching Aggregate Posterior Distributions
Deep latent variable models (DLVMs) are designed to learn meaningful representations in an unsupervised manner, such that the hidden explanatory factors are interpretable by independent latent variables (aka disentanglem…
DisentanglementStructured Recognition for Generative Models with Explaining Away
A key goal of unsupervised learning is to go beyond density estimation and sample generation to reveal the structure inherent within observed data. Such structure can be expressed in the pattern of interactions between e…
Density EstimationHippocampusTime Series AnalysisVariational Inference