A Majorization Ceiling in Doubly Normalized Reference Attention

Automatic line-art colorization takes an uncolored drawing and a colored reference picture of the same character and fills the drawing with the right colors. One recent fix for color bleeding across outlines replaces the usual softmax in the attention layer with a Sinkhorn-style "double normalization," which forces every row and every column of the attention matrix to sum to one. We point out that this choice is not just a stabilizer. A classical theorem, the one that also governs which quantum states can be converted into which, says a doubly stochastic matrix can only blur a set of values toward their average and can never sharpen them. The practical consequence is a hard limit. If the drawing needs a color over far more area than the reference shows (a full-body sketch colored from a close-up reference, say), the layer cannot deliver that color at full strength, and dilution or bleeding follows.

The proposal has two parts. First, we turn this limit into a per-image predictor of failure and test it. Second, we test a relaxation borrowed from entanglement catalysis. In quantum information, pairing two states with a small auxiliary state that comes back unchanged makes some otherwise impossible conversions possible. The analogue here is a small auxiliary axis added to the attention layer. The same theory makes sharp, falsifiable predictions: a uniform auxiliary axis should give exactly zero benefit, and flat two-tone regions should never benefit.

Core Claim

A few terms first. A vector $y$ is majorized by $v$, written $y \prec v$, when both have the same total and, after sorting each in decreasing order, every running sum of the top $m$ entries of $y$ is at most that of $v$. Informally, $y$ is a more evened-out version of $v$. Birkhoff's theorem, as recalled in the research file, says that for a fixed value vector $v$ the outputs reachable by doubly stochastic mixing are exactly the majorized ones:

$$\{\,A v : A \text{ doubly stochastic}\,\} = \{\, y : y \prec v \,\}.$$

Here $v$ is one value channel across the reference tokens and $y$ is the same channel across the drawing's tokens. For the matrix to be square, the drawing and the reference must have equal token counts, which holds in the same-resolution setting of Eliminating Gradient Conflict in Reference-based Line-Art Colorization.

That paper introduced Stop-Gradient Attention with double normalization, which we call SGA. It showed double normalization reduces bleeding. It did not note that the same constraint caps each attention layer's output. For every channel, the $m$ drawing tokens with the largest output can together hold no more than the $m$ largest reference values. When a color covers a larger share of the drawing than of the reference, the running-sum curves of what the drawing needs and what the reference supplies cross. At a crossing, the layer is forced to dilute the color. This is the same crossing picture that Nielsen's theorem uses for the conversion of quantum states from one to another.

Entanglement catalysis addresses exactly these crossings. The existence of quantum entanglement catalysts and Efficient entanglement-assisted transformation for bipartite pure states show that for some incomparable pairs a fixed non-uniform weight vector $\omega$ exists such that

$$y \otimes \omega \prec v \otimes \omega \quad \text{even though} \quad y \not\prec v.$$

The symbol $\otimes$ is the outer product flattened into a vector of length $nk$, where $n$ is the token count and $k$ is the length of $\omega$.

We turn this into an attention layer. Each token is split into $k$ slots, weighted by a fixed non-uniform $\omega$. Attention is doubly normalized over the full set of $nk$ (token, slot) pairs. A penalty requires the output to factor back as $y \otimes \omega$, which is the attention counterpart of "the catalyst is returned unchanged." When the factorization holds exactly, the layer's reachable set grows from majorization to catalytic majorization. That set is still bounded, since every Rényi-entropy ordering of the kind used in Multiple-copy entanglement transformation and entanglement catalysis must still hold. The new layer therefore sits strictly between SGA's blur-only constraint and unconstrained softmax, which can copy anything, shortcuts included.

The layer is only meaningful if values are nonnegative, because the catalysis theory concerns probability vectors, and majorization under a tensor product is not invariant to shifting the values by a constant. We therefore pass value projections through a softplus and normalize per channel. The image-level bound is only a heuristic, since MLP blocks and residual paths sit between attention layers. The per-layer bound is exact, and we measure both.

Research Program

The first deliverable is a diagnostic. For every test pair and every attention layer of a trained SGA model, we take each value channel and compute a deficit: the largest amount by which the running-sum curve of the drawing's required profile rises above the reference's curve. We use the ground-truth colored target's features passed through the same projections. We also compute a cheap image-level proxy from color histograms of the colored reference and the ground-truth target. The central empirical question is whether this deficit predicts where SGA fails, beyond what simple region-area mismatch predicts. If it does not, the rest of the program is moot and we report the negative result.

The second deliverable is a feasibility census that uses the quantum algorithms directly. The fixed-catalyst-dimension decision procedure of The existence of quantum entanglement catalysts runs in time polynomial in $n$ for constant $k$. We run it on downsampled per-channel profiles from the failing pairs, with $k = 2$ and $k = 3$. This tells us in advance what fraction of the ceiling violations any catalytic layer could possibly fix. The census also reads a constraint straight from Multiple-copy entanglement transformation and entanglement catalysis: catalysis helps only when the target has at least two successive components distinct from its maximum and minimum. Flat paint-bucket fills produce nearly two-level profiles, so the theory predicts no gain on them and any gain concentrated in shaded or gradient regions. We treat this as a pre-registered prediction rather than a caveat. The order-preserving polyhedra of Efficient entanglement-assisted transformation for bipartite pure states give the region of admissible $\omega$. From that region we choose one fixed $\omega$ that is admissible for the largest share of training-set violations.

