How Much Prompt Is Enough? A Blackbox Minimization of Few-Shots in LLMs
Abstract
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\%~~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.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI, cs.HC
Related papers
Improving the Energy-Efficiency of the Code Generated by LLMs through Effective Prompting
Shared title terminologycs.SERitika Rekhi, Bing Zhang, Md Arman Islam et al.
Comparing Humans and LLMs in Software Engineering Research
Shared title terminologycs.SEMarc Herrmann, Tolga Çakır, Michael Mircea et al.
FineCR: A Fine-Grained Benchmark for Evaluating LLMs on Raising Code Review and its Resolution
Shared title terminologycs.SETaufiqul Islam Khan, Shaowei Wang, Haoxiang Zhang et al.
J2KMigBench: Evaluating LLMs on Java-to-Kotlin Migration in Real-World Repositories
Shared title terminologycs.SEMoshood A. Fakorede, Marcoantoni Rubio-Gonzalez, Umar Farooq
Merged, but Did It Fix the Issue? Using LLMs to Link GitHub Issues to Their Fixes
Shared title terminologycs.SEAfridi Mahmud, Md. As-Aid Rahman, Rifat Shahriyar
Memory Matters, but Retrieval Is Not Enough: An Empirical Study of Memory Systems
Shared title terminologycs.SEMuhammad Waseem, Md Nasir Uddin Shuvo, Md Aidul Islam et al.