← PolicyAttention overview

PolicyAttention · How it works

Softmax attention as policy improvement, and where it breaks

One softmax attention row computes the policy mirror descent step exactly. Around it we build a causal actor–environment–critic loop, bound the loss of the policy it returns, and test both the exact construction and learned Transformers against it.

Part 1 · The idea

1Why softmax, not linear attention?

Transformers can run learning algorithms in context. For reinforcement learning, the constructions that improve a policy, and not only evaluate it, have used linear attention: its unnormalized bilinear products can carry a semi-gradient or actor–critic update. Standard softmax attention behaves differently. Its outputs are positive, normalized mixtures, and the constructive results for it have stopped at policy evaluation (temporal-difference learning).

For one well-known control update that normalization is not an obstacle but the update itself. Negative-entropy policy mirror descent (PMD) reweights each action by the exponential of its value and renormalizes:

πk+1(a∣s)=πk(a∣s)eηkQk(s,a)∑bπk(b∣s)eηkQk(s,b)

State by state, that is exactly a softmax of the old log-probabilities plus the scaled values:

πk+1=softmax(logπk+ηkQk).
Earlier constructions and PolicyAttentionEarlier constructions improve a policy with linear attention or evaluate one with softmax attention. PolicyAttention uses one softmax row as the policy-improvement step, samples under the new policy, evaluates it with a softmax critic and bounds the loss of the policy it returns.Earlier constructionsLinear attentionimproves a policy through unnormalized momentsSoftmax attentionevaluates a policy (TD), no improvementPolicyAttentionActorone softmax row,scores log π + ηQEnvironmentfresh samples underthe new policyCriticsoftmax TDevaluationReturned policyloss bounded byactor + critic errorsnext round: the critic’s Q feeds the actor
Earlier constructions and PolicyAttentionEarlier constructions improve a policy with linear attention or evaluate one with softmax attention. PolicyAttention uses one softmax row as the policy-improvement step, samples under the new policy, evaluates it with a softmax critic and bounds the loss of the policy it returns.Earlier constructionsLinear attentionimproves viaunnormalized momentsSoftmax attentionevaluates (TD) onlyPolicyAttentionActorone softmax row, scores log π + ηQEnvironmentfresh samples under the new policyCriticsoftmax TD evaluationReturned policyloss bounded by actor + critic errors
Figure 1. Earlier constructions, and softmax as the improvement step. PolicyAttention keeps standard softmax attention and gives it the actor’s job: one row with scores logπ+ηQ. The environment and a softmax critic close the loop, and the actor’s and critic’s errors bound the loss of the policy the loop returns.

The identity is classical. What is new is treating it as the native actor of a causal Transformer and asking which control guarantees follow, and where they stop.

2Three calls, three errors

Each round runs in a fixed order: the actor must form a policy before the environment can sample under it, and the critic may only evaluate that policy after the samples exist. The order separates three kinds of error.

How should the policy change?

Actor · softmax routing error ζk

Memories carry each state–action pair’s logπ and Q; a query routes to its own state’s memories and the softmax takes the PMD step. With a finite margin κ, other states’ memories keep a small weight; ζk measures how far the row ends up from exact PMD.

What happens under the new policy?

Environment · sampling

The environment draws fresh transitions, with successor actions taken from the policy the actor just produced. The guarantee assumes a generative oracle: a fresh batch for every state–action pair, every round.

How good is the new policy?

Critic · TD error δk

The critic first looks up the next state’s value for each transition and forms a TD target, then averages the targets for each state–action pair. δk measures its distance from an exact one-step evaluation of the produced policy.

A greedy-defect recursion then carries ζk and δk through the rounds into a bound on ‖Q⋆−Qπ^T‖∞, the loss of the policy the loop finally returns (§13). The last critic call does not enter, because the returned policy is formed before it.

3Why a stronger step can backfire

A larger step η makes ideal PMD greedier, which helps. It also spreads the scores further apart, and a finite margin has to keep the other states’ memories down against that spread. In a two-state family where every quantity is exact, the competition reduces to one ratio, ρ=ηc/((1−γ)κ) for reward scale c: the implemented update improves the policy when ρ<1 and makes it worse when ρ>1.

