Cross-Attention That Opens Only When It Pays: Information-Gated Fusion for Joint Diffusion

One way to build a diffusion model (a generator that learns by gradually turning random noise into samples) is to model an image and a paired signal, such as a depth map, a pose skeleton or a face identity, as one joint distribution. The same network can then draw the image from the signal, estimate the signal from the image, or produce both from scratch. The two halves of such a model talk through cross-modal attention, where features from one modality look up and copy information from the other. Current joint models leave that channel always on. When the two modalities are tightly linked, as an image and its depth map are, this works well. When they are only loosely linked, as an image and an identity embedding are, training becomes unstable. It is also not clear that one branch is not quietly ignoring the other.

We propose to gate each cross-attention connection in a joint diffusion model by the information it actually delivers. Independent noise levels per modality are already part of training, and they provide a free counterfactual. A model sees the image denoised with an informative condition and with a condition that is nearly pure noise. The gap between the two denoising errors measures how much the condition helped. We use this measured gain to supervise a gate on every cross-attention path. Information flows only where and when it lowers denoising error, and paths that never pay are pruned at inference. We expect this to stabilize training on loosely correlated pairs. We also expect it to give a direct readout of modality dominance and to recover part of the 2x slowdown that joint models pay over single-stream conditional models.

Core Claim

The amount of information one modality should pass to the other during joint denoising depends on three things: the noise levels of both modalities, the specific pair (depth versus identity), and the image region (a face versus the background). Existing joint models capture at most the first.

UniCon has the following design:

  • Two parallel diffusion branches joined by joint cross-attention.
  • Independently sampled timesteps $t_x, t_y$ for the two branches.
  • A single training stage that covers generation, estimation and joint sampling.

Its cross-attention is static across timesteps. The paper also reports training instability and data hunger on loosely correlated conditions such as identity and appearance.

JointDiT builds an RGB-depth dual-branch Flux transformer. It scales cross-branch attention with adaptive weights that depend on the two noise levels, which favors the cleaner modality. This is the closest prior work. Its weights depend only on the timestep pair and were demonstrated only on dense RGB-depth. They do not respond to whether the other modality is informative for this content.

Gated Cross-Attention for drug-target interaction supplies our gating form: a learned mix $g\cdot\text{cross} + (1-g)\cdot\text{orig}$ with sparse attention. It showed that this preserves the identity of the weaker modality's features in a discriminative task, reducing Davis MSE from 0.438 to 0.393. Its gate, however, is trained end to end with no signal saying when crossing is worthwhile.

What is new here is the training signal for the gate. It comes from the joint model's own counterfactual denoising gain, which no cited joint model computes.

Research Program

Write $\ell_x(t_x, t_y)$ for the image branch's noise-prediction error when the image is at noise level $t_x$ and the condition at $t_y$, with $T$ the maximum noise level. The measured information gain of the condition for the image is

$$\Delta_x(t_x,t_y) = \mathbb{E}\big[\ell_x(t_x,T)\big] - \mathbb{E}\big[\ell_x(t_x,t_y)\big],$$

the drop in error from replacing an uninformative condition with one at level $t_y$. $\Delta_y$ is defined symmetrically.

This gain is the natural quantity for two reasons. Diffusion losses are mean-squared denoising errors under Gaussian corruption. Under Gaussian corruption, the drop in optimal mean-squared error from adding side information, integrated over noise levels, gives the mutual information between signal and side information; this is the standard I-MMSE identity. So $\Delta$ is a local, per-noise-level view of how much the two modalities share.

$\Delta$ can be estimated at two granularities:

  • Coarse. Bin ordinary training losses by $(t_x, t_y)$. Because $t_y$ is sampled uniformly in UniCon-style training, the bin near $t_y=T$ is a free reference, and no extra compute is needed.
  • Fine. Run a second forward pass with the condition fully noised on about 10% of each batch. This gives a per-token gain map $\Delta_x(i)$, kept as an exponential moving average.

Each cross-attention path $\ell$ (one per layer and direction) gets a gate $g_\ell \in [0,1]$ in the GCA form. The gate is a small network of the two timestep embeddings and the pooled query features, with sparsemax attention inside. The gates are trained with the usual diffusion loss plus a penalty on opening where the measured gain is below a threshold $\epsilon$:

$$\mathcal{L}_{\text{gate}} = \lambda\,\mathbb{E}_{\ell,i}\big[\,g_\ell(i)\,\max(0,\ \epsilon - \hat\Delta(i))\,\big],$$

where $\hat\Delta(i)$ is the normalized gain at token $i$ and $\lambda$ sets the strength. Gates remain free to open wherever crossing reduces error. Paths that transmit mostly noise, the failure the file's Gap 2 describes for a fully noised branch, are pushed closed.

At inference, any layer whose average gate falls below a cutoff over a task's timestep pairs is skipped entirely. Skipping is fixed per task: controllable generation uses $t_y=0$, estimation uses $t_x=0$, and joint sampling uses equal levels. This turns gating into a concrete speedup.

