How Much Prompt Is Enough? A Blackbox Minimization of Few-Shots in LLMs
TL;DR Highlight
Delta debugging trimmed few-shot prompts by 65.3% on average with unchanged propositional output
Who Should Read
Backend developers whose long few-shot prompts raise token costs and break when swapping LLMs
Core Mechanics
- 65% of exemplar characters were unnecessary
- Across 6 models and 2 temperatures (12 runs), a mean of 65.3% (±15.8%) was removed with output propositions unchanged.
- Removal ranged from 38.4% to 87.3% depending on the model.
- The skeleton stays, the prose goes
- Identifiers, constraint declarations and logical expressions were mostly kept.
- Natural-language prose and cross-prompt relationship annotations were mostly deleted.
- Bigger models tolerate more trimming
- Each extra 10B parameters added 4.3 percentage points of removal.
- Model family explained much more variance than size alone.
- Over-compressed prompts break on other models
- The shortest prompt (about 29 tokens) had low mean transfer accuracy.
- Prompts that kept more structural scaffolding transferred better.
- Pick the minimizer and the consumer separately
Evidence
- Mean removal of 65.3%
- Averaged over 12 model/temperature runs against a 1749-character original exemplar.
- Min 38.4% (Mistral-Small-24B, T=0.0), max 87.3% (Llama-3.3-70B, T=0.0).
- Accuracy after minimization
- At T=0.0, 4 of 6 models matched the full-prompt baseline 100% across 10 runs.
- At T=0.5, 3 models (gemma-2-9b-it, Mistral-Small-24B, Qwen-2.5-72b) hit 100%.
- Cross-model transfer
- At T=0.0, 22 of 30 off-diagonal pairs gave valid output with 78.1% mean accuracy.
- At T=0.5, 28 pairs were valid with 75.1% mean accuracy.
- Regression analysis
- A size-only model had R²=0.544, while a family model had R²=0.912.
- gemma-2-9b-it compressed 16.5 points more than Llama-3.1-8B (p=0.042).
How to Apply
- Delete relationship annotations first
- Remove the blocks in your few-shot examples that explain how examples relate to each other.
- Compare outputs on a handful of existing test inputs.
- Build a ddmin-style halving loop
- Split the examples into lines and remove subsets.
- Keep a removal if output matches the baseline and revert it otherwise.
- Don't over-trim if you swap models
- If you have fallback models, stop at a mid-length prompt that keeps identifiers and structure.
- Run the trimmed prompt on every target model to confirm.
- Rerun to filter out flaky reductions
- Run the same input several times after trimming.
- Reject any reduction that gives a different result even once.
Try It
# Paste into Claude or ChatGPT (simplified version of the paper's method: manual prompt minimization)
Below is my few-shot prompt and test inputs.
[Prompt]
{{current few-shot prompt}}
[Test inputs]
{{input 1}}
{{input 2}}
Instructions:
1. First, produce outputs for each input with the original prompt as the baseline.
2. Split the prompt into units (role, task description, example body, cross-example relation notes, closing constraints).
3. Create versions with one unit removed and check whether the output matches the baseline.
4. Keep the removal if it matches, otherwise revert.
5. Show the final minimal prompt, the list of removed parts, and the percentage of characters saved.
Next: try the minimal prompt on another model and check the output matches.Terminology
Related Papers
AI is a tool and using it well takes skill
A rebuttal to Hickey: LLMs are tools, and skill in directing and checking them decides the outcome
Reflective Prompt Optimization of a Deep-Research Agent: A Topic-Disjoint, Multi-Seed Protocol for Measuring Transferable Gains and Prompt-Level Overfitting
Reflective prompt optimization raised held-out citation reward from 0.702 to 0.781 on a deep-research agent.
GPT‑6 and Intelligent UI for everyone
GPT-6 reportedly adds generated UI to chat; with no article text, only comment reactions are available.
Base Models Can Reason By Taking a Cue From Training Data
Prefilling just two opening tokens lifted Olmo-3-7B's MATH-500 accuracy from 42% to 78%.
Labels Override Definitions in Jev-Style Typed Decision Models
Renaming options to A/B raised routing accuracy by +0.1511 over meaningful labels.
Language Models Are "Insecure" Reporters
Adding "Be honest" raised GPT-5.5's flagging of a hidden negative result from 2/200 to 190/200.
Original Abstract (Expand)
Prompts are the primary mechanism for directing the behavior of large language models (LLMs). Yet the internal structure and causal hierarchy of prompts remain poorly understood: which parts are causally necessary and which are redundant is an open question. This opacity can have severe consequences. Subtle prompt variations can silently shift model outputs in critical software systems, and engineers lack techniques to reason about prompt reliability. We present \framework, a blackbox prompt-minimization framework that reduces few-shot prompts to their necessary minimal subset. We use a case study to apply \framework to a few-shot learning system and demonstrate the insights that this framework can provide. Our experiments show that few-shot exemplars can be reduced by a mean of 65.3\%~$\pm$~15.8\% in character count while fully preserving propositional output fidelity. The models preferentially retain logical identifiers and constraint declarations while discarding natural language prose and cross-prompt relational annotations. Our analysis also shows that some models are universal encoders, able to produce highly legible yet minimized prompts, while others are universal decoders, able to interpret minimized prompts from most other models. By identifying which components are indispensable, \framework provides a principled basis for prompt compression and structural analysis of few-shot exemplars.