Two-state family at margin 8Ideal PMD gain, the decoder without a mask and the decoder with a state-local mask, against the step size.−2−10120123η = 1.6step size ηvalue gain at s−, margin κ = 8ideal PMDdecoder, no maskdecoder, state-local mask
Figure 2. Try it. Two self-looping states with rewards (−c,0) and (c,0), a uniform prior and its exact Q, c=1, γ=0.8; the curve is the value gain at the worse state. Move the step size, change the margin, and switch on a state-local mask, which lets each query see only its own state’s memories. Shown at margin κ = 8. Exact computation for this family, not an illustration.

Within one state, the common level of the Q-values cancels out of PMD. Across states it does not: it shifts the two states’ softmax normalizers in opposite directions, by ηc/(1−γ) in total. So a larger step uses up the margin κ faster than it sharpens the intended row. The critic is exact throughout: the wrong action is chosen from a perfect value table.

4The decoder in one picture

The decoder’s two calls per roundThe actor call reads state-action memories carrying log pi, Q and the step size, then one query per state, and returns the new policy. The environment then draws fresh transitions under that policy. The critic call reads the current Q memories, the transitions and evaluation queries, and returns the next Q. One fixed decoder serves both calls.Actor callmemories (s, a, log π, Q, η), then one query per states1 a1s1 a2s1 a3s2 a1…q s1q s2…new policy π̂ₖ₊₁Environmentfresh transitions (s, a, r, s′, a′), with a′ drawn from π̂ₖ₊₁, after the actor callCritic callcurrent Q memories, then transitions, then evaluation queriesQ s1 a1Q …s a r s′ a′s a r s′ a′…qnext Q̂ₖ₊₁one decoder: 2 blocks, 2 heads,head width S+A+3, model width 6S+6A+14the same weights for both calls
The decoder’s two calls per roundThe actor call reads state-action memories carrying log pi, Q and the step size, then one query per state, and returns the new policy. The environment then draws fresh transitions under that policy. The critic call reads the current Q memories, the transitions and evaluation queries, and returns the next Q. One fixed decoder serves both calls.Actor callmemories (s, a, log π, Q, η), then queriess1 a1s1 a2…q s1…new policy π̂ₖ₊₁Environmenttransitions (s, a, r, s′, a′), a′ from π̂ₖ₊₁Critic callQ memories, transitions, queriesQ …s a r s′ a′…qnext Q̂ₖ₊₁2 blocks, 2 heads, same weights for both calls
Figure 3. Two calls per round. One fixed decoder reads an actor packet, then, after the environment has sampled under the new policy, a critic packet. Causal masking means no critic token can see a transition before the policy that generated it exists.
  • Small and fixed. 2 blocks, 2 heads, head width S+A+3 and model width 6S+6A+14, with a gated ReLU feed-forward map of 8 active units. The same weights serve both calls; the step size ηk arrives as token content.
  • Normalization-free. No layer normalization: the value channels must keep controlled amplitudes while the key channels carry score-dependent routing, and normalizing tokens would change both at once.
  • Declared before freezing. Step-size caps, packet sizes and coverage floors are fixed before the margins are chosen and the weights frozen; the bound holds for that declared horizon.

5Where it runs

The two NeurIPS 2026 workshop papers split the work: one builds the loop and its guarantee and checks a learned Transformer against it; the other maps where the loop fails. Two ICAIF 2026 workshop papers take the update rule into synthetic finance settings.

PTA Workshop, NeurIPS 2026 tested

Construction, guarantee, learned realization

The causal loop, the returned-policy bound, a learned pre-LN Transformer, repeated control by trained actors, and the decoder with the coverage oracle relaxed. OpenReview

EvoRobust Workshop, NeurIPS 2026 tested

Failure modes and robustness

The exact reversal boundary, the state-local mask, a learned stress screen and a matched audit of the values the learned actor actually produces. OpenReview

ICAIF 2026 workshops

Synthetic allocation and market making

Whether trained attention controllers obey the update they are said to implement, and which learned part limits an in-context market maker. Market-making pages

Part 2 · The evidence

Tested so far NeurIPS 2026 workshops

  • The exact decoder on the two-state family: 1,803 grid cells, with and without a state-local mask
  • The same decoder with the coverage oracle relaxed, on 64 random MDPs
  • A learned pre-LN Transformer against PMD and four fixed rules on held-out MDPs
  • 5 separately trained actors in repeated control over 20 rounds, with an exact critic
  • A learned stress screen, a matched audit on a retrained checkpoint, and visible-versus-masked actors

Not yet tested Open

  • A learned critic run on ordinary trajectory data
  • Learned closed-loop rollouts with matched actor and critic errors
  • Hard-exploration MDPs

6How we test it

