TL;DR
When building prompts for Large Language Models (LLMs) under a fixed token budget, "breadth" usually beats "depth." This paper demonstrates that using a larger number of short, concise examples for in-context learning generally outperforms using a few long, detailed ones, especially in Question Answering and Natural Language Inference tasks.
What Problem Does This Paper Address?
In-context learning (ICL)—providing an LLM with a few examples (demonstrations) in the prompt—is a standard way to improve performance without fine-tuning. However, tokens aren't free. In production, longer prompts mean higher costs and increased latency.
Practitioners often face a resource-allocation dilemma: Should I use my limited token budget on a few high-quality, long demonstrations with lots of context, or on many short, "bare-bones" examples? While previous research has looked at which examples to pick or how many to include, this paper specifically investigates the trade-off between demonstration length and count under a strict budget ceiling.
Methods
The authors treat prompt construction as a controlled token-allocation problem. Their approach involves three main steps:
- Binning: They partition a pool of candidate demonstrations into four length-based bins (from very short to very long) using the Freedman–Diaconis rule to ensure data-driven ranges.
- Prompt Construction: For a given token budget (e.g., 4,000 tokens), they build prompts using examples sampled exclusively from one bin at a time. They iteratively add examples until the next one would exceed the budget.
- Evaluation: They test this across six instruction-tuned LLMs from three families: Qwen 3 (4B, 30B), Phi-4 (mini, full), and Gemma 3 (4B, 27B).
By keeping the total token expenditure the same, they can isolate whether the model benefits more from broader example coverage (more short examples) or richer individual demonstrations (fewer long examples).
Datasets
The study evaluates performance on three distinct benchmarks:
- Beat the AI: An adversarial reading comprehension (QA) dataset designed to challenge existing systems.
- Natural Questions (NQ): A standard QA benchmark, here used to test long-context scenarios (budgets up to 30,000 tokens) where demonstrations are full Wikipedia articles.
- ANLI R3: The third round of the Adversarial Natural Language Inference benchmark, used to see if the "short is better" trend holds for classification tasks beyond extractive QA.
Key Insights and Ideas
- Granularity is a Design Dimension: The "size" of demonstrations is just as important as the number of demonstrations. The authors show that "demonstration granularity" is an underexplored but critical factor in prompt engineering.
- The Breadth Advantage: Shorter examples allow the model to observe a broader range of answer patterns and mappings within the same budget. This "breadth" appears more valuable than the "depth" provided by extra context in longer examples.
- Diminishing Returns in Long Context: In the Natural Questions (NQ) experiments, the advantage of adding more examples saturates earlier. This is likely due to the "lost in the middle" phenomenon, where LLMs struggle to retrieve information from the center of very long prompts.
- Random Selection is Suboptimal: A "random baseline" (sampling examples of any length) typically performed worse than the "Short Bin" strategy, suggesting that practitioners should deliberately filter for shorter examples rather than just picking at random.
Key Results
The most striking results came from the Beat the AI benchmark. As shown in Figure 1 below, the shortest bin (Bin 1) consistently yielded the highest F1 scores across all six models.
- Performance Gains: On Beat the AI, Gemma 4B saw a massive 56.20% improvement over zero-shot prompting by using 41 short examples. Qwen 30B improved by 20.36% using 51 short examples.
- Long-Context Nuance: On Natural Questions, the preference for shorter examples remained, but the gap between bins was smaller. For instance, Qwen 30B achieved its best result (70.50 F1) with 7 examples from the shortest bin, compared to 66.78 in a zero-shot setting.
- Cross-Task Consistency: In the ANLI R3 (NLI) experiment, one of the two shortest bins produced the best results for five out of the six models tested.
Limitations and Future Work
The authors acknowledge several constraints:
- Task Scope: The study focuses primarily on extractive QA and NLI. The findings might differ for generative tasks like creative writing or complex reasoning (e.g., Chain-of-Thought), where longer demonstrations might be necessary to show the model how to think.
- Homogeneous Bins: The experiments used prompts where all examples came from the same length bin. Real-world "mixed-bin" strategies (combining a few long examples with many short ones) were not explored.
- Fixed Ordering: The study did not investigate how the order of short vs. long examples affects performance, which is known to be a factor in ICL.
Future research could look into "budget-aware" retrieval—algorithms that dynamically select a mix of example lengths to maximize the "Return on Investment" (ROI) for every token spent.
Summary updated