video generationattentionoptimal transportdiffusion

Injecting Structure into Diffusion Attention Through Its Prior

Every softmax row is an entropic transport plan with a cost and a reference measure. Conditioning writes to the cost. A vision-language model that writes to the measure gets an orthogonal, unbounded channel into a video diffusion model, and the gradient it receives is an exact advantage over chunks.

A softmax attention row is the exact solution of an entropic optimal transport problem, and that problem has two inputs: a cost, computed from the query and the keys, and a reference measure, the distribution the row is pulled toward before any cost is paid. Every standard way of conditioning a diffusion model writes to the cost. Masks, linear position biases and attention sinks write to the measure, and they are the only familiar mechanisms that do. We argue that the measure is the native channel for a vision-language model to inject structure into a video diffusion model: writing there is orthogonal to the computation inside each chunk, it is unbounded where the cost channel is capped by QK-normalization, and its gradient under the diffusion loss is an exact, sampling-free advantage over chunks. The coarse causal mask that a VLM chose in our experiments, and that improved chunked autoregressive generation, is the degenerate corner of this channel. The channel is needed because the diffusion model's own cost is dominated by position: its queries are noisy where their positions are exact, and once a row is peaked on nearby keys, the gradient that could teach it to look elsewhere is multiplied by an attention weight that is already zero.

The question we start from is a small engineering surprise. We generate video chunk by chunk with an autoregressive diffusion transformer; each new chunk attends, through a KV cache, to the chunks before it. When we let a vision-language model read the prompt and decide, per new chunk, which past chunks it may see, the generations get better. That should not happen to a model that already sees everything: an attention row can put as little weight on a chunk as it likes. So the mask is supplying something the model cannot produce for itself, and it is supplying it through the crudest possible interface, a binary pattern over chunks. We want to know what the non-crude version of that interface is, why the model needs it, and whether learning to use it is a reinforcement learning problem. A recent paper by Litman gives the right language: the forward pass of attention is one-sided entropic optimal transport and the backward pass is an advantage-weighted policy gradient. We use both halves.

Key results
  • A softmax row minimizes expected cost plus $\tau$ times a KL divergence to a reference measure $\pi$. Conditioning changes the cost; a mask sets $\pi$ to zero on some keys. The soft version of a VLM mask is a per-chunk logit bias $\beta_b = \tau\log\pi_b$, and the row becomes a posterior: prior from the VLM, likelihood from the backbone. ()
  • Attention over chunks factors into a gate over block potentials and a readout inside each block. A per-chunk bias moves only the gate, so the channel can be added to a frozen backbone, at no cost, in any block-sparse kernel. ()
  • With QK-normalization the log-ratio of any two attention weights is bounded by $2G/\tau$. No signal entering through queries and keys can implement a mask or push a chunk below a fixed floor. The bias is a coordinate the backbone could not have learned to move. ()
  • The gradient of the loss with respect to $\beta_b$ is $-(\sigma_b/\tau)A_b$, where $A_b$ is the advantage of chunk $b$. Every chunk's counterfactual readout is observed in one dense forward pass, so this is REINFORCE with an exact baseline and no sampling. Reinforcement learning proper is needed only across chunks, where the choice at chunk $n$ changes the state for chunk $n+1$. (, )
  • The diffusion model needs the prior because its own attention is position-dominated for three reasons: the denoising target is local, a noisy query has an exact position but a corrupted content term, and the Fisher information of a peaked row, $(1-\|p\|^2)/\tau^2$, vanishes, so far keys stop receiving gradient however useful they are. Whether this is degeneracy depends on a measurement we have not made: whether any head retrieves an object across an occlusion. ()
  • Attention sinks are the model's substitute for a null option that one-sided transport lacks. A hard mask must never remove the chunk that hosts the sink; the soft channel handles it automatically. ()

The Setting: A Mask That Should Not Help