Every experiment uses small finite MDPs where the true values can be computed exactly, so each error is measured against the truth rather than estimated. Two kinds of evidence are kept apart.

  • The exact construction. The fully specified decoder, run as written. On the two-state family every number is a deterministic computation; in the coverage study the decoder runs on 64 fresh random MDPs with S=4, A=3, γ=0.8, η=0.8 and T=20 rounds, its protocol fixed in a file before the run.
  • Learned Transformers. Ordinary pre-LN Transformers trained on generated MDPs with disjoint train, validation and test splits, at the same S, A and γ. The actor gets no PMD probabilities as labels: it is trained with a KL-proximal objective whose row-wise optimum is PMD, and the critic with Bellman (TD) targets. Learned models are compared with the construction through measured errors; they are not the construction.

Losses are reported as the normalized returned-policy loss ‖Q⋆−Qπ^T‖∞/‖Q⋆−Qπ0‖∞: 0 is optimal, 1 is no better than the starting policy.

7Results: the exact decoder

Take the two-state family at margin κ=8 and raise the step from 0.8 to 2.4. Ideal PMD gets better at every step. The implemented update, through the decoder’s own forward map, gets worse and then reverses.

Step η = 0.8

ρ = 0.5 · below the boundary

+0.916 of 0.950

Result. The implemented gain keeps most of the ideal gain; the actor’s row error is 0.014.

Step η = 1.6

ρ = 1 · on the boundary

0.000 of 1.660

Result. Exactly no improvement: the leaked mass cancels the PMD step. Row error 0.664.

Step η = 2.4

ρ = 1.5 · past the boundary

−2.009 of 2.084

Result. The largest ideal gain becomes the largest loss. Row error 1.637, out of a possible 2.

Value gain against step size in the matched two-state familyIdeal PMD gain rises with the step size. The implemented gain of the decoder without a mask falls below zero once eta passes (1 - gamma) kappa / c, marked by a dot. With a state-local mask the decoder equals ideal PMD at every step.−2−10120123η = 0.8Margin κ = 4−2−10120123η = 1.6Margin κ = 8−2−10120123η = 2.4Margin κ = 12value gain at s−step size ηideal PMDdecoder, no maskdecoder, state-local mask
Value gain against step size in the matched two-state familyIdeal PMD gain rises with the step size. The implemented gain of the decoder without a mask falls below zero once eta passes (1 - gamma) kappa / c, marked by a dot. With a state-local mask the decoder equals ideal PMD at every step.−2−10120123η = 0.8Margin κ = 4−2−10120123η = 1.6Margin κ = 8−2−10120123η = 2.4Margin κ = 12step size ηideal PMDdecoder, no maskdecoder, state-local mask
Figure 4. The reversal at three margins. Value gain at the worse state against the step size, c=1, γ=0.8, self-margin ν=20. Without a mask the gain turns negative at η=(1−γ)κ/c: 0.8, 1.6 and 2.4 (dots). With a state-local mask the decoder equals ideal PMD at every step.

Across the 1,803 cells of the grid (η from 0 to 3 in steps of 0.005, three margins), the unmasked decoder has 840 cells with negative gain and the masked decoder 0. In this family the actor’s row error also predicts the value lost, exactly: ΔVimplemented=ΔVPMD−c2(1−γ)ζ.

8Relaxing the coverage oracle

The guarantee assumes the critic receives fresh samples for every state–action pair after each actor call. An acting agent does not get that: it sees one trajectory. The theorem says nothing once the oracle is removed, so we ran its own decoder there. Every arm gets the same budget of 12m fresh transitions per round; only how they are spread differs.

