The ROI of Small Examples: Optimizing In-Context Learning Under Token Budgets
Anxo Perez, Jorge Gab\'in, Javier Parapar
Key points
From the paper's conclusion- We study this aspect in question answering (QA), by organizing candidate demonstrations into length-based bins and constructing prompts from examples within the same length range under fixed budgets.
Abstract
In-context learning (ICL) improves large language model performance at inference time without updating model parameters. However, these gains are not free: in practical deployments, longer prompts directly increase inference cost and latency. Under a fixed token budget, prompt construction therefore becomes a resource-allocation problem. While prior work has often focused on how many examples to include in ICL, we study the complementary question of whether the available budget is better spent on a few long demonstrations or on a larger number of shorter ones. We study this aspect in question answering (QA), by organizing candidate demonstrations into length-based bins and constructing prompts from examples within the same length range under fixed budgets. Experiments on two QA benchmarks (\textit{Beat the AI} and \textit{Natural Questions}), using six instruction-tuned LLMs, show that shorter demonstrations are generally the most effective use of prompt space. This effect is especially strong on \textit{Beat the AI}, and remains visible on NQ, although gains are smaller and saturate earlier in the long-context setting. An additional natural language inference experiment on ANLI R3 finds that one of the two shorter bins performs best for five of six models, although longer demonstrations remain competitive. Overall, our results highlight demonstration granularity as an important factor in prompt design.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- A Review of Prompt Engineering Techniques for Large Language ModelsInternational Journal of Human-Computer Interaction · 2025
- Do LLMs Learn from Rewards in Context? : Rethinking the role of reward in In-Context Reinforcement LearningarXiv · 2026
- How Many Examples, and Which Ones? A Study of In-Context Learning for Natural Language InferencearXiv · 2026
- Learn the Effects, Not the Examples: Implicit ICL via Attention PatchingarXiv · 2026
- You Only Edit Once: Incentivizing In-Context Capability of LLMs via Local Demonstration RefinementarXiv · 2026
- From Copying to Composition: How Language Models Develop In-Context LearningarXiv · 2026