Our model is a multimodal diffusion transformer trained to generate video in chunks, in the diffusion-forcing family: chunk $n$ is denoised while attending to the clean, cached keys and values of chunks $1$ through $n-1$. A chunk is a short span of latent frames, a few thousand tokens. Text tokens sit in the same attention as video tokens. We write $q$ for a query vector at any layer, head, spatial position and noise level, $k_j$ and $v_j$ for a cached key and value, $s_j = \langle q, k_j\rangle$ for a score, and $\tau$ for the temperature, $\sqrt{d}$ in the standard parameterization. The keys of chunk $b$ form a block $B_b$.

We found two things. First, when a vision-language model reads the prompt and emits, for each new chunk, a binary visibility pattern over past chunks, and we apply that pattern as a block-level causal mask, generations improve: objects that leave and re-enter the frame keep their identity more often, and long rollouts drift less.We report the effect qualitatively. The experiments were run on an internal model, and this article is about why the effect exists and what its principled form is, not about its size. Second, when we look at the attention patterns of the same model, almost every head is diagonal: in the appropriate token order, a query attends to keys at nearby positions in space and time, and the pattern has little to do with which object a token belongs to.

The two observations are in tension. A model whose attention is diagonal is not using the distant chunks much, so masking them should change little. Yet masking helps. The resolution, which the rest of the article develops, is that the model cannot compute the thing the mask supplies: a content-based judgment about which past chunk matters now. The mask makes that judgment with a VLM that reads clean inputs, and injects the result at the only place where a judgment about keys can enter an attention row without going through the query.

A Softmax Row Has Two Inputs

Litman proves that the attention row $p$ for a query $q$ is the unique minimizer of

$$ J(p) = \sum_j p_j C_j - \tau H(p), \qquad C_j = -\langle q, k_j\rangle, $$

over the probability simplex, where $H$ is Shannon entropy. This is a one-sided entropic optimal transport problem: one unit of mass at the query is moved onto the keys, the source marginal is fixed, the target marginal is free, and the entropy term buys smoothness at the price of cost. The minimizer is $\mathrm{softmax}(s/\tau)$. The same paper shows that the family is a design space: replace Shannon entropy by a squared norm and you get sparsemax; add a linear penalty on distance to the regularizer and you get ALiBi.

The ALiBi case is the one to look at, because it exposes a second input hiding in the problem. The entropy term in $J$ is relative entropy to the uniform distribution. Nothing forces that choice. Replace it with relative entropy to an arbitrary reference measure $\pi$ on the keys:

$$ p^\star = \arg\min_{p \in \Delta}\ \sum_j p_j C_j + \tau\, \mathrm{KL}(p \,\|\, \pi). $$

The stationarity condition is $C_j + \tau(\log p_j - \log \pi_j + 1) = \lambda$, so

$$ p^\star_j \;\propto\; \pi_j\, e^{s_j/\tau} \;=\; \exp\!\big((s_j + \tau \log \pi_j)/\tau\big). $$

The reference measure enters as an additive logit bias $\tau \log \pi_j$, and every additive logit bias is a reference measure. ALiBi is the measure $\pi_j \propto e^{-\gamma|i-j|/\tau}$. A causal mask is the measure that is zero on the future. The VLM's chunk mask is the measure that is zero on the chunks it rejected. This is the content of : an attention row has a cost input and a measure input, and the two are written to by disjoint sets of mechanisms.

A diagram with two inputs, a cost computed from q and k and a reference measure, feeding one entropic transport solver that outputs an attention row.
An attention row has two inputs. The cost (blue) is computed from the model's own queries and keys; cross-attention, adaptive normalization and concatenated tokens all act by changing it. The reference measure (amber) is the distribution the row sits at when every cost is equal; masks, ALiBi and sinks act by changing it. The solution multiplies the two. Throughout the article, blue is the backbone's own computation and amber is what is written from outside.

Conditioning, in all its forms, is on the cost side. Cross-attention to a text encoder, adaptive layer norm driven by a timestep or a caption embedding, and VLM features concatenated as extra tokens all change $q$ and $k$, and therefore $C$. The backbone must learn to translate the signal into scores. The measure side is different in kind: it is a prior over keys that the row multiplies in before the backbone's own evidence is weighed. In Bayesian terms, $p^\star_j \propto \pi_j\, e^{s_j/\tau}$ is a posterior with prior $\pi$ and likelihood $e^{s/\tau}$. Conditioning changes the likelihood. A mask changes the prior.