Returned-policy loss when the coverage oracle is relaxedNormalized returned-policy loss on 64 random MDPs for each way of spending the same sample budget. The balanced oracle gives a median of 0.009; a single on-policy stream raises it to 0.029 at m = 6 and 0.016 at m = 24; carrying the old Q for unvisited pairs brings it back to the oracle level.Budget m = 6 samples per pair (per round, 72 in all)Balanced (oracle)0.009Uniform pairs0.010On-policy stream0.029On-policy, carry Q0.010Exploring stream0.012Exact backup0.010Budget m = 24Balanced (oracle)0.009On-policy stream0.016On-policy, carry Q0.010Exploring stream0.0090.0010.010.1normalized loss of the returned policy (log scale); dots: 64 MDPs; diamond and bar: median, 95% interval
Returned-policy loss when the coverage oracle is relaxedNormalized returned-policy loss on 64 random MDPs for each way of spending the same sample budget. The balanced oracle gives a median of 0.009; a single on-policy stream raises it to 0.029 at m = 6 and 0.016 at m = 24; carrying the old Q for unvisited pairs brings it back to the oracle level.Budget m = 6 samples per pair (per round, 72 in all)Balanced (oracle)Uniform pairsOn-policy streamOn-policy, carry QExploring streamExact backupBudget m = 24Balanced (oracle)On-policy streamOn-policy, carry QExploring stream0.0010.010.1returned-policy loss, log scale
Figure 5. Same budget, different coverage. Normalized returned-policy loss after 20 rounds on 64 MDPs, one dot per MDP. Balanced is the oracle, with m draws per pair; uniform pairs draws pairs at random; the on-policy stream is one continuing trajectory under the new policy; the exploring stream mixes in 20% uniform actions; carry Q keeps the old value for pairs that went unvisited. Only the balanced arm meets the theorem’s hypotheses.
  • One on-policy stream of the oracle’s size leaves 3.86 of 12 pairs unvisited per round on average, so the critic error rises from 0.214 to 1.219 at m=6, and the median loss from 0.009 to 0.029 (paired difference 0.018 [0.014, 0.022]). Four times the data brings it down only to 0.016.
  • Carrying the old Q forward for unvisited pairs brings the loss back to 0.010 although the critic error stays large, so the loss appears to come mainly from overwriting unvisited pairs with leaked outputs. That patch is not part of the decoder or the theorem.

9Results: learned Transformers

Does an ordinary Transformer, trained without PMD labels, learn the same map? On held-out MDPs a pre-LN actor’s output is closest to PMD by a wide margin among five fixed rules, and it responds to the step size it is given.

Closest rule

Held-out row-L1 error to PMD

0.0357

Result. The next-closest fixed rule is at 0.112. Mean KL to PMD 0.0022; fitted step 0.755–0.810 for a supplied 0.8.

Critic

TD error on held-out MDPs

0.121

Result. Mean absolute TD error of the Bellman-trained critic; the largest error seen is 0.676.

Repeated control

5 trained actors · 20 rounds

1.052×

Result. Median loss ratio to an exact PMD reference; every run within the registered 1.5× band, none stalled.

How close the learned actor is to PMDLeft: mean held-out row-L1 distance from the learned pre-LN actor to five fixed rules; PMD is closest at 0.0357. Right: the step size the actor effectively takes against the step it is given, for a supervised actor and for the actor trained without PMD labels.Held-out row error to each rulePMD: softmax(log π + ηQ)0.0357Additive projected rule0.112Prior policy (no update)0.239Boltzmann over Q0.606Reward-only rule0.607mean row-L1 to the rule’s output; lower is closerThe step the model takes0.40.40.80.81.21.2step size supplied, ηfitted stepno PMD labels (slope 0.743)supervised (slope 0.885)
How close the learned actor is to PMDLeft: mean held-out row-L1 distance from the learned pre-LN actor to five fixed rules; PMD is closest at 0.0357. Right: the step size the actor effectively takes against the step it is given, for a supervised actor and for the actor trained without PMD labels.Held-out row error to each rulePMD0.0357Additive projected rule0.112Prior policy (no update)0.239Boltzmann over Q0.606Reward-only rule0.607mean row-L1 to the rule’s output; lower is closerThe step the model takes0.40.40.80.81.21.2step size supplied, ηfitted stepno PMD labels (slope 0.743)supervised (slope 0.885)
Figure 6. One-step correspondence. Left: mean held-out row-L1 distance from the learned actor to each fixed rule (15 runs, 18 task cells). Right: the step size the actor effectively takes, refitted from its outputs, against the step it is given (15 seeds per value). Both actors move with η; slopes below one show shrinkage towards the middle of the training range.

One-step correspondence does not show that an actor stays useful when its own outputs become its next inputs. A later study with separately trained actors (5 fresh runs of 51,200 training steps, seeds 12100–12104) put them in a closed loop on 64 held-out MDPs, with an exact one-step critic, so that it tests the actor alone. The reference is exact PMD at each actor’s fitted step, with the same critic.

