SPARE: Structural Parameter-Free Affinity Regularization for Flow Matching

Zong-Wei Hong, Jinglun Li, Shen Zhang, Yuhan Liu, Linze Li, Yao TangarXiv 2026

TL;DR

SPARE (Structural Parameter-free Affinity Regularization) is a zero-overhead regularizer that accelerates the training of diffusion transformers by matching their internal token similarities to those of clean VAE latents. By operating entirely on pairwise scalar relationships, it eliminates the need for expensive external encoders or learnable projection heads, delivering substantial image quality improvements with virtually no computational or memory cost.

What Problem Does This Paper Address?

Diffusion and flow-matching transformers generate stunning visuals but suffer from notoriously slow training convergence. To speed things up, researchers often regularize the model's internal representations during training. Currently, this leaves practitioners with a frustrating trade-off between two costly families of methods:

  1. Target-based alignment (e.g., REPA): Forces the transformer's internal features to match a heavy, pretrained external encoder (like DINOv2). This requires a learnable MLP projection head to bridge the different feature dimensions, adding extra parameters and massive compute overhead.
  2. Target-free repulsion (e.g., Dispersive Loss): Drops the external encoder and simply pushes different images' features apart to encourage diversity. While parameter-free, it completely discards the inherent spatial structures present in the data.

The authors of SPARE ask a clever question: Can we get the structural benefits of a target regularizer without paying the price of an external encoder and projection head?

Methods

The core insight behind SPARE is that spatial structure—how tokens relate to one another—is what primarily drives the benefits of representation alignment.

Instead of aligning high-dimensional feature vectors (which requires a projection head to fix dimension mismatches), SPARE aligns pairwise token affinities (cosine similarities). Because an affinity map is a matrix of single scalars, it collapses the dimension gap entirely. This allows the model's internal features to be compared directly to the clean target data.

Figure 2: Four ways to regularize a diffusion transformer’s representations. (a) Vanilla training, where the latent’s structure goes unused. (b) Target-based alignment (REPA, SRA, SRA2) matches each image’s tokens to reference features through a learnable MLP head (red); the reference may come from a frozen external encoder (blue, drawn) or from internal substitutes. (c) Target-free objectives drop the target and repel the model’s own features uniformly; Dispersive Loss (drawn) repels across the batch, and DiverseDiT applies the same principle across blocks. (d) SPARE (ours) adds nothing. Pairwise affinities of intermediate tokens are calibrated to those of the clean latent, across all positions within each image and at the same position across images, so the data decides which relations should be strong and which weak. The zoom-in, drawn for |B| = 2 images and P = 4 tokens, shows one image’s affinity rows with self-pairs excluded, split into within-image pairs (Apq) and same-position cross-image pairs (App), and the KL calibration toward the frozen latent target.

SPARE extracts the "clean latent" from the VAE (which is already computed during the standard diffusion pipeline) and calculates two types of structural relationships:

  • Intra-image affinity: How tokens within the same image relate to each other, which naturally maps out object boundaries.
  • Cross-image affinity: How tokens at the same spatial position across different images in a batch relate to each other, capturing shared global layouts (like sky at the top or ground at the bottom).

The network is then trained using a single Kullback-Leibler (KL) divergence objective that calibrates the intermediate transformer tokens' affinity distributions to match these clean latent targets.

Datasets

The approach was evaluated on two standard image synthesis benchmarks:

  • ImageNet-1K ($256 \times 256$): Used for class-conditional image generation using Scalable Interpolant Transformers (SiT) backbones.
  • MS-COCO ($256 \times 256$): Used for text-to-image generation using the MMDiT architecture.

Key Insights and Ideas

  • Affinities Bypass the Dimension Gap: Mapping features to a token-to-token affinity matrix removes the ambient feature dimension. This makes layers of any width directly comparable to the target latents without needing a learnable MLP bridge.
  • Clean Latents Provide Free Supervision: You don't need a multi-billion parameter self-supervised model like DINOv2 to teach a transformer about geometry. The clean VAE latent space already faithfully preserves object boundaries and spatial layouts for free.
  • Rethinking Cross-Image Relationships: Prior target-free methods assumed batch-mates share no meaningful structure and should always be repelled. SPARE demonstrates that natural images share strong positional regularities. Aligning these cross-image affinities improves generation, whereas blindly repelling them actually degrades it.
Figure 1: Each map shows the cosine similarity between the query token (star) and all tokens, plotted as deviation from the map’s mean. Model features are taken from layer 3 of SiT-XL/2 at 400K iterations with noised input at timestep 0.5, while the VAE latent is computed from the clean image. The clean latent carries two kinds of affinity structure. Within a single image, affinities follow object boundaries (rows 1–2, one query per image). Across images in a batch, the grass query of image 1 localizes the grass region of image 2 (row 3). Vanilla training recovers neither (mean cosine 0.95, near- uniform maps). SPARE recovers both directly from the data, with no projection head and no added parameters, and im- proves generation quality.

Key Results

  • Best-in-Class Parameter-Free Performance: On ImageNet $256 \times 256$, SPARE achieved the lowest Fréchet Inception Distance (FID) among all parameter-free regularizers, reducing the baseline SiT-XL/2 FID from 17.43 to 13.86 at 400K iterations.
  • Virtually Zero Overhead: SPARE introduces 0 extra parameters, 0 extra FLOPs, and requires a mere 0.08 GB of additional training memory. For comparison, other target-free methods like DiverseDiT add up to 5.52 GB of memory overhead.
  • Highly Complementary: When combined with encoder-based methods like REPA, SPARE pushes performance even further, improving SiT-XL/2's FID from 7.90 to 7.49 at 400K iterations, and reaching an impressive FID of 1.90 under classifier-free guidance at 1M iterations.

Limitations and Future Work

  • The Semantic Gap: SPARE relies purely on spatial and structural layouts from the VAE. It lacks the high-level semantic and conceptual awareness that heavy, pretrained vision-language models provide. This is why encoder-based methods like REPA still maintain an absolute performance edge when compute is ignored.
  • Restricted Cross-Image Matching: Currently, SPARE only matches cross-image affinities at identical spatial coordinates (e.g., pixel $(x,y)$ in Image 1 to pixel $(x,y)$ in Image 2). Expanding this to non-local, flexible cross-image correspondences could unlock even richer structural targets.
  • Scale and Modality: The evaluation is currently limited to $256 \times 256$ image generation. Testing SPARE on higher resolutions, massive text-to-image models, or video generation remains an open avenue for future research.

Summary updated

BibTeX
@misc{hong2026spare,
  author = {Zong-Wei Hong and Jinglun Li and Shen Zhang and Yuhan Liu and Linze Li and Yao Tang},
  title = {{SPARE: Structural Parameter-Free Affinity Regularization for Flow Matching}},
  year = {2026},
  eprint = {2608.01990},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.01990},
}
Figure