Source-linked AI summary
Ask Me Anything: A simple strategy for prompting language models
Simran Arora, Avanika Narayan, Mayee F. Chen, Laurel Orr, Neel Guha, Kush Bhatia, Ines Chami, Frederic Sala, Christopher Ré
TL;DR
Prompting is brittle, and manually designing effective prompts for each task is difficult to scale. AMA generates multiple prompts, aggregates their noisy predictions with weak supervision, and shows that a 30x smaller model can exceed few-shot GPT3-175B’s average performance across 20 benchmarks.
Problem
Prompting performance varies substantially with small prompt changes, while manually exploring task-specific prompt strategies is difficult to scale.
Method
AMA recursively reformats inputs into open-ended question-answering prompts, collects multiple predictions, and combines them with weak supervision that models prompt accuracies and dependencies.
Results
A 30x smaller LM exceeds the average performance of few-shot GPT3-175B across 20 popular language benchmarks.
Takeaways & Limitations
Prompt aggregation may provide another axis for understanding language-model scaling performance.
Takeaways & Limitations
AMA has lower lift on tasks relying on memorized knowledge and shows limitations on NQ; information retrieval may help when tasks require unavailable domain knowledge.
Abstract
from arXiv · showhide
Large language models (LLMs) transfer well to new tasks out-of-the-box simply given a natural language prompt that demonstrates how to perform the task and no additional training. Prompting is a brittle process wherein small modifications to the prompt can cause large variations in the model predictions, and therefore significant effort is dedicated towards designing a painstakingly "perfect prompt" for a task. To mitigate the high degree of effort involved in prompt-design, we instead ask whether producing multiple effective, yet imperfect, prompts and aggregating them can lead to a high quality prompting strategy. Our observations motivate our proposed prompting method, ASK ME ANYTHING (AMA). We first develop an understanding of the effective prompt formats, finding that question-answering (QA) prompts, which encourage open-ended generation ("Who went to the park?") tend to outperform those that restrict the model outputs ("John went to the park. Output True or False."). Our approach recursively uses the LLM itself to transform task inputs to the effective QA format. We apply the collected prompts to obtain several noisy votes for the input's true label. We find that the prompts can have very different accuracies and complex dependencies and thus propose to use weak supervision, a procedure for combining the noisy predictions, to produce the final predictions for the inputs. We evaluate AMA across open-source model families (e.g., EleutherAI, BLOOM, OPT, and T0) and model sizes (125M-175B parameters), demonstrating an average performance lift of 10.2% over the few-shot baseline. This simple strategy enables the open-source GPT-J-6B model to match and exceed the performance of few-shot GPT3-175B on 15 of 20 popular benchmarks. Averaged across these tasks, the GPT-J-6B model outperforms few-shot GPT3-175B. We release our code here: https://github.com/HazyResearch/ama_prompting
1 Introduction
LLMs support task transfer through natural-language prompts, but prompting is brittle and often demands extensive task-specific prompt engineering.
- In-context learning applies LLMs to new tasks using natural-language prompts containing task descriptions and demonstrations.
- Small prompt changes can produce large performance variations, with outcomes also varying across model families and sizes.
- Prompt engineering often requires manually exploring large strategy spaces and rewriting inputs separately for each task.
- AMA’s motivating workflow runs prompt-chains that generate questions and answers, then combines the resulting noisy answers using weak supervision.
AMA PROMPTING
AMA addresses brittle prompting by generating multiple open-ended question-answering prompt variants and aggregating their noisy predictions with weak supervision. It combines effective prompt formats, scalable task reformatting, and dependency-aware aggregation across broad model and benchmark settings.
- Prompt aggregation: Prompting errors vary in accuracy and correlation, so majority vote can be unreliable for aggregating multiple prompt predictions.The reported average accuracy variation is 9.5%, while error overlap exceeds the independent-error expectation by 69%.
- Effective prompt formats: AMA identifies open-ended question-answering prompts as more effective than restrictive output formats across diverse tasks.Converting three SuperGLUE tasks to open-ended formats provided a 72% performance improvement.
- Scalable collection: AMA recursively reformats inputs with reusable question()- and answer()-prompt chains, allowing varied chains to collect multiple label votes.The chains apply task-agnostic operations across inputs and can be reused without example-level customization.
- Prompt aggregation: Weak supervision combines prompt-chain predictions while modeling their varying accuracies and dependencies without labeled data.AMA defines a probabilistic graphical model over the label and prompt predictions, then selects the most probable label.
- Results: AMA improves prompting across 20 benchmarks and 14 open-source models spanning EleutherAI, BLOOM, OPT, and T0 at 125M–175B parameters.Across models, AMA improves over the few-shot k = 3 baseline by an average of 10.2% ± 6.1% absolute lift.
- Results: An open-source model with 30x fewer parameters matches or exceeds few-shot GPT3-175B results on 15 of 20 benchmarks.
2 Related Work
Related work improves prompting through model training, prompt engineering, task decomposition, prompt aggregation, and weak supervision. AMA complements these approaches by targeting off-the-shelf LLMs with scalable prompt transformation and aggregation.
- Training based strategies: Training-based strategies improve prompting by scaling models, data, or compute, or by fine-tuning language models over prompts.
- Prompt-engineering: Prompt-engineering research studies natural-language task specifications but often targets narrow settings or requires task-specific manual input rewriting.
- Task decomposition: Task-decomposition methods handle explicitly compositional tasks through multiple inference steps, while distinguishing them from single-step language tasks.
- Prompt sensitivity: Prompt-sensitivity work improves individual prompts, whereas AMA manages prompting noise by aggregating multiple prompt outputs.
- Weak supervision: Weak supervision learns noisy-source accuracies and correlations to produce weak labels, while AMA uses aggregation to improve out-of-the-box LLM performance.
3 ASK ME ANYTHING PROMPTING
AMA replaces painstaking single-prompt design with collections of imperfect prompts, generated in open-ended question-answering formats and aggregated using weak supervision. Across tasks, it studies prompt effectiveness, scalable prompt creation, and aggregation under varying accuracies and dependencies.
- 3 ASK ME ANYTHING PROMPTING: AMA applies collections of prompts to each task input and aggregates their predictions into a final output.Its framework represents prompts as P and combines their predictions with an aggregator φ.
- 3.2 Effective Prompt Formats: Precise question reformulation raises WSC performance by 49.4% to 74.7%, exceeding the 38% lift from a less-specific open-ended question.The more precise reformulation extracts the context mentioning the pronoun and asks “Whose dog?”.
- 3.2 Effective Prompt Formats: Open-ended answers require mapping for specialized output classes, producing 33.3% and 11.1% lifts over few-shot baselines on DBPedia and AGNews.AMA inserts an LLM step that maps semantic answers such as “journal” to valid categories.
- 3.2 Effective Prompt Formats: Open-ended QA structures occur about 1000× more frequently than restrictive structures in a 2% sample of The Pile.The analysis examines approximately 200B tokens and relates the frequency difference to the models’ pretraining environment.
- 3.3 Creating Prompt Collections at Scale: AMA recursively applies task-agnostic functional prompt()-chains to transform inputs into questions and answers, varying demonstrations and question style.question() prompts transform statements into open-ended questions, while answer() prompts generate answers given questions and optional context.
- 3.4 Prompt Aggregation: Prompt collections exhibit a 12.1% best-to-worst accuracy gap for PE and 9.6% for PT, alongside 9.7% variance in class-conditional accuracies and correlated errors.Average error-set Jaccard indices are 42.2 for PE and 39.9 for PT, motivating aggregation beyond simple majority voting.
- 3.4 Prompt Aggregation: AMA uses unlabeled weak supervision to model prompt accuracies and dependencies before selecting the most probable label.It learns a probabilistic graphical model and aggregates predictions by maximizing Pr_G,θ(y|P(x)).
4 Information Flow in AMA
AMA’s information flow separates prompt quality from aggregation quality: prompts supply information about the label, while aggregation determines how much survives compression into the final prediction.
- Information flow metric: Conditional entropy H(y|ŷ) measures uncertainty remaining in the true label y given prediction ŷ.Lower entropy indicates that ŷ encodes more information relevant to y.
- Information flow metric: The decomposition attributes H(y|ŷ) to prompt quality H(y|P(x)) and aggregation loss H(y|ŷ) − H(y|P(x)).The first term depends on prompt quality and quantity; the second depends on how φ compresses prompt outputs.
- Evaluation: AMA outperforms k-shot baselines as both individual prompt-chain quality and the number of aggregated chains increase.This evaluation concerns the prompt-information term H(y|P(x)).
- Evaluation: Weak supervision reduces information loss relative to majority vote when prompt outputs have dependencies or accuracies unlike majority vote’s assumed distribution.Majority vote assumes conditionally independent prompt predictions with a shared better-than-random accuracy.
- Evaluation: As the number of aggregated prompts increases, conditional entropy decreases, suggesting prompt aggregation as another axis for understanding LLM scaling performance.The paper also characterizes H(y|ŷAMA) theoretically under a standard weak-supervision model.
5 Results
AMA is evaluated across diverse open-source models, tasks, and aggregation settings. It generally improves few-shot performance, with especially large gains for GPT-J-6B and tasks whose needed knowledge is present in the input, while knowledge limitations remain.
- Experimental setup: AMA is evaluated on 20 benchmarks using 14 LLMs from four model families spanning 125M–175B parameters.The tasks include SuperGLUE, natural-language inference, classification, and question answering.
- 5.1 Main Results: GPT-J-6B exceeds few-shot GPT3-175B’s average performance on 15 of 20 benchmarks, with AMA improving GPT-J-6B’s few-shot performance by 41% on average.The comparison uses few-shot GPT3-175B results and GPT-J-6B results in Table 1.
- 5.1 Main Results: AMA provides the most lift on tasks whose requisite knowledge is included in the input and that rely largely on natural-language understanding.Lift is lower on tasks relying on memorized knowledge, although generated context can help on closed-book WebQ.
- Experimental setup: AMA’s evaluation excludes rank-classification scoring except for tasks with explicit multiple-choice options.This differs from scoring used in the cited GPT3 and T0 comparisons.
- 5.2 Evaluation across Models: 10.2% ± 6.1% absolute lift and 21.4% ± 11.2% relative lift are observed across models and tasks.Average family-level absolute lifts are 11.0% for EleutherAI, 11.0% for BLOOM, 11.9% for OPT, and 2.9% for T0.
- Diagnostics: Models with higher performance on question generation, answer generation, answer selection, and extraction generally receive more lift from AMA.The diagnostic buckets range from T0 3B models, which see the least lift, to 6–7B GPT models, which see the most.
- 5.3 Evaluation against other aggregation methods: AMA achieves up to 8.7 points of lift over majority vote and is no worse than majority vote on 16 of 20 tasks.On the remaining four tasks, AMA is at most 1.0 points worse; dependency modeling improves performance by up to 9.6 points and 2.2 points on average on nine tasks.
- 5.3 Evaluation against other aggregation methods: For T0 with PromptSource prompts, majority vote gives a 3.6-point average lift and weak supervision gives a 6.1-point average lift.The evaluation uses 10 prompt formats for each of CB, WIC, WSC, and RTE.
6 Conclusion
The paper introduces AMA as a scalable method for generating multiple prompts and aggregating their answers with weak supervision. Across model families and sizes, it reports broad lift and shows GPT-J-6B exceeding few-shot GPT3-175B on 15 of 20 benchmarks.
- Conclusion: AMA scalably obtains multiple prompts from a task input and combines their intermediate answers using weak supervision for the final prediction.The method is motivated by open-ended question-answering formats and prompt variability.
- Conclusion: AMA provides lift across four language model families and model sizes ranging from 125M to 175B parameters.The conclusion frames this as broad coverage across model scale and family.
- Conclusion: A 30x smaller open-source language model exceeds few-shot GPT3-175B’s average performance across 20 popular language benchmarks.The conclusion identifies this as the paper’s central result.
8 Ethics Statement
The authors frame AMA as a proof-of-concept intended to support practitioners, especially those using smaller, open-source LLMs, while acknowledging potential misuse, error modes, and inherent risks.
- AMA is intended to aid practitioners exploring and using LLMs, especially smaller, open-source models.
- The authors recognize that AMA could be used for harmful or unethical tasks.
- They characterize AMA as a proof-of-concept with error modes and inherent risks associated with using LLMs.
- All experiments use A100 NVIDIA GPUs.
A.2 Metrics
The evaluation uses task-specific metrics and re-evaluates RealTimeQA with the same GPT-3 endpoint used elsewhere; weak supervision uses unlabeled data for structure and parameter learning.
- RealTimeQA is re-evaluated with the davinci endpoint and its few-shot prompt because other GPT-3 evaluations use davinci.
- Most tasks use matching accuracy, while DROP and RealTimeQA use text F1, WebQ and NQ use span-overlap accuracy, and MultiRC uses F1a accuracy.
- Weak-supervision structure learning uses unlabeled test-set data plus 1000 unlabeled training samples, with default parameters from Varma et al. (2019).
B Additional Results
Table 3 compares AMA results for BLOOM-7.1B with few-shot GPT3-175B, using published GPT-3 numbers and classification baselines from prior work.
- Table 3 compares BLOOM-7.1B AMA results against few-shot GPT3-175B results.
- The GPT-175B values are reported from Brown et al. (2020), with shot counts shown in parentheses.
- Classification-task baselines in the table come from Zhao et al. (2021).
B.1 BLOOM Model Results
For BLOOM-7.1B, AMA consistently improves over few-shot performance, although it remains below the comparably sized GPT-J-6B results reported elsewhere.
- B.1 BLOOM Model Results: AMA produces consistent lift over few-shot performance for the BLOOM-7.1B model across the 20 benchmarks.
- B.1 BLOOM Model Results: BLOOM-7.1B AMA performance remains below the comparably sized GPT-J-6B results reported in Table 5.1.
- B.1 BLOOM Model Results: Table 4 reports prompt aggregation using Majority Vote and Weak Supervision on three random few-shot prompts without prompt reformatting.
- B.1 BLOOM Model Results: Few-shot results for BLOOM 7.1B are also often lower than the few-shot results for GPT-J-6B.
B.2 AMA Ablations
The ablation isolates prompt aggregation without AMA’s QA reformatting and finds that aggregation alone does not close the performance gap.
- AMA Ablations: Aggregation alone leaves large performance gaps when AMA’s QA reformatting is omitted.The study compares three few-shot prompts aggregated by majority vote or weak supervision without applying AMA QA reformatting.
B.3 Weak Supervision Ablations
The weak-supervision ablations examine alternative prompt aggregation methods, additional unlabeled data, and inference cost. They evaluate whether modeling prompt accuracies and dependencies improves aggregation reliability.
- Aggregation methods: AMA’s aggregation method is compared with majority vote, weighted majority vote, and selecting the best prompt.Weighted majority vote uses labeled examples to weight prompts by their estimated accuracy, while Pick Best selects the strongest labeled-set prompt.
- Dependency modeling: Weak supervision learns a probabilistic graphical model from prompt outputs and can incorporate dependencies among prompts.The ablation varies whether dependency information is modeled and compares the resulting inference costs.
- Additional unlabeled data: Even without additional unlabeled data, AMA is evaluated as a viable aggregation setting on RTE, WSC, and AGNews.Figure 6 reports accuracy across 100%, 50%, 20%, 10%, and 0% of the additional dataset, averaged over five runs.
- Inference cost: 13.0 seconds is the average weak-supervision runtime without modeled dependencies, compared with 84.3 seconds when dependencies are modeled in RTE.The reported times include learning the graphical model and aggregating outputs over RTE, WSC, and AGNews.
B.4 Additional AMA Baselines
AMA is compared with Self-Consistency and is analyzed through a weak-supervision model that represents prompt accuracies and dependencies. At the GPT-J-6B scale, AMA outperforms Self-Consistency.
- Self-Consistency comparison: Self-Consistency aggregates multiple prompt outputs through temperature-based sampling and builds on Chain-of-Thought prompting.The comparison is relevant because both methods aggregate multiple outputs without additional supervised training.
- Self-Consistency comparison: AMA outperforms Self-Consistency at the GPT-J-6B model scale using the same number of prompts.The comparison uses the exact prompts and overlapping benchmark tasks provided for Self-Consistency.
- Weak-supervision aggregation: Weak supervision aggregates prompt votes by learning Pr(y, P(x)) and predicting the most probable label given the prompt outputs.The model is parameterized to capture both varying prompt accuracies and dependencies when they exist.
D Information-Flow Theoretical Result
The theoretical analysis models prompt outputs and labels with an Ising-style graphical model, expressing conditional entropy through prompt–label correlations and prompt interactions. It connects the model to AMA’s information flow and QA-format diagnostics.
- Information flow: AMA’s idealized residual error corresponds to information lost when prompt outputs are converted into a randomly drawn label from Pr(·|P(x)).The residual depends on the uncertainty of the conditional label distribution under exact recovery.
- Graphical-model formulation: AMA models Pr(y, P(x)) with a probabilistic graphical model whose nodes are the label and prompt outputs.The model uses an Ising formulation with unary prompt–label terms and pairwise prompt-dependence terms.
- Prompt dependencies: Prompt interactions affect the graphical model through pairwise dependence parameters, while the entropy normalization term is independent of those interactions.The recovered graph represents conditional dependencies among prompt outputs given the label.
- Conditional entropy: Theorem 1 expresses H(y|P(x)) under the Ising model in terms of prompt signal and a normalization term.The vector Θ represents prompt–label correlation strengths, while µ contains accuracy-scaled correlations.
- Information flow: Prompt aggregation reduces conditional entropy as the number of aggregated prompts increases.The analysis interprets this reduction as information about y obtained from observing P(x).
- QA-format analysis: Open-ended QA structures occur about 1000× more frequently than restrictive prompt structures in the sampled Pile corpus.The analysis also observes frequent yes-no questions followed by “yes” or “no,” resembling AMA’s format.
G Error Analysis
AMA’s errors cluster around knowledge access, instruction following, and long-context transformations. It gains most when required knowledge is explicitly in context but struggles with factual recall, restrictive output spaces, and long inputs.
- AMA’s common error modes are knowledge, instruction-following, and long-context errors.
- Knowledge errors: AMA yields the most gains when the knowledge needed is explicitly provided in context, such as reading comprehension and extractive QA.
- Knowledge errors: AMA provides comparatively less lift when tasks require recalling encoded factual knowledge or applying common-sense or real-world knowledge.
- Instruction Following: Restrictive output spaces can cause AMA to generate answers outside the desired classes, especially in multi-way classification.
- Long-context errors: AMA question() struggles with long or syntactically complex inputs, while answer() struggles to extract correct spans from contexts longer than 6 sentences.
H Datasets and Prompts
The appendix evaluates AMA across 20 datasets spanning several benchmark categories and illustrates its prompt-chain transformations with task-specific examples. These examples include summarization-to-classification, yes/no question generation, and real-time question answering.
- H Datasets and Prompts: The evaluation covers 20 datasets across SuperGLUE, NLI, Classification, and RealTime QA benchmark categories.
- H.1 AGNews: AGNews examples transform passage summaries into one of four categories: World News, Sports, Business, or Technology and Science.
- H.1 AGNews: AGNews prompt-chain examples summarize passages before mapping the summaries to categories such as Business, Sports, World News, or an unfinished Technology and Science label.
- H.2 ANLI R1: ANLI R1 examples rewrite statements as yes/no questions and answer them using formats that can include True, False, or Neither.
- H.2 ANLI R1: ANLI R1 examples include entailment, contradiction, and unknown-information cases involving factual statements about people and events.
- H.15 RealTime QA: The RealTime QA example pairs multiple news articles with a question and an answer, illustrating question answering over current-text inputs.