The program has three stages:

  1. Build the gain maps on a reproduced UniCon (Stable Diffusion image branch, LoRA condition branch). This is a diagnostic in its own right: we expect dense pairs to show high gain at all noise levels, and identity to show gain concentrated at low image noise and on face tokens.
  2. Train gated models for each pair.
  3. Test whether the gates, the gain maps and an attribution measure in the style of When One Modality Rules Them All agree on which modality dominates. That paper showed InstructPix2Pix attributing almost everything to text (0.9532 versus 0.0045 for image), which is the kind of lopsidedness our gain maps should reveal.

Baselines

Naive reference. UniCon with its static, ungated joint cross-attention, retrained by us on the same data and step budget. On zero-shot NYUv2 depth, UniCon reports AbsRel 7.9 against 13.7 for JointNet (UniCon). Our reproduction must land near 7.9 before any comparison counts. Its reported throughput, 5.02 iterations per second versus 10.82 for ControlNet, is the latency reference.

Strongest existing method. JointDiT-style noise-adaptive scheduling weights ported into the same UniCon backbone, so that the comparison isolates the weighting rule rather than the Flux transformer. JointDiT is the strongest competitor because it already modulates cross-attention by modality state and reportedly beats UniCon and ControlNet on PascalVOC and OpenImages depth-conditioned FID. No reported number was found on Lacuna for JointDiT's FID or its NYUv2 AbsRel, so we will compare against our port. Beating it means two things: at least matching it on dense pairs (depth, soft edge) within seed noise, and clearly improving stability and fidelity on identity and appearance.

Key-ingredient ablation. The same GCA-style gates trained end to end with no gain penalty. This tests whether the measured-gain supervision matters at all, or whether a learnable gate alone does the work.

Second ablation. Gates fixed to an offline schedule, read once from a trained UniCon's gain maps. This tests whether online, content-dependent gating is needed.

External reference. For estimation, the decoupled specialist DPT, which UniCon reports being competitive with.

Fairness. All variants share data, resolution, LoRA rank, optimizer, step count and a matched hyperparameter sweep of equal size. The extra 10% forward pass is counted in our reported training compute.

Why not just…?

Why not just use JointDiT's noise-level weights? This is the most serious threat. If loosely correlated pairs fail only because a noisy branch pollutes a clean one, timestep-only weighting would fix it, and our content-dependent signal would add nothing. The ported-JointDiT baseline settles this directly.

Our hypothesis says it should not be enough for identity. Identity information is useful on face tokens and useless elsewhere at the same timestep pair, and a timestep-only weight cannot express that. If the port matches us on CelebA identity stability and fidelity, we will report that content dependence is unnecessary and keep only the pruning result.

Why not just a learnable gate, as in GCA? The GCA evidence shows gating preserves weaker-modality features in a discriminative setting. In joint diffusion, though, the gradient telling a gate to open comes from a single noisy timestep sample. For a loosely correlated pair that gradient is weak and high-variance. This is plausibly the same source as UniCon's instability.

The unsupervised-gate ablation measures exactly this. If it is equally stable across five seeds, the gain penalty is superfluous, and we would say so.

Why not just drop cross-attention for concatenation plus a contrastive loss, as CMMD does? CMMD gains real speed: 136 ms versus 721 ms per function evaluation, and FVD 611 versus 726 on AIST++. But its alignment gains are small: a 45% hit rate on EPIC-Sound against 44% without the contrastive loss. Its authors also concede a quality-alignment trade-off. Our approach targets the speed CMMD wants by removing only the paths that carry no measured information. We include an easy-fusion variant on the same backbone to check whether it matches gated attention on dense pairs, where its simplicity might suffice.

Proposed Experiments

Pairs and data. Training uses UniCon's setting for depth, soft edge, identity and appearance. Dense-pair evaluation covers:

  • Controllable generation: PascalVOC FID and condition alignment.
  • Estimation: zero-shot AbsRel on NYUv2, ScanNet, KITTI, DIODE and ETH3D.

Loosely correlated pairs are evaluated on CelebA identity-conditioned generation using identity-embedding similarity and FID. No reported number was found on Lacuna for UniCon's CelebA identity result, so our reproduction is the reference.

Stability. Measured as the fraction of seeds that diverge or plateau, and the variance of the final loss, across five seeds per variant.

Generality. A multi-domain extension trains on Joint-1.6M and checks edge estimation on BSDS500 against Jodi's reported ODS of 0.826 (Jodi).

Decisive checks. The gain maps must recover the expected structure: high and broad gain for depth, sparse and face-localized gain for identity. If they do not, the signal is not measuring what we claim. The gated model must:

  • cut seed-level failures on identity and appearance relative to both UniCon and the JointDiT port;
  • stay within noise of them on NYUv2 AbsRel and PascalVOC FID;
  • raise throughput above UniCon's 5.02 iterations per second at matched quality, after layer pruning.

Finally, a modality-attribution test in the style of Wang et al. checks whether gated models show more balanced attribution between branches than ungated ones. Balance would mean neither branch is short-circuiting the other.