SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.06940 · ICLR · 2025

Representation Alignment for Generation: Training Diffusion Transformers Is Easier Than You Think

Jinwoo Shin, Jongheon Jeong, Kaist, Saining Xie, Sihyun Yu, Huiwon Jang, Jonathan Huang, Sangkyung Kwak

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2410.06940.json · badge: /api/ran/2410.06940.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
sihyun-yu/REPA canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
End2End-Diffusion/REPA-E extension (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
cloneofsimo/repa-rf reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
create_npz_from_sample_folder Ran
ran; our contract draft was wrong, not the code
sihyun-yu/REPA/generate.py
code served (permissive licence) · get_code("7b21a01ae77703a3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary directory with sample PNG files
temp_dir = tempfile.mkdtemp()

# Create a few small sample PNG images (3 samples instead of 50000 for testing)
num_samples = 3
image_height = 32
image_width = 32

for i in range(num_samples):
    # Create a small RGB image array
    img_array = np.random.randint(0, 256, (image_height, image_width, 3), dtype=np.uint8)
    img = Image.fromarray(img_array, mode='RGB')
    img.save(f'{temp_dir}/{i:06d}.png')

ARGS = {
    'sample_dir': temp_dir,
    'num': num_samples,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mean_flat Ran
ran; our contract draft was wrong, not the code
sihyun-yu/REPA/loss.py
code served (permissive licence) · get_code("dd96bc6c07c85dae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes a tensor x and computes the mean over all non-batch dimensions
# It expects x to be a multi-dimensional tensor where dim 0 is the batch dimension
# Let's create a small tensor with batch size 2 and some additional dimensions

x = torch.randn(2, 4, 3, 5)  # batch_size=2, then 3 other dimensions

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
register_forward_hook Ran
ran; our contract draft was wrong, not the code
cloneofsimo/repa-rf/model.py
pointer only (licence: NONE) · get_code("2574faa65a90497c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cloneofsimo/repa-rf when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

repeat_interleave_batch Ran
ran; our contract draft was wrong, not the code
End2End-Diffusion/REPA-E/models/jepa.py
code served (permissive licence) · get_code("633782fa73a481c8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (12, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Analyze the function:
# - x: a tensor that gets sliced by B and concatenated
# - B: batch size (int)
# - repeat: number of times to repeat each batch (int)
# The function divides x into N batches of size B, repeats each batch 'repeat' times,
# and concatenates everything back together.

# Create a small tensor: total length should be divisible by B
# Let's use B=2, so we need a tensor of length that's a multiple of 2
# Shape: (4, 3) means 4 samples with 3 features
x = torch.randn(4, 3)

B = 2  # batch size
repeat = 3  # repeat factor

ARGS = {
    "x": x,
    "B": B,
    "repeat": repeat,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (12, 3) — shape (12, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample_posterior Ran
ran; our contract draft was wrong, not the code
End2End-Diffusion/REPA-E/train_repae.py
code served (permissive licence) · get_code("d9ed023467b54ff6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# moments should be a tensor with shape (batch_size, 2*latent_dim)
# because it gets chunked into mean and std along dim=1
moments = torch.randn(2, 8)  # batch_size=2, 2*latent_dim=8 (so latent_dim=4)

latents_scale = 1.0
latents_bias = 0.0

ARGS = {
    "moments": moments,
    "latents_scale": latents_scale,
    "latents_bias": latents_bias,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
timestep_embedding Ran
ran; our contract draft was wrong, not the code
cloneofsimo/repa-rf/model.py
pointer only (licence: NONE) · get_code("226b182ef184aeeb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cloneofsimo/repa-rf when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

trunc_normal_ Ran
ran; our contract draft was wrong, not the code
End2End-Diffusion/REPA-E/models/jepa.py
code served (permissive licence) · get_code("28455f5511c6676f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Create a small tensor to be initialized
tensor = torch.empty(2, 4)

# Define arguments for trunc_normal_
ARGS = {
    "tensor": tensor,
    "mean": 0.0,
    "std": 1.0,
    "a": -2.0,
    "b": 2.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SILoss Not yet run
unverified (harvested, no recorded run)
sihyun-yu/REPA/loss.py
code served (permissive licence) · get_code("d329e84f446c15f7")
How it ran

no invocation recorded.

apply_masks Not yet run
unverified (harvested, no recorded run)
End2End-Diffusion/REPA-E/models/jepa.py
code served (permissive licence) · get_code("d93366188784217e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 6 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
trunc_normal_ 160 other papers
123 dated earlier, 3 the same month, 32 later, 2 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
create_npz_from_sample_folder 23 other papers
11 dated earlier, 3 the same month, 9 later
2401.08740 (2024-01)
SiT: Exploring Flow and Diffusion-based Generative Models with Scalable Interpolant Transformers
2402.14167 (2024-02)
T-Stitch: Accelerating Sampling in Pre-Trained Diffusion Models with Trajectory Stitching
2403.09176 (2024-03)
Switch Diffusion Transformer: Synergizing Denoising Tasks with Sparse Mixture-of-Experts
and 20 more not named here
mean_flat
brick of this paper's assembly: helper
6 other papers
5 later, 1 undated
2505.02831 (2025-05)
No Other Representation Component Is Needed: Diffusion Transformers Can Provide Representation Guidance by Themselves
2505.07447 (2025-05)
Unified Continuous Generative Models
2505.13447 (2025-05)
Mean Flows for One-step Generative Modeling
and 3 more not named here
apply_masks 3 other papers
2 dated earlier, 1 later · 1 only as an assembly brick
2301.08243 (2023-01)
Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture
2409.19407 (2024-09)
Brain-JEPA: Brain Dynamics Foundation Model with Gradient Positioning and Spatiotemporal Masking
2504.13820 (2025-04)
CheXWorld: Exploring Image World Modeling for Radiograph Representation Learning
repeat_interleave_batch 3 other papers
1 dated earlier, 2 later · 2 only as an assembly brick
2301.08243 (2023-01)
Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture
2504.13820 (2025-04)
CheXWorld: Exploring Image World Modeling for Radiograph Representation Learning
2602.02603 (2026-02)
EchoJEPA: A Latent Predictive Foundation Model for Echocardiography
sample_posterior 1 other paper
1 later
2504.10483 (2025-04)
REPA-E: Unlocking VAE for End-to-End Tuning with Latent Diffusion Transformers

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent studies have shown that the denoising process in (generative) diffusion models can induce meaningful (discriminative) representations inside the model, though the quality of these representations still lags behind those learned through recent self-supervised learning methods. We argue that one main bottleneck in training large-scale diffusion models for generation lies in effectively learning these representations. Moreover, training can be made easier by incorporating high-quality external visual representations, rather than relying solely on the diffusion models to learn them independently. We study this by introducing a straightforward regularization called REPresentation Alignment (REPA), which aligns the projections of noisy input hidden states in denoising networks with clean image representations obtained from external, pretrained visual encoders. The results are striking: our simple strategy yields significant improvements in both training efficiency and generation quality when applied to popular diffusion and flow-based transformers, such as DiTs and SiTs. For instance, our method can speed up SiT training by over 17.5×, matching the performance (without classifier-free guidance) of a SiT-XL model trained for 7M steps in less than 400K steps. In terms of final generation quality, our approach achieves state-of-the-art results of FID=1.42 using classifier-free guidance with the guidance interval.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2410.06940")
get_code_for_paper("2410.06940")
have("2410.06940")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2410.06940.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2410.06940.svg)](https://syntology.ai/paper/2410.06940)

Connect an agent — have() is free.