Seen this way, the VLM's binary mask is a dogmatic prior: it puts zero mass on some chunks, and no evidence from the backbone can restore them. The soft version, a per-chunk bias $\beta_b = \tau \log \pi_b$ with $\pi_b$ positive, is a prior that a strong enough score can overrule. lets you move between the two. We call $\beta_b$ the measure channel, and the rest of the article is about why it is the right place for a VLM to write.

Drag the prior on chunk 2. Left: the gate over five chunks, grey without a prior and blue with it. A bias $\beta_2$ moves $\log(\sigma_2/\sigma_1)$ by exactly $\beta_2/\tau$ and changes nothing else about the gate's shape; the hard mask is the limit $\beta_2 \to -\infty$. Right: the attention distribution inside chunk 2 keeps its shape for every $\beta_2$; only its total mass $\sigma_2$ moves. Illustrative; synthetic potentials.

The Measure Channel Leaves the Chunk Alone

The reason a chunk-level prior is cheap, and safe to add to a frozen model, is an identity that every online-softmax kernel already uses. Partition the keys into blocks $B_1, \dots, B_n$ and define for each block a potential and a readout:

$$ \phi_b(q) = \tau \log \sum_{j \in B_b} e^{s_j/\tau}, \qquad o_b(q) = \sum_{j \in B_b} \frac{e^{s_j/\tau}}{\sum_{l \in B_b} e^{s_l/\tau}}\, v_j . $$

Then the full attention output is a gate over blocks applied to the block readouts:

$$ \mathrm{Attn}(q) = \sum_b \sigma_b(q)\, o_b(q), \qquad \sigma(q) = \mathrm{softmax}\big(\phi(q)/\tau\big). $$

This is associativity of the exponential sum. Now add a bias $\beta_b$ to every score in block $b$. Inside the block the softmax is invariant to a constant shift, so $o_b$ does not move. The potential shifts by exactly $\beta_b$, so the gate becomes $\sigma_b \propto \exp((\phi_b + \beta_b)/\tau)$. A per-chunk prior is a modification of the gate and nothing else ().

Per-chunk keys feed a potential and a readout; the VLM prior adds to the potentials only, the gates are a softmax across chunks, and the output is the gated sum of readouts.
The prior enters the gate, not the readout. Each chunk $B_b$ produces a potential $\phi_b$ and a readout $o_b$. The VLM's $\beta_b$ (teal) is added to the potentials, which are normalized across chunks into gates $\sigma_b$. The readouts, which are the backbone's own within-chunk attention, are multiplied by the gates and summed; $\beta_b$ never touches them.

Three consequences follow. The channel composes with a frozen backbone: within each chunk the model computes exactly what it computed before, so nothing it learned about local structure is disturbed. The channel is free: a per-block additive bias is what a block-sparse attention kernel already supports, and it costs nothing beyond the addition. And the channel is the same object as the hard mask: set $\beta_b = -\infty$ on the rejected chunks and you recover the pattern the VLM chose in our experiments, so whatever the mask was doing, the bias can do with a continuous dial.

Under QK-Norm the Cost Channel Is Bounded

One might ask why the backbone could not learn to do this itself through conditioning. Give it the VLM's features as extra tokens; let the queries and keys adjust. The answer is that the cost channel has a ceiling that the measure channel does not. Modern diffusion transformers normalize queries and keys before the dot product, so $\|q\| \le G_q$ and $\|k_j\| \le G_k$ for fixed gains. Write $G = G_q G_k$. Then for any two keys,

$$ \big|\log p_j - \log p_l\big| = \frac{|s_j - s_l|}{\tau} \le \frac{2G}{\tau}, $$

and a chunk of $|B_b|$ keys out of $N$ keeps a share of at least $(|B_b|/N)\, e^{-2G/\tau}$ no matter what the queries and keys contain. The cost channel can attenuate a chunk by a bounded factor and can never exclude it (). The measure channel has no such floor: $\beta_b$ is added after normalization, outside the bound.

