SwaFlow-3B-EMA-Instruct Released by tokyotech-llm

SwaFlow-3B-EMA-Instruct Released by tokyotech-llm

At a Glance

Item Value
Repository tokyotech-llm/SwaFlow-3B-EMA-Instruct
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-Instruct", a non-autoregressive flow language model. This model is based on “SwaFlow-3B-EMA", the final weight-averaged version of the 3B-scale hyperspherical (Riemannian) flow language model included in the SwaFlow suite, and has undergone 1 epoch of instruction tuning using the “Dolci-Instruct-SFT" dataset provided by the Allen Institute for AI.

SwaFlow is a model suite built to openly research Riemannian flow language models from both training and scaling perspectives. It features multiple model sizes based on the same training recipe, complete states throughout the training process, a shared data order across all runs, and autoregressive twins trained on the same data. According to the model card, this suite is not intended to provide models for general applications, but is instead designed for research purposes to elucidate the characteristics of flow language models in their early stages.

The weights of the base “SwaFlow-3B-EMA" were post-hoc reconstructed using an exponential moving average (EMA) with a decay rate of 2^(-100/t) from 200 complete states saved every 20B tokens during the final pre-training run. Pre-training utilized the “Dolma 3 Mix" dataset from the Allen Institute for AI, spanning a 4T token scale.

Specifications

  • Parameters: 3.74B (width 3072, 28 layers, 24 heads, FFN 8192)
  • Context length: 2,048 tokens

Performance

While the model card does not contain a structured benchmark score comparison table or list of figures, qualitative comparisons with autoregressive models and reports on behavior are documented as evaluation results and model limitations by the publishers.

According to the explanation by the publishers, in multiple-choice tasks, all autoregressive twins trained on the same data (including the smallest 150M-scale model) outperformed the average score of the final 3B flow model. This comparison result is analyzed as clearly indicating that non-autoregressive flow language model technology is still in an early stage of development.

In the instruction tuning process, examples containing tool calls were removed from “Dolci-Instruct-SFT", followed by training for 1,107 steps (512 × 2,048 tokens, totaling approximately 1.16B tokens). AdamW was used as the optimization algorithm, with a learning rate of 3e-5, a warmup of 55 steps, and a linear decay applied over the remaining 90% of the steps.

However, it is reported that even with this instruction tuning, the generated text is frequently observed to be incoherent. Additionally, adjustments to suppress the generation of harmful content (safety tuning) have not been applied, and the model requires caution assuming research and educational use.

Strengths and Use Cases

SwaFlow-3B-EMA-Instruct is not intended for general conversational applications or practical task processing, but is instead designed for researching and verifying non-autoregressive spherical (Riemannian) flow language models.

According to the model card, the model is not intended for incorporation into practical applications, but is published for foundational research to openly compare and analyze the behavior of Riemannian flow models across different model scales and training processes. It assumes prompt processing corresponding to English (en), and adaptation to conversational inputs has been pursued through instruction tuning using the Dolci-Instruct-SFT dataset.

Therefore, it is not suited for use as a general instruction-following model handling practical tasks such as advanced code generation or mathematical reasoning, but is suitable for verification purposes in elucidating the characteristics of state-of-the-art flow language models and architecture research.

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

SwaFlow-3B-EMA-Instruct is available on the Hugging Face repository (tokyotech-llm/SwaFlow-3B-EMA-Instruct). It is licensed under Apache 2.0 and is not a gated model requiring prior consent, allowing direct access to obtain it. Note that the pre-training data Dolma 3 Mix and the instruction tuning data Dolci-Instruct-SFT are provided under the ODC-By 1.0 license.

The repository contains config.json and model.safetensors in single-precision floating-point format (fp32).

For inference and usage, the dedicated codebase swaflow-suite available on GitHub must be installed in advance. Additionally, the tokenizer from HuggingFaceTB/SmolLM2-135M is used.

Caution is required when constructing prompts, which should be written in plain text format without using special tokens. User utterances are written as User: followed by a blank line, and assistant responses are written as Assistant:. To prevent tokenization misalignment at prompt boundaries, it is recommended to tokenize the User: portion and the Assistant: portion separately and then concatenate them.

An example of specific inference code using PyTorch is as follows:

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-Instruct", device="cuda").eval()

# Encode each part separately and concatenate
ids = tokenizer.encode("User: What is the capital of France?\n\n").ids + tokenizer.encode("Assistant:").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:  # Determine termination with ID 0 (<|endoftext|>)
    tokens = tokens[: tokens.index(0)]
print(tokenizer.decode(tokens))

During generation, text is generated by integrating the flow on the sphere from noise. Hyperparameters such as the number of evaluation steps (steps) and temperature can be controlled via SamplerConfig.

Related Articles

What to Read Next

Sources