提出新方法让大模型提示词更抗改写,提升稳定性。
Beyond Magic Words: Sharpness-Aware Prompt Evolving for Robust Large Language Models with TARE
- 通过对抗性改写测试提示词鲁棒性,识别文本锐度问题。
- 在多个任务上,新方法比传统优化保留更高准确率。
- 适合需要稳定提示词的落地应用,如客服、医疗问答。
大语言模型性能依赖精心设计的提示词。现有优化方法多关注单点准确率,忽视改写不变性和搜索稳定性,导致提示词对微小语义改写极度敏感。本文首次在离散语义空间中形式化定义提示词的文本锐度,并提出基于语义邻域的鲁棒性标准。TARE(文本锐度感知演化)是一种无梯度框架,交替执行采样式对抗搜索与鲁棒性选择;ATARE进一步学习非各向同性权重并动态调整邻域半径,在探索与保真间平衡。在多样化任务上的实验表明,该方法能显著降低文本锐度差距,生成在改写下仍保持高准确率的提示词,优于仅优化准确率的方法,且计算开销可控。
原文摘要 · Abstract (English)
The performance of Large Language Models (LLMs) hinges on carefully engineered prompts. However, prevailing prompt optimization methods, ranging from heuristic edits and reinforcement learning to evolutionary search, primarily target point-wise accuracy. They seldom enforce paraphrase invariance or searching stability, and therefore cannot remedy this brittleness in practice. Automated prompt search remains brittle: small, semantically preserving paraphrases often cause large performance swings. We identify this brittleness as the textual sharpness of the prompt landscape. In this work, we provide the first formal treatment of textual sharpness in the discrete, semantic space of prompts, together with an operational robustness criterion over a semantic neighborhood; the design is black-box or API-only, requiring no gradients to update the model's parameters. Then we introduce TARE (Textual Sharpness-Aware Evolving), a derivative-free framework that alternates between an inner, sampling-based adversarial search that stresses a prompt with hard paraphrases and an outer, robust selection that prefers candidates whose neighborhoods remain strong. We further propose ATARE, which learns anisotropic weights to shape the semantic neighborhood and adapts its radius over time to balance exploration and fidelity. Diverse tasks evaluate our methods, whose design for minimizing textual sharpness gap leads to prompts that preserve accuracy under paraphrasing, outperforming accuracy-only prompt search while remaining computationally practical.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。