Chunk share on a log axis versus downward push; the cost channel curve flattens at a floor while the measure channel curve keeps falling.
The cost channel floors; the measure channel does not. The share of a chunk as a signal pushes it down, for four equal chunks. Through queries and keys (blue) the share cannot fall below $(|B_b|/N)e^{-2G/\tau}$ once the bound on normalized dot products is reached; through a bias (amber) it falls without limit, and the hard mask is the limit. Illustrative; $2G/\tau = 4$ chosen for the drawing.

The bound matters less for its numerical value than for what it says about the mechanism. To suppress a chunk through the cost, the backbone must rotate the content of queries and keys, which are also carrying every other function those vectors serve. The bias is a coordinate independent of all of them. It is not a knob the backbone could have learned to turn through its inputs; it is a knob that did not exist in its parameterization. This is the precise sense in which the measure channel is native: it is one of the two inputs the row has, and the model's training has only ever written to the other one.

The Prior's Gradient Is a Chunk Advantage

The second half of Litman's paper concerns the backward pass. Let $c = \sum_j p_j v_j$ be the context vector, $L$ a downstream loss, $g = \nabla_c L$, and define the marginal utility of key $j$ as $u_j = -\langle g, v_j\rangle$: the reward for putting more weight on it. Then the gradient of the loss with respect to a score is

$$ \frac{\partial L}{\partial s_j} = -\frac{p_j}{\tau}\,\big(u_j - \mathbb{E}_p[u]\big), $$

which is REINFORCE with the expected utility as baseline, except that the expectation is computed exactly rather than estimated from a sample, because the utility of every key is available at once. The row is a policy over keys, and backpropagation is its exact policy gradient.

Sum this over a chunk. Since $\beta_b$ shifts every score in $B_b$ by the same amount, $\partial L/\partial \beta_b = \sum_{j \in B_b} \partial L/\partial s_j$, and a short calculation () gives

$$ \frac{\partial L}{\partial \beta_b} = -\frac{\sigma_b}{\tau}\, A_b, \qquad A_b = -\langle g,\; o_b - c\rangle . $$

$A_b$ is the advantage of chunk $b$: positive when the chunk's readout $o_b$ lies downhill of the current output $c$ along the loss gradient, in which case the prior on the chunk should rise, and negative when it lies uphill (). The advantages are mean-zero under the gate, $\sum_b \sigma_b A_b = 0$, so shifting every chunk's prior together is a null direction, as it should be.

In value space, the current output c, the loss gradient g, and four chunk readouts; readouts on the downhill side of the line through c have positive advantage.
The gradient on a chunk's prior is a projection. In the space of attention outputs, the current output $c$ is the gated mix of the chunk readouts $o_b$ (amber). The loss gradient $g$ (rust) splits the space along the dashed line through $c$. A readout on the downhill side has positive advantage and its prior should rise; one on the uphill side should fall. Every readout is computed in the same dense forward pass, so no chunk's advantage has to be estimated.

Two things about this gradient are unusual for a reinforcement learning signal. It is exact: a single dense forward pass through the diffusion model evaluates every chunk's readout, including the ones the prior is currently suppressing, so there is no Monte Carlo variance and no need to roll out alternatives. And it is cheap: $o_b$ and $c$ are already materialized by any attention kernel that processes keys in blocks. A VLM head that outputs $\beta$ can be trained by ordinary backpropagation through a frozen backbone, and the signal it receives is the advantage of each chunk under the current policy.

What the Diffusion Model Cannot Compute

We now return to the puzzle. A model that can put arbitrarily little weight on a chunk should not benefit from having the chunk removed. It benefits because the weight it puts on chunks is not a judgment about content; it is, to a first approximation, a function of position. We see three reasons, of increasing depth, and the third is where Litman's geometry does real work.

Locality Is Learned ALiBi

Video latents are strongly correlated across nearby positions in space and time, and the denoising target at most noise levels is well predicted by a local neighborhood. The minimum-mean-square denoiser of a locally correlated field is a local filter, and a transformer trained to be one learns a cost that increases with distance. In the variational framework this is a learned ALiBi: a linear-in-distance penalty on the regularizer, induced through rotary position encoding rather than written in by hand. Analyses of video diffusion transformers report exactly this: heads sort into spatially local and temporally local types, and attention energy decays with spatiotemporal distance. Diagonal patterns are the expected shape of a local denoiser, not a defect.

