Manuscript Offprint

arXiv:2611.09701

Where Should Learning Live? Regret Analysis for Text, Parameter, and Joint Adaptation

Jungtaek Kim, Jaden Park, Jongwon Jeong, Emmanouil-Vasileios Vlatakis-Gkaragkounis, Kangwook Lee

ABSTRACT

Language-model systems can select prompts and parameter adapters repeatedly during deployment, using feedback to guide later choices. Earlier choices may change the context or environment inherited by later configurations. We study selection among preconstructed candidates and compare cumulative loss with the best fixed prompt–parameter pair used from the beginning. This excess loss separates into three terms: selection regret within the available family, the gap from restricting that family, and the benefit or harm of the actual deployment history. Selection is evaluated using the history each candidate would have produced if used throughout, which separates candidate quality from the effects of switching. When loss functions are fixed independently of selector randomness, past choices affect loss for only a bounded number of rounds, and every candidate's own-history loss is revealed, limiting switches yields sublinear expected regret within the selected family. We also quantify the costs and additional assumptions of independent probing and deployment-only feedback. Controlled experiments show that fewer switches can either lower or raise deployed loss, depending on whether inherited histories are harmful or helpful. With Qwen3.5-9B on Spider, text-only selection has lower within-family regret than joint selection, yet produces more failures because its candidate family excludes stronger configurations.

1 INTRODUCTION

Language-model agents edit code, execute tests, and use tool feedback (Yang et al., 2024b), while recent benchmarks study learning across sequences of related tasks (Asawa et al., 2026). Consider a coding agent that handles successive tasks in a persistent workspace. Before each task, a selector chooses an instruction prompt and a model checkpoint or adapter. The agent edits code, runs tools, and receives feedback such as whether its changes pass the task's tests. Feedback guides the next configuration choice, while the edited code and tool history remain in the workspace. The next configuration therefore inherits the consequences of earlier choices. How should we compare text-only, parameter-only, and joint adaptation in such a system?

Each opportunity to select and execute a configuration is a deployment round, indexed by tt. For example, a round can be one coding task, one question in Spider (Yu et al., 2018), or one dialogue turn in SParC (Yu et al., 2019). We consider a sequence of TT rounds, which can share state and need not be independent. The selector uses earlier feedback to choose a configuration, executes it, incurs a loss, and uses the available feedback to update future selection probabilities. Minimizing cumulative loss over these repeated choices gives an online learning problem (Cesa-Bianchi & Lugosi, 2006). Recent methods construct configurations through reflective prompt optimization (Agrawal et al., 2026), joint prompt–parameter optimization (Bo et al., 2026), and alternating harness–weight optimization (Kim et al., 2026). In our setting, candidates are constructed before evaluation. During evaluation, online learning updates their selection probabilities without constructing new prompts or adapters.

A configuration pairs reusable text, such as prompts, demonstrations, and retrieval contents, with deployable parameters, such as checkpoints or adapters (Brown et al., 2020; Lewis et al., 2020; Hu

*Co-corresponding authors.

et al., 2022). Text-only selection keeps the base parameters, parameter-only selection keeps the base text, and joint selection can change both. Figure 1 illustrates these configuration families. The workspace, generated history, and tool sessions constitute operational state, which evolves even under a fixed configuration. Retaining feedback across trials can influence later behavior without changing model parameters (Shinn et al., 2023).

Our comparator is the best available joint configuration used for all TT rounds from the common initial condition, with its own resulting history. This own-history comparison follows the policy-regret perspective (Arora et al., 2012). For example, a coding agent that switches to configuration bb after using aa can encounter different code from an agent that used bb throughout.

This comparison raises three separate questions. (i) How well does the selector choose among its available candidates, when each is evaluated on the history it would have produced if used throughout? (ii) How much better is the best joint candidate than the best candidate in the selected family? (iii) Does the actual sequence of choices create a more or less favorable history than those fixed-configuration evaluations? We call the corresponding terms diagonal selection regret, family restriction, and the signed state effect. Their sum is exactly the deployed excess loss. Diagonal refers to repeating a single configuration throughout the history, and signed emphasizes that inherited state can reduce as well as increase loss.

Figure

Figure 1: Text-only and parameter-only families within the joint family.

Our strongest feedback model evaluates every candidate on its own fixed-configuration history. Ordinary deployment feedback need not supply those counterfactual losses. We also study independent probes of individual candidates and updates based only on deployed outcomes. For state-dependent guarantees, we require bounded influence: choices sufficiently far in the past no longer affect current loss, including through hidden state. These assumptions connect our analysis to online learning with memory (Anava et al., 2015). We also compare joint sampling and coordinatewise conditional selection: they agree for additive losses under a product prior, but interactions can separate their regret even when both eventually select the optimum. The online-learning methods are established (Geulen et al., 2010; Avner et al., 2012; Cheng et al., 2023). Our analysis connects their guarantees to adaptation comparators, information requirements, and signed state effects.

Controlled studies show that reducing switches helps when mixed histories are harmful and hurts when they are beneficial, even with the same per-round selection probabilities. With Qwen3.5-9B (Qwen Team, 2026) on Spider, text-only selection incurs less within-family regret than joint selection but more deployed loss because its candidates are weaker. On recursive SParC, earlier generated queries in Structured Query Language (SQL) supply the inherited state. Lazy exponential weights (EW) substantially reduces switching with only a small change in estimated expected loss.