Repeated control by five learned actorsMedian normalized returned-policy loss over 64 held-out MDPs for 20 rounds, for each of 5 separately trained actors and the exact PMD reference with the same exact critic. At round 20 the ratio of learned to reference loss is between 0.918 and 1.396, median 1.052, against the registered band of 1.5.Median loss per round, five runs10.10.0115101520roundlearned actorexact PMD referenceRatio to the reference at round 20run 10.978run 21.396run 31.237run 40.918run 51.0520.51.01.5registered band ≤ 1.5median 1.052; 5 of 5 inside the band
Repeated control by five learned actorsMedian normalized returned-policy loss over 64 held-out MDPs for 20 rounds, for each of 5 separately trained actors and the exact PMD reference with the same exact critic. At round 20 the ratio of learned to reference loss is between 0.918 and 1.396, median 1.052, against the registered band of 1.5.Median loss per round, five runs10.10.0115101520roundlearned actorexact PMD referenceRatio to the reference at round 20run 10.978run 21.396run 31.237run 40.918run 51.0520.51.01.5registered band ≤ 1.5median 1.052; 5 of 5 inside the band
Figure 7. Repeated control. Left: median normalized loss per round for each learned actor (teal) and its exact PMD reference (dashed). Right: the ratio of the two at round 20, against the band registered before the runs. The band is a usefulness criterion, not a claim of superiority.

The same checkpoints, without retraining, kept all 5 run ratios below 1.5 on four declared environment families of the same shape (cross-run medians 0.927, 1.004, 1.014, 0.997). Replacing the exact critic by the learned one, given 6 fresh samples per pair under the returned policy, leaves a small resolved gap to the reference: median 0.000518 [0.000008, 0.002155].

10Stress test and matched audit

Are the learned errors uniformly small? A screen of a separately trained pre-LN checkpoint, 512 examples per condition from 8 generated MDPs, says no: on low-entropy inputs the mean row error to PMD is 0.059 but the largest is 1.977, close to the maximum possible of 2 (all conditions in §15).

Two follow-ups separate what that screen can and cannot say.

  • It is not the routing failure. This model’s actor packet for a state holds only that state’s memories, so the competing group of §3 does not exist and a state-local mask would change nothing.
  • Large row error is not value loss. On a retrained checkpoint we ran the actor on every state and solved exact values for the policy it returns and for ideal PMD on the same inputs. At low entropy 79 of 512 inputs have negative implemented gain (by 0.126 on average, 1.426 at most), while the input with the largest row error gains 1.775 more than PMD.
Row error and value loss on low-entropy inputsEach dot is one of 512 low-entropy inputs to a retrained learned actor: its largest row error to PMD against the difference between the value gain of the policy it returns and the gain of ideal PMD. Inputs whose implemented gain is negative are ochre. Large row error and value loss do not line up; the input with the largest row error gains more than PMD.−1.5−1−0.500.511.500.511.52largest row error, +1.775 over PMDimplemented minus ideal PMD value gainrow error to PMD (max over states, 0 to 2)implemented gain below zero (79 of 512)other inputs
Row error and value loss on low-entropy inputsEach dot is one of 512 low-entropy inputs to a retrained learned actor: its largest row error to PMD against the difference between the value gain of the policy it returns and the gain of ideal PMD. Inputs whose implemented gain is negative are ochre. Large row error and value loss do not line up; the input with the largest row error gains more than PMD.−10100.511.52largest row error, +1.775 over PMDimplemented minus ideal PMD value gainrow error to PMD (max over states, 0 to 2)implemented gain below zero (79 of 512)other inputs
Figure 8. Row error against value, low-entropy inputs. 512 inputs of the retrained actor. The rank correlation between the largest row error and the value shortfall is 0.12, and the 5% of inputs with the largest row error do better than PMD by 0.170 on average.

To see whether cross-state visibility opens the channel of §3 in learned models, we trained paired actors on a packet holding all 12 memories, with and without a state-local mask (same seed, data and initial weights; 3 seeds, 3,200 steps). Replacing only the other states’ memories, which leaves the PMD target unchanged, moved the visible actor’s row by 0.255 on average on IID inputs (0.320 at low entropy) and the masked actor’s by exactly 0. The masked actor was also closer to PMD: row error 0.022 against 0.084 on IID inputs.

11Limitations and what didn’t work