Noisy Queries, Exact Positions

The second reason is specific to diffusion and, we think, underappreciated. The query is computed from a noisy latent, $x_t = \alpha_t x_0 + \sigma_t \epsilon$. Its content term is a mixture of signal and noise, $\alpha_t\langle q_0, k\rangle + \sigma_t\langle \epsilon, k\rangle$, and the second part carries no information about which key is relevant. Its position term, carried by the rotary phase, is exact at every noise level. So at high noise the cost is position-dominated by construction, before any learning has happened (). The model is not failing to compute a content-based judgment at the early steps; it has nothing to compute it from.

Stacked areas versus noise level: the informative content share of score variance shrinks to zero as noise rises while the position share grows.
At high noise, a query's content term is noise and its position term is exact. Shares of score variance in a toy model with a position term of fixed variance and a content term whose signal fraction is $\alpha_t^2$ under a rectified-flow schedule. Illustrative; synthetic, with content-to-position variance ratio 1.5 at $t=0$.

This also says where the prior is worth most. A VLM reads the prompt and the clean past chunks; it can judge which chunk holds the object that is about to re-enter the frame, at every noise level. The measure channel carries that judgment into the rows whose own content term is noise. The prior should therefore be strongest at high noise and fade as the query becomes informative, which suggests making the VLM head a function of the noise level or scheduling $\beta$ against it.

A Peaked Row Stops Learning

The third reason is dynamical. Litman shows that the standard gradient with respect to the scores is the natural-gradient direction $u$ pushed through the Fisher information matrix of the row:

$$ \nabla_s L = -\tau\, F(s)\, u, \qquad F(s) = \frac{1}{\tau^2}\big(\mathrm{diag}(p) - p p^\top\big). $$

The trace of $F$ is $(1 - \|p\|^2)/\tau^2$, a function of the Rényi-2 entropy of the row, and it goes to zero as the row becomes peaked. Since $F$ is positive semidefinite, $\|\nabla_s L\| \le (1 - \|p\|^2)\,\|u\|/\tau$, and per key, $|\partial L/\partial s_j| = (p_j/\tau)\,|A_j|$. A key with small attention receives small gradient however large its advantage. shows the consequence: once the position term has made the row local, the one distant key that would help cannot be learned, because its learning signal is multiplied by an attention weight that is already near zero.

Drag the locality strength. Top: an attention row over keys at relative positions $-12$ to $11$, with a position penalty $\gamma|\Delta|$ in the cost. Bottom: the gradient each key's score receives, $(p_j/\tau)\,|u_j - \mathbb{E}_p u|$. The key at $\Delta = +8$ has by far the largest advantage, standing in for an object that reappeared. As $\gamma$ grows the row becomes diagonal, the Fisher trace falls, and the useful key's gradient vanishes. Illustrative; synthetic utilities, seeded.

The process is self-reinforcing. The position term is the easiest gain, so it is learned first. Once it dominates, the Fisher metric has collapsed along every non-local direction, and the content subspace of the query-key map stops receiving signal from distant keys. This is attention entropy collapse stated in the geometry of the row. QK-normalization prevents the row from becoming exactly one-hot, which is why training does not diverge, but it does not prevent the position term from dominating. In a language model the same dynamics are counteracted by the data: repeated tokens are common, so a head that copies from a distant match is rewarded often enough to form. In video an object that leaves and returns is rare, and under teacher forcing the local solution is almost always sufficient, so the pressure to form a retrieval head is weak exactly where it would matter at inference.

Is This Degeneracy?

Whether the diagonal pattern means the attention has degenerated depends on two measurements we have not yet made, and we want to be precise about what they are. The first is the difference between attention weight and attention effect. The weight on a distant key may be small while its contribution to the output is large, if its value vector is large and aligned with what the layer needs; the gradient formula above makes the split explicit, with $p_j$ and $A_j$ as separate factors. The off-diagonal share should be recomputed with value-weighted norms before concluding that the off-diagonal is empty.

