Rectified Language Flow

A rectified-flow language model that writes 1,024 tokens at a time, with no masking and no left-to-right order. Below, ReLF-Large and an autoregressive model of the same size generate side by side on measured wall-clock time.

0 ms
ReLF steps
ReLF-Large
AR-Large
Blocks

Block 1

At every sampling step all 1,024 positions hold a predicted token, and the whole block moves together along a short trajectory from noise to text; the autoregressive model fills the same block one token at a time. Each box is one token position, the clock is measured wall-clock time, and every frame is stored model output.

one block at a time, batch size 1

From the paper

Results

On OpenWebText with 64 function evaluations, ReLF attains lower generative perplexity than autoregressive baselines at every model size tested under matched diversity, and reflow straightens the flow for few-step generation.

Generative perplexity against entropy for ReLF, ELF and autoregressive models at three sizes, with real text marked by a star.

(a) Quality and diversity at 64 NFE

Bar chart of the wall-clock speedup of ReLF over autoregressive models at batch sizes 1 and 64 for three model sizes.

(b) Wall-clock speedup

Quality, diversity and speed. (a) Quality–diversity trade-off of ReLF and ELF at 64 NFE, with AR temperature sweeps as reference; colors denote methods, markers model sizes, and the star real text. ReLF-Large reaches Gen. PPL 17.3 at entropy 5.51, close to real text (17.3 at 5.49). (b) Wall-clock speedup over AR for 1,024-token generation on one GPU, with KV caching for AR and CUDA graphs for both; ReLF after two reflow rounds at 16 NFE.
Generative perplexity and entropy against the number of function evaluations for three model sizes after zero, one and two reflow rounds.
Few-step generation across reflow rounds. Gen. PPL (top) and entropy (bottom) versus NFE for ReLF-Small, ReLF-Medium and ReLF-Large after zero, one and two reflow rounds. At 8 NFE, two rounds reduce Gen. PPL by 40%, 41% and 35%, respectively, relative to the model before reflow. Dotted lines are same-size AR models; long-dashed lines are real OpenWebText.
Time per batch and throughput of ReLF and autoregressive models at batch sizes 1, 4, 16 and 64, with the speedup over the autoregressive model above each ReLF bar.
Latency and throughput. ReLF at 16 NFE after two reflow rounds and AR on one GPU, with KV caching for AR and CUDA graphs for both. Top: time per batch of 1,024-token sequences; bottom: throughput in tokens per second, at batch sizes 1, 4, 16 and 64. Labels above the ReLF bars give the speedup over AR.

From the paper

Ablations

Singular logits, Hellinger–SVD embeddings and cross-entropy training each lower generative perplexity at matched entropy, and a 32-dimensional flow space gives the best quality–diversity trade-off.

Generative perplexity against entropy with and without singular logits, over momentum guidance strength.

(a) Singular logits

Generative perplexity against entropy for Hellinger–SVD, Gaussian and one-hot embeddings.

(b) Embedding matrix

Generative perplexity against entropy for cross-entropy and MSE training over the guidance scale.

(c) Training objective

Generative perplexity against entropy for flow embedding dimensions 16 to 256.

(d) Flow embedding dimension

Generative perplexity and entropy against the number of function evaluations for the SDE and Euler samplers.

(e) Sampling budget

Generative perplexity and entropy against the guidance scale for the Small, Medium and Large models.

(f) Guidance and model size

Legend: SDE sampler solid line, Euler sampler dashed line in panels b and e; real data as a dashed reference line.
Ablations. ReLF-Small at 64 NFE unless indicated. (a) Singular logits under momentum guidance α. (b) Embedding matrix. (c) Cross-entropy and MSE training objectives over the guidance scale ω. (d) Flow embedding dimension. (e) Number of function evaluations at ω = 1.7. (f) Guidance response of the Small, Medium and Large models. Panels (a)–(d) show Gen. PPL versus entropy; (e) and (f) show Gen. PPL above and entropy below. The diversity floor is entropy 5.40. At entropy 5.45, cross-entropy training reaches Gen. PPL 24.1 versus 25.6 for MSE.

From the paper

How it works

ReLF is trained with cross-entropy on positionwise token posteriors, and its velocity is the posterior-weighted mean of the token embeddings. Singular logits capture the divergent part of the posterior analytically, leaving the network a bounded residual and guaranteeing that the flow converges to a valid token embedding.

Architecture diagram: the noisy state and the self-conditioning input enter a Transformer whose residual logits are added to singular logits; the probability-weighted mean of token embeddings is fed back as the next self-conditioning input.
Architecture. From the noisy state Zt and the self-conditioning input, the Transformer outputs residual logits fθ, which are added to the singular logits s. The prediction X̂1, a probability-weighted mean of token embeddings, is fed back without gradient as the next self-conditioning input (dashed).
Three panels: token probabilities along the trajectory with bounded logits and with singular logits, and the resulting flow paths in embedding space.
Singular logits connect commitment to embedding convergence. A four-token example in which both models share the bounded residual fθ and the initial state Z0. (a) With bounded logits, the token distribution pt keeps mass on competing tokens. (b) Adding s = log rt drives pt to a one-hot distribution. (c) Correspondingly, the flow ends at an embedding mixture (dashed) or at the token embedding E(w1) (solid).

About the replay

ModelSequential steps per blockTime per blockSpeedup, batch size 1Speedup, batch size 64Gen. PPLEntropy