Abstract
Large Language Models (LLMs) are highly sensitive to subtle, non-semantic variations in prompt phrasing and formatting. In this work, we present the first systematic evaluation of 5 methods for improving prompt robustness within a unified experimental framework. We benchmark these techniques on 8 models from Llama, Qwen and Gemma families across 52 tasks from the Natural Instructions dataset. Our evaluation covers robustness methods from both fine-tuned and in-context learning paradigms, and tests their generalization against multiple types of distribution shifts. Finally, we extend our analysis to GPT-4.1 and DeepSeek V3 to assess frontier models' current robustness to format perturbations. Our findings offer actionable insights into the relative effectiveness of these robustness methods, enabling practitioners to make informed decisions when aiming for stable and reliable LLM performance in real-world applications.
Introduction
Prompt sensitivity—where minor changes like swapping a colon for a dash or adding a trailing space significantly impact model performance—remains a critical barrier to the reliable deployment of Large Language Models (LLMs). While numerous "robustness methods" have been proposed to mitigate this behavior, they are often evaluated in isolation using disparate benchmarks. This lack of systematic comparison leaves practitioners uncertain whether to employ post-hoc mathematical corrections, template ensembling, or specialized fine-tuning. This paper addresses this gap by providing a large-scale, unified benchmark of five representative robustness strategies across 52 tasks and 10 models.
Methodology
We evaluate five methods across two primary paradigms:
In-Context Learning (ICL) and Inference-Time Methods
- Batch Calibration (BC): A post-hoc technique that estimates and subtracts "contextual bias" (the model's inherent preference for certain labels) from the output distribution.
- Template Ensembles (TE): Averaging predicted probabilities across multiple prompt formats.
- Sensitivity-Aware Decoding (SAD): A decoding strategy that penalizes predictions that fluctuate significantly under minor input perturbations.
Supervised Fine-Tuning (SFT) Methods
- LoRA with Format Augmentations: Parameter-efficient fine-tuning on datasets where each instruction is presented in diverse formats.
- LoRA with Consistency Loss (LoRA-JS): Training with a Jensen-Shannon divergence penalty to enforce consistent output distributions across varying prompt formats.
The evaluation suite includes 52 tasks from Natural Instructions, mathematical reasoning via GSM8K, and cross-domain generalization tests using Open Hermes 2.5.
Key Results and Analysis
Our systematic benchmarking reveals several critical insights into the trade-offs between accuracy and stability.
The "Efficiency King": Batch Calibration
For classification tasks, Batch Calibration (BC) emerged as a highly effective, low-cost solution. It consistently improved both accuracy and robustness with near-zero computational overhead. As shown in our comparative analysis, BC delivered statistically significant reductions in performance "spread" (the variance across different prompt formats) in 6 out of 8 open-source models tested. However, its effectiveness is contingent on the label distribution; BC struggles significantly with highly imbalanced datasets where its assumption of uniform class distribution fails.
Fine-Tuning: Accuracy vs. Robustness
While fine-tuning with format augmentations (LoRA) significantly boosted raw accuracy, it surprisingly did little to improve robustness. Models became "smarter" but remained equally sensitive to formatting changes. This suggests that standard SFT helps models learn task logic but does not necessarily internalize format invariance.
The Risks of Ensembling
Template Ensembling (TE) showed mixed results. While it can stabilize predictions, a single "toxic" prompt format within the ensemble can degrade average accuracy. We found that using majority voting instead of probability averaging was a more robust strategy for frontier models like GPT-4.1 and DeepSeek V3, reducing sensitivity in 19 out of 20 test cases.
Conclusion and Future Work
Even frontier models are not immune to the "punctuation tax," exhibiting 8-10% accuracy fluctuations based on formatting. Our findings suggest that inference-time strategies like Batch Calibration offer the best immediate ROI for classification, while current fine-tuning methods require further innovation to achieve true format invariance. Future research is directed toward developing SFT methods that can truly internalize format-invariance rather than just memorizing specific templates.
Summary updated