Background: LLMs Are Softmax Policies

An LLM is a softmax policy over its vocabulary. The state is the prompt plus every token generated so far, and the action is the next token.

Here is the output logit of action given state , with and . Two facts I kept using:

  • Only differences between logits matter. Adding the same constant to every logit leaves unchanged.
  • , which makes the softmax derivative simple:

Where the logits come from

A transformer layer is attention plus an MLP, each wrapped in RMSNorm and a residual connection:

Attention mixes information across positions; the MLP transforms each position on its own. After the last layer and a final RMSNorm, the LM head turns the hidden state into logits:

  • has one row per token, shape vocab_size × hidden_size. It starts random and is learned during pretraining.
  • is the final hidden state at a position. All the context lives here; is the same at every position.

The input embedding encodes (token IDs → vectors) and the LM head decodes (final hidden state → one logit per vocabulary token). In full-parameter RL, which is what this paper does, the LM head is still trainable; under LoRA it is usually frozen. Either way its structure comes from pretraining, and RL's small learning rate adjusts it rather than reorganizing it.

Tabular vs. LLM softmax

The theory in the paper assumes a tabular softmax policy, where every state-action pair has its own parameter:

An LLM is not tabular. Its logits come from shared weights, , so one gradient step moves logits at many states at once. This matters later: Lemma 1 only needs a softmax, so it holds for LLMs as long as we plug in the actual logit change. Proposition 1 and Theorems 1-2 compute that logit change assuming tabularity, so for LLMs they are approximations.

The Predictable Collapse of Entropy

Without entropy or KL regularization, entropy drops sharply at the start of RL and keeps falling toward zero, while validation accuracy rises and then plateaus. Across 11 runs, 73% of the entropy drop and 76% of the performance gain happen in the first 200 of 2,400 steps.

Accuracy and entropy fit

so the ceiling at is . (The takeaway box in Section 2 writes ; Eq. 6 is the correct form.) Fitting on only the first 36 steps predicts the next 200 with an RMSE of about 0.9% on math and 1.2% on code. The coefficients look independent of the algorithm (GRPO, RLOO, PRIME and REINFORCE++ collapse onto one curve) and scale log-linearly with model size within Qwen2.5.

One caveat: entropy and accuracy are both smooth, monotone functions of the training step, so a smooth monotone fit between them is partly expected. The early-prediction result is the more convincing part.

Entropy as Average Surprise

  • is the log-likelihood of token .
  • is the surprise of token .
  • Entropy is the average surprise, weighted by . Surprise belongs to one token; entropy belongs to the whole distribution at a position.

The log comes from additivity. Surprise should add for independent events, , and is the only continuous function that does this while being zero at and decreasing in . The same property lets sequence entropy split into per-token terms, which is why averaging token-level entropy makes sense.

Example with :

is the effective number of choices: 1 nat is roughly 3 live options per token, 0.1 nat is roughly one.

Lemma 1: Entropy Change Is a Covariance

  • is the log-prob before the update.
  • is how much the logit moved.

The covariance is taken over the tokens at one state, weighted by . It asks: are the tokens that are already likely the ones whose logits go up?

Derivation

I wanted every step. Work at one state and write .

Step 1: first-order Taylor expansion. Entropy is a function of all the logits, so

and with ,

Step 2: derivative of softmax (quotient rule). With and :

Both cases together:

Step 3: derivative of entropy with respect to one probability (product rule).

Step 4: chain rule. Changing changes every , so sum over :

Step 5: split the sum. The indicator keeps only in the first part, and factors out of the second:

where . The 's cancel because .

Step 6: plug into Step 1.

Step 7: recognize the covariance. With and ,

since : the -weighted deviations from the -weighted mean cancel. So centering is optional, and

Nobody negates anything by choice; the minus falls out of Step 5. Likely tokens have a negative entropy gradient, so boosting them lowers entropy.

Numeric check. and . The centered log-probs are , so

The exact change is , or .

Reading the covariance

Covariance measures whether two quantities move together:

  • : above-average goes with above-average , or below with below.
  • : they move in opposite directions.
  • : no linear relationship.

So a positive covariance of means entropy goes down, and a negative one means entropy goes up.

