SwaFlow-3B-EMA: Non-Autoregressive Riemannian Flow Model

SwaFlow-3B-EMA: Non-Autoregressive Riemannian Flow Model

At a Glance

Item Value
Repository tokyotech-llm/SwaFlow-3B-EMA
Family guide SwaFlow guide (5 articles)
Publisher guide Swallow (Institute of Science Tokyo): models and licenses
Published 2026-11-28
License apache-2.0
Formats safetensors
Source type Primary source (the publisher itself)

Values determined by this site’s code when the information was collected. Dates are JST.

Overview

tokyotech-llm has released “SwaFlow-3B-EMA", a non-autoregressive hyperspherical (Riemannian) flow language model. This model is based on the 3B-scale flow language model from the research model suite “SwaFlow suite", where weights during training have been averaged and reconstructed using exponential moving average (EMA).

The model was pretrained up to 3T tokens under a uniform-$\alpha$ setting, and training was then continued up to 4T tokens using clean-prefix mid-training. In its final run, exponential moving averages with a decay rate of $2^{-100/t}$ were calculated using the script scripts/posthoc_ema.py from 200 full states (training states) saved every 20B tokens to reconstruct the weights. It adopts an approach that generates text by integrating flows from noise on a sphere.

Specifications

The primary specifications of the model listed in the model card are as follows:

  • Parameters: 3.74B (width 3072, 28 layers, 24 heads, FFN 8192)
  • Vocabulary size: 49,152 (SmolLM2 tokenizer)
  • Context length: 2,048 tokens
  • Time convention: $\alpha = 1$ is clean data, $\alpha = 0$ is pure noise (training window $\alpha \in [0, 0.10]$)
  • Pretraining: 4T tokens with Dolma 3 Mix, $4,096 \times 2,048$ tokens per step, AdamW optimizer, constant learning rate of 3e-4 after warmup
  • Hardware: 32 nodes $\times$ 8 NVIDIA H200

Performance

The model repository does not contain detailed numerical comparison tables or structured evaluation benchmark data. However, the “Scope and limitations" section of the model card describes the performance characteristics of the model by the publishers and results compared with autoregressive models trained on the same data.

According to the publishers’ explanation, flow language models are still in an early research stage. In evaluations on multiple-choice tasks compared with autoregressive twins trained on the same dataset, it is reported that all autoregressive twins, including the smallest 150M parameter model, outperformed the final 3B flow model in average score.

Additionally, text generated from flow language models, including instruction-tuned models, often tends to be incoherent. It is explained that tuning to avoid the generation of harmful content has not been performed either, and it is intended for research purposes rather than practical applications. Note that these evaluations are based on information provided by the publishers on the model card rather than third-party verification.

Strengths and Use Cases

This model, “SwaFlow-3B-EMA", is not intended for general conversational processing or practical applications, but is provided with the primary purpose of openly researching and verifying the behavior, scale changes, and characteristics during training of Riemannian flow language models.

Main use cases and characteristics are as follows:

  • Research on non-autoregressive flow language models: Suitable for behavioral analysis and algorithmic experiments of the non-autoregressive approach, which generates text by integrating flows from noise states on a sphere.
  • Verification of weight averaging (EMA) effects: It is an exponential moving average (EMA) weight calculated from checkpoints every 20B tokens in the final training run, allowing researchers to investigate how it affects generation quality and structure compared to a single checkpoint.
  • Analysis of pretraining data: As an English text generation model pretrained on the “Dolma 3 Mix" dataset (4T tokens) provided by the Allen Institute for AI, it allows observation of how dataset composition affects flow language models.

Note that according to the publishers’ explanation, flow language models including this model are in the early stages of development. Because the generated text is often incoherent and tuning to suppress the output of harmful content has not been applied, it is not suitable for tasks assuming practical operation or deployment in end-user services.

How It Differs from Similar Models

