Run this model with HF Jobs

Run lafa-hf/lafa-8B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/lafa-hf/lafa-8B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/lafa-hf/lafa-8B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/lafa-hf/lafa-8B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/lafa-hf/lafa-8B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Lafa-8B

Lafa (Large flow language model) is a continuous flow language model that generates text block by block and can verify its own flow drafts autoregressively in self-speculative decoding.

EMA weights in BF16. Block size: B = 4.

Paper: arXiv:2610.28559 ยท Code: GitHub

Results

Paper results; model size is shown in each plot.

Main quality-throughput result

Lafa 7B reaches 2.54ร— AR throughput at matched or better quality.

Flow decoding frontier

Flow decoding accuracy, averaged over GSM8K, HumanEval, and IFEval.

Self-speculative decoding frontier

Self-speculative decoding accuracy vs. tokens per forward pass (TPF), averaged over six benchmarks.

Load

pip install -r requirements-inference.txt
import torch
from transformers import AutoModel, AutoTokenizer

MODEL_ID = "lafa-hf/lafa-8B"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModel.from_pretrained(
    MODEL_ID,
    trust_remote_code=True,
    dtype=torch.bfloat16,
    device_map="auto",
)

messages = [{"role": "user", "content": "Explain flow matching briefly."}]
inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
    return_dict=True,
)
inputs = {k: v.to(model.device) for k, v in inputs.items()}

Flow decoding

output_ids = model.generate(
    **inputs,
    gen_mode="flow",
    max_new_tokens=128,
    num_steps=4,
    grid_mode="warp",
    noise_scale_override=0.1,
    cfg_scale=8.0,
    sde_gamma=0.0,       # 0 = ODE
    sde_alpha=0.0,
    sde_vp=False,
    sde_noiseless=False,
    euler_alpha=1.0,
)
Parameter Notation Default
num_steps S 4
noise_scale_override noise multiplier 0.1
cfg_scale w_CFG 8.0
sde_gamma gamma 0.0
sde_alpha alpha 0.0
grid_mode warp, uniform, uniform_range warp
euler_alpha alpha_Euler 1.0

AR decoding

output_ids = model.generate(
    **inputs,
    gen_mode="ar",
    max_new_tokens=128,
)

Self-speculative decoding

output_ids = model.generate(
    **inputs,
    gen_mode="speculative",
    max_new_tokens=128,
    grid_mode="warp",
)

All modes return token IDs. Print the generated text with:

text = tokenizer.decode(
    output_ids[0, inputs["input_ids"].shape[1]:],
    skip_special_tokens=True,
)
print(text)

Generation is greedy. Use batch size 1 for flow and self-speculative decoding.

Citation

@article{chavan2026largeflow,
  title   = {Large Flow Language Models},
  author  = {Chavan, Arnav and Lee, Chanhyuk and Bamba, Udbhav and Yoo, Jaehoon
             and Hong, Seunghoon and Raghunathan, Aditi and Kim, Jinwoo},
  journal = {arXiv preprint arXiv:2610.28559},
  year    = {2026}
}
Downloads last month
257
Safetensors
Model size
8B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for lafa-hf/lafa-8B

Finetuned
Qwen/Qwen3-8B
Finetuned
(2,462)
this model

Collection including lafa-hf/lafa-8B

Paper for lafa-hf/lafa-8B