| Bandit | |
|---|---|
| number of arms | |
| an arm | |
| best arm, the one with the highest mean reward | |
| horizon: the number of rounds in a run | |
| a round, | |
| arm pulled at round | |
| reward seen at round , drawn independently with mean | |
| mean reward of arm , unknown to the agent | |
| mean reward of the best arm; in Krishnamurthy et al.'s instances | |
| gap between the best arm's mean and every other arm's mean; the other arms sit at in Krishnamurthy et al.'s instances | |
| number of pulls of arm in rounds 1 to | |
| average reward of arm over its pulls up to round | |
| regret after rounds, : the reward lost against always pulling the best arm | |
| Failure statistics | |
| fraction of replicates with a suffix failure at round : the best arm is never pulled in rounds to | |
| replicate average of the share of rounds 1 to spent on the least-pulled arm; at most , plotted as | |
| Algorithm help | |
| UCB's exploitation term for arm at round , | |
| UCB's exploration bonus for arm at round , | |
| UCB's weight on the exploration bonus | |
| Constants | |
| Krishnamurthy et al.'s hard instance: five Bernoulli arms, the best at mean 0.6 and the rest at 0.4; the easy instance has | |
| main horizon in Krishnamurthy et al. (200 and 500 in checks) | |
| horizon in Schmied et al. | |
Context. Language models now sit in feedback loops where they act, observe an outcome, and act again, such as recommending items or picking the next experiment. Learning from that feedback requires exploration, trying an option that looks worse now to check whether it is actually better. The multi-armed bandit isolates that requirement. Three papers pose bandits to language models in text, putting the task and history in the prompt. Krishnamurthy et al. (2024) test pretrained models through prompting alone. Nie et al. (2025) pass a bandit algorithm's behavior through prompts or fine-tuning, and Schmied et al. (2026) measure why models fall short and train them with RL.
Given the raw history of past rounds, pretrained models fail in two ways. Most commit to one arm early and never return to the best arm; a few keep pulling every arm nearly equally. They explore well only when the prompt summarizes each arm's pull count and average reward, or after fine-tuning or RL. Across GPT-3.5, GPT-4, and Llama 2, GPT-4 with that summary was the only prompted configuration in Krishnamurthy et al. to explore about as well as Thompson samplinga bandit algorithm that keeps a posterior over each arm's mean (here Beta, from a uniform prior), draws one value from each, and pulls the arm with the largest draw. Reading note: UCB and Thompson sampling. The same prompt failed with the raw list. In Nie et al., a smaller model fine-tuned on UCBupper confidence bound: pull the arm with the largest average reward plus a bonus that shrinks as the arm is pulled more. Reading note: UCB and Thompson sampling's choices beat a larger prompted one, though neither reached UCB.
Schmied et al. trace early commitment to two distinct habits and show that RL fine-tuning on bandit rewards pushes models to explore more. Small models repeat whichever action fills their context. Large models compute UCB's rule accurately in most steps, yet still act greedily in most of them. In practice, a system that must explore should compute the summary statistics, or run the whole decision rule, in code rather than asking the model to track a raw history. Evaluation also needs hard instances, because greedy play already does well on easy ones and hides the failure.
Setting. A bandit has arms; each arm has an unknown mean reward arm 's mean reward, unknown to the agent. At round , the agent pulls an arm the arm pulled at round and sees an independent reward the reward of round , drawn independently with mean with mean , learning nothing about the other arms. Write the arm with the highest mean for the best arm, the best arm's mean reward for its mean, and the number of times arm was pulled in rounds 1 to for arm 's pull count in the first rounds. Regretthe expected reward lost against always pulling the best arm, summed over rounds. Reading note: UCB and Thompson sampling measures the expected reward lost relative to always pulling :On the instances below, UCB and Thompson sampling achieve regret of order , where the gap between the best arm's mean and every other arm's mean is the mean gap between the best arm and every suboptimal arm.
Prompting alone (Krishnamurthy et al.). The authors use Bernoulli rewards with and every other arm at . The hard instance has and ; the easy one has and . Each round, the model reads the task and history and names an arm. Prompt configurations vary five choices plus an option for step-by-step reasoning (chain of thoughttext in which the model reasons before giving its answer; here asked for in zero-shot form, with no worked examples. Reading note: Depth, width and expressivity). The scenario uses buttons or ads, and the framing either stays neutral or hints to balance exploration and exploitation. The history is either the raw list of past rounds or per-arm pull counts and average rewards. Output is one arm or a distribution to sample from, at temperature 0 or 1 (distribution answers run only at 0). GPT-4 wrote chain-of-thought reasoning reliably only with a second reminder, called reinforced chain of thought. Runs last rounds with 10 or 20 replicates per configuration, benchmarked against UCB, Thompson sampling, and Greedyafter one pull of each arm, always pull the arm with the best average reward so far.
Two failure statistics detect what total reward cannot at this scale. A suffix failurea replicate in which the best arm is never pulled from some round to the end at round means a replicate never pulls in rounds to , and the fraction of replicates with a suffix failure at round is the fraction of replicates with one. Once unlucky early draws push 's average below what another arm settles at, Greedy never tries again. Total reward hides this failure at . On the hard instance (simulated here), Greedy averages about 11 short of always pulling , matching what Thompson sampling spends on exploration, with a standard deviation near 10 per replicate. Separating the two by mean reward would take thousands of replicates. Their , 0.48 versus 0.01 in the paper, already differs by about three standard errors at 10 replicates. The second statistic, the average over replicates of the share of rounds 1 to spent on the least-pulled arm; at most , averages over replicates the share of rounds 1 to spent on the least-pulled arm. A rescaled that stays high as grows flags a uniform-like failurepulls spread nearly evenly over the arms to the end, with no shift toward the better ones.
The first statistic bounds regret directly. In these instances, every pull of an arm other than loses exactly in expectation (in general, ). A replicate with a suffix failure at round misses on all remaining rounds, so regret satisfies (computed here)A suffix-failure rate bounded above zero as grows therefore forces linear regret in , against for UCB and Thompson sampling. A replicate in a suffix failure gathers no new data on , so longer horizons cannot repair it.
On the hard instance at , all but five configurations across the three models have . The basic GPT-4 prompt (buttons, neutral framing, raw history, one arm, no reasoning, temperature 0) reaches 0.50, near Greedy's rate and far above UCB's 0.02. Many of its replicates pull the best arm only a handful of times while the rest lock onto it right away, so lucky runs mask the failure in average reward. Extended to with 20 replicates, it suffers suffix failures in more than 60% of replicates and earns clearly less reward than UCB and Thompson sampling. Four of the five configurations below 0.15 fail the opposite way. Two GPT-4 configurations requesting a distribution over arms end with of 0.41 and 0.49, against 0.28 for Thompson sampling and 0.18 for UCB. Over 200 rounds, the one with raw history keeps that fraction flat and earns clearly less reward. Two GPT-3.5 configurations at temperature 1 likewise keep pulls nearly uniform.
The fifth is the one configuration that explores well, and it depends on the summarized history. It pairs GPT-4 with the buttons scenario, exploration-exploitation framing, the summary, reinforced chain of thought, and temperature 0. That setup ends with of 0.33, and its share of pulls on climbs steadily toward 1, much like Thompson sampling. Rerun at with 40 replicates, it holds at 0.03, against 0.12 for the same prompt with raw history, 0.00 for Thompson sampling, and 0.47 for Greedy. The authors suggest the summary helps because the model cannot reliably count and average a raw list itself. With many arms or contexts, however, each arm or context-arm pair appears only a few times, turning summarization into an algorithm design problem of its own.
Easy instances do not reveal the failure. On the easy instance, with 3 replicates per configuration, most GPT-4 setups avoid suffix failures and earn high reward while picking the best-looking arm in most rounds. Greedy also does well there, even though it provably fails with constant probability and 19% of its replicates suffer suffix failures. When rewards separate the arms quickly, little exploration is needed, so easy instances cannot test whether a model truly explores.
Algorithmic prompts and fine-tuning (Nie et al.). Nie et al. introduce BanditBenchNie et al.'s suite of bandit tasks posed in text: 16 multi-armed configurations and a contextual task built from movie ratings to test whether handing a model more of a bandit algorithm's computation closes the gap. Its multi-armed suite uses or 20 arms with Bernoulli rewards (gap 0.2 or 0.5) or Gaussian rewards. Its contextual task sets expected reward linear in feature vectors shown in the prompt, with LinUCBthe UCB rule for contextual bandits with rewards linear in the features: play the arm with the largest , for the arm's feature vector , the ridge-regression estimate , and , summed over past pulls with rewards ; the square root is the estimate's standard deviation at (Li et al., 2010). Reading note: Contextual bandits as the reference algorithm. Methods are ranked by win ratethe share of significant wins (t-test, , 30 runs each) against all other methods over all configurations, which depends on the pool of compared methods. Alongside Krishnamurthy et al.'s summary, the prompt can supply UCB's two terms for each arm. Writing arm 's average reward over its pulls up to round for arm 's average reward so far and UCB's weight on the exploration bonus for the exploration weight, they areUCB picks the arm with the largest sum, leaving the model only an addition and a maximum. On the contextual task, the prompt supplies LinUCB's two terms. As an alternative, oracle behavior fine-tuningOFT: fine-tuning the model to predict UCB's next arm from the history, by maximum likelihood on UCB trajectories (OFT) trains Gemini 1.5 Flash by maximum likelihood to predict UCB's next arm from text histories.
Fine-tuning helps more than any prompt, and neither reaches the algorithm. On the multi-armed tasks, adding the summary or UCB's terms lifts the larger Gemini 1.5 Pro's win rate from 45.5% with raw history to 60.0% and 59.6%. OFT lifts Flash to 65.6%, beating Pro under every prompt, while UCB stands at 90.6%. On the contextual task, raw history is nearly useless to both models (0.0% and 7.1%), and LinUCB's terms lift Pro to 64.3%. Flash fine-tuned with those terms in its training and test prompts reaches 89.3%, against 96.4% for LinUCB.
Why models commit early, and RL fine-tuning (Schmied et al.). The authors test Gemma2 models at 2B, 9B, and 27B on BanditBench's Gaussian bandits, letting each write up to 256 tokens of reasoning before each action. Episodes run steps over arms labeled as colored buttons. Action coverage, the fraction of arms tried at least once by step , the fraction of arms tried at least once, climbs for about 10 steps and stalls at 40% (2B) and 65% (9B, 27B) on 10 arms. As soon as an action returns a reward, the models put very high probability on it and keep choosing it, so an untried arm, possibly the best one, is never sampled.
To separate repetition from reward-chasing, the authors take short random-policy histories, repeat the last action 0 to 100 times, and inspect each model's next-action distribution. For 2B, entropy falls as repetitions grow, and 96% of choices go to the most frequent action in the history. For 27B, entropy rises, only 14% of choices go to that action, and most go to the highest-reward arm tried so far. The authors link the small model's habit to the copycat biasan imitation-trained policy's tendency to repeat its own previous action, because in recorded data the last action predicts the next one well (Wen et al., 2020). Reading note: xLSTM for fast inference of behavior cloning, reading it as an artifact of supervised pretraining.
The 27B model computes the right action and does not take it. Prompted to calculate UCB's counts, means, and bonuses before acting, it gives its highest computed value to the true UCB-optimal arm in 90.3% of steps. Yet 58.1% of all steps pair a correct calculation with the greedy action (the tried arm with the highest UCB value, when that is not optimal). Only 21.6% pair a correct calculation with the optimal arm. Among steps where its math is right, the model still acts greedily about 64% of the time and follows UCB in 24% (computed here), a knowing-doing gapthe gap between what a model can state or compute about a task and what it actually does when acting.
RL on the model's own reasoning makes it explore more and copy less. RL fine-tuning (RLFTreinforcement learning fine-tuning, the paper's name for RL on the model's own reasoning and actions with rewards from the environment: PPO's clipped objective with a KL penalty to the starting model, and a penalty of when no valid action can be read from the output) runs for 30k updates over a pool of 512 bandits and lowers cumulative regret for 2B and 9B on 5, 10, and 20 arms. Coverage finishes 12% higher on 10 arms and 13% higher on 20. At 0 to 10 repetitions, choices of the most frequent action drop from 70% to 35%, though it still dominates at high repetition. On contextual bandits built from MovieLens, where the prompted model performs near random, the RL-tuned 2B model approaches LinUCB.
Of seven exploration mechanisms compared on 10-arm bandits, with and without RLFT, trying every arm once at the start gives the largest improvement. The other six are epsilon-greedy, shuffling action labels, a summary of counts and mean rewards, a self-correction pass, a majority vote over samples, and a +1 reward for each untried arm during RLFT. With try-all, the 27B model nearly matches UCB, showing that it chooses well once every arm has an estimate. For 2B and 27B, the summary leaves regret well above try-all, though at 9B it gives the lowest regret of the mechanisms tested. Self-correction gives the highest regret at every size (both read approximately from Figure 8; the text discusses neither).
RLFT lowers regret under each of these mechanisms. Adding the +1 exploration bonus rewards trying a new arm immediately instead of relying only on delayed returns over a 50-step episode. That bonus lifts coverage from 50% to 70% and lowers regret further. Supervised fine-tuning on 32k UCB rollouts also reaches UCB's regret over these 50-step episodes.
Consequences and limits. Language models choose well once every arm has an estimate, while summarizing the history in the prompt helps only unevenly. A summary produced GPT-4's single working prompt and lifted Gemini 1.5 Pro. Among Schmied et al.'s Gemma2 models, however, it gave the lowest regret only at 9B and left 2B and 27B well behind try-all. Even when the prompt supplies UCB's terms, leaving only an addition and a maximum, Pro still wins far less often than UCB. The safer engineering choice keeps the decision rule itself in code.
Krishnamurthy et al. measure both failure statistics on every configuration they run, and Schmied et al. observe the same early commitment in another model family under a different metric. Krishnamurthy et al. use few replicates (10 for most GPT-4 setups), horizons of at most 500 rounds, and mid-2023 models, and their results depend sensitively on interacting prompt changes. Nie et al.'s win rates depend on the pool of compared methods. Schmied et al. test one model family up to 27B, run RL only at 2B and 9B, and use three seeds per result. Their 50-step episodes are too short for 20 arms, where UCB is still exploring and some models fall below its regret. Arm labels also matter. Numbering arms instead of using colors lifts 27B's coverage to nearly 90% on 10 arms.
Terms
- Suffix failure
- best arm never pulled from some round on; Greedy's failure, and most prompted configurations'
- Uniform-like failure
- pulls stay nearly even to the end; high
- Regret from suffix failures
- on these instances
- Summary versus raw history
- GPT-4's one success needs per-arm counts and averages in the prompt; suffix failures at T = 200: 3% with the summary, 12% with the raw list
- Easy instances
- greedy play does well, so they cannot show exploration
- UCB terms in the prompt
- UCB's average and bonus per arm in the prompt; the model only adds and maximizes
- OFT
- fine-tuning on UCB's next arm; Flash 65.6% against Pro's best 60.0% and UCB's 90.6%
- Copying the frequent action
- choosing the action that fills the context; 96% of choices for 2B, 14% for 27B
- Knowing-doing gap
- 27B computes UCB's choice correctly in 90.3% of steps but acts greedily in about 64% of those
- RLFT and try-all
- RL on the bandit's rewards: coverage +12%, frequent-action choices 70% to 35%; pulling every arm once gives the largest gain; +1 per untried arm: coverage 50% to 70%
Sources
- Akshay Krishnamurthy, Keegan Harris, Dylan J. Foster, Cyril Zhang, and Aleksandrs Slivkins. Can Large Language Models Explore In-Context? NeurIPS, 2024.
- Allen Nie, Yi Su, Bo Chang, Jonathan N. Lee, Ed H. Chi, Quoc V. Le, and Minmin Chen. EVOLvE: Evaluating and Optimizing LLMs For In-Context Exploration. ICML, 2025.
- Thomas Schmied, Jörg Bornschein, Jordi Grau-Moya, Markus Wulfmeier, and Razvan Pascanu. LLMs are Greedy Agents: Effects of RL Fine-tuning on Decision-Making Abilities. ICLR, 2026.
- Lihong Li, Wei Chu, John Langford, and Robert E. Schapire. A Contextual-Bandit Approach to Personalized News Article Recommendation. WWW, 2010.
- Chuan Wen, Jierui Lin, Trevor Darrell, Dinesh Jayaraman, and Yang Gao. Fighting Copycat Agents in Behavioral Cloning from Observation Histories. NeurIPS, 2020.
Connected notes
- Reward model overoptimizationLearning from human preferences · Feedback between a model and its data
Optimizing against a learned reward raises gold score up to a KL that moves out smoothly with the log of the reward model's size and then lowers it, so early stopping or a KL target has a real effect on the gold score.
- Stein's paradox and the James-Stein estimatorBenign overfitting · Comparing noisy runs is an estimation problem
With effects spread around a common mean, the posterior mean pulls each raw estimate toward that mean, and Lindley's version of James-Stein estimates both the mean and the amount of pulling from the spread of the estimates themselves. It beats the raw estimates in total squared error for every configuration of the once there are four or more, and in Efron's batting example it cuts the total prediction error to 0.28 of that of the raw batting averages.
- PPO and RLOO for language modelsReinforcement learning for reasoning · Feedback between a model and its data
Labelers were told to penalize inaccuracy but not copying, so summarization policies learned to copy whole sentences, and collecting labels on the current policy's samples during training mattered for summarization, where labelers preferred the online model 64% and 65% of the time.
- Learned KV-cache evictionEfficient sequence models · Comparing noisy runs is an estimation problem
By the note's rough estimate the difference between two average pass@1 scores, over about 120 problems with 16 samples each, has a standard deviation of at most about 0.016 before any training-seed variation, so gaps of 0.01 to 0.02 between eviction methods are not resolved.