Feed-forward style transfer repaints a photograph in the manner of a painting with a single pass through a trained network, with no per-image optimization. Transformer versions such as StyTr2 keep global composition better than convolutional networks. Their cost, however, grows quadratically with the number of image patches ("tokens"), so they slow down sharply at high resolution. The standard fix from the efficiency literature is token merging: average together tokens that look alike, run attention on the shorter sequence, then copy results back to the original grid. Style transfer breaks the assumption behind this fix. A flat gray sky in the photo is maximally redundant as input, yet after stylization with Van Gogh it must become the busiest swirling texture in the picture. If merging decides redundancy from the input, it will flatten exactly the regions where the style should add brushstrokes.
We propose to decide redundancy from the output instead. A cheap low-resolution stylization pass, the "draft," predicts where the stylized result will be smooth and where it will be textured. That prediction then drives how aggressively the full-resolution pass merges content tokens. The style image's tokens, which act as an unordered bank of texture samples, are compressed separately and much harder. Together these turn a coarse-scale attention pass into a style-conditioned token budget for the fine scale. We expect higher compression than content-driven merging at equal stylization quality, measured by ArtFID and by how well high-frequency texture is kept.
Core Claim
In content–style cross-attention, which tokens are redundant depends on the style, not only on the content. The claim is falsifiable on a specific slice of data: content images with large uniform regions paired with highly textured styles. On this slice, merging by content similarity should lose texture energy and worsen ArtFID much faster than merging by draft-output similarity as the merge rate rises. Off this slice, for example busy content with smooth styles, the two criteria should roughly agree. If they do not diverge on the predicted slice, the claim is wrong.
Research Program
The base model is a pretrained StyTr2. It has two transformer encoders, one for content patches and one for style patches. A transformer decoder lets each content token attend to all style tokens, and a small convolutional decoder turns tokens back into pixels. Content self-attention costs $O(N^2)$ in the $N$ content tokens, and cross-attention costs $O(NS)$ in the $S$ style tokens. Both terms matter at 1024px and above.
Three parts are built, each tested in isolation.
The first is the draft pass. The same network stylizes a downsampled copy of the content, at a quarter of the side length and therefore about one sixteenth of the tokens. This mirrors the drafting stage of LapStyle, which renders global style patterns at low resolution and adds residual detail later. Unlike LapStyle, the draft here is used to decide where to spend compute rather than as the image itself, and it works for arbitrary styles, whereas LapStyle trains one model per style. The draft's decoder features are upsampled to the full token grid, giving a predicted stylized feature $d_i$ at each content position $i$.
The second is output-side content merging. We adopt the bipartite soft matching of Token Merging and the merge-then-unmerge scheme of Token Merging for Fast Stable Diffusion. That second work merges tokens before attention and copies outputs back to their grid positions afterward, so the spatial layout a pixel decoder needs is never destroyed. We change only the similarity used for matching. Instead of the cosine similarity of the content keys, we match on
$$ s_{ij} = \cos(d_i, d_j), $$
the similarity of the draft's predicted stylized features at positions $i$ and $j$. The per-region merge rate is also scaled down where the draft has high local Laplacian energy, which measures how much fine detail is present. In effect, coarse-scale attention picks which fine tokens stay separate. That is the role coarse queries play in Pyramid Sparse Transformer and the thumbnail selector plays in LookWhere?. The difference is that our selection signal depends on the style, which both of those recognition-oriented methods lack. We also never discard tokens; we only merge them. LookWhere? leaves unselected regions without high-resolution processing, which in stylization would leave them unpainted.
The third is asymmetric style compression. Style tokens are queried as a bag of samples, and their spatial position matters little. We merge them aggressively and keep ToMe's proportional-attention correction: a merged key that stands for $m$ tokens gets $\log m$ added to its attention logit, so the softmax still assigns that cluster its full share of attention. This shrinks $S$ to a small $K$ and makes cross-attention nearly linear in $N$. Single-sequence compression methods apply one criterion to all tokens: DART drops tokens that duplicate a few pivot tokens, and ToMe merges by key similarity. Neither separates a sequence whose layout must be kept (content) from one whose distribution must be kept (style).
Training follows a constraint from prior work. Pyramid Sparse Transformer reports that training with hard top-$k$ fine-token selection failed to converge or to improve results. We therefore never train through a hard selection step. The method is first evaluated with no retraining at all. A second variant fine-tunes StyTr2 for a short schedule while merge rates are sampled at random, so the decoder learns to tolerate merged tokens. The budget rule itself stays training-free.
Baselines
The naive reference is unmodified StyTr2 at full token count. It sets the quality ceiling and the latency and memory floor. Every compressed variant is also scored by perceptual distance to this full-resolution output, which isolates what compression costs from what the base model already gets wrong.
The strongest existing efficiency method is ToMe for Stable Diffusion applied directly to StyTr2: random 2×2 partitions, matching on content keys, unmerging before the pixel decoder, with style tokens left intact. On its own task it reports an FID of 33.02 against 33.12 for the unmerged model at 50% token reduction, with Stable Diffusion v1.5 evaluated on ImageNet-1k. It also reports texture blurring once more than 60% of tokens are merged (Token Merging for Fast Stable Diffusion). This makes it the natural competitor, because it already solves the grid-destruction problem and differs from our method only in the redundancy criterion. It runs on the same checkpoint, at the same merge-rate grid from 30% to 80%, on the same pairs and GPU. In the fine-tuned setting it receives the same random-rate fine-tuning budget. We count it as beaten if, at matched wall-clock latency, our method has lower ArtFID and keeps more high-frequency energy on the flat-content / textured-style slice. The draft pass's cost is included in our latency.
The strongest fast stylizers outside the transformer family bound whether transformer efficiency matters at all. ArtNet reports 68.03 FPS on 512×512 images, and LapStyle reports 110 FPS at 512px on a Titan X, though LapStyle needs one model per style. SANet reports 18–24 FPS at 512px. All are rerun on our hardware and placed on the same quality–latency curve. We found no reported ArtFID for StyTr2, ArtNet, SANet or LapStyle on Lacuna, so all ArtFID values will be measured by us under one protocol.
Two ablations isolate the key ingredient. The first uses the full method's output-side budget but keeps content-key similarity for matching; this separates the effect of where merging happens from what similarity it uses. The second, and the more important, drops the draft entirely. It matches on the decoder's own intermediate cross-attended features in the same pass, after the first decoder layer. If this matches the draft-based version, we adopt it, since the claim concerns an output-side criterion, not the draft. A style-compression-only variant measures how much speedup comes from the style side alone.
Why not just…?
Why not just plug ToMe for Stable Diffusion into StyTr2? This is the real threat. Our hypothesis predicts that it holds up at low merge rates and fails on flat content paired with textured styles, where queries with similar content get identical stylized outputs. The head-to-head sweep, broken down by data slice, settles the question. If content-key merging matches our method on the predicted failure slice, the core claim is refuted and we will report it as such.
Why not just use a fast CNN, or draft at low resolution and upsample? ArtNet and LapStyle are already several times faster than any transformer stylizer. Arguments for transformers rest on StyTr2's report of less content leak, and ArtNet's own structural similarity ranked second to the slower StyleSwap. That is suggestive, not decisive. The quality–latency curve at 512, 1024 and 2048px will show whether compressed transformers occupy a region the CNNs do not. If they do not, the honest conclusion is that this efficiency work is not worth deploying. The draft-only-plus-upsampling variant is included explicitly to test whether the full-resolution pass adds anything.
Why not just use fixed windowed or memory-efficient attention? Fixed local windows, as in the per-head windows of Multi-Scale Self-Attention for Text Classification, cut cost but give every region the same budget. Kernels like FlashAttention save memory, not the quadratic compute. We run a windowed-attention StyTr2 at matched latency and combine every method with the same efficient kernel. Merging and efficient kernels can be stacked, as ToMe for SD showed with xFormers, so this alternative is a component of the comparison, not a substitute for it.
Proposed Experiments
Content images come from MS-COCO and styles from WikiArt, following the StyTr2 and SANet training sources. Evaluation follows the ArtFID protocol. ArtFID combines LPIPS content distance with a Fréchet distance computed on features from a network trained on artworks, and its authors report a 0.939 rank correlation with human judgments. We add the ArtNet-style set of 1092 pairs for comparability with ArtNet. Beyond ArtFID we measure three things: LPIPS to the uncompressed output, the ratio of Laplacian-band energy in compressed versus uncompressed outputs, and latency and peak memory at 512, 1024 and 2048px.
The decisive check is a stratified analysis. COCO images are binned by the fraction of low-texture area and WikiArt styles by texture energy. ArtFID degradation is then plotted against merge rate for content-key and draft-output matching in each bin. The hypothesis predicts a widening gap in the flat-content / textured-style bin and a near-zero gap in the opposite bin. A second check sweeps draft resolution to find where strokes finer than the draft's resolution go undetected. A small user preference study on the decisive slice, in the format of SANet's and LapStyle's studies, confirms that the measured texture loss is visible to people.
References
- StyTr2: Image Style Transfer with Transformers
- Drafting and Revision: Laplacian Pyramid Network for Fast High-Quality Artistic Style Transfer
- Token Merging: Your ViT But Faster
- Token Merging for Fast Stable Diffusion
- Pyramid Sparse Transformer: Enhancing Multi-Scale Feature Fusion with Dynamic Token Selection
- LookWhere? Efficient Visual Recognition by Learning Where to Look and What to See from Self-Supervision
- Stop Looking for "Important Tokens" in Multimodal Language Models: Duplication Matters More
- Real-time Universal Style Transfer on High-resolution Images via Zero-channel Pruning
- Arbitrary Style Transfer With Style-Attentional Networks
- Multi-Scale Self-Attention for Text Classification
- ArtFID: Quantitative Evaluation of Neural Style Transfer