PAFT: Prompt-Agnostic Fine-Tuning
Chenxing Wei, Yao Shu, Mingwen Ou, Ying Tiffany He, Fei Richard Yu
TL;DR
PAFT addresses the problem of prompt-induced brittleness in fine-tuning large language models by introducing a two-phase framework that constructs a diverse set of synthetic prompts and trains with dynamic prompt variation. Through candidate prompt construction using an LLM ensemble and a dual prompting strategy, followed by a dynamic fine-tuning process, PAFT learns task semantics that generalize across unseen prompts. Empirical results show PAFT yields higher generalization to unseen prompts (up to 7% improvement) and stronger downstream performance across QA, reasoning, and tool use tasks, alongside up to 3.2× faster inference due to reduced prompt sensitivity. The approach is supported by theoretical insights linking prompt diversity to improved cross-domain generalization via domain adaptation bounds and MMD-based discrepancy controls, underscoring PAFT’s practical impact for robust, prompt-agnostic LLM deployment.
Abstract
Fine-tuning large language models (LLMs) often causes overfitting to specific prompt wording, where minor phrasing variations drastically reduce performance. To address this, we propose Prompt-Agnostic Fine-Tuning (PAFT), a method that enhances robustness through dynamic prompt variation during training. PAFT first generates diverse synthetic prompts, then continuously samples from this set to construct training instances, forcing models to learn fundamental task principles rather than surface-level patterns. Across systematic evaluations using both supervised fine-tuning (SFT) and reinforcement learning fine-tuning (RLFT), PAFT demonstrates substantially improved prompt robustness, achieving 7% higher generalization accuracy on unseen prompts than standard methods. In addition to enhanced robustness, PAFT consistently yields superior overall performance on established benchmarks for question answering, mathematical reasoning, and tool use. Notably, models trained with PAFT attain 3.2 faster inference speeds due to reduced prompt sensitivity. Ablation studies further validate effectiveness of PAFT, while theoretical analysis reveals that PAFT can effectively enhance the cross-domain generalization ability of LLM.
