Same Question, Different Words: A Latent Adversarial Framework for Prompt Robustness
Tingchen Fu, Fazl Barez
TL;DR
Prompt robustness is critical for reliable LLM deployment, but paraphrase-induced performance variation remains a challenge. The authors introduce Latent Adversarial Paraphrasing (LAP), a dual-loop framework that searches for latent continuous paraphrases in hidden space and optimizes the model to perform well on them, using a Lagrangian constraint to preserve semantics. Empirical results across multiple backbones on RobustAlpaca show LAP improves worst-case win-rate by roughly 0.5%–4% absolute over vanilla supervised fine-tuning, without extra paraphrase data or inference-time latency, and it maintains downstream task performance. These findings suggest a practical route to robust prompt handling by shaping embedding geometry, with potential broad impact on real-world LLM deployments.
Abstract
Insensitivity to semantically-preserving variations of prompts (paraphrases) is crucial for reliable behavior and real-world deployment of large language models. However, language models exhibit significant performance degradation when faced with semantically equivalent but differently phrased prompts, and existing solutions either depend on trial-and-error prompt engineering or require computationally expensive inference-time algorithms. In this study, built on the key insight that worst-case prompts exhibit a drift in embedding space, we present Latent Adversarial Paraphrasing (LAP), a dual-loop adversarial framework: the inner loop trains a learnable perturbation to serve as a "latent continuous paraphrase" while preserving semantics through Lagrangian regulation, and the outer loop optimizes the language model parameters on these perturbations. We conduct extensive experiments to demonstrate the effectiveness of LAP across multiple LLM architectures on the RobustAlpaca benchmark with a 0.5%-4% absolution improvement on worst-case win-rate compared with vanilla supervised fine-tuning.
