NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

How Many Bits Does Style Transfer Need? Message-Budgeted Cross-Image Attention

Training-free style and appearance transfer in diffusion models works by letting one image "read" from another. A diffusion model is a generator that turns random noise into an image by denoising it step by step. During that process, the image being generated (the content) swaps in or appends the internal features of a reference image (the style), so that each location in the content image pulls its look from the matching location in the reference. Every current method lets the content side read the reference's entire feature set at every layer and step. Nobody has asked how much of that information is actually needed, or whether the answer depends on the kind of transfer. This note proposes to answer that question by treating the reference as one party (Bob) who sends a message of bounded size and the content generator as another party (Alice) who must produce the stylized image from that message alone. That setup is the standard two-party model of communication complexity.

The central prediction comes from lower-bound results on Hamming-distance and disjointness problems. Transfer that only needs global agreement, such as matching the overall color palette, should need a message of roughly constant size. Transfer that must put the right appearance on each corresponding part should need a message that grows with the number of distinct semantic parts. A second prediction is that letting the content side speak first, by announcing a coarse summary of which parts it contains, should sharply lower the required message when the reference contains many parts the content does not. We will measure rate–quality curves, meaning the trade-off between message size and output quality, for attention injection on standard benchmarks. We will test whether they follow the predicted scaling. We will also test whether the content-aware two-round protocol beats the strongest content-blind compression at equal budget.

Core Claim

The claim has two parts, one empirical and one methodological. Empirically, the reference information that cross-image attention actually uses is far smaller than the full set of reference keys and values (the per-location features attention reads from). Its size scales with the number of corresponding semantic parts between the two images, not with resolution. Methodologically, the scaling is predicted by communication complexity, which gives a concrete design rule that current methods lack. If content and reference are mismatched in which parts they contain, a one-way message from reference to content is necessarily wasteful. A short message in the opposite direction first is the cheap fix.

Formally, let $\delta$ be a quality target (for example a bound on region-wise appearance error). Let $R_1(\delta)$ be the smallest number of bits a content-blind reference message needs to reach it. Let $R_2(\delta)$ be the same quantity when the content side may first send a summary of at most $s$ bits. We conjecture

$$R_1(\delta) \approx c\, P_{\text{ref}}, \qquad R_2(\delta) \approx s + c\, P_{\text{shared}},$$

where $P_{\text{ref}}$ is the number of distinct semantic parts in the reference, $P_{\text{shared}}$ is the number of parts the two images share, and $c$ is the per-part cost of describing an appearance. The first form follows from a standard argument: a sender who does not know which of its parts the receiver will need must describe all of them. The second form follows from the intersection structure studied for disjointness.

Why Communication Complexity Is the Right Lens

The theory supplies the shape of the prediction, not a new theorem about neural networks. The Information Complexity of Hamming Distance shows that deciding whether two strings differ in at most $d$ places costs $\Omega(\min\{\log n, d \log(1/\epsilon)\})$ bits of information. In contrast, the $d=0$ case (equality) costs a constant independent of $n$. This constant-versus-$d$ split is the analogue we expect between global statistics transfer (AdaIN, which matches per-channel feature means and variances) and part-wise transfer. Lower Bounds on the Deterministic and Quantum Communication Complexity of Hamming-Distance Problems gives near-$n$ deterministic bounds for the exact versions, showing that exact local agreement cannot be compressed away. Near-optimal bounds on bounded-round quantum communication complexity of disjointness shows that the number of rounds of interaction changes total communication for intersection-type problems. That result motivates our two-round protocol. New bounds on classical and quantum one-way communication complexity characterizes one-way protocols through rectangle bounds, the regime our content-blind baselines live in.

These papers motivate and shape the hypothesis. They do not prove it for diffusion features. Real features are continuous, approximately matched, and judged by perceptual quality. For that reason, the theoretical deliverable is modest. It is a reduction showing that a synthetic, idealized part-wise transfer task embeds a Hamming-distance or intersection instance, so any protocol solving that task inherits the known bounds. The rest of the program is empirical.

On the vision side, Cross-Image Attention for Zero-Shot Appearance Transfer replaces the content image's keys and values with the reference's. The product of content queries and reference keys then acts as a dense correspondence map. The same paper reports failures when the two images lack corresponding parts, which is exactly the regime where our theory says content-blind messages waste bits. Style Injection in Diffusion (StyleID) swaps keys and values but blends back the content queries and sharpens attention with a temperature. Style Aligned Image Generation via Shared Attention shows that all-to-all sharing across a batch causes style collapse and content leakage, so every image attends only to one reference. CoCoDiff builds explicit dense correspondences and refines them iteratively. All four assume unlimited access to reference features. None measures how much of that access matters. We reuse their injection mechanics unchanged and constrain only what crosses from reference to content.

Research Program

We will build three message-budgeted variants of attention injection on the StyleID pipeline (Stable Diffusion with key–value swapping and query preservation), with a budget of $m$ tokens per injected layer quantized to $b$ bits.

The first variant is content-blind compression. The reference side compresses its key–value set to $m$ tokens without seeing the content, using k-means clustering of reference keys with averaged values, or random subsampling. The second variant is two-round, content-aware selection. The content side sends a coarse summary: $s$ bits encoding a clustered sketch of its own queries at the lowest-resolution layer. The reference side returns the $m$ tokens with highest affinity to that sketch. The third variant is the global-only reference, which sends only channel statistics, the AdaIN message.