Specific differences from SwaFlow-related models covered previously on our site are as follows:

First, SwaFlow-3B-Instruct Released: Instruction-Tuned 3B Non-Autoregressive Flow Language Model is a model obtained by performing 1 epoch of instruction tuning using the instruction dataset “Dolci-Instruct-SFT" on the standard “SwaFlow-3B" final checkpoint without EMA. In contrast, this model, “SwaFlow-3B-EMA", is a pretrained base model reconstructed by taking the exponential moving average of multiple checkpoints at a stage prior to receiving instruction tuning.

Additionally, SwaFlow-3B-EMA-Instruct: Non-Autoregressive Flow Language Model is a model based on this model (SwaFlow-3B-EMA) with additional instruction tuning via “Dolci-Instruct-SFT". This model corresponds to the state before receiving instruction-added learning, making it suitable for cases where one wants to investigate the characteristics of pure EMA weights before adaptation processing for dialogue tasks is introduced.

Hardware Requirements

Estimated requirements (calculated by Local Model Watch) — 3.7B parameters

Your VRAM Quantization File size Est. memory needed
24GB (RTX 4090 / 3090, etc.) F32 13.9GB 16.7GB

Inference engine support (architecture name matched against each project’s own model registry in its source code, checked 2026-11-28): llama.cpp: not registered, vLLM: not registered, MLX (mlx-lm): not registered. “Not registered" means the name is absent from that registry today, not that the model cannot run.

Memory estimates add a 20% runtime overhead (KV cache, etc.) to the actual size of the distributed files. Actual usage varies with context length, batch size and inference engine. These figures are computed by this site from file sizes, not published by the model’s authors. The listed files are distributed in F32 (32-bit). Loading in a lower precision (BF16 or quantized) needs less memory, so treat this as the size of the files as distributed, not a minimum. This site has not measured the lower-precision figures. Compare with other models in our VRAM quick reference. What the quantization names mean: glossary.

Can You Run It Locally?

The publisher distributes this model as safetensors.

License — apache-2.0 (Commercial use allowed): Permits commercial use, modification and redistribution. Redistribution requires including the license and stating changes; includes a patent grant.

Compiled by this site’s code from the published formats and the license field. License summaries are not legal advice — check the publisher’s original terms before relying on them.

How to Get It

This model is published on the Hugging Face repository in safetensors (fp32 precision) and config.json formats. It is distributed under the Apache 2.0 license, and no individual consent procedure for the license (gated model) is required to obtain it.

When using it, you need to install the code environment included in the official SwaFlow repository in advance.

To execute inference, use HuggingFaceTB/SmolLM2-135M as the tokenizer and load the model via the torchtitan library. Specifically, by writing as follows in a Python script to perform flow integration processing from the sphere, you can generate text following the input text (prefix_tokens).

import torch
from tokenizers import Tokenizer
from torchtitan.models.swaflow.hf import from_pretrained
from torchtitan.models.swaflow.sampling import SamplerConfig, generate

tokenizer = Tokenizer.from_pretrained("HuggingFaceTB/SmolLM2-135M")
model = from_pretrained("tokyotech-llm/SwaFlow-3B-EMA", device="cuda").eval()

ids = tokenizer.encode("The capital of France is").ids
prefix = torch.tensor([ids], device="cuda")
with torch.no_grad():
    out = generate(model, num_samples=1, seq_len=prefix.shape[1] + 256,
                   config=SamplerConfig(steps=64), prefix_tokens=prefix,
                   prefix_lengths=torch.tensor([prefix.shape[1]], device="cuda"))
tokens = out[0, prefix.shape[1]:].tolist()
if 0 in tokens:  # <|endoftext|> ends the text
    tokens = tokens[: tokens.index(0)]
print(tokenizer.decode(tokens))

Evaluation steps and sampling temperature during generation are configured using SamplerConfig.

Related Articles

What to Read Next

Sources