The second is the existence of retrieval heads. In language models most heads are local and a small minority carry long-range retrieval; removing that minority destroys long-context ability while leaving everything else intact. Mostly diagonal is therefore the normal state of a trained transformer. The pathology would be the absence of the minority. The test is a probe: place an object in chunk 1, occlude it through chunks 2 and 3, let it reappear in chunk 4, and ask which heads attend from the chunk 4 object tokens back to the chunk 1 object tokens. If none do, the model carries identity by a chain of local copies, which must drift with horizon, and the VLM prior is supplying a capability the model lacks. If a few do, the attention has not degenerated, and both the prior and any cache compression should be applied per head: protect those heads, and write the prior into them.

Sinks Are the Missing Null Option

One more feature of the transport problem explains a pattern that appears alongside the diagonal. The source marginal in one-sided transport is fixed at one: every row must place a full unit of mass on the keys. There is no option to decline. The unbalanced version of the problem adds one: a null destination with its own cost $C_0$, which in the attention parameterization is an extra logit $s_0$,

$$ p_0 = \frac{e^{s_0/\tau}}{e^{s_0/\tau} + \sum_j e^{s_j/\tau}}, $$

a softmax that can sum to less than one over the real keys. The proposal to add such a logit has been made for language models. A model trained without it builds one: it designates a key that every query can see, gives it a value of near-zero norm, and parks unneeded mass there (). That is the attention sink. In causal language models the designated key is the first token, the only one visible to every query; the sink is associated with massive activations in the residual stream, and its function has been explained as preventing representations from over-mixing. In vision transformers the same role is played by high-norm background patches, and adding explicit register tokens removes them. In a joint text-video transformer the natural hosts are text and padding tokens; in a chunked causal model, the first chunk.

Left: with mass forced to sum to one, six poorly matching keys each receive a share. Right: with a null slot, the keys receive little and the null slot takes the rest.
A sink is a null option built from a real key. Left: balanced transport must place a full unit of mass even when no key matches, and the output is a smear of unrelated values. Right: an unbalanced problem has a null slot that absorbs the surplus and contributes no value. A model without the slot creates one from a key every query can see, with a near-zero value. Illustrative; synthetic bars.

This has three consequences for the channel. A hard mask must not remove the chunk or tokens that host the sink; if it does, the surplus mass is forced onto unrelated keys and the output degrades, which is the failure that streaming language models hit when the first token leaves the window. A soft prior does not have this problem, because the sink's logit stays in the normalization. Distrust of the past is better expressed by raising a null logit than by masking every past chunk, which would force all mass onto the current chunk. And if past chunks are compressed, the sink keys must be kept exactly or their mass absorbed into an explicit log-mass channel; a register token can serve as the explicit sink. Diagonal attention with a sink is the minimum-mixing solution: attend locally, and when nothing local applies, attend to nothing.

Where Reinforcement Learning Enters

Is learning to use the channel a reinforcement learning problem? Litman's result is easily summarized as attention doing reinforcement learning, and it is worth being exact about what that means. Within one row, the softmax is a policy over keys, the utility is a reward, and backpropagation is the policy gradient. But the reward of every arm is observed, so this is a full-information bandit: no exploration, no variance, no bootstrapping. The same is true one level up. The VLM's $\beta_b$ parameterizes a prior over chunks, and showed that its gradient is an exact advantage computed from readouts that a single dense pass produces. If the VLM's output is continuous, learning it is supervised learning in disguise.

Reinforcement learning proper enters across chunks (). The prior chosen for chunk $n$ changes the chunk that is generated, which changes the cache, which is the state for chunk $n+1$. That is a Markov decision process whose state is the prompt, the chunks so far and their cache, whose action is the prior table for the next chunk, and whose reward is the quality of the rollout. Credit for a visibility decision at chunk $n$ that pays off at chunk $n+4$ cannot come from the one-step gradient; it needs rollouts. The action is low-dimensional, a few scalars per past chunk per head group, and the backbone is frozen, so group-sampled policy optimization is affordable, and the exact one-step advantage is a natural baseline for it.