Scope

  • A generative oracle, not trajectories. The guarantee assumes fresh samples for every state–action pair after each actor call, with at least mmin,k per pair. Trajectory data do not provide this: pairs go unvisited, counts depend on the data, samples are Markov-dependent and successor actions go stale. Step sizes and packet caps are supplied from outside; the decoder does not choose its own schedule.
  • Normalization-free. The exact construction has no layer normalization, and nothing is proved for pre-LN, RMSNorm, post-LN or final-LN models. The learned pre-LN model is compared with the construction only through measured errors. The arXiv version also sketches a compilation into a layer-normalized model; its proof leaves constants unnamed and is not relied on here.
  • Small generated MDPs. All learned results use S=4, A=3, γ=0.8 and generated task families with held-out splits: generalization within the family, not across environments.
  • The reversal boundary is exact on one family only. It needs the uniform prior, self-loops, an exact critic and visible cross-state memories. At κ=8 a tilted prior moves the first negative step from about 1.6 to between 1.22 and 2.36, and a 5% cross-state transition moves it to 2.34. These are numerical sensitivities, not a law. The mask removes this mechanism only; it does not bound critic error, within-state error or learned-actor error, and it needs a state index that a general transcript may not expose.

What the evidence does not show

  • No learned critic on trajectory data, and no learned closed-loop rollout with matched errors. Repeated control uses an exact one-step critic; with the learned critic it still uses the balanced oracle.
  • The coverage study is one forgiving family. Its dense random transitions mix quickly: exact backup alone already gives loss 0.010, and the worst-case sampling bound at α=0.05 (8.74 at m=6, 4.37 at m=24) is far above the measured critic errors. Hard-exploration MDPs are untested, and the reading that loss comes from overwriting unvisited pairs is an interpretation.
  • Task loss does not identify the mechanism. A paired actor trained on rewards only had lower loss than the PMD-trained actor in repeated control (median difference −0.005963 [−0.009794, −0.003191]). The loss ratio of 1.052 is a registered usefulness band, and the paired difference to the reference, 0.000177 [−0.000137, 0.000748], establishes neither a disadvantage nor equivalence.
  • “No PMD labels” is not discovery. The actor sees no PMD probabilities, but its objective encodes the PMD variational principle. The evidence supports close correspondence, not exact recovery of PMD’s coefficients, and the effective step shrinks towards the middle of the training range (slope 0.743).
  • The cause of the low-entropy failures is unknown. Clipping the log-prior input to its training minimum changes little (13.7% of inputs still negative; chosen after looking at the worst row). Masking does not remove them either: 12.8% of the masked actor’s low-entropy inputs still lose value, against 22.7% visible. Learned results are diagnostics, not evidence of a general learned-model failure.
  • No benchmark or state-of-the-art claim. The arXiv version compares against adaptations of two published in-context methods under a common harness in which PolicyAttention receives exact model information the others do not; we do not present that as a benchmark result. Later experiments on sparse interaction budgets and on external benchmarks were mixed or exploratory and support no performance claim.

Implementation and reproducibility

  • Different checkpoints. The stress screen’s checkpoint was not kept. The matched audit retrained the same configuration and seed; two reruns agree with each other but not with the archive (low-entropy mean 0.0635, maximum 1.9885), so the screen and the audit come from different checkpoints. Repeated control also uses checkpoints other than those of §9’s one-step results.
  • Carried, not rerun. The held-out correspondence numbers (0.035741, TD MAE 0.121) and the effective-step sweep are carried from the accepted submission and cannot be replayed from the current repository. A much smaller error reported in an early phase is a deterministic identity check, not a held-out result.
  • Smaller than planned. The visible-versus-masked control was cut to 3 seeds at 3,200 steps for runtime. The critic in the stress screen was scored against targets sampled under ideal PMD rather than the returned policy; the matched audit corrects this for one critic call (0.154 against 0.155).
  • Protocol records. The coverage protocol was written to a file before the run but is not externally timestamped, and its bound check on realized residuals is an indexing check, since it reuses those residuals.

12Open questions

These come from the papers’ own scope sections and reviewers’ remaining concerns; none has been run.

  1. Learning without the oracle

    Run a learned critic on ordinary trajectory data, where pairs go unvisited and samples depend on each other, and measure what happens to the returned policy. The coverage study suggests where to look: how the critic treats pairs it has not seen.

  2. Closed-loop audits of learned models

    Measure a learned model’s actor and critic errors against the policy it actually executes, round after round, rather than on fixed inputs, so that the bound’s residuals are observed in the loop they describe.

  3. Routing failures in general models

    Find out whether reversals of the kind in §7 occur in learned Transformers that see other states’ memories. Visibility opens a sensitivity channel in the paired control, but that does not establish the reversal law in learned models.

Part 3 · Technical details

13Definitions and the bound

