The ROI of Small Examples: Optimizing In-Context Learning Under Token Budgets
Anxo Perez, Jorge Gabín, Javier Parapar
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 (Beat the AI and 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 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.
Create a lesson
Related papers
Your Judge Inherits Your Prompt: In-Context Label Bias in an LLM-as-Judge Is Directional, Not Symmetric
Shared title terminology · Abdullah Ahmad, Ahmed J. O. Ahmed, Luca Citi
Weight-Space Programming Writes In-Context Learning and Matches Fine-Tuning in Language Models
Shared title terminology · Konstantinos Skianis, Aristidis Likas
A Mechanistic Analysis of In-Context Learning and Out-of-Context Hallucination
Shared title terminology · Tianxiang Chen, Jingyuan Zhou, Guoyao Yang et al.
How Many Bytes Has a BPE Model Seen? Estimating Byte-Token Exposure in Pretraining from Corpus Statistics and Embedding Norms
Shared title terminology · Liwei Zhang, ZhiMing Tong, Mochen Guan et al.
Alignment without Transfer: Tokenization Impacts Cross-lingual Representations during Multilingual Language Model Pretraining
Shared title terminology · Jonathan von Rad, Pontus Stenetorp, Yao Lu
Structurally Different, Functionally Persistent: Capability Regions Under Model Optimization
Shared title terminology · Jiwoo Kum, Chanwoo Kim, Doyun Kim et al.