A loop: prompt and clean past chunks feed a VLM policy that emits a prior table, the diffusion model denoises the next chunk with the prior in its attention, and the chunk and cache become the next state; an exact gradient returns to the prior and a rollout reward returns to the policy.
Two levels of learning. Inside a chunk, the prior's gradient is exact and needs no sampling (teal, dashed). Across chunks, the chosen prior changes the next state, and credit is assigned by rollouts (amber, dashed). The VLM reads clean inputs, which is what lets it supply the content term the noisy queries lack.

This suggests a two-stage recipe. First, train the VLM's prior head by the exact gradient, against a loss that requires long-range information: distillation toward a teacher that sees every past chunk in clean form, rather than the teacher-forced denoising loss, which the local solution already satisfies. Second, fine-tune by rollouts with a reward that sees drift, for instance a judge of object identity across the generated video, using the stage-one advantage as the baseline. If the VLM must emit a discrete mask, for instance as text, the dense pass still gives every chunk's readout, so its advantage can serve as the reward for the discrete choice instead of a noisy rollout score.

The gain we observed from the VLM's mask has two possible sources, and they point at different dials. It could come from semantic selection, or merely from showing the model less of a drifted past. Masks of equal sparsity chosen at random, by recency alone, and by the VLM separate the two: if the VLM's mask does not beat recency, the information being injected is trust rather than content, and the right dial is the null logit, a decaying trust in the past, rather than a prior over chunks.

The Full Set of Dials

Everything above concerned one dial, the per-chunk bias. The transport problem has three ingredients, cost, regularizer and marginal constraints, and each admits a modification that an external model could write. We list them so the choice is explicit.

DialIngredientFormMeaningCost to implement
$\beta_b$reference measurelogit $+\,\beta_b$ on block $b$how much chunk $b$ matters nowa block bias in the kernel; nothing
$\kappa_b$cost, rank onelogit $+\,\langle q, \kappa_b\rangle$ on block $b$when chunk $b$ matters, as a function of what is askedone scalar per query and block, precomputed
$\tau_b$regularizer strengthtemperature inside block $b$how broadly to read within the chunka scale inside the block
$s_0$marginal, unbalancedan extra null logithow much to distrust every past chunkone extra column
$b_b$target marginalcolumn constraint, Sinkhornhow much total mass chunk $b$ receives across queriesiterations inside attention; breaks fused kernels

We would start with $\beta_b$, add $\kappa_b$ if the prior needs to depend on the query, and add $s_0$ if the equal-sparsity comparison points at trust rather than content. We would not pursue the target marginal; it is the one dial that cannot be added to a fused attention kernel. A zero-training variant of $\beta_b$ is also available: the VLM's own attention from the prompt onto frames of the past chunks is itself a transport plan, and its mass on chunk $b$ can be used as $\pi_b$ directly.

Limitations

Our experimental claim is qualitative and comes from one internal model; the retrieval-head probe and the equal-sparsity mask comparison have not been run, and we say so where they appear. The bound in is loose in practice: trained gains can make $2G/\tau$ large, so the floor may be low; its force is in the mechanism it describes rather than its value. The three explanations of diagonal attention are not exclusive and we have not measured their relative weights. The exactness of the one-step gradient depends on evaluating every chunk's readout in a dense pass, which is affordable at training time but is not what a sparse inference kernel does. And the claim that a VLM supplies a content term the model lacks assumes the VLM's judgment is good; a wrong prior is overruled by a strong score, which is the argument for the soft channel, but it still costs something.

The variational view of softmax goes back to maximum-entropy inference and was made exact for attention by Litman; sparse alternatives come from changing the regularizer, doubly stochastic attention from adding a target marginal, and ALiBi from adding a linear penalty. The reference-measure form we use is standard in entropic transport, and unbalanced transport supplies the null option. Attention sinks were identified in streaming language models and studied empirically and mechanistically; registers are the vision-side remedy. Entropy collapse in attention and its normalization-based remedies are due to Zhai et al.. Induction and retrieval heads are the language-model analogues of what we would look for in video. Chunked autoregressive video diffusion follows diffusion forcing and self forcing; the locality of video attention is documented by sparse and radial attention.

Appendix: Derivations