Take a finite discounted MDP with S states, A actions, 0<γ&lt;1 and |r|≤Rmax; write BQ=Rmax/(1−γ) and Fπ for the one-step Bellman operator under π. With pk+1=PMDηk(πk,Qk) the ideal update and π^k+1 the actor’s output, the two residuals are

ζk=maxs‖π^k+1(·∣s)−pk+1(·∣s)‖1,
δk=‖Qk+1−Fπ^k+1Qk‖∞.

For the greedy set Gk(s)=\argmaxaQk(s,a), let Dk(s)=−logπk(Gk(s)∣s), D¯k=maxs,aES′∣s,aDk(S′) and hk=D¯k/ηk+BQζk. Choose b0≥‖Q⋆−Q0‖∞ (for example 2BQ) and set bk+1=γbk+δk+γhk. Then, for a finite horizon T,

‖Q⋆−Qπ^T‖∞≤γ1−γ(2bT−1+hT−1)

There is no δT−1 term: the returned policy is formed before the backup that would produce QT. With state and role margins κ,ν, the actor’s routing error is bounded by

ζk≤2R¯k1+R¯k,

where

R¯k=(S−1)e−κ+2ηkBQ+Se−(κ+ν)+ηkBQ,

and, with leakage masses λ1,k,λ2,k and at least mmin,k fresh samples per pair, with probability at least 1−α over the horizon,

δk≤2BQ(γλ1,k+λ2,k)+ϵk,

with the sampling term

ϵk=BQ2log(2SAT/α)mmin,k.

A larger η lowers the D¯/η term but raises the routing bound through ηBQ: the trade-off that §7 makes exact.

14The two-state family

States s− and s+ loop on themselves, with action rewards (−c,0) and (c,0). From a uniform prior and its exact Qπ, the query at each state sees all four state–action memories with logits log12+ηQπ(s¯,a)+κ1{s¯=s} and one-hot action values, and itself with logit −ν and a uniform value. This row is exactly the actor call of the frozen decoder at S=A=2, up to a common score shift. At s−, ideal PMD picks the better action with probability σ(ηc), and the wrong-state group, which prefers the other action, has partition ratio

ZwrongZintended=exp(−κ+ηc1−γ),

so the sign of the implemented improvement ΔV(s−)=Vπ^(s−)−Vπ(s−) is set by the margin against the step:

sgnΔV(s−)=sgn[(1−γ)κ−ηc].

The query’s own uniform value lowers the gain but does not move the threshold. A state-local mask removes the wrong-state group (Zwrong=0): without the query token the row is exactly PMD; with it, p^−12=Zintended(p−12)/(Zintended+Zq)&gt;0 for every η>0.

15Full tables

Coverage relaxation in the normalization-free decoder
mArmUnvisited pairsMin. countCritic error δLoss LT [95%]Paired difference to balanced
6Balanced (oracle)0.006.000.2140.009 [0.007, 0.013]–
6Uniform pairs0.032.380.2590.010 [0.006, 0.013]−0.000 [−0.001, 0.000]
6On-policy stream3.860.201.2190.029 [0.026, 0.032]+0.018 [0.014, 0.022]
6On-policy stream, carry4.590.191.2840.010 [0.005, 0.012]−0.001
6Exploring stream1.450.370.8570.012 [0.010, 0.016]+0.001
24Balanced (oracle)0.0024.000.1060.009 [0.007, 0.013]–
24On-policy stream3.021.381.1340.016 [0.014, 0.018]+0.005
24On-policy stream, carry3.591.370.9380.010 [0.007, 0.013]−0.000
24Exploring stream0.083.340.2730.009 [0.007, 0.012]−0.000
–Exact backup (no samples)––0.0000.010 [0.007, 0.012]–

64 MDPs, S=4, A=3, γ=0.8, η=0.8, T=20, all margins 16. Unvisited pairs: mean per round, of 12. Critic error: mean per-round δk against the exact Fπ^k+1. Loss: median normalized returned-policy loss with a bootstrap interval over MDPs; the difference is the paired median against the balanced arm at the same budget.

Held-out actor correspondence
Comparison ruleMean row-L1
PMD: softmax(log π + ηQ)0.035741
Additive projected rule0.111635
Prior policy (no update)0.239124
Boltzmann over Q0.605904
Reward-only rule0.607055
Repeated-control loss ratios
Repeated control, round 20Loss ratio to reference
Run 1 (seed 12100)0.978413
Run 2 (seed 12101)1.396388
Run 3 (seed 12102)1.236607
Run 4 (seed 12103)0.918064
Run 5 (seed 12104)1.052287