Our main contributions are summarized as follows.

  • Loss accounting. We separate selection, family restriction, and state effects relative to a common fixed joint comparator; see Section 2.

  • Selection and state guarantees. We connect selection bounds to configuration families and bound expected excess loss for a selector that limits switches under exogenous losses, bounded influence, and full counterfactual feedback; see Sections 3–4.

  • Weaker feedback. We quantify the costs and additional assumptions of approximate evaluation, sparse probes, and deployment-only feedback; see Section 5.

  • Empirical comparisons. Controlled studies and SQL evaluations show how candidate availability and inherited state change the interpretation of selection regret and switching; see Section 6.

References (72)

  • GEPA: Reflective prompt evolution can outperform reinforcement learning
  • Understanding prompt engineering may not require rethinking generalization
  • Online learning over a finite action set with limited switching
  • Online learning for adversaries with memory: Price of past mistakes
  • Online bandit learning against an adaptive adversary: From regret to policy regret
  • Continual learning bench: Evaluating frontier AI systems in real-world stateful environments, 2026 (opens arXiv in a new tab)
  • The nonstochastic multiarmed bandit problem
  • Decoupling exploration and exploitation in multi-armed bandits
  • Prompt and parameter co-optimization for large language models
  • Language models are few-shot learners
  • Regret analysis of stochastic and nonstochastic multi-armed bandit problems
  • Prediction, Learning, and Games
  • Online learning with switching costs and other adaptive adversaries
  • Understanding the role of feedback in online learning with switching costs
  • Online learning with sleeping experts and feedback graphs
  • Combining expert advice in reactive environments
  • Bandits with switching costs: $T^{2/3}$ regret
  • Hsieh, Y. Wang, H. Guo, T. Shu, M. Song, E. Xing, and Z. Hu
  • Doubly robust policy evaluation and learning
  • Online Markov decision processes
  • LightMem: Lightweight and efficient memory-augmented generation
  • Chasing ghosts: Competing with stateful policies
  • Promptbreeder: Self-referential self-improvement via prompt evolution
  • Regret in the on-line decision problem
  • A decision-theoretic generalization of on-line learning and an application to boosting
  • Understanding prompt tuning and in-context learning via meta-learning
  • Regret minimization for online buffering problems using the weighted majority algorithm
  • Fine-tuning vs. in-context learning in large language models: A formal language learning perspective
  • Connecting large language models with evolutionary algorithms yields powerful prompt optimizers
  • Tracking the best expert
  • Parameter-efficient transfer learning for NLP. In Proceedings of the International Conference on Machine Learning (ICML), 2019
  • LoRA: Low-rank adaptation of large language models
  • Doubly robust off-policy value evaluation for reinforcement learning
  • Efficient algorithms for online decision problems
  • DSPy: Compiling declarative language model calls into self-improving pipelines
  • WHALE: A Simple Recipe for Joint Harness-Weight Optimization
  • Overcoming catastrophic forgetting in neural networks
  • Feedback descent: Open-ended text optimization via pairwise comparison
  • Meta-Harness: End-to-end optimization of model harnesses
  • The power of scale for parameter-efficient prompt tuning
  • Yih, T. Rocktäschel, S. Riedel, and D. Kiela
  • Prefix-Tuning: Optimizing continuous prompts for generation
  • The weighted majority algorithm
  • Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning
  • Locating and editing factual associations in GPT. In Advances in Neural Information Processing Systems (NeurIPS), 2022
  • Rethinking the role of demonstrations: What makes in-context learning work? In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), 2022
  • Few-shot fine-tuning vs. in-context learning: A fair comparison and evaluation
  • Online Markov decision processes under bandit feedback
  • Optimizing instructions and demonstrations for multi-stage language model programs
  • Coin betting and parameter-free online learning
  • MemGPT: Towards LLMs as Operating Systems
  • gradient descent
  • Analyzing and adapting large language models for few-shot multilingual NLU: Are we there yet? Transactions of the Association for Computational Linguistics, 13:1096–1120, 2025
  • Learning to retrieve prompts for in-context learning
  • Toolformer: Language models can teach themselves to use tools
  • AutoPrompt: Eliciting knowledge from language models with automatically generated prompts
  • Reflexion: Language agents with verbal reinforcement learning
  • LoRA vs full fine-tuning: An illusion of equivalence
  • Fine-tuning and prompt optimization: Two great steps that work better together
  • Learning, fast and slow: Towards LLMs that adapt continually, 2026 (opens arXiv in a new tab)
  • Chang, and D. Yu
  • A-Mem: Agentic memory for LLM agents
  • Large language models as optimizers
  • SWE-agent: Agent-computer interfaces enable automated software engineering
  • ReAct: Synergizing reasoning and acting in language models
  • Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task
  • SParC: Cross-domain semantic parsing in context
  • Optimizing generative AI by backpropagating language model feedback
  • SPRIG: Improving large language model performance by system prompt optimization
  • Paschalidis
  • Semantic evaluation for text-to-SQL with distilled test suites
  • Large language models are human-level prompt engineers