All three variants keep the content's own keys and values available in the concatenated, hybrid form used by Text to Sketch Generation with Multi-Styles. Low budgets therefore degrade toward self-attention rather than to noise.

The analysis step sweeps $m$ and $b$ to trace rate–quality curves. We then regress the budget needed to reach a fixed quality against counts of reference parts and shared parts. Part counts come from MS-COCO instance categories and SPair-71k keypoint classes. The theory step writes down the synthetic reduction. An image with $n$ part slots, each carrying one of two textures, is transferred part-wise. Correctness on all slots is equivalent to computing the slot-wise agreement pattern, so the Hamming-distance and intersection bounds apply. We check that the learned protocols' curves on rendered versions of this task bend where the bounds say they must.

A secondary hypothesis concerns content leakage. Reproducing reference geometry should need many more bits than reproducing appearance. A moderate budget may therefore reduce leakage as a side effect, and this would show up as better structure preservation (CFSD) at equal style fidelity.

Baselines

The do-nothing reference point is the content image denoised from its own inversion with no injection. It anchors the structure metrics from above and the style metrics from below. The global-statistics baseline is AdaIN on the initial latent alone, as used inside StyleID. It is the constant-size message and tests whether part-wise information buys anything at all.

The strongest full-access method on the shared MS-COCO/WikiArt protocol is StyleID. Style Injection in Diffusion reports ArtFID 28.8 and FID 18.1. CoCoDiff reports FID 18.432, LPIPS 0.549, and CFSD 0.609 on the same content and style sources. We will rerun both with their released settings on our exact content–style pairs and model checkpoint rather than copying numbers. They define the unbounded-message ceiling.

The proposal does not aim to beat these methods outright. Success means matching StyleID's ArtFID within its rerun seed variance using a small fraction of the reference tokens. The strongest compression competitor is content-blind k-means compression at the same token budget. It receives the same layer and timestep schedule, the same temperature, and an equal tuning budget over cluster initialization and temperature.

The key ablation isolates interaction. At equal total bits, counting the content summary $s$ against the two-round method, we compare one-way and two-round selection. The two-round method beats this ablation only if it reaches equal ArtFID and part-wise appearance accuracy with fewer total bits. The gain must also grow with $P_{\text{ref}} - P_{\text{shared}}$, as predicted. A second ablation randomizes which content summary is sent. This separates the value of the interaction from the value of simply sending extra bits.

Why not just…?

Why not just keep full key–value injection, since memory is cheap? For a single pair, full injection is fine, and we treat it as the ceiling, not the target. The question matters in two places. One is multi-reference and reference-bank settings, where caching every reference's features at every layer and step dominates memory and transfer. The other is scientific: Style Aligned Image Generation via Shared Attention found that unrestricted sharing causes leakage, which suggests that "more reference information" is not monotonically better. The leakage measurement in this proposal tests that directly.

Why not just send global statistics (AdaIN or Gram matrices)? Both Cross-Image Attention for Zero-Shot Appearance Transfer and CoCoDiff report that global statistics misplace textures across parts. The Hamming-distance results explain why: global matching is equality-like and constant-cost, while part-wise agreement is not. We include AdaIN as a baseline and expect it to win on single-texture styles. A finding that it matches dense injection on part-wise appearance accuracy would falsify the core claim.

Why not just compress the reference with clustering or token merging, with no theory? This is the real threat. If k-means compression matches two-round selection at every budget, the interaction idea is wrong and the contribution shrinks to a measured rate–quality curve. The theory says the two should coincide when reference and content share most parts, and diverge when the reference has many parts the content lacks. We therefore stratify every comparison by part mismatch. Divergence in the mismatched stratum and coincidence in the matched stratum would support the claim. Coincidence in both strata would refute it, and we would report that.

Why not just train an IP-Adapter or LoRA, which is already a fixed-size message? Adapters are fixed-size messages, which makes them a natural point on our curve rather than a competitor to the question. They need per-style training (StyleID reports optimization baselines taking over 800 seconds versus about 12.4 seconds training-free). Their message is also content-blind by construction. We will place a released image-adapter's embedding size on the rate axis as a reference point, without training new ones.

Proposed Experiments

The main experiment uses MS-COCO content images and WikiArt style references, following the StyleID protocol. It reports ArtFID, FID, LPIPS, and CFSD against token budgets from a handful of tokens up to full access. For part-wise accuracy, we use COCO instance masks and SPair-71k keypoint-annotated pairs (SPair-71k, 12,234 test pairs). For each content part we measure whether its output appearance, as Gram distance within the region, is closer to the corresponding reference part than to any other reference part. No reported part-wise result on these benchmarks was found on Lacuna, so this metric is new and will be validated against a small user study. The cross-domain pairs from Cross-Image Attention (buildings, animals, cars) provide the mismatched-part stress test.

The decisive checks are three. First, the budget needed to reach StyleID-level ArtFID should scale with the number of shared parts, not with image resolution, when resolution is varied at fixed content. Second, the two-round advantage over k-means at equal total bits should grow with part mismatch. Third, on the synthetic slot task, no budgeted protocol should succeed below the bit count implied by the Hamming-distance reduction. If all three hold, communication complexity becomes a working design tool for attention injection. If the first fails, reference information is not organized by parts and the lens does not apply.