Deploying LLM agents in non-stationary environments requires continually revising their instructions as the task drifts, yet rewriting after every reported mistake can turn noisy feedback into persistent errors. This raises an often-overlooked scheduling question in prompt adaptation: when should feedback trigger a lasting instruction update, and at what editor-call cost? Taking inspiration from proportional-integral-derivative (PID) control, we introduce a family of lightweight gates that react to the current error, accumulate evidence over time, and roll back deterioration after an edit. We benchmark these gates against both simple baselines and advanced prompt optimizers (TextGrad and GEPA), over a diverse suite of drifting tasks, LLM parameter sizes, feedback-noise levels, and random seeds. PID-gated continual prompt adaptation yields a more favorable Pareto trade-off between task performance (high accuracy, low error) and editor-call budget than the baselines considered, pointing to control-theoretic scheduling as a simple, general tool for robust prompt adaptation under unreliable feedback.
Figures & tables
Figure 1: The regulated textual feedback loop. Signals enter from outside: target yt from the left, input xt from above. The Sensor flips the label with probability η (labels are either categorical, as in Parity, or bucketed categorical, as in Guess number / moving target). The comparator produces the observed error et (binary for Parity, bucketed distance for numeric tasks); when the controller fires, editor g rewrites the prompt θ .
Figure 2: Cost-quality snapshot at η=0.1 on Qwen3-14B (one marker per method, mean over 5 seeds). Higher accuracy and lower MAE/RMSE are better; fewer calls are cheaper. Points near the top-left (or bottom-left, for MAE/RMSE) indicate a better cost-quality trade-off.
Parity
Guess number
Track moving target
Policy
Acc.(%) ↑
Calls ↓
MAE ↓
Calls ↓
RMSE ↓
Calls ↓
No Edit
47.8±5.8
0.0±0.0
17.61±3.05
0.0±0.0
19.42±2.05
0.0±0.0
Fixed Cadence
68.5±10.1
7.0±0.6
12.17±3.54
8.0±0.0
19.70±4.10
8.0±0.0
TextGrad
88.0±4.4
34.8±13.1
5.20±1.47
105.0±21.1
8.33±1.57
165.0±3.3
GEPA
79.7±6.4
44.4±7.6
9.18±1.55
142.4±18.3
10.12±0.91
159.6±9.2
Proportional Gate (P)
90.2±3.6
20.2±5.1
4.70±2.76
63.8±14.3
7.14±1.42
110.2±5.5
Table 1: Primary results on Qwen3-14B at η=0.1 ( 10% feedback corruption, 5 random seeds). Bold marks the best mean per column, excluding No Edit and Fixed Cadence.
Parity
Guess number
Track moving target
Policy
Acc.(%) ↑
Calls ↓
MAE ↓
Calls ↓
RMSE ↓
Calls ↓
No Edit
47.8±5.8
0.0±0.0
17.61±3.05
0.0±0.0
19.42±2.05
0.0±0.0
Fixed Cadence
61.0±15.7
7.2±0.7
14.59±4.48
7.8±0.4
20.03±5.50
8.0±0.0
TextGrad
87.3±5.9
34.8±13.9
3.92±1.39
99.6±20.2
7.03±1.22
160.8±8.8
GEPA
79.7±6.4
44.4±7.6
8.27±1.75
107.0±10.6
10.31±0.98
161.6±3.5
Proportional Gate (P)
89.2±3.7
22.6±6.4
3.93±1.34
67.6±19.5
6.45±1.20
108.0±3.9
Table 2: Scaling-up ablation on Qwen3.8-27B at η=0.1 ( 10% feedback corruption, 5 random seeds). Bold marks the best mean per column, excluding No Edit and Fixed Cadence.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 3: Cost–quality tradeoff across all three feedback-noise levels on Qwen3-14B (mean over 5 seeds). Marker face shade encodes noise: hollow η=0 , half-filled η=0.1 , solid η=0.2 . Lines connect the three noise points for each method. Points near the top-left (bottom-left for MAE/RMSE) indicate a better cost–quality trade-off. PID gates sit on a better frontier than TextGrad and GEPA at every noise level.
Symbol
Meaning
t,T
Step index and horizon; T=120 steps per trajectory.
xt,yt
Input and hidden ground-truth target; yt never reaches the editor.
y^t,y~t
Predictor output y^t=f(θt,xt) and observed (possibly corrupted) feedback.
et
Observed error: 1[y^t=y~t] for categorical tasks, or a bucketed distance for numeric ones.
θt
Current prompt (plant state); the editor’s target of change.
f,g
LLM predictor y^t=f(θt,xt) and LLM editor θt+1=g(θt,H) (invoked when the gate fires).
Production agentic systems routinely face evolving constraints and must comply from the very next interaction. Scenarios like a tool-call notification changing a compliance threshold or a policy update adding disclosure requirements fit this criteria, having close to no room for errors in production. This proactive adaptation setting is common in deployment, but absent from current benchmarks, which assume either static constraint sets or reactive protocols with evaluation feedback. We introduce RECAP, a benchmark that measures continual-learning phenomena (forgetting, regression, forward transfer) at the constraint level under a strictly proactive adapt-then-test protocol: prompt optimization methods receive only the constraint specification and must generalize before seeing any test data. Evaluating six methods across five LLMs and three schedules with evolving constraints, we find that these methods show no significant improvement in performance, even after incurring a higher latency. These methods, designed for offline or reactive settings, are inadequate for the proactive paradigm. Our work emphasizes the growing need for designing proactive prompt adaptation methods, where the models must remain robust to evolving needs in deployment.
Prompt-based adaptation offers several ways to specialize a frozen language model, ranging from natural-language prompt optimization to learned continuous prompts. These methods are usually compared through downstream performance, although similar outputs need not arise from similar internal computations. We study how discrete prompt optimization, prompt tuning, and prefix tuning alter the processing of dense and mixture-of-experts language models. Our analysis shows that the location of the adaptation predicts how task information is carried to the output: optimized text primarily changes response construction, input-level prompts write their influence into content representations, and layer-wise prefixes maintain direct control through attention. In MoE models, these differences further induce distinct expert-routing patterns. At the same time, common representation-level measurements respond strongly to generic context changes and do not reliably distinguish useful adaptations from matched placebos. We argue that understanding prompt adaptation requires separating representation drift from the part of that drift that is aligned with, and causally used by, the model's task computation. This perspective provides practical guidance for selecting, evaluating, and interpreting prompt adaptation methods.
Mikhail Aleksandrov, Nail Bashirov, Maksim Ivanov +6
Do LLM scientific agents rely only on their initial task context, or do they adapt their decisions in response to experimental feedback? We study this question in neural operator adaptation, where a large language model (LLM) selects fine-tuning configurations under a limited trial budget. Across transfers within and between partial differential equation (PDE) families, the LLM achieves lower held-out test nRMSE than random search and Bayesian optimisation in nearly every matched comparison. Endpoint performance alone cannot distinguish what happens, so we verify each attribution with controlled interventions. Before observing any validation score, the LLM's first configuration already ranks near the top of the corresponding random-search pool, indicating a useful initial bias. A complementary cold-start intervention shows that the selected base learning rate shifts with the PDE description. Once feedback becomes available, reassigning validation scores among evaluated configurations changes the next proposal in every case tested, whereas a value-preserving rewrite produces no comparable aggregate effect. These interventions establish that the LLM's decision-level actions respond to the given task and observed outcomes, showing that it combines a task-dependent prior with sensitivity to experimental feedback.