What Makes Good In-Context Examples for GPT-$3$?
Auteurs : Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, Weizhu Chen
Résumé scientifique
GPT-$3$ has attracted lots of attention due to its superior performance across a wide range of NLP tasks, especially with its powerful and versatile in-context few-shot learning ability. Despite its success, we found that the empirical results of GPT-$3$ depend heavily on the choice of in-context examples. In this work, we investigate whether there are more effective strategies for judiciously selecting in-context examples (relative to random sampling) that better leverage GPT-$3$'s few-shot capabilities. Inspired by the recent success of leveraging a retrieval module to augment large-scale neural network models, we propose to retrieve examples that are semantically-similar to a test sample to formulate its corresponding prompt. Intuitively, the in-context examples selected with such a strategy may serve as more informative inputs to unleash GPT-$3$'s extensive knowledge. We evaluate the proposed approach on several natural language understanding and generation benchmarks, where the retrieval-based prompt selection approach consistently outperforms the random baseline. Moreover, it is observed that the sentence encoders fine-tuned on task-related datasets yield even more helpful retrieval results. Notably, significant gains are observed on tasks such as table-to-text generation (41.9% on the ToTTo dataset) and open-domain question answering (45.5% on the NQ dataset). We hope our investigation could help understand the behaviors of GPT-$3$ and large-scale pre-trained LMs in general and enhance their few-shot capabilities.
Les articles autour de lui, par date et par proximité
Plus haut, c’est plus proche de cet article ; à gauche, c’est plus ancien. Les traits relient les articles proches entre eux : les groupes de traits sont des sous-thèmes. Sélectionnez un point pour voir pourquoi il est là. Retour au résumé de cet article
Les articles autour de celui-ci
Classés selon la proximité de leur titre et de leur résumé avec ceux de cet article. Sélectionnez-en pour les lire ensemble.
Les articles les plus proches
-
Calibrate Before Use: Improving Few-Shot Performance of Language ModelsTony Z. Zhao, Eric Wallace, Shi Feng et al. · 2021 · Computation and Language · cité 2 193 fois · Pas encore résumé
Résumé scientifique
GPT-3 can perform numerous tasks when provided a natural language prompt that contains a few training examples. We show that this type of few-shot learning can be unstable: the choice of prompt format, training examples, and even the order of the training examples can cause accuracy to vary from near chance to near state-of-the-art. We demonstrate that this instability arises from the bias of language models towards predicting certain answers, e.g., those that are placed near the end of the prompt or are common in the pre-training data. To mitigate this, we first estimate the model's bias towards each answer by asking for its prediction when given the training prompt and a content-free test …
-
Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder et al. · 2020 · Computation and Language · cité 65 949 fois · Résumé IA disponible
Résumé scientifique
Recent work has demonstrated substantial gains on many NLP tasks and benchmarks by pre-training on a large corpus of text followed by fine-tuning on a specific task. While typically task-agnostic in architecture, this method still requires task-specific fine-tuning datasets of thousands or tens of thousands of examples. By contrast, humans can generally perform a new language task from only a few examples or from simple instructions - something which current NLP systems still largely struggle to do. Here we show that scaling up language models greatly improves task-agnostic, few-shot performance, sometimes even reaching competitiveness with prior state-of-the-art fine-tuning approaches. Spec…
-
GPT-4 In-Context Learning Ability with Semantico-Syntactically Similar Examples in RussianTimofei Plotnikov · 2025 · Mundo Eslavo · Pas encore résumé
Résumé scientifique
In zero-shot performance with a dataset of over 2,200 Russian phrases and sentences, GPT-4 encounters difficulties to correctly identify the meaning of some examples. Therefore, the "problematic" examples are chosen for further investigation. To address these challenges, the in-context learning ability employed in GPTs can be utilized to enhance unsuccessful performance. This approach presumes providing semantico-syntactically similar examples beforehand. The experiment demonstrates that even with just one in-context example, GPT-4’s performance becomes more robust across nearly all problematic examples. However, the examples that remain misinterpreted potentially reveal that the model can u…
-
Making Pre-trained Language Models Better Few-shot LearnersTianyu Gao, Adam Fisch, Danqi Chen · 2021 · Annual Meeting of the Association for Computational Linguistics · cité 2 387 fois · Pas encore résumé
Résumé scientifique
The recent GPT-3 model (Brown et al., 2020) achieves remarkable few-shot performance solely by leveraging a natural-language prompt and a few task demonstrations as input context. Inspired by their findings, we study few-shot learning in a more practical scenario, where we use smaller language models for which fine-tuning is computationally efficient. We present LM-BFF—better few-shot fine-tuning of language models—a suite of simple and complementary techniques for fine-tuning language models on a small number of annotated examples. Our approach includes (1) prompt-based fine-tuning together with a novel pipeline for automating prompt generation; and (2) a refined strategy for dynamically an…
-
Prompt Programming for Large Language Models: Beyond the Few-Shot ParadigmLaria Reynolds, Kyle McDonell · 2021 · Computation and Language · cité 1 458 fois · Résumé IA disponible
Résumé scientifique
Prevailing methods for mapping large generative language models to supervised tasks may fail to sufficiently probe models' novel capabilities. Using GPT-3 as a case study, we show that 0-shot prompts can significantly outperform few-shot prompts. We suggest that the function of few-shot examples in these cases is better described as locating an already learned task rather than meta-learning. This analysis motivates rethinking the role of prompts in controlling and evaluating powerful language models. In this work, we discuss methods of prompt programming, emphasizing the usefulness of considering prompts through the lens of natural language. We explore techniques for exploiting the capacity …
-
Active Example Selection for In-Context LearningYiming Zhang, Feng Shi, Chenhao Tan · 2022 · Conference on Empirical Methods in Natural Language Processing (EMNLP) · cité 100 fois · Pas encore résumé
Résumé scientifique
With a handful of demonstration examples, large-scale language models show strong capability to perform various tasks by in-context learning from these examples, without any finetuning.We demonstrate that in-context learning performance can be highly unstable across samples of examples, indicating the idiosyncrasies of how language models acquire information.We formulate example selection for in-context learning as a sequential decision problem, and propose a reinforcement learning algorithm for identifying generalizable policies to select demonstration examples.For GPT-2, our learned policies demonstrate strong abilities of generalizing to unseen tasks in training, with a 5.8% improvement o…
-
Learning To Retrieve Prompts for In-Context LearningOhad Rubin, Jonathan Herzig, Jonathan Berant · 2022 · Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies ( · cité 375 fois · Pas encore résumé
Résumé scientifique
In-context learning is a recent paradigm in natural language understanding, where a large pretrained language model (LM) observes a test instance and a few training examples as its input, and directly decodes the output without any update to its parameters.However, performance has been shown to strongly depend on the selected training examples (termed prompts).In this work, we propose an efficient method for retrieving prompts for in-context learning using annotated data and an LM.Given an inputoutput pair, we estimate the probability of the output given the input and a candidate training example as the prompt, and label training examples as positive or negative based on this probability.We …
-
Structured Prompting: Scaling In-Context Learning to 1,000 ExamplesYaru Hao, Yutao Sun, Li Dong et al. · 2022 · Computation and Language · preprint, non relu par les pairs · cité 110 fois · Résumé IA disponible
Résumé scientifique
Large language models have exhibited intriguing in-context learning capability, achieving promising zero- and few-shot performance without updating the parameters. However, conventional in-context learning is usually restricted by length constraints, rendering it ineffective to absorb supervision from a large number of examples. In order to go beyond few shots, we introduce structured prompting that breaks the length limit and scales in-context learning to thousands of examples. Specifically, demonstration examples are separately encoded with well-designed position embeddings, and then they are jointly attended by the test example using a rescaled attention mechanism. So we can scale the num…
Les travaux antérieurs sur lesquels il s’appuie
-
Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus et al. · 2020 · Neural Information Processing Systems · cité 20 475 fois · Résumé IA disponible
Résumé scientifique
Large pre-trained language models have been shown to store factual knowledge in their parameters, and achieve state-of-the-art results when fine-tuned on downstream NLP tasks. However, their ability to access and precisely manipulate knowledge is still limited, and hence on knowledge-intensive tasks, their performance lags behind task-specific architectures. Additionally, providing provenance for their decisions and updating their world knowledge remain open research problems. Pre-trained models with a differentiable access mechanism to explicit non-parametric memory can overcome this issue, but have so far been only investigated for extractive downstream tasks. We explore a general-purpose …
-
Generation-Augmented Retrieval for Open-Domain Question AnsweringYuning Mao, Pengcheng He, Xiao-Dong Liu et al. · 2020 · Annual Meeting of the Association for Computational Linguistics · cité 334 fois · Pas encore résumé
Résumé scientifique
We propose Generation-Augmented Retrieval (GAR) for answering open-domain questions, which augments a query through text generation of heuristically discovered relevant contexts without external resources as supervision. We demonstrate that the generated contexts substantially enrich the semantics of the queries and GAR with sparse representations (BM25) achieves comparable or better performance than state-of-the-art dense retrieval methods such as DPR. We show that generating diverse contexts for a query is beneficial as fusing their results consistently yields better retrieval accuracy. Moreover, as sparse and dense representations are often complementary, GAR can be easily combined with D…
-
Response Generation by Context-aware Prototype EditingYu Wu, Furu Wei, Shao-Han Huang et al. · 2018 · AAAI Conference on Artificial Intelligence · cité 128 fois · Pas encore résumé
Résumé scientifique
Open domain response generation has achieved remarkable progress in recent years, but sometimes yields short and uninformative responses. We propose a new paradigm, prototypethen-edit for response generation, that first retrieves a prototype response from a pre-defined index and then edits the prototype response according to the differences between the prototype context and current context. Our motivation is that the retrieved prototype provides a good start-point for generation because it is grammatical and informative, and the post-editing process further improves the relevance and coherence of the prototype. In practice, we design a contextaware editing model that is built upon an encoder…
-
A Retrieve-and-Edit Framework for Predicting Structured OutputsTatsunori B. Hashimoto, Kelvin Guu, Yonatan Oren et al. · 2018 · Neural Information Processing Systems · cité 191 fois · Pas encore résumé
Résumé scientifique
For the task of generating complex outputs such as source code, editing existing outputs can be easier than generating complex outputs from scratch. With this motivation, we propose an approach that first retrieves a training example based on the input (e.g., natural language description) and then edits it to the desired output (e.g., code). Our contribution is a computationally efficient method for learning a retrieval model that embeds the input in a task-dependent way without relying on a hand-crafted metric or incurring the expense of jointly training the retriever with the editor. Our retrieve-and-edit framework can be applied on top of any base model. We show that on a new autocomplete…
-
GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language UnderstandingAlex Wang, Amanpreet Singh, Julian Michael et al. · 2018 · BlackboxNLP@EMNLP · cité 9 221 fois · Résumé IA disponible
Résumé scientifique
Human ability to understand language is general, flexible, and robust. In contrast, most NLU models above the word level are designed for a specific task and struggle with out-of-domain data. If we aspire to develop models with understanding beyond the detection of superficial correspondences between inputs and outputs, then it is critical to develop a unified model that can execute a range of linguistic tasks across different domains. To facilitate research in this direction, we present the General Language Understanding Evaluation (GLUE, gluebenchmark.com): a benchmark of nine diverse NLU tasks, an auxiliary dataset for probing models for understanding of specific linguistic phenomena, and…
Les articles qui le citent
-
Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair P. Moore et al. · 2022 · Proceedings of the conference - Association for Computational Linguistics. Meeting · cité 610 fois · Pas encore résumé
Résumé scientifique
When primed with only a handful of training samples, very large, pretrained language models such as GPT-3 have shown competitive results when compared to fully-supervised, finetuned, large, pretrained language models.We demonstrate that the order in which the samples are provided can make the difference between near state-of-the-art and random guess performance: essentially some permutations are "fantastic" and some not.We analyse this phenomenon in detail, establishing that: it is present across model sizes (even for the largest current models), it is not related to a specific subset of samples, and that a given good permutation for one model is not transferable to another.While one could u…
-
Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?Sewon Min, Xinxi Lyu, Ari Holtzman et al. · 2022 · Conference on Empirical Methods in Natural Language Processing (EMNLP) · cité 755 fois · Pas encore résumé
Résumé scientifique
Large language models (LMs) are able to incontext learn-perform a new task via inference alone by conditioning on a few input-label pairs (demonstrations) and making predictions for new inputs.However, there has been little understanding of how the model learns and which aspects of the demonstrations contribute to end task performance.In this paper, we show that ground truth demonstrations are in fact not required-randomly replacing labels in the demonstrations barely hurts performance on a range of classification and multi-choce tasks, consistently over 12 different models including GPT-3.Instead, we find that other aspects of the demonstrations are the key drivers of end task performance, …
-
Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and OrderingZhiyong Wu, Yaoxiang Wang, Jiacheng Ye et al. · 2023 · Proceedings of the conference - Association for Computational Linguistics. Meeting · cité 74 fois · Pas encore résumé
Résumé scientifique
Despite the impressive few-shot performance of in-context learning (ICL), it remains a common practice to randomly select examples to serve as the context.In this paper, we advocate self-adaptive in-context learning, a new principle for ICL, in which the self-adaption mechanism is introduced to help each input find an in-context example organization (i.e., selection and permutation) that can derive the correct output, thus maximizing performance.To validate the effectiveness of self-adaptive ICL, we propose a general select-then-rank framework and a set of novel selection and ranking algorithms.Upon extensive evaluation on eight different NLP datasets, our self-adaptive ICL method achieves a…
-
Self-Improving In-Context LearningBaturay Saglam, Dionysis Kalogerias · 2026 · arXiv.org · preprint, non relu par les pairs · Pas encore résumé
Résumé scientifique
We propose to improve in-context learning (ICL) by optimizing the continuous embeddings of a fixed few-shot prompt at test time. The key observation is that the log-probabilities a model assigns to its demonstrated outputs$\unicode{x2013}$available from a single forward pass without generating any tokens$\unicode{x2013}$provide a meaningful signal for how well the model has inferred the task from its demonstrations. We formalize this signal as a bounded, self-supervised confidence proxy and maximize it via zeroth-order optimization over the prompt embeddings, yielding a test-time calibration procedure. The approach requires no finetuning, no token generation, no predefined label set, and no …
-
Improving few-shot stance detection with MINE: meta-prompting and in-context N-shot examplesUwaila Ekhator, Francesca Spezzano · 2026 · International Journal of Data Science and Analysis · Pas encore résumé
Résumé scientifique
Stance detection aims to identify an author’s stance toward a target topic. Although recent prompting-based methods enable zero- and few-shot stance detection with large language models (LLMs), they often require extensive prompting or costly use of multiple LLM agents, as well as large labeled training datasets. We present MINE (Meta-prompting and In-context N-shot Examples), a simple, light-weight, training-free framework that first creates a target-specific LLM stance agent through meta-prompting, and then augments it with a small number of semantically retrieved examples. While meta-prompting and retrieval-augmented in-context learning have been studied independently, these components ha…
Aller plus loin
Comment ces articles sont-ils trouvés ?
Nous comparons le titre et le résumé de cet article avec ceux de tous les articles résumés sur ce site, et avec les articles que Semantic Scholar recommande, ceux qu’il cite et ceux qui le citent (pour un article très cité, ses citations les plus récentes et, depuis OpenAlex, les plus citées). Parmi les travaux antérieurs et les suites, les articles qui s’utilisent en profondeur, une méthode qu’il utilise et les suites très citées remontent un peu. Les niveaux (très proche, proche, apparenté) viennent de la similarité des textes, pas d’un jugement de qualité ; * signale un article sans résumé, comparé par son titre. La phrase sous un article est écrite par une IA à partir des deux résumés : vérifiez-la dans les articles. Un article jugé hors sujet par trois lecteurs quitte la liste.
Mis à jour le 2 novembre 2026.