"High probability" means is above its -weighted average, i.e. : the token is less surprising than average. It does not mean , which never happens. The zero point doesn't matter anyway, since .

Logit goes upLogit goes down
High-probability token ()entropy ↓entropy ↑
Low-probability token ()entropy ↑entropy ↓

Only relative logit changes matter: gives zero covariance and no entropy change. And is a rate, not a level. A small positive covariance still means entropy keeps falling, just slowly.

Theorems 1 & 2: Plugging in the Update Rule

Lemma 1 says nothing about how the logits change. That comes from the training algorithm.

Advantage. is how much better action is than the policy's average from . It averages to zero under the policy, (Lemma 3 in the appendix). GRPO estimates it per response, and every token in the response shares it:

With 3 of 8 responses correct, correct responses get about and wrong ones about .

Vanilla policy gradient (Proposition 1). For a tabular softmax,

so (Theorem 1)

Natural policy gradient. NPG is steepest ascent where step size is measured by KL between policies instead of Euclidean distance in parameter space, with Fisher matrix . It is still policy gradient; the KL metric changes the direction, not just the length. For a tabular softmax the logit change is just , so (Theorem 2)

Both theorems give the same sign table:

High advantage ()Low advantage ()
High probabilityentropy ↓ (confident and right)entropy ↑ (confident and wrong)
Low probabilityentropy ↑ (unlikely but right)entropy ↓ (unlikely and wrong)

The difference is weighting. Under vanilla PG a rare token's logit moves by , so "unlikely but right" is damped by its small probability. Under NPG every logit moves by .

The paper's argument for why the covariance is positive in practice: a pretrained model is reasonably calibrated, so its confident outputs tend to be correct. Probability and advantage line up, and RL keeps sharpening.

Empirical Verification (Section 3.3)

The theory predicts

They run on-policy GRPO without the PPO surrogate on Qwen2.5-7B, treating each response as one action with a length-normalized log-prob. In Figure 8 (left), the covariance and the entropy decrease share a shape: large and positive early, then smaller but still positive, which explains why entropy only falls. In Figure 8 (right), easy prompts have higher covariance than hard ones.

This supports the direction of the effect, but it is not a quantitative check. The curves are on separate axes, the constant can't literally be , and the covariance is sequence-level while entropy is token-level.

Why Standard Entropy Control Fails (Section 4.1)

Normally in RL we encourage exploration with an entropy bonus, or penalize KL divergence from a reference model. Neither works well here.

Entropy bonus. entropy_coef is in

This is a loss (lower is better), so subtracting rewards entropy. In Figure 9, 0.0001 and 0.001 barely change entropy, 0.01 makes it explode past 5, and 0.005 stabilizes it without beating the baseline. Adding entropy loss does not boost performance. The bonus flattens every token, including the many positions where the model should be certain.

Reference KL. kl_coef is in

In Figure 10, a larger keeps entropy stable but degrades performance. This felt counter-intuitive until I split the KL:

It contains an entropy bonus, but also a pull toward the reference model's favorite tokens. The KL-regularized optimum is

so a larger holds the whole policy near the base model, which is exactly what RL is trying to move away from. The reference KL is mainly useful in RLHF, where a learned reward model can be hacked. With a verifiable reward there is little to protect against, so it mostly costs performance.

Clip-Cov

Section 4 restricts the update of high-covariance tokens instead of regularizing every token. Each token gets a centered cross-product (Eq. 10):

This is each token's term in Theorem 2's covariance. is the number of tokens scored together; in the verl implementation that is the set of response tokens passed to one loss call (a micro-batch), not the full rollout batch.

The distribution is extremely heavy-tailed (Table 1, Qwen2.5-7B, step 1):

TokensMean covariance
Top 0.02%5.654
Top 0.2%3.112
Top 2%1.385
All0.003

The top 0.2% alone contribute about twice the whole batch's covariance, so the other 99.8% are net negative. A handful of tokens drive the collapse.

Clip-Cov clips a small fraction of high-covariance tokens out of the policy gradient update:

This is a random subset of the outliers, of size , where is the clip ratio. The paper uses , and . A new subset is drawn each update, and tokens scoring above 5 are never touched.