Ratio of median normalized losses over 64 held-out MDPs, learned actor over the exact PMD reference at the actor’s fitted step, both with an exact one-step critic. Cross-run median 1.052; paired median difference 0.000177 [−0.000137, 0.000748] (95% hierarchical bootstrap).

Archived learned stress screen
Stress screen (archived)Actor row-L1, meanActor row-L1, maxCritic TD error, meanCritic TD error, max
IID reference0.02730.16760.13550.7845
Reward scale ×20.05121.26190.31991.9377
Bimodal rewards0.03950.53250.25321.2943
Sparse transitions0.02500.16710.16521.7184
Low policy entropy0.05901.97730.16232.3521
High policy entropy0.02440.05790.08750.4811

512 examples per condition from 8 generated MDPs, η=0.8. Maxima are over the evaluated sample, not population suprema; critic errors are against six-sample TD targets drawn under ideal PMD.

Matched audit on a retrained checkpoint
Matched audit (retrained)Row-L1, meanRow-L1, maxIdeal gainImplemented gainNegativeCritic error, meanCritic error, per-input max
IID reference0.0280.3440.7190.7090.0%0.1520.336
Reward scale ×20.0521.2711.6481.5930.0%0.3020.717
Low policy entropy0.0761.9920.1580.14415.4%0.1540.373
High policy entropy0.0220.0850.6720.6540.0%0.1030.251

512 inputs per condition. Gains are uniform-state means of V−Vπ under exact evaluation; ideal PMD gain is never negative. Critic error is against Fπ^Qπ, with packets drawn under the returned policy; using a learned instead of an oracle critic in the next actor call changes value by −0.007.

16Reproducibility notes

Decoder
Every token coordinate, packet order, Q/K/V/O matrix and feed-forward weight is listed in the EvoRobust supplement; at S=A=2 the weights have 60 non-zero entries. All 1,803 grid cells replay through the full forward map, and the repository circuit agrees on all weights and actor outputs.
Exact checks
Direct softmax and Bellman solves match the partition and error–value identities on the 1,803 grid cells and on 2,928 further checks over reward scale, discount and margin, all to machine precision (errors below 10−14).
Coverage study
64 MDPs drawn once from a fixed seed, uniform starting policy, Q0=0; the decoder is the theorem’s own, unchanged.
Repeated control
5 runs of 51,200 steps (seeds 12100–12104), 64 held-out MDPs, 20 rounds, an exact one-step critic for both the learned actors and the reference.
Tests
The decoder’s 11 tests pass (shapes, score identity, masked exactness, envelope, critic bound, cross-call silence, feed-forward gate, shared weights, causal mask, witness replay, repository cross-check), as do the repository’s architecture tests.

Summary

17In brief

Design

Policy mirror descent multiplies each action’s probability by the exponential of its value and renormalizes, which is what a softmax does. A small fixed decoder uses one attention row for that step and a second call for TD evaluation, and its errors are carried into a bound on the returned policy.

Results

In the exact decoder, a margin of 8 turns an ideal gain of 2.084 at step 2.4 into an implemented gain of −2.009, and masking other states removes the effect. Trained without PMD labels, a pre-LN Transformer lands within 0.0357 of PMD per row, and five trained actors control within 1.5× of exact PMD.

Open questions

Whether the loop holds up when the critic learns from ordinary trajectories, what learned models’ errors look like inside the loop, and whether the reversal appears in learned models at all. Details are under Limitations and what didn’t work.

18Sources

PolicyAttention: Softmax Attention Implements Policy Mirror Descent for Closed-Loop Control. Yuhe Sui, Yingzhi Tang, Shufang Chen. arXiv 2609.30500, 2026. [arXiv]

Accepted Research

  • PolicyAttention: Robustness and Failure Modes of Softmax Policy Improvement

    Yuhe Sui, Yingzhi Tang, Xinyue Wu

    EvoRobust Workshop, NeurIPS 2026 · 2026 · Accepted [OpenReview]

  • PolicyAttention: When Softmax Attention Becomes Policy Improvement

    Yuhe Sui

    PTA Workshop, NeurIPS 2026 · 2026 · Accepted [OpenReview]

The EvoRobust camera-ready version is titled PolicyAttention: When Stronger Softmax Policy Improvement Backfires. Results come from the camera-ready versions of the two NeurIPS workshop papers and their data, and from the records of the later repeated-control study.

Back to top ↑