The standard way to interact with Large Language Models (LLMs) is a "one-at-a-time" paradigm: you provide a task description, a few examples, and a single data point. While effective, this approach is computationally and financially wasteful. For every single query, you pay for the same instruction tokens and wait for the same API overhead.
Researchers are moving toward batch prompting, a strategy that packs multiple independent data points into a single prompt. By leveraging the massive context windows of modern models, this approach amortizes the fixed costs of instructions across many samples, slashing costs and latency without necessarily sacrificing performance.
The Logic of Amortization
The primary driver behind batch prompting is the reduction of redundant tokens. In a typical few-shot setup, the "instruction prefix"—the task description and the demonstration examples—can be hundreds or even thousands of tokens long. If you process 100 data points individually, you pay for those prefix tokens 100 times.
As Yulan He notes in OverPrompt, aggregating multiple task inputs into a single prompt allows the model to share these instruction tokens across the entire batch. This strategy significantly reduces per-instance latency and token consumption. Jianzhe Lin and Liang Du demonstrate in BatchPrompt that this can reduce token usage by over 80% while maintaining competitive accuracy.
This amortization applies not just to text, but to any high-overhead context. For example, in database tasks, Christopher Buss and colleagues show that grouping multiple mapping rules into one prompt allows the model to share the database schema context, avoiding the redundant cost of re-processing large metadata descriptions for every individual rule (Towards Scalable Schema Mapping using Large Language Models).
Comparative Context and Accuracy
Surprisingly, batching isn't just about saving money; it can sometimes improve results. By seeing multiple data points simultaneously, the model can engage in "comparative reasoning."
In the context of Entity Resolution, Meihao Fan and Ju Fan found that their framework, BATCHER, often achieved higher accuracy than traditional prompting. The shared context allows the model to better identify discriminative attributes that distinguish between different data instances. Similarly, Bo Chen and Jie Tang argue in GuARD that stacking queries allows models to share global context, mimicking human comparative reasoning and improving pattern recognition for anomaly detection.
Managing Contextual Interference
The main risk of batching is "contextual interference"—where the model becomes confused by the presence of multiple, potentially similar queries in the same window.
To combat this, Tinghan Yang and Jennifer Neville introduced CliqueParcel, which balances efficiency against "faithfulness." They found that while grouping by semantic similarity seems intuitive, random assignment is often more effective at preventing the model from conflating different inputs. Other researchers, like Jianzhe Lin, use data permutation and "self-reflection" mechanisms to ensure the model remains focused and accurate across the entire batch (BatchPrompt).
Expanding to Vision and Multi-Label Tasks
The batching principle extends beyond simple text classification:
- Visual Recognition: Siyu Xu and Chang Xu developed CollagePrompt, which packs multiple images into a single spatial grid. This allows GPT-4V to process an entire "collage" of images in one inference pass, reducing costs by up to 90%.
- Behavioral Modeling: In MuHBoost, Nguyen T. Thach and colleagues transitioned from binary relevance to multi-label prompting. By predicting a vector of health outcomes in a single pass, they minimized token consumption and API latency for longitudinal data.
- Evaluation: Steffen Eger and Daniil Larionov applied this to machine translation evaluation with BatchGEMBA, slashing costs by 4x while maintaining high correlation with human judgments.
From Instances to Strategies
A final evolution of this idea moves from batching data to batching logic. Chang Gao and Shuming Shi propose StrategyLLM, which generates general problem-solving strategies at the task level rather than the instance level. By deriving high-level logic once and applying it to all subsequent queries, the overhead of developing sophisticated prompts is decoupled from the volume of requests, creating a highly cost-effective workflow for complex reasoning.