Two notes to self:

  • This is an objective to maximize (ratio × advantage, like PPO's ), even though Section 4.1 uses for a loss. The code minimizes . If you minimized Eq. 12 as written, a positive advantage would push below .
  • Setting a term to 0 just means the token contributes no gradient: Clip-Cov skips the gradient for these tokens. Their probabilities can still move through shared parameters. The implementation also keeps PPO's ratio clipping for everything else.

Written with a consistent sign convention, and with the PPO clipping the code keeps:

with importance ratio .

KL-Cov

Rank the tokens by covariance and take the top fraction:

sorts tokens by score, highest first. is the proportion of tokens subjected to the KL penalty, with : for 7B and for 32B. Unlike Clip-Cov, there is no upper bound and no randomness.

with .

  • Notation: is the -th response token and is everything before it (the prompt is conditioned on too, just dropped). So is one number: the probability of the sampled token given its prefix.
  • That also means the KL as written compares two numbers, which isn't defined. The intended KL is over the full distributions , and the code uses a single-sample stand-in, .
  • The anchor is the rollout policy , not the initial model, so this only slows each round of updates. With , the absolute-value penalty acts like a dead zone: selected tokens with are held in place, and larger ones move more slowly.
  • In the pseudo-code, KL-Cov replaces PPO's ratio clipping rather than adding to it.

Both selections in a few lines (simplified from Listing 1; log_prob and adv are 1-D tensors over the response tokens, padding ignored):

cov = (log_prob - log_prob.mean()) * (adv - adv.mean())   # Eq. 10
n = int(ratio * cov.numel())

# Clip-Cov: a random subset of tokens with lb < cov < ub gets no gradient
cand = torch.nonzero((cov > lb) & (cov < ub)).squeeze(-1)
clip_idx = cand[torch.randperm(cand.numel())[:n]]

# KL-Cov: the top-n tokens by cov get a penalty toward the rollout policy
kl_idx = torch.topk(cov, n).indices

Both work as entropy dials (Figure 12): clipping more tokens or raising gives higher entropy, and KL-Cov gives smoother curves.

Results

Qwen2.5-7B and 32B, trained on DAPO-MATH (256 prompts × 8 responses, 8 policy updates per rollout batch) and evaluated on 7 math benchmarks. Averages from Table 2:

ModelGRPOClip-higherClip-CovKL-Cov
Qwen2.5-7B38.638.840.440.6
Qwen2.5-32B45.847.250.352.2

KL-Cov has a slight edge, mostly on 32B, and gives smoother entropy curves. It was also tuned per model size ( differs) while Clip-Cov wasn't, and each configuration is a single run.

The headline 15.0% and 14.6% are KL-Cov vs. GRPO on AIME24 and AIME25 for the 32B model:

GRPOKL-CovGainOut of 30 problems
AIME2421.836.8+15.0 points≈ 4.5 more
AIME2516.230.8+14.6 points≈ 4.4 more

These are percentage points (avg@32), not relative gains. Against Clip-higher the AIME24 edge is only about 0.4 problems. On easier benchmarks the gain is minimal: MATH-500 goes from 84.2 to 84.6 for KL-Cov on 32B (about 2 of 500 problems), while Clip-higher drops to 77.2 on the same benchmark, a reminder of how noisy single runs are.

Takeaways and Open Questions

  • Entropy looks like a symptom, not a target. The entropy bonus raised entropy with no gain, and the authors report no relationship between the entropy level their methods maintain and final performance (Section 4.5).
  • The selected tokens are probably low-probability ones. Since , a confident token can sit at most about above the average log-prob, while a rare token can sit several nats below. With GRPO advantages capped near , confident tokens top out around , roughly 1 or less, so scores of 3 to 5 have to come from rare tokens in wrong responses (the "unlikely and wrong" cell). The paper doesn't report what the selected tokens look like, so this is arithmetic, not measurement.
  • Missing controls. Restraining the same number of random tokens, or tuning the entropy bonus to match KL-Cov's entropy, would show whether selecting by covariance is what matters.
  • The theory is tabular. Lemma 1 holds for any softmax, but the logit changes in Theorems 1-2 assume independent logits, and the empirical check is qualitative.