REPA-G: Test-Time Conditioning with Representation-Aligned Visual Features

Nicolas Sereyjol-Garros, Ellington Kirby, Victor Letzelter, Victor Besnier, Nermin SametNeurIPS 2026

TL;DR

What if you could steer an image generator using visual concepts directly plucked from reference photos—like "this exact rabbit's pose" combined with "that specific patch of glowing lava"—without writing a giant text prompt or fine-tuning the model? REPA-G unlocks this exact capability entirely at test time by hijacking a training trick originally meant just to make diffusion models learn faster. It turns out that teaching a generator to mimic a vision encoder's "thoughts" during training gives you a built-in, zero-cost steering wheel at inference.

What Problem Does This Paper Address?

Diffusion and flow-matching models are phenomenal artists, but directing them is surprisingly clunky. Class labels (e.g., "Angora Rabbit") are far too blunt, while text prompts require poetic gymnastics that still miss fine spatial or stylistic nuances. If you want precise visual control—say, using a reference image—you usually have to bolt on extra adapter networks (like IP-Adapter) and run expensive post-training.

Meanwhile, a recent trend called Representation Alignment (REPA) speeds up diffusion training by forcing the generator’s intermediate layers to align with rich, semantic features from pre-trained self-supervised vision encoders (like DINOv2). Until now, researchers treated this alignment strictly as training scaffolding, throwing away its potential once the model finished learning. The authors ask: since the trained generator now speaks the same rich visual language as a vision encoder, can we use that shared language to guide image generation on the fly?

Figure 1: Comparing class-label, text-prompt, and REPA-G conditioning. All models are trained on ImageNet. (Top) We average extracted features ( ) from a anchor image to generate a generic “rabbit” image. (Bottom) We combine a masked feature map with a specific “lava” patch ( ) to synthesize a rabbit on a volcano. While text prompts require lengthy descriptions and often lack precision, our feature-based conditioning offers better compositional control and provides more precise generation.

Methods

Standard classifier guidance steers image generation by taking the gradient of a discrete class predictor and nudging the denoising process toward it. Representation-Aligned Guidance (REPA-G) adapts this paradigm from discrete labels to continuous visual features.

At inference time, you pass a reference image through a vision encoder (like DINOv2—or even an early layer of the aligned diffusion model itself) to get target feature tokens. At each denoising step, REPA-G measures a similarity objective—called the potential—between the generator's internal features and your target features, using the gradient of this similarity to pull the emerging image toward the target concepts. No new parameters, no retraining.

What is novel here is how the authors design the potential to control granularity and composition:

  • Independent Patch Alignment (IPA): Uses fixed spatial weights to match features. Depending on how you weight the patches, you can match the full feature map (near-reconstruction), a masked region (preserving an object's pose while varying the background), an average of all patches (capturing the broad vibe or category without spatial constraints), or a single patch.
  • Selective Patch Alignment (SPA): Instead of forcing a target concept into a rigid grid location, SPA uses a temperature-controlled soft-maximum over patches. This lets the generator dynamically decide where to place a concept—crucial when blending an object from one photo with a background texture (like water or lava) from another.

Datasets

  • ImageNet: 1.2M images across 1,000 classes (preprocessed to $256\times256$, plus a $512\times512$ fine-tuned evaluation). Used as the primary training source for the pretrained backbones and for single- and multi-source evaluations.
  • COCO: 123K images ($256\times256$), used for zero-shot distribution-level evaluation and text-to-image comparisons (via validation set captions).
  • No brand-new datasets are introduced, though the authors construct a custom 40,000-image compositional benchmark from 50 ImageNet classes paired with 8 background textures to test multi-concept blending.

Key Insights and Ideas

  • Denoising alone doesn't learn semantics: When the authors clustered the internal features of a standard diffusion transformer (SiT), the groups were semantically meaningless—explaining why naive feature guidance fails miserably on vanilla models. Training with representation alignment organizes the latent space into clean, smooth semantic neighborhoods where distances directly correspond to visual similarity.
  • Early exit means cheap gradients: Usually, backpropagating through a massive diffusion model at every sampling step is painfully slow. Because REPA aligns features early in the network (the 8th transformer block), REPA-G only backpropagates through the first few layers, making it just 26% slower than unconditional generation.
  • It works beyond REPA: The magic isn't exclusive to DINOv2 or the specific REPA loss. REPA-G works across different vision encoders (CLIP, Perception Encoder) and even on Self-Flow—a self-distilled generative model that uses no external vision backbone at all—proving that any semantically organized, noise-robust internal space can be steered this way.

Key Results

  • Drastic quality jumps on aligned models: On unconditional ImageNet ($256\times256$), guiding a vanilla SiT model actually hurts quality, worsening FID from 45.02 to 71.35. On an aligned REPA-E model, REPA-G slashes FID from 15.07 down to 1.45 (full map) and 2.50 (average concept), while zero-shot COCO FID drops from 36.23 to 4.61.
  • Visual features beat long text: Compared against CAD-I (an ImageNet-trained text-to-image model) using detailed COCO captions, REPA-G achieves an FID of 3.58 (average features) and 2.11 (full features) versus CAD-I's 37.98.
  • Outperforming trained adapters: Without any extra weights or training, REPA-G beats a trained IP-Adapter baseline on ImageNet by 6 FID points, achieves 25% higher DINOv2 alignment, and runs with higher throughput.
  • Superior concept composition: In multi-source blending (e.g., placing an anchor object onto a new target background), combining IPA with SPA achieves the highest CLIP adherence score (0.238) and combined patch similarity (0.466), cleanly outperforming class-interpolation baselines (0.190 CLIP score).

Limitations and Future Work

REPA-G isn't completely plug-and-play when blending multiple complex sources: users sometimes need to manually tune the guidance scale ($\lambda$) to keep one concept from overpowering another. Furthermore, strongly conflicting conditions remain tough—incompatible identities can bleed together, competing spatial constraints can tug gradients in opposite directions, and extreme out-of-distribution mashups can trigger visual artifacts. Future work aims to resolve these gradient conflicts and combine REPA-G with orthogonal structural controls (like depth or edge maps).

Summary updated

Abstract

While representation alignment with self-supervised models has been shown to improve diffusion model training, its potential for enhancing inference-time conditioning remains largely unexplored. We introduce Representation-Aligned Guidance (REPA-G), a framework that leverages these aligned representations, with rich semantic properties, to enable test-time conditioning from features in generation. By optimizing a similarity objective (the *potential*) at inference, we steer the denoising process toward a conditioned representation extracted from a pre-trained feature extractor. Our method provides versatile control at multiple levels of granularity, ranging from patch level matching via single patches to broad semantic guidance using global image feature tokens. We further extend this to multi-concept composition, allowing for the faithful combination of distinct concepts. REPA-G operates entirely at inference time with no additional training required, offering a flexible and precise alternative to often ambiguous text prompts or coarse class labels. Our approach achieves high-quality, diverse generations on ImageNet and COCO. Code is available at https://github.com/valeoai/REPA-G.
BibTeX
@inproceedings{sereyjolgarros2026repa,
  author = {Nicolas Sereyjol-Garros and Ellington Kirby and Victor Letzelter and Victor Besnier and Nermin Samet},
  title = {{REPA-G: Test-Time Conditioning with Representation-Aligned Visual Features}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=uJPI1xg4IN},
}
Figure