Reference measure. Minimize $\sum_j p_j C_j + \tau\sum_j p_j(\log p_j - \log \pi_j)$ subject to $\sum_j p_j = 1$. The Lagrangian condition is $C_j + \tau(\log p_j - \log\pi_j + 1) - \lambda = 0$, so $\log p_j = \log \pi_j - C_j/\tau + \mathrm{const}$ and $p_j \propto \pi_j e^{s_j/\tau}$. The objective is strictly convex on the simplex, so this is the unique minimizer. A global rescaling of $\pi$ cancels; a zero in $\pi$ makes the KL term infinite off its support, which is the hard mask.

Block decomposition. $\sum_{j} e^{s_j/\tau} = \sum_b e^{\phi_b/\tau}$ by definition of $\phi_b$, and $\sum_j e^{s_j/\tau} v_j = \sum_b e^{\phi_b/\tau} o_b$ by definition of $o_b$; divide. Adding $\beta_b$ to all $s_j$ with $j \in B_b$ multiplies $e^{\phi_b/\tau}$ by $e^{\beta_b/\tau}$ and leaves the within-block normalized weights unchanged.

Bounded log-ratio. $|s_j - s_l| \le |\langle q, k_j\rangle| + |\langle q, k_l\rangle| \le 2 G_q G_k$ by Cauchy-Schwarz, and $\log p_j - \log p_l = (s_j - s_l)/\tau$. Summing $p_j \ge p_{\max} e^{-2G/\tau}$ over a block and using $p_{\max} \ge 1/N$ gives the floor.

Chunk advantage. With $\partial L/\partial s_j = -(p_j/\tau)(u_j - \mathbb{E}_p[u])$ and $\partial s_j/\partial \beta_b = \mathbf{1}[j \in B_b]$,

$$ \frac{\partial L}{\partial \beta_b} = -\frac{1}{\tau}\sum_{j\in B_b} p_j\big(u_j - \mathbb{E}_p[u]\big) = -\frac{\sigma_b}{\tau}\Big(\bar u_b - \mathbb{E}_p[u]\Big), \qquad \bar u_b = \sum_{j \in B_b}\frac{p_j}{\sigma_b}\, u_j . $$

Since $\sum_{j\in B_b}(p_j/\sigma_b)\, v_j = o_b$ and $u_j = -\langle g, v_j\rangle$, we have $\bar u_b = -\langle g, o_b\rangle$ and $\mathbb{E}_p[u] = -\langle g, c\rangle$, so $A_b = \bar u_b - \mathbb{E}_p[u] = -\langle g, o_b - c\rangle$. Mean-zero: $\sum_b \sigma_b \bar u_b = \sum_j p_j u_j = \mathbb{E}_p[u]$.

Fisher trace and gradient bound. $\mathrm{tr}(\mathrm{diag}(p) - pp^\top) = \sum_j p_j - \sum_j p_j^2 = 1 - \|p\|^2$, and $1 - \|p\|^2 = 1 - e^{-H_2(p)}$ with $H_2$ the Rényi-2 entropy. $F \succeq 0$ because it is a covariance, that of the one-hot indicator under $p$, so its operator norm is at most its trace, and $\|\nabla_s L\| = \tau\|F u\| \le \tau\,\mathrm{tr}(F)\,\|u\| = (1 - \|p\|^2)\|u\|/\tau$.

Null option. Append a key with score $s_0$ and value $0$ to the transport problem; the minimizer over the enlarged simplex is the softmax over $(s_0, s_1, \dots, s_m)$, and the output $\sum_{j\ge 1} p_j v_j$ carries less than one unit of value mass. A real key with $v \approx 0$ that every query can see implements the same thing with $s_0 = \langle q, k_{\mathrm{sink}}\rangle$.

Citation

Xiao, “Injecting Structure into Diffusion Attention Through Its Prior”, Han Xiao’s Blog, 2026.

@article{xiao2026injecting,
  author  = {Han Xiao},
  title   = {Injecting Structure into Diffusion Attention Through Its Prior},
  journal = {Han Xiao’s Blog},
  year    = {2026},
  note    = {https://blog.hanxiao.run/attention-prior-channel/}
}