SwaFlow: A Fully Open Suite for Studying Riemannian Flow Language Models Across Training and Scale

Daisuke Oba, Sakae Mizuki, Hiroya Takamura, Naoaki OkazakiarXiv 2026

TL;DR

What happens when you replace discrete next-token prediction with continuous flow matching on the surface of a high-dimensional sphere—and actually scale it up? SwaFlow is the first Pythia-style open research suite for Riemannian flow language models, scaling from 150M to 3B parameters across trillions of tokens alongside matched autoregressive "twins." By tracking 386 intermediate checkpoints, the authors reveal both the hidden geometric mechanics of how these models learn and a glaring blind spot: standard continuous training completely fails to teach models how to read clean prompts—until a simple late-stage fix brings them to life.

What Problem Does This Paper Address?

While autoregressive (AR) models generate text one discrete token at a time, Riemannian flow language models corrupt and denoise text continuously along a curved geometric space (in this case, a hypersphere of unit-length token embeddings). Instead of masking a word completely, every token slides smoothly along a great circle toward random noise, retaining graded evidence of its identity.

Until now, we had no idea if this paradigm was actually worth scaling. Existing Riemannian flow releases were tiny (~100M parameters) and consisted only of final model weights. Without multiple model sizes, intermediate training states, reproducible data orders, or apples-to-apples AR baselines, the community couldn't watch how these continuous models evolve—or diagnose where they break as they grow.

Methods

The authors built SwaFlow, an open suite designed specifically for controlled scientific dissection:

  • Hyperspherical Flow Architecture: Models use a bidirectional Diffusion Transformer (DiT) with Llama-style blocks. Clean unit embeddings ($e_w$) are corrupted toward uniform spherical noise ($z$) via spherical linear interpolation controlled by a mixing ratio $\alpha \in [0, 1]$. Under the standard uniform $\alpha$ schedule, a single noise level $\alpha$ is drawn per sequence and applied to every token.
  • Matched AR Twins & Deterministic Order: Models are trained at 150M, 500M, 1B, and 3B scales (plus AR twins up to 1B sharing the exact architecture, hyperparameters, and data order). A seed-based permutation lets researchers trace any of the 386 released checkpoints down to the exact documents it saw.
  • Constant Learning Rate + Post-Hoc EMA: Learning rates are never decayed so any checkpoint can be cleanly branched. For the final 3B model, the authors reconstruct an Exponential Moving Average (EMA) of weights from saved checkpoints in place of LR decay.
  • Clean-Prefix Mid-Training: To fix prompting failures, the authors branch runs late in pretraining: half the time, a random-length prefix is kept completely clean ($\alpha=1$) while the rest of the sequence is corrupted.
Figure 2: Corruption at one position and across a sequence. (Left) A token’s embedding ew moves along a great circle toward its own noise z (Eq. 1). (Right) One sequence per row; only uniform α leaves no position clean.
Figure 1: The suite at a glance. All runs share one data order, so they compare step by step. Solid: released every 40B tokens (20B from 1.9T to 2T); hatched: only where marked.

Datasets

  • Pretraining: Dolma 3 Mix (2T tokens for core suite runs; 4T tokens for the final 3B model), tokenized with the SmolLM2 tokenizer.
  • Finetuning: Dolci-Instruct-SFT (general instruction tuning) and TinyGSM (math program synthesis).
  • Evaluation: Six multiple-choice benchmarks (BoolQ, OpenBookQA, PIQA, HellaSwag, ARC-Easy, WinoGrande), GSM8K (0-shot Python execution), and a custom prefix probe (4-way document continuation).

Key Insights and Ideas

  • The "Information Band" Widens with Scale: Early in training, token embeddings are spread out (isotropic), so simple nearest-neighbor geometry guarantees you can recover a noisy token without looking at surrounding words. As training progresses, embeddings crowd together (anisotropy), shrinking this geometric safety net—while the model simultaneously learns to denoise much heavier corruption. The gap between what geometry guarantees ($\alpha_{\text{geo}}$) and what the model actually solves ($\alpha_{\text{sol}}$) is where contextual reasoning lives, and it widens dramatically with scale.
  • Scale Alone Cannot Fix Prompt Blindness: Under standard uniform-$\alpha$ training, unconditional generation scales smoothly, but multiple-choice accuracy stays stuck at random chance even at 3B parameters and 2T tokens. Why? Because every token in a training sequence shares the same noise level; the model literally never sees a clean prompt paired with a noisy continuation. In fact, feeding it a clean prompt makes predicting the response harder than feeding it a corrupted one!
  • Cheap Late-Stage Surgery Works: Adding clean prefixes for just the final 5% of training (100B tokens) cures prompt blindness across all sizes at the cost of only ~1% in held-out loss, slashing initial finetuning gradient norms by an order of magnitude to match AR models.

Key Results

  • Conditioning Unlocked: Clean-prefix mid-training at 2T tokens lifts 3B prefix-probe accuracy from 58.2% to 95.4% (surpassing the 1B AR twin at 94.4%+) and drops clean-prompt SFT loss from 2.109 to 0.860.
  • Multiple-Choice Benchmarks: Earlier Riemannian models (S-FLM, SFCD) sit at random chance (~37.8%–38.0% average vs. 37.5% chance). SwaFlow-3B (4T, mid-trained + EMA) reaches 43.4% (44.5% after instruction tuning).
  • The Autoregressive Gap Remains: Despite these gains, next-token prediction remains far more sample-efficient on standard benchmarks: even the 150M AR twin (48.1%) and 1B AR twin (60.4%) outperform the 3B flow base model on multiple choice.
  • EMA Without Decay: Reconstructing weight averages from saved states lowers the final 3B model's held-out cross-entropy from 1.006 to 0.968 and boosts multiple-choice accuracy by +1.6 points.

Limitations and Future Work

The authors are refreshingly candid: SwaFlow is a scientific microscope, not a ChatGPT competitor. Even at 3B parameters, generative perplexity lags far behind natural text, AR twins remain well ahead on downstream tasks, and much of the multiple-choice jump on BoolQ reflects a shift toward majority-class ("yes") answers rather than deep reading comprehension. Furthermore, AR twins stop at 1B due to compute budgets, generation speed wasn't benchmarked against AR, and no safety evaluations were conducted. Open questions ripe for the community—using SwaFlow's 386 checkpoints—include testing context ablations inside the information band and exploring whether applying clean prefixes throughout pretraining can close the remaining gap with autoregression.

Summary updated

BibTeX
@misc{oba2026swaflow,
  author = {Daisuke Oba and Sakae Mizuki and Hiroya Takamura and Naoaki Okazaki},
  title = {{SwaFlow: A Fully Open Suite for Studying Riemannian Flow Language Models Across Training and Scale}},
  year = {2026},
  eprint = {2611.38244},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.38244},
}
Figure