TextReg:通过正则化文本空间优化缓解提示分布过拟合
研究论文 · 2026/10/06
大型语言模型对用于指定任务目标和行为约束的提示高度敏感。近期许多提示优化方法利用LLM生成的反馈迭代重写提示,但所得提示往往变得更长、积累狭窄的样本特定规则,并在训练分布之外泛化不佳。我们将此失败模式研究为提示分布过拟合,并认为它反映了离散文本空间优化中缺乏表示控制。我们通过表示低效性形式化这一观点,这是一种双因素度量,将提示低效性分解为容量成本和范围狭窄性,将分布性提示过拟合归因于优化过程中二者的耦合增长。我们提出TextReg,一个通过正则化文本梯度实现软惩罚目标的正则化框架,结合双证据梯度纯化、语义编辑正则化和正则化引导的提示更新。在多个推理基准上,TextReg显著提高了分布外(OOD)泛化能力,相比TextGrad准确率提升高达+11.8%,相比REVOLVE提升+16.5%。
该研究针对提示优化中普遍存在的分布过拟合问题,提出了理论解释和有效的正则化方法,显著提升了模型在分布外场景的泛化能力,对提升LLM在现实应用中的鲁棒性具有重要意义。
Large language models (LLMs) are highly sensitive to the prompts used to specify task objectives and behavioral constraints. Many recent prompt optimization methods iteratively rewrite prompts using LLM-generated feedback, but the resulting prompts often become longer, accumulate narrow sample-specific rules, and generalize poorly beyond the training distribution. We study this failure mode as prompt distributional overfitting and argue that it reflects a lack of representation control in discrete text-space optimization. We formalize this view through representational inefficiency, a dual-factor measure that decomposes prompt inefficiency into capacity cost and scope narrowness, attributing distributional prompt overfitting to their coupled growth during optimization. We propose TextReg, a regularization framework that realizes a soft-penalty objective through regularized textual gradients, combining Dual-Evidence Gradient Purification, Semantic Edit Regularization, and Regularization-Guided Prompt Update. Across multiple reasoning benchmarks, TextReg substantially improves out-of-distribution (OOD) generalization, with accuracy gains of up to +11.8% over TextGrad and +16.5% over REVOLVE.