The third deliverable is the catalytic layer itself, dropped into the SGA architecture in place of its doubly normalized attention and trained with SGA's recipe plus the factorization penalty. Attention cost grows by $k^2$, which is 4 to 9 times for the small $k$ we use. That cost is reported openly.

Baselines

The naive reference point is SCFT-style softmax cross-attention without stop-gradient. It is the model SGA improved on, and the only numbers the file gives for it are relative ones. Eliminating Gradient Conflict in Reference-based Line-Art Colorization reports a 27.21% Fréchet Inception Distance (FID) improvement and a 25.67% structural similarity (SSIM) increase for SGA over SCFT on Anime Portraits. No reported absolute FID or SSIM result was found on Lacuna for SGA or SCFT on Anime Portraits or AFHQ. Both are therefore retrained from the published description on identical data, with the same XDoG sketch extraction (a standard synthetic line-drawing filter), the same number of steps, and the same hyperparameter search budget.

The strongest competitor on this specific question is SGA itself. It is the method whose constraint we claim is binding, and it is the best bleeding-controlled attention design in the file. Beating it means lower FID and higher SSIM on the stratum of pairs with high predicted deficit, with no loss on the low-deficit stratum. Overall averages are not the test. We also include the best softmax variant with stop-gradient but without double normalization, because it removes the ceiling entirely.

The ablation that isolates the catalytic ingredient comes in three versions of the slot layer. In the first, $\omega$ is uniform, and the theory says it must match SGA exactly, as the maximally-entangled no-go result of Efficient entanglement-assisted transformation for bipartite pure states predicts. In the second, the factorization penalty is removed, so the auxiliary axis is "consumed." In the third, the extra slots are kept but double normalization is replaced with softmax, which controls for parameter and compute increases.

For context on reference-following under pose change, the MangaNinja benchmark numbers are PSNR 21.34 and MS-SSIM 0.972 for MangaNinja: Line Art Colorization with Precise Reference Following, against 16.19 and 0.845 for IP-Adapter. Our models are much smaller, non-diffusion networks. We do not expect to beat MangaNinja, and we use this benchmark only for the deficit-versus-error analysis.

Why not just…?

Why not just drop double normalization and use softmax with stop-gradient? Softmax has no ceiling, but SGA's own results suggest the unconstrained layer learns pixel-copying shortcuts. It reached lower training reconstruction loss yet generalized worse, a gap summarized by the 27.21% FID figure above. The question is whether some intermediate constraint beats both extremes. The softmax-with-slots control answers it directly. If that control matches the catalytic layer, the benefit came from capacity, not from catalysis, and we will say so.

Why not just use learned non-uniform row and column targets in the Sinkhorn step, as in unbalanced transport? This is the real threat. Letting each reference token be used in proportion to its predicted area in the drawing removes the area-mismatch ceiling by construction. Its weakness is that it needs a per-token mass prediction, which amounts to knowing the correspondence the layer is supposed to discover. We implement it with a small learned mass head under the same budget and compare the two on the high-deficit stratum. We commit in advance: if learned marginals match or beat the catalytic layer, the paper's contribution becomes the ceiling diagnosis plus learned marginals, and the catalytic layer is reported as a dominated alternative.

Why not just give the model more references, as in Cobra: Efficient Line Art COlorization with BRoAder References? Adding references that cover the under-represented region does lift the running-sum curve, and in production that is often the right answer. Our controlled experiment separates the two situations. For some pairs we supply a second reference that covers the missing area, and for others no such reference exists. The catalytic layer is meant only for the single-reference case, which is common in practice: a single character sheet per scene, or one colored keyframe as in ToonComposer: Streamlining Cartoon Production with Generative Post-Keyframing.

Why not just use region matching? Graph-based paint-bucket matching such as Noma et al. sidesteps attention entirely, but it breaks under region splits, merges, and occlusion. We include it as a reference on flat-fill pairs. That is exactly where our theory predicts catalysis cannot help, and where region matching may well win.

Proposed Experiments

The controlled experiment uses Anime Portraits (33,000+ faces) and AFHQ with XDoG sketches, following the SGA setup. We create a dial for area mismatch by pairing each full target with reference crops at zoom factors from 1× to 3×. Zooming in on part of the face shrinks some regions' share of the reference and enlarges others, which pushes the predicted deficit up in a controlled way.

The first decisive check is the correlation between per-pair deficit and SGA's per-pair error. Error should rise with deficit even after controlling for plain region-area ratio. If it does not, the ceiling does not matter in practice.

The second check is the uniform-$\omega$ control. It must be statistically indistinguishable from SGA. A gap would indicate an implementation artifact, not catalysis.

The third check is whether the catalytic layer's gains over SGA fall on the pairs the census marks as catalyzable, and on shaded rather than flat regions. We measure this with per-region error using ground-truth segment masks.

The realistic-shift experiment repeats the deficit analysis on Danbooru2021's 13,000 test illustrations and on the 200-pair MangaNinja benchmark, where pose and crop mismatch occur naturally. These tell us whether controlled crops overstate how often the ceiling binds.

Every result is reported as FID and SSIM, split by deficit stratum, alongside wall-clock cost. That lets the reader weigh a possible gain against the extra attention cost of 4 to 9 times.