| Bandits | |
|---|---|
| number of arms; the set of arms | |
| an arm's mean reward; reward standard deviation | |
| horizon; step | |
| arm chosen at step t | |
| times arm was chosen up to step | |
| action coverage: fraction of arms tried | |
| most frequent action in the history; highest-reward action tried | |
| Agent and fine-tuning | |
| context given to the model; text it generates (reasoning and action) | |
| token budget per step | |
| policy being trained; policy that sampled the data; starting model | |
| probability ratio of new to sampling policy; advantage | |
| clipping range; KL weight | |
| Constants | |
| horizon of every bandit episode | |
| default token budget (2048 in Step 3) | |
| RLFT's clipping range and KL weight | |
| penalty for no valid action; exploration bonus per untried arm (Step 5) | |
Context. Language models are being used as agents on the hypothesis that their knowledge and step-by-step reasoning let them act well after little interaction. On the simplest test of acting under uncertainty, the multi-armed bandita repeated choice among options (arms), each giving a random reward from its own unknown distribution; the agent must try arms to learn which is best while collecting reward, they explore too little, and in games they can often describe the right move without making it, a failure called the knowing-doing gapthe gap between what a model can state or compute about a task and what it actually does when acting. Schmied et al. take Gemma2 models at 2B, 9B and 27B, measure why they fall short on text bandits, and then fine-tune the 2B and 9B models with RL on their own chain of thoughtreasoning text the model writes before its answer and the environment's rewards, on bandits and (2B only) Tic-tac-toe. Their finding is that pretrained models choose actions from the statistics of their context, the small one repeating the most frequent action and the larger ones committing early to the best action seen, and that RL on environment rewards makes them explore more but not as well as a bandit algorithm, so information and exploration still have to be supplied or rewarded. It carries the in-context-learning question, what a model learns from its context, over to choosing actions.
Exploration is the missing part. With reasoning, the models try 40 to 65% of 10 arms in 50 steps and stop trying new ones after about 10 steps; without it they try a quarter. The 2B model mostly repeats whatever action fills its context, and the 27B model, which does not, computes the textbook exploration rule, UCB (a bonus that shrinks with each pull), correctly in 87% of steps and still acts greedily in most of them. RL fine-tuning lowers regretcumulative regret: the expected reward lost against always pulling the best arm, summed over steps, widens the set of arms tried and halves the copying of the most frequent action when it has been repeated only a few times, and the largest further gains come from giving the model information (trying every arm once) or rewarding exploration directly (+1 for each new arm).
Setting. The bandits come from BanditBencha suite of bandit tasks posed in text to language models, from Nie et al.: arms described as colored buttons (or as numbers), Gaussian rewards with means an arm's mean reward, drawn uniformly from for each bandit and noise the reward standard deviation: 0.1, 1 or 3 (low, medium or high noise), and a horizon of the number of steps per episode, 50 steps. At step the model reads instructions and the recent history as lines such as "Step=3 Action=red Reward=0.5", writes up to the token budget per step for reasoning plus the action, 256 by default tokens of reasoning followed by an action, and the action the arm chosen at step : the last match of the pattern ACTION=X in the generated text, or a random arm if none is found is executed. With the set of arms and the number of times arm was chosen up to step , exploration is measured by action coverage, the fraction of arms tried at least once by step and performance by cumulative regret. The references are UCBupper confidence bound: pull each arm once, then always the arm with the highest mean reward plus a bonus that shrinks as the arm is pulled more, which the paper treats as the upper bound on performance, and a uniformly random agent as the lower bound. RLFTreinforcement learning fine-tuning, the paper's name for RL on the model's own reasoning and actions with rewards from the environment trains the policy the language model as a policy: given the context, a distribution over generated text on its own reasoning and actions with PPOproximal policy optimization: policy-gradient RL that clips each update so the policy moves only a little's clipped objective and a KL penalty to the starting model the instruction-tuned Gemma2 model before fine-tuning: where the ratio of the new to the sampling policy's probability of the generated text given the context is the probability ratio, rewards-to-go minus a Monte Carlo baseline for bandits; from a learned value head with generalized advantage estimation for Tic-tac-toe the advantage, the clipping range and the KL weight . The reward adds a penalty of when no valid action can be extracted. Training runs 30k updates over a pool of 512 bandits, 16 per rollout.
Main findings (all empirical). On 10-arm button bandits the 2B model covers 40% of arms and the 9B and 27B models 65%, all three about 25% without reasoning, and on 20 arms no model passes 45%. In histories where one action is repeated, the 2B model picks the most frequent action 96% of the time and the 27B model 14%. Asked to compute UCB's values first, the 27B model gets UCB's choice right in about 87% of steps, but in steps with a correct computation it takes the greedy action 64% of the time (the paper's introduction) and UCB's action 24% (my computation from its confusion matrix, 21.6/90.3). RLFT on 2B lowers regret for 5, 10 and 20 arms at every noise level, raises action coverage by 12%, and cuts frequent-action choices from 70% to 35% at low repetition. An exploration bonus during RLFT raises coverage from 50% to 70%. In Tic-tac-toe, RLFT lifts the 2B model's average return against a random opponent from 0.15 to 0.75 and against MCTSMonte Carlo tree search, a game-playing search algorithm, here the strongest opponent from −0.95 to about 0. Fine-tuning on UCB's own trajectories comes close to UCB's regret.
Consequences and limits. An LLM agent that must gather information does better when it already has an observation of every action (trying each arm once) or is told which moves are legal, when it can reason with enough tokens, and, during RL fine-tuning, when exploration is rewarded directly; demonstrations from an expert, where they exist, work better than RL from the model's own attempts. RL on the model's own reasoning narrows the gap between what it computes and what it does, but it does not turn the model into a bandit algorithm. The study is small: one model family up to 27B, RL only at 2B and 9B, horizons of 50 steps (too short for 20 arms), toy environments, the knowing-doing measurement only for the 27B model, and three seeds per result.
The models stop trying new arms early. Over 64 bandits with 10 or 20 arms, coverage climbs for about 10 steps and then stalls, at 40% (2B) and 65% (9B, 27B) of 10 arms with reasoning and 25% without, and at most 45% of 20 arms. Regret stays well above UCB's while beating a random agent. The models put very high probability on an action as soon as it has returned a reward and keep choosing it, so an untried arm, possibly the best one, is never sampled. With arms labeled by numbers in place of colors the 27B model covers almost 90% of 10 arms and 60% of 20, so the labels matter, though the same trends hold.
The small model copies the most frequent action in its context. Starting from random-policy histories of 2 to 10 steps, the last action is repeated 0 to 100 times and the model's probabilities over all actions are read off. Each choice is classed as frequent (the most-chosen action the frequent action: the action chosen most often in the history), greedy (the highest-reward action tried so far, the greedy action: the action with the highest observed reward among those tried; when it coincides with the frequent action the choice counts as greedy) or other. For 2B the entropy of the action distribution falls as repetitions grow (correlation −0.67), and 96% of choices go to the frequent action; here that action is never also the best one seen, because an action that is both is counted as greedy. For 27B the entropy rises with repetitions (correlation 0.61), only 14% of choices are frequent, and most are greedy. The authors relate this to the copycat bias of behavior cloningtraining a policy by supervised learning to imitate recorded actions and read it as an artifact of supervised pretraining, which motivates RL.
The larger model computes the right action and does not take it. The 27B model is told to compute UCB's counts, means and bonuses inside tags, with 2048 tokens per step, and then act. Over 64 bandits and 50 steps, a rationale counts as correct when its highest computed UCB value is on the arm with the highest true UCB value, and the action is classed as optimal (that arm), greedy (the best arm by UCB value among those already tried, when that is not the optimal arm) or other. Correct rationales followed by a greedy action make up 58.1% of steps, followed by the optimal action 21.6% and by some other action 10.6%; incorrect rationales make up the remaining 9.8%. So the model can carry out the rule, and in most steps it does not follow it.
RL on its own reasoning makes the small model explore more and copy less. RLFT lowers cumulative regret for 2B and 9B on 5, 10 and 20 arms at medium noise, with similar results for 2B at low and high noise, and narrows the gap between 2B and its larger counterparts. Coverage on 10 arms first dips after 10k updates and then ends 12% higher at 30k, with a similar 13% on 20 arms. At 0 to 10 repetitions of an action, frequent-action choices fall from 70% to 35% and other choices rise from 8% to 35%, while at high repetition the frequent action still dominates. On contextual banditsbandits in which each step shows a context, here a user description, and the best arm depends on it built from MovieLensa public dataset of users' movie ratings, where the prompted model does about as well as random, the fine-tuned 2B model comes close to LinUCBthe UCB rule for contextual bandits whose expected rewards are linear in the context features.
Trying every arm or rewarding exploration works better than other exploration tricks. On 10-arm bandits seven mechanisms are compared with and without RLFT: trying every arm once at the start (with a templated rationale), epsilon-greedychoosing a random action with a fixed probability and the best-looking action otherwise with a 10% random-action rate, shuffling the action labels in the context, a summary of counts and mean rewards, a self-correction pass, a majority vote over 16 samples, and a +1 reward for each untried arm during RLFT. Trying every arm gives the largest improvement at every size, and with it the 27B model nearly matches UCB, so once the model has an estimate for every arm it chooses well. Handing it a summary of counts and mean rewards does not do the same: that mechanism has the highest regret of the seven at every size (approximate, read from Figure 8; the text does not discuss it). RLFT lowers regret under each mechanism, and the exploration bonus raises coverage from 50% to 70% and lowers regret further, so the behavior RL produces follows the reward it is given.
Tic-tac-toe, reasoning and expert data show the same pattern. In Tic-tac-toe, a game whose state changes with each move, RLFT raises the 2B model's average return (win 1, draw 0, loss −1) against a random opponent from 0.15 to 0.75, and against MCTS, called optimal in the paper, from −0.95 to 0.0, drawing against it; without the list of legal moves in the context the return against random reaches only 0.45. RLFT without reasoning barely reaches the prompted model with reasoning, which the authors read as the chain of thought acting as an exploration mechanism. Fine-tuning on 32k UCB rollouts (1.6M transitions), with or without UCB's computations written out, reaches UCB's regret. More thinking tokens during RLFT help: 16 or 64 per step do poorly and 512 brings 2B to the level of 9B with RLFT, at a cost in rollout time (the paper's example: 500 tokens over 50 steps is up to 25k generated tokens per episode).
Terms
- Greediness
- committing to the best arm seen so far; coverage stalls after about 10 steps at 40 to 65% of 10 arms
- Frequency bias
- choosing the action that fills the context; 96% of choices for 2B, 14% for 27B
- Knowing-doing gap
- 27B computes UCB correctly in 87% of steps but acts greedily in 64% of those
- Action coverage
- fraction of arms tried at least once by step t
- RLFT
- PPO with a KL penalty on the model's own reasoning and actions, rewarded by the environment, with a -5 penalty for invalid actions
- Try-all
- pull every arm once at the start; largest gain, 27B nearly matches UCB
- Exploration bonus
- +1 for an untried arm during RLFT; coverage 50% to 70%
- Effect of RLFT
- lower regret, coverage +12%, frequent-action choices 70% to 35% at low repetition; still below UCB
- Chain of thought
- without it RLFT barely matches prompting with it; 512 thinking tokens bring 2B to 9B's level
- Expert data
- fine-tuning on 32k UCB rollouts reaches UCB's regret
Quiz
- Why does a +1 reward for each untried arm during RLFT raise coverage from 50% to 70%?Under a 50-step horizon the value of exploring shows up only indirectly in later rewards, so plain RLFT reinforces it weakly. A direct bonus makes exploratory actions immediately advantageous, so the policy learns more of them.
- For bandits, RLFT estimates advantages from rewards-to-go with a Monte Carlo baseline. Why not sample several actions at each step and compare them, as GRPO-style methods compare several answers?The authors note that producing multiple rollouts from the same state needs environment resets and is impractical for multi-step decision tasks, so they use standard Monte Carlo baselines (and a value head for Tic-tac-toe).
- What happens when RLFT is run without chain-of-thought reasoning on 10-arm bandits?Without reasoning RLFT barely attains the in-context performance of the model that reasons, and with more thinking tokens (512) the 2B model reaches 9B's level, so the rationale is where exploration and its justification happen.
Sources
- 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.