# TextReg: Mitigating Prompt Distributional Overfitting via Regularized Text-Space Optimization

Source: [TextReg: Mitigating Prompt Distributional Overfitting via Regularized Text-Space Optimization](<https://www.sota2.com/research/paper/6a0e91c1f984739ed6738d75>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-05-22T05:00:12.727Z

Authors: Lucheng Fu, Ye Yu, Yiyang Wang, Yiqiao Jin, Haibo Jin, B. Aditya Prakash, Haohan Wang

Published: 2026-05-20T15:47:26.000Z

## Abstract

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.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Logical Deduction (Seven Objects) on BBH (test)](<https://www.sota2.com/research/sota/logical-deduction-seven-objects-on-bbh-test.md>): Logical deduction; BBH Logical Deduction (Seven Objects) (test); Accuracy: 55.2.

- [Logical Deduction (5 Objects) on Test Set](<https://www.sota2.com/research/sota/logical-deduction-5-objects-on-test-set.md>): Logical deduction; Logical Deduction 5 objects (test); Accuracy: 61.1.

- [Tracking Shuffled Objects on Tracking Shuffled Objects 5 objects (test)](<https://www.sota2.com/research/sota/tracking-shuffled-objects-on-tracking-shuffled-objects-5-objects-test.md>): Tracking Shuffled Objects; Tracking Shuffled Objects 5 objects (test); Accuracy (TSO 5-obj): 94.1.

- [tracking shuffled objects seven objects on BBH (test)](<https://www.sota2.com/research/sota/tracking-shuffled-objects-seven-objects-on-bbh-test.md>): tracking shuffled objects seven objects; BBH (test); Accuracy: 92.2.

- [Arithmetic Reasoning on SVAMP (test)](<https://www.sota2.com/research/sota/arithmetic-reasoning-on-svamp-test.md>): Arithmetic Reasoning; SVAMP (test); Accuracy: 90.1.

- [Arithmetic Reasoning on MultiArith (test)](<https://www.sota2.com/research/sota/arithmetic-reasoning-on-multiarith-test.md>): Arithmetic Reasoning; MultiArith (test); Accuracy: 96.7.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2605.21318>)

[PDF](<https://arxiv.org/pdf/2605.21318.pdf>)
