Paper notes

π0: A Flow-Matching Action Expert on PaliGemma for Controlling Many Robots with Action Chunks

π0 (Physical Intelligence, 2024) adds a roughly 300M flow-matching action expert to the 3B PaliGemma and generates 50-step continuous action chunks at up to 50 Hz. The experts share self-attention, so prefix keys and values are computed once. This page recomputes sizes and tests the cache.

Published Updated 40 min read

On this page
  1. Why This Paper Matters
  2. Background: Are Discrete Action Tokens Enough?
  3. Method
  4. Overview
  5. Two Experts
  6. The Block-Causal Mask
  7. The Flow-Matching Loss and Sampling
  8. Inference and Execution
  9. Data and Training Recipe
  10. Experiments and Findings
  11. Hands-On Check: Parameter Counts, the Block Mask, the Inference Budget and the Resolution of the Evaluation
  12. Parameter counts: Gemma 2B matches to the digit, and 3.3B is rounding
  13. The block-causal mask: caching is exact, and a bidirectional mask breaks it
  14. The inference budget: the action phase is about 9% of the compute but 37% of the time
  15. The control loop: the cost of one inference is a few milliseconds per executed action
  16. The timestep distribution: biased toward noise, and consistent with the openpi code
  17. The resolution of the evaluation: only 10 trials per bar
  18. Arithmetic on the data mixture
  19. Limitations and What to Keep in Mind
  20. What to Take from This Paper
  21. Further Reading
  22. FAQ

π0 (read “pi-zero”) is a generalist robot policy released by Physical Intelligence in October 2024. Next to the 3B-parameter vision-language model PaliGemma it attaches an action expert of about 300M parameters, and it uses flow matching to generate a 50-step chunk of continuous actions in one go, which lets it control robots at up to 50 Hz. PaliGemma and the action expert are two sets of weights inside one transformer that exchange information only in the self-attention layers. The attention mask splits the sequence into three blocks, “image and language”, “state” and “actions”, and earlier blocks cannot see later ones, so the keys and values of the image and language tokens are computed once per inference and the following 10 flow-matching steps only recompute the action tokens. The paper pre-trains on about 10,000 hours of data from 7 robot configurations and 68 tasks, then post-trains on high-quality data, and reaches tasks that take 5 to 20 minutes, such as folding laundry, clearing a table and assembling a box.

This page follows the text of arXiv v4 (8 January 2026); the first version was submitted on 31 October 2024. The paper’s main results are bar charts and the text gives very few numbers, so the figures quoted here come from the text, from the appendix tables, or from the recomputation in the script below; numbers that can only be read off a bar chart are not quoted.

Why This Paper Matters

  • It gives one concrete way to attach continuous actions to a vision-language model. RT-2 and OpenVLA discretize actions into 256 bins per dimension and generate them token by token. π0 keeps the VLM’s semantic knowledge but generates continuous actions with flow matching. The paper says that, to the authors’ knowledge, this is the first flow-matching VLA that produces high-frequency action chunks for dexterous manipulation.
  • It moves the “pre-training plus post-training” recipe of large language models to robots. The argument is that training on high-quality data only does not teach the model to recover from mistakes, because such data hardly contains any; training on low-quality diverse data only gives actions that are neither efficient nor robust; combining both gives a fluent main policy and a repertoire of recoveries.
  • Scale. The paper says that, in terms of the amount of robot data, this was by far the largest robot learning experiment at the time (about 10,000 hours of the authors’ own data, plus open-source data such as OXE).
  • The architectural details can be checked one by one. The size of the action expert, the block-causal mask, the prefix cache, the 10 integration steps and the timestep distribution are all tested in the script below.
  • Related pages on this site. The training objective is explained in the Flow Matching breakdown, and the predecessor that uses diffusion for actions in the Diffusion Policy breakdown; how multimodal models are put together is in Multimodal LLMs; the principle behind prefix caching is in KV Cache; and “two sets of weights split by token type” resembles a mixture of experts, with the difference explained in the FAQ.

Background: Are Discrete Action Tokens Enough?

RT-2 and OpenVLA split every action dimension into 256 bins, write the action as tokens, and let the VLM generate them autoregressively. The paper points out that this route struggles with high-frequency, dexterous tasks: every action takes several tokens to decode, so the control rate stays low (OpenVLA itself reports about 6 Hz, see the OpenVLA breakdown), and a whole high-frequency chunk is hard to output. The other route generates action chunks with a diffusion model (Diffusion Policy, ACT and similar), which can handle dexterous tasks but usually has no VLM semantic knowledge, and its training data is tens to hundreds of trajectories. π0 sets out to combine the two: a pre-trained VLM for Internet-scale semantic knowledge, flow matching for continuous action chunks, and large-scale multi-robot data for training.

The paper lists three challenges: the research has to be done at a very large scale, because the benefits of pre-training are often absent at smaller scales; it needs an architecture that can use diverse data sources and still represent fine motions; and it needs the right training recipe, which the authors call perhaps the most important ingredient.

Method

Overview

π0 architecture: two experts share self-attention, the action expert generates action chunks with flow matching Camera images are encoded by SigLIP into image tokens that form block 1 together with the language tokens, handled by the PaliGemma (Gemma 2B) expert. The joint state is projected into one token (block 2) and the 50 tokens of the noisy action chunk (block 3) are handled by a roughly 300M-parameter action expert. Both experts share the self-attention of one 18-layer transformer under a block-causal mask: block 1 sees only itself, block 2 sees blocks 1 and 2, block 3 sees everything, so the keys and values of block 1 are computed once and cached. The action expert outputs a velocity field that is integrated with 10 Euler steps into a 50-step action chunk. Camera images (2-3) SigLIP: image tokens Language instruction tokenized: text tokens Joint state q projected to 1 token Noisy actions Aτ 50 tokens, τ=0 is noise MLP-fused with τ One transformer: 18 layers, two weight sets Expert A: PaliGemma (Gemma 2B) Block 1: image + text tokens Blind to blocks 2-3: cacheable Blocks 2-3 read the cached K, V of block 1 Expert B: action expert (~300M) Block 2: state token Block 3: 50 action tokens Full attention inside a block; experts meet only in self-attention Attention mask (row sees column) 1 2 3 1 2 3 filled = visible, blank = hidden Velocity field vθ Euler integration: 10 steps Action chunk (50 steps) run 16 or 25, then re-infer
The π0 architecture (redrawn from the paper's Figure 3 and Appendix B): images, language, state and noisy actions form three blocks handled by two sets of weights that meet only in self-attention; the mask between blocks is causal, so the keys and values of block 1 can be cached; the action expert outputs a velocity field, and 10 Euler steps give a 50-step action chunk.

An observation is ot=[It1,…,Itn,ℓt,qt]o_t=[I_t^1,\dots,I_t^n,\ell_t,q_t]: 2 to 3 camera images, a language instruction and the robot’s joint angles qtq_t. What is modeled is p(At∣ot)p(A_t\mid o_t), where At=[at,at+1,…,at+H−1]A_t=[a_t,a_{t+1},\dots,a_{t+H-1}] is the action chunk of the next H=50H=50 steps. Images are encoded by the SigLIP encoder that comes with PaliGemma, the state is projected by a linear layer, and the noisy actions are embedded by the small MLP described below, so that all of them become vectors with the same width as the language tokens. Robots differ in the dimensions of state and action, so the paper zero-pads the vectors to the largest robot’s dimension (18) and masks out missing image slots when a robot has fewer than three cameras.

Two Experts

π0 is one transformer with two sets of weights (the paper calls them experts): every token is routed to one of them, and the two sets interact only in the self-attention layers.

ItemExpert A (backbone)Expert B (action expert)
Tokens it processesImage, languageState, noisy actions
InitializationPaliGemma (SigLIP plus Gemma 2B)Random
Width and MLP dimension2048 and 163841024 and 4096
ParametersAbout 3BAbout 300M

Their depth (18), query heads (8), KV heads (1) and head dimension (256) must be identical, because they read each other’s keys and values in the same attention; the paper writes only the backbone’s values and the action expert’s width and MLP dimension, and I confirmed the rest against the Gemma report and the openpi configuration. The paper likens the design to a “mixture of experts with two mixture elements” and says that giving the robot-specific tokens their own weights improved performance over the shared weights used in Transfusion, but the text gives no comparison data. The action expert is made smaller to speed up a forward pass that has to run 10 times.

The Block-Causal Mask

The attention mask splits the sequence into three blocks, bidirectional inside a block and causal between blocks:

BlockTokensCan see
1Image, languageBlock 1
2State qtq_tBlocks 1, 2
3Noisy actions AtτA_t^\tauBlocks 1, 2, 3

The paper gives two reasons. First, block 1 holds the inputs PaliGemma saw during its pre-training, and keeping it from seeing the new inputs reduces the distribution shift from that pre-training. Second, the state does not change with the flow-matching step, and since it cannot see block 3, its keys and values can be cached. The result is that the keys and values of block 1 (and, the paper says, of the state) are computed only once per action chunk.

The Flow-Matching Loss and Sampling

π0 models the distribution of action chunks with conditional flow matching and a simple linear-Gaussian (optimal-transport) probability path: for every action chunk AtA_t, draw noise ϵ∼N(0,I)\epsilon\sim\mathcal N(0,I) and a flow-matching time τ∈[0,1]\tau\in[0,1], and build the noisy actions

Atτ=τAt+(1−τ) ϵ,A_t^\tau=\tau A_t+(1-\tau)\,\epsilon ,

then train the network’s velocity field to match u=At−ϵu=A_t-\epsilon:

L(θ)=Eτ, ϵ∥vθ(Atτ,ot)−(At−ϵ)∥2.L(\theta)=\mathbb E_{\tau,\,\epsilon}\big\|v_\theta(A_t^\tau,o_t)-(A_t-\epsilon)\big\|^2 .

Here τ=0\tau=0 is pure noise and τ=1\tau=1 is data, the same convention as in the Flow Matching breakdown. The paper writes the conditional distribution as N(τAt,(1−τ)I)\mathcal N(\tau A_t,(1-\tau)I); with the construction above the variance should be (1−τ)2(1-\tau)^2, which does not affect training. Sampling starts from At0∼N(0,I)A_t^0\sim\mathcal N(0,I) and integrates with the Euler method

Atτ+δ=Atτ+δ vθ(Atτ,ot),δ=0.1,A_t^{\tau+\delta}=A_t^\tau+\delta\,v_\theta(A_t^\tau,o_t),\qquad \delta=0.1 ,

for 10 steps. Each noisy action goes through a linear layer W1W_1, is concatenated with the sinusoidal encoding of τ\tau, and then passes through W2W_2, a swish and W3W_3 to produce the embedding fed to the action expert; inside the action expert, the action tokens attend to each other bidirectionally.

During training τ\tau is not sampled uniformly but from a Beta distribution that favors small τ\tau (the noisy side):

p(τ)=Beta(s−τs; 1.5, 1),s=0.999.p(\tau)=\mathrm{Beta}\left(\frac{s-\tau}{s};\,1.5,\,1\right),\qquad s=0.999 .

The reason, given in Appendix B, is a hypothesis. Work such as Stable Diffusion 3 argues for sampling the middle timesteps more, because at very low noise the model only needs to learn the identity and at very high noise only the mean of the data. For action prediction, however, the “mean action given the observation” E[At∣ot]\mathbb E[A_t\mid o_t] is much harder than the “mean image given the text”, because an observation constrains the action far more than a text constrains an image, so the high-noise timesteps deserve more samples. Timesteps above ss are never sampled because they are not needed as long as the integration step is larger than 1−s1-s.

Inference and Execution

For every new action chunk the system encodes the images, runs one forward pass over the prefix, and then performs 10 flow-matching steps, each running a forward pass over the action tokens only (the prefix keys and values come from the cache). The chunk length is H=50H=50, but the whole chunk is not executed: 20 Hz robots run inference after every 16 executed actions (an interval of 0.8 s), and 50 Hz robots after every 25 (0.5 s). The authors tried temporal ensembling and found that it hurt performance, so the chunks are executed open loop.

Data and Training Recipe

The pre-training mixture has two parts: the authors’ own dexterous-manipulation data, 903M timesteps in total (106M single-arm, 797M dual-arm) over 7 robot configurations and 68 tasks, and open-source data (OXE, Bridge v2, DROID) that makes up 9.1% of the mixture and has control rates of 2 to 10 Hz, usually with one or two cameras. What the paper calls a “task” is much broader than usual: the “bussing” task, for example, involves a wide range of dishes, cups, utensils and trash, so 68 tasks are far richer than the number suggests. The data is imbalanced (laundry folding has the most), so every task-robot combination is weighted by n0.43n^{0.43}, where nn is the number of samples of that combination, which down-weights the large ones. The language labels include task names and segment annotations about 2 seconds long.

Post-training uses a smaller, task-specific, high-quality dataset to make the model execute fluently: the simplest tasks need only about 5 hours and the most complex ones 100 hours or more. The main model is pre-trained for 700k steps; to compare fairly with the baselines the authors also report a “compute parity” version trained for only 160k steps.

The paper’s intuition for the two phases is that the pre-training data should cover as many tasks as possible and, within each task, a diversity of behaviors; its quality may be lower, and it teaches the model to recover from mistakes. The post-training data should be consistent and fluent, and it teaches the model to do the task well. For tasks that need semantic reasoning and high-level strategy (clearing a table, for example), a high-level VLM can break “bus the table” into subtasks such as “pick up the napkin” and “throw the napkin into the trash”, which π0 then executes; the paper compares this to SayCan.

Experiments and Findings

The evaluations are all real-robot experiments: every task and every method is evaluated over 10 episodes, a full success scores 1.0 and partial completion gets a fractional score (for bussing, for example, the fraction of objects placed in the right receptacle). The text does not give the values shown in the figures, so the table below carries only the text’s conclusions:

ExperimentCompared againstThe paper’s conclusion in the text
Out of the box (Figure 7): shirt folding, easy and hard bussing, grocery bagging, toast out of a toasterOpenVLA and Octo (both trained on the same mixture), OpenVLA fine-tuned on UR5e data only, π0-small (470M, no VLM initialization), compute-parity π0 (160k steps)π0 is the best on every task, with near-perfect shirt folding and easy bussing; the parity version still beats all baselines, and π0-small also beats OpenVLA and Octo
Language following (Figure 9): bussing, table setting, grocery baggingπ0 and π0-small under three kinds of instruction: the task only, step-by-step from a human, step-by-step from a high-level VLMπ0 follows language clearly better than π0-small; step-by-step instructions (from a human or a high-level VLM) improve π0, while π0-small hardly gains
New-task fine-tuning (Figure 11): stack bowls, fold a towel, Tupperware in the microwave, replace a paper towel roll, Franka items in a drawer; 1, 5 and 10 hours of data per taskOpenVLA, Octo, ACT, Diffusion Policy, and π0 trained from scratchπ0 is best overall; the strongest earlier methods are ACT and Diffusion Policy trained from scratch; pre-training helps more on tasks closer to the pre-training data, sometimes by 2x
Complex multi-stage tasks (Figure 13): laundry folding (static and mobile), dryer unloading, table bussing, box building, packing a to-go box, packing eggsπ0 out of the box, π0 from scratch, pre-trained plus fine-tuned π0Pre-training plus fine-tuning is best, with more than half of the maximum score on every task; the paper says other methods could not solve these tasks, so it compares only against its own ablations

A few notes. The new tasks are tiered by their similarity to the pre-training data: stacking bowls and folding a towel are closest, the microwave task adds an object never seen in pre-training, and replacing the paper towel roll and the Franka drawer task need entirely new motions and objects. OpenVLA and Octo use public checkpoints pre-trained on OXE and are fine-tuned per task; ACT and Diffusion Policy are trained on the fine-tuning data only. All baselines were run only on the bowl-stacking and microwave tasks, and because OpenVLA and Octo were clearly worse, they were evaluated at only one data size. The paper reads the fact that the strongest earlier models were trained from scratch as a sign that existing methods have not yet learned to exploit this kind of pre-training.

Hands-On Check: Parameter Counts, the Block Mask, the Inference Budget and the Resolution of the Evaluation

Several of π0’s key design choices can be checked with arithmetic or a few dozen lines of code. The script below does five things: ① recomputes the parameter count from the public Gemma and SigLIP architectures to check “3B plus 300M”; ② tests the claim that the block-causal mask lets the prefix keys and values be cached, using a toy two-expert transformer, and shows what happens with a bidirectional mask; ③ divides the paper’s Table I timings by my estimate of the compute to see what each of the three inference phases costs; ④ compares the Beta timestep distribution with uniform and logit-normal sampling and ties it to the openpi code; ⑤ works out how large a gap a bar chart built from only 10 trials per bar can resolve.

Environment: Apple M2 Max (CPU only), Python 3.14.3, numpy 2.4.2, scipy 1.18.1; no model is downloaded, the parameter counts come from public architecture hyperparameters, and the whole script runs in under a second. The Gemma dimensions come from the Gemma technical report (Table 1). The action expert must have the same depth, number of query heads, number of KV heads and head dimension as the backbone, because both experts read each other’s keys and values in one attention; I confirmed this against the gemma_300m configuration in the openpi repository: width 1024, depth 18, MLP dimension 4096, 8 query heads, 1 KV head, head dimension 256. Images of 224×224 pixels with 256 tokens each, and 20 language tokens, are my assumptions (the paper states neither the image resolution nor the prompt length). The Table I timings and the data-mixture numbers were copied by hand from the paper’s PDF. The only randomness is the toy model’s weights and the timestep sampling; the seeds are fixed, so the output should not change on another machine.

"""pi0: checks on the parameter counts, the block-causal mask with its
prefix cache, the timestep distribution and the inference budget.

CPU only, finishes in seconds. Usage: python pi0_en.py
"""
import numpy as np
from scipy.stats import binomtest, fisher_exact

# ---------------------------------------------------------- 1. parameter counts
HEADS, KV, HD, DEPTH, VOCAB = 8, 1, 256, 18, 256128  # Gemma 2B attention shape
SD, SL, SFF, NP = 1152, 27, 4304, 256                # SigLIP So400m/14, 224px
ADIM = 18                                            # action/state dim (paper)
SIG_BLK = 4 * SD + (3 * SD * SD + 3 * SD) + (SD * SD + SD) \
    + 2 * SD * SFF + SFF + SD                        # one ViT block


def stack(w, mlp, heads=HEADS):
    """All 18 layers of one expert: attention, gated MLP, RMSNorm."""
    attn = w * heads * HD + 2 * w * KV * HD + heads * HD * w
    return DEPTH * (attn + 3 * w * mlp + 2 * w) + w


def siglip():
    """SigLIP So400m/14; PaliGemma uses no pooling head."""
    return 14 * 14 * 3 * SD + SD + NP * SD + SL * SIG_BLK + 2 * SD


LLM, EXPERT = stack(2048, 16384), stack(1024, 4096)


def part_params():
    emb, proj, w = VOCAB * 2048, SD * 2048 + 2048, 1024
    print("Gemma 2B embedding %d (report 524550144)" % emb)
    print("Gemma 2B layers    %d (report 1981884416)" % LLM)
    print("  with 18 heads, as the paper's appendix prints: %d" % stack(
        2048, 16384, 18))
    pali = emb + LLM + siglip() + proj
    print("SigLIP %.1fM, projector %.2fM, PaliGemma %.3fB" % (
        siglip() / 1e6, proj / 1e6, pali / 1e9))
    extra = 2 * (ADIM * w + w)               # action-in and state projections
    extra += (2 * w * w + w) + (w * w + w)   # two layers of the action-time MLP
    extra += w * ADIM + ADIM                 # action output projection
    print("action expert layers %.1fM (paper: ~300M), I/O %.2fM" % (
        EXPERT / 1e6, extra / 1e6))
    print("pi0 total %.3fB (paper: 3.3B)" % ((pali + EXPERT + extra) / 1e9))


# ---------------------------------------- 2. block-causal mask and prefix cache
NH, NKV, DH, NL = 4, 1, 8, 3          # toy: 4 query heads share 1 KV head
WA, FA, WB, FB = 24, 48, 16, 32       # expert A (prefix), expert B (action)


def make_attn_mask(ar):
    """big_vision / openpi rule: see every token whose cumsum <= mine."""
    c = np.cumsum(ar)
    return c[None, :] <= c[:, None]


def rms(x):
    return x / np.sqrt((x * x).mean(-1, keepdims=True) + 1e-6)


def gelu(x):
    return 0.5 * x * (1 + np.tanh(0.79788456 * (x + 0.044715 * x ** 3)))


def rope(x, pos):
    half = DH // 2
    ang = pos[:, None] * 10000.0 ** (-np.arange(half) / half)
    c, s = np.cos(ang)[:, None], np.sin(ang)[:, None]
    return np.concatenate([x[..., :half] * c - x[..., half:] * s,
                           x[..., :half] * s + x[..., half:] * c], -1)


def make_toy(seed):
    r = np.random.default_rng(seed)

    def lin(i, o):
        return r.normal(0, i ** -0.5, (i, o))

    def expert(w, f):
        return dict(q=lin(w, NH * DH), k=lin(w, NKV * DH),
                    v=lin(w, NKV * DH), o=lin(NH * DH, w),
                    g=lin(w, f), u=lin(w, f), d=lin(f, w))

    return [(expert(WA, FA), expert(WB, FB)) for _ in range(NL)]


def run(model, hs, pos, mask, cache=None):
    """hs = (prefix tokens, suffix tokens). Each token uses only its own
    expert's weights and meets the others in self-attention only.
    Returns the outputs and the (K, V) of every layer."""
    kvs = []
    for li, layer in enumerate(model):
        q, k, v = [], [], []
        for h, w in zip(hs, layer):
            x = rms(h)
            q.append((x @ w["q"]).reshape(-1, NH, DH))
            k.append((x @ w["k"]).reshape(-1, NKV, DH))
            v.append((x @ w["v"]).reshape(-1, NKV, DH))
        q = rope(np.concatenate(q), pos)
        k, v = rope(np.concatenate(k), pos), np.concatenate(v)
        kvs.append((k, v))
        if cache:                            # prefix K, V come from the cache
            k = np.concatenate([cache[li][0], k])
            v = np.concatenate([cache[li][1], v])
        s = np.einsum("thd,skd->hts", q, k) / np.sqrt(DH)
        s = np.where(mask, s, -1e30)
        p = np.exp(s - s.max(-1, keepdims=True))
        p /= p.sum(-1, keepdims=True)
        o = np.einsum("hts,skd->thd", p, v).reshape(len(pos), NH * DH)
        new, n0 = [], 0
        for h, w in zip(hs, layer):
            h = h + o[n0:n0 + len(h)] @ w["o"]
            x = rms(h)
            new.append(h + (gelu(x @ w["g"]) * (x @ w["u"])) @ w["d"])
            n0 += len(h)
        hs = new
    return [rms(h) for h in hs], kvs


def part_cache():
    P, H, STEPS = 12, 5, 10
    r = np.random.default_rng(1)
    model = make_toy(0)
    pre = r.normal(size=(P, WA))                  # image/text tokens (toy)
    state = r.normal(size=(1, WB))
    pos = np.arange(P + 1 + H)
    # prefix | state | actions: three blocks, as in openpi's ar_mask
    ar = np.array([0] * P + [1] + [1] + [0] * (H - 1))
    mask = make_attn_mask(ar)
    steps = [np.concatenate([state, r.normal(size=(H, WB))])
             for _ in range(STEPS)]               # only actions change
    ea, eb = np.zeros((0, WA)), np.zeros((0, WB))
    print("\ntoy two-expert transformer: float64, %d layers" % NL)
    print("  block mask rows (prefix, state, action), 1 = visible:")
    for name, i in (("prefix", 0), ("state", P), ("action", P + 1)):
        print("   %-6s %s" % (name, "".join(
            "%d" % mask[i, j] for j in (0, P - 1, P, P + 1, P + H))))

    def check(mask, label):
        print("  %s" % label)
        moved = 0.0
        for nc, what in ((P, "cache prefix:        "),
                         (P + 1, "cache prefix + state:")):
            hs = (pre, eb) if nc == P else (pre, state)
            _, kv = run(model, hs, pos[:nc], mask[:nc, :nc])  # computed once
            diff, first = 0.0, None
            for x in steps:
                (oa, ob), _ = run(model, (pre, x), pos, mask)  # recompute all
                (_, oc), _ = run(model, (ea, x[nc - P:]), pos[nc:],
                                 mask[nc:], kv)
                diff = max(diff, np.abs(ob[nc - P:] - oc).max())
                first = oa if first is None else first
                moved = max(moved, np.abs(oa - first).max())
            print("    %s max |diff| vs full: %.1e" % (what, diff))
        print("    prefix output moves with the actions by: %.1e" % moved)

    check(mask, "block-causal mask (pi0):")
    check(make_attn_mask(np.zeros(P + 1 + H)), "fully bidirectional mask:")


# --------------------------------------------------------- 3. inference compute
def flops(img_tok=256, n_img=3, n_txt=20, n_act=50, steps=10):
    p, d, suf = n_img * img_tok + n_txt, HEADS * HD, n_act + 1
    vit = n_img * img_tok * (2 * SL * SIG_BLK + 4 * img_tok * SD * SL)
    pre = p * (2 * LLM + 4 * p * d * DEPTH)
    flow = steps * suf * (2 * EXPERT + 4 * (p + suf) * d * DEPTH)
    return vit / 1e12, pre / 1e12, flow / 1e12


def part_flops():
    vit, pre, flow = flops()
    ms = {"images": 14, "prefix": 32, "flow x10": 27}     # paper, Table I
    print("\nFLOPs, 3 images x 256 tokens + 20 text + state + 50 actions")
    print("  %-9s %7s %5s %9s" % ("phase", "TFLOPs", "ms", "TFLOP/s"))
    for (name, t), f in zip(ms.items(), (vit, pre, flow)):
        print("  %-9s %7.3f %5d %9.1f" % (name, f, t, f / t * 1e3))
    tot = vit + pre + flow
    print("  flow share: %.1f%% of FLOPs, %.1f%% of time (73 ms)" % (
        100 * flow / tot, 100 * 27 / 73))
    naive = 10 * (vit + pre) + flow
    print("  no cache at all: %.1f TFLOPs (%.1fx the cached %.2f)" % (
        naive, naive / tot, tot))
    print("  flow share of FLOPs if image tokens per image change:")
    for k in (64, 128, 256, 512):
        v, p, f = flops(img_tok=k)
        print("    %3d tokens: %.1f%%" % (k, 100 * f / (v + p + f)))


# -------------------------------------------- 4. timesteps and the control loop
S = 0.999


def part_tau():
    rng = np.random.default_rng(0)
    n = 5_000_000
    x = rng.beta(1.5, 1, n)
    pi0 = S * (1 - x)                         # p(tau) = Beta((s-tau)/s; 1.5, 1)
    uni = rng.uniform(0, 1, n)
    logit = 1 / (1 + np.exp(-rng.normal(0, 1, n)))   # SD3 logit-normal
    t_code = x * 0.999 + 0.001                # openpi: t=1 is noise
    print("\ntimestep distributions (tau=0 is pure noise), n=5e6")
    print("  %-12s %6s %8s %8s %8s" % ("", "mean", "P<0.1", "P<0.5", "P>0.9"))
    for name, t in (("uniform", uni), ("logit-normal", logit),
                    ("pi0 Beta", pi0)):
        print("  %-12s %6.3f %7.1f%% %7.1f%% %7.1f%%" % (
            name, t.mean(), 100 * (t < 0.1).mean(), 100 * (t < 0.5).mean(),
            100 * (t > 0.9).mean()))
    print("  exact P(tau<0.5) = 1 - ((s-0.5)/s)^1.5 = %.4f" % (
        1 - ((S - 0.5) / S) ** 1.5))
    print("  openpi t = 0.999*Beta + 0.001 vs 1 - tau: max |diff| = %.1e" % (
        np.abs(t_code - (1 - pi0)).max()))
    print("  Euler grid: tau = %s" % ", ".join(
        "%.1f" % (0.1 * i) for i in range(10)))


def part_budget():
    print("\ncontrol loop (H=50 actions per chunk)")
    print("  %-11s %3s %4s %6s %6s %6s %6s" % (
        "robot", "Hz", "run", "every", "chunk", "73 ms", "86 ms"))
    for name, hz, k in (("UR5e/Franka", 20, 16), ("others", 50, 25)):
        every = k / hz                        # seconds between inferences
        print("  %-11s %3d %4d %5.1fs %5.1fs %5.1f%% %5.1f%%" % (
            name, hz, k, every, 50 / hz, 7.3 / every, 8.6 / every))
    print("  OpenVLA ~6 Hz = %.0f ms per action; pi0 on-board per executed"
          % (1e3 / 6))
    print("  action: %.1f ms (16 actions), %.1f ms (25 actions)" % (
        73 / 16, 73 / 25))
    print("\nreading a bar built from 10 episodes (partial credit ignored)")
    for k in (3, 5, 7, 9):
        ci = binomtest(k, 10).proportion_ci()
        print("  %d/10: 95%% Clopper-Pearson [%.2f, %.2f]" % (
            k, ci.low, ci.high))
    need = []
    for k2 in range(10):                      # baseline k2/10
        ks = [k for k in range(k2, 11)
              if fisher_exact([[k, 10 - k], [k2, 10 - k2]])[1] < 0.05]
        need.append("%d:%s" % (k2, ks[0] if ks else "-"))
    print("  baseline k2 -> smallest k1 with Fisher p<0.05:")
    print("  " + "  ".join(need))
    print("\nmixture arithmetic")
    print("  106M + 797M = %dM timesteps" % (106 + 797))
    print("  hours at 50 Hz / 20 Hz: %.0f / %.0f (paper: about 10,000)" % (
        903e6 / 50 / 3600, 903e6 / 20 / 3600))
    print("  weight n^0.43: 10x data -> %.2fx, 100x -> %.2fx, 1000x -> %.1fx"
          % (10 ** 0.43, 100 ** 0.43, 1000 ** 0.43))


if __name__ == "__main__":
    part_params()
    part_cache()
    part_flops()
    part_tau()
    part_budget()

The output:

Gemma 2B embedding 524550144 (report 524550144)
Gemma 2B layers    1981884416 (report 1981884416)
  with 18 heads, as the paper's appendix prints: 2170628096
SigLIP 412.4M, projector 2.36M, PaliGemma 2.921B
action expert layers 311.5M (paper: ~300M), I/O 3.21M
pi0 total 3.236B (paper: 3.3B)

toy two-expert transformer: float64, 3 layers
  block mask rows (prefix, state, action), 1 = visible:
   prefix 11000
   state  11100
   action 11111
  block-causal mask (pi0):
    cache prefix:         max |diff| vs full: 1.4e-15
    cache prefix + state: max |diff| vs full: 1.3e-15
    prefix output moves with the actions by: 0.0e+00
  fully bidirectional mask:
    cache prefix:         max |diff| vs full: 9.9e-01
    cache prefix + state: max |diff| vs full: 8.0e-01
    prefix output moves with the actions by: 1.7e+00

FLOPs, 3 images x 256 tokens + 20 text + state + 50 actions
  phase      TFLOPs    ms   TFLOP/s
  images      0.656    14      46.9
  prefix      3.215    32     100.5
  flow x10    0.381    27      14.1
  flow share: 9.0% of FLOPs, 37.0% of time (73 ms)
  no cache at all: 39.1 TFLOPs (9.2x the cached 4.25)
  flow share of FLOPs if image tokens per image change:
     64 tokens: 25.1%
    128 tokens: 15.3%
    256 tokens: 9.0%
    512 tokens: 5.3%

timestep distributions (tau=0 is pure noise), n=5e6
                 mean    P<0.1    P<0.5    P>0.9
  uniform       0.500    10.0%    50.0%    10.0%
  logit-normal  0.500     1.4%    50.0%     1.4%
  pi0 Beta      0.400    14.6%    64.7%     3.1%
  exact P(tau<0.5) = 1 - ((s-0.5)/s)^1.5 = 0.6470
  openpi t = 0.999*Beta + 0.001 vs 1 - tau: max |diff| = 1.1e-16
  Euler grid: tau = 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9

control loop (H=50 actions per chunk)
  robot        Hz  run  every  chunk  73 ms  86 ms
  UR5e/Franka  20   16   0.8s   2.5s   9.1%  10.7%
  others       50   25   0.5s   1.0s  14.6%  17.2%
  OpenVLA ~6 Hz = 167 ms per action; pi0 on-board per executed
  action: 4.6 ms (16 actions), 2.9 ms (25 actions)

reading a bar built from 10 episodes (partial credit ignored)
  3/10: 95% Clopper-Pearson [0.07, 0.65]
  5/10: 95% Clopper-Pearson [0.19, 0.81]
  7/10: 95% Clopper-Pearson [0.35, 0.93]
  9/10: 95% Clopper-Pearson [0.55, 1.00]
  baseline k2 -> smallest k1 with Fisher p<0.05:
  0:5  1:7  2:8  3:9  4:10  5:10  6:-  7:-  8:-  9:-

mixture arithmetic
  106M + 797M = 903M timesteps
  hours at 50 Hz / 20 Hz: 5017 / 12542 (paper: about 10,000)
  weight n^0.43: 10x data -> 2.69x, 100x -> 7.24x, 1000x -> 19.5x

Parameter counts: Gemma 2B matches to the digit, and 3.3B is rounding

  • Both Gemma 2B numbers equal the technical report exactly: 524,550,144 embedding parameters and 1,981,884,416 in the remaining layers. So the layer formula in the script (eight query heads sharing one KV head, a gated MLP, two RMSNorms) is right.
  • The appendix’s “num heads=18” (v4) cannot be correct. 18 heads times a head dimension of 256 is 4,608, not the width of 2,048; with 18 heads the layers would hold 2.17B parameters, which does not match the Gemma report. Gemma 2B has 8 heads (report Table 1; openpi’s gemma_2b configuration also has 8), so this is most likely a typo.
  • The action expert recomputes to 311.5M, consistent with the paper’s “about 300M”. The input and output projections for actions and state and the action-time MLP add another 3.21M, which is negligible.
  • The total is 3.24B, while the paper says 3.3B. The paper adds 300M to PaliGemma’s “3B”; PaliGemma is exactly 2.921B here (SigLIP 412.4M, projector 2.36M, Gemma 2.506B), so 3.3B is rounding, not counting. The SigLIP count leaves out the pooling head: PaliGemma uses the outputs of all 256 patches directly.

The block-causal mask: caching is exact, and a bidirectional mask breaks it

The toy model has two experts (widths 24 and 16, each with its own q, k, v, o and gated MLP), 3 layers, 4 query heads sharing 1 KV head, and rotary position encoding; every token uses only the weights of its own expert, and the two groups of tokens meet only in self-attention, as in the paper’s Appendix B. The sequence is 12 “prefix” tokens, 1 state token and 5 action tokens, and the mask rule is the one in openpi’s make_attn_mask: each token gets a 0 or a 1, and a token sees every token whose cumulative sum is not larger than its own. The three rows of 0s and 1s in the output show the mask at five positions (first and last prefix token, state, first and last action): the prefix sees only the prefix, the state sees the prefix and itself, and the actions see everything.

  • Under the block-causal mask, cached and full recomputation differ by at most 1.4×10⁻¹⁵, which is float64 rounding. Caching the state token as well (the paper’s Appendix B) and caching only the prefix (openpi’s implementation, where the state token is recomputed together with the actions) are both exact. The prefix outputs are completely unaffected by the action tokens (the difference is exactly 0).
  • With a fully bidirectional mask the cache is immediately wrong: the differences are 9.9×10⁻¹ and 8.0×10⁻¹, and the prefix output moves by 1.7 with the action tokens, so every flow-matching step would have to recompute everything.
  • This is not a surprising result; it is an identity that follows from the mask. The script tests whether the construction of the mask and the cache code path (the rotary position offset, the shared KV head, the joining of two experts) are written correctly. The toy weights are random, so it says nothing about robots.

The inference budget: the action phase is about 9% of the compute but 37% of the time

The compute is estimated as 2×parameters per token plus attention: 788 prefix tokens (3×256 image tokens plus 20 language tokens) go through Gemma 2B, and the action expert processes the state plus 50 action tokens in each of 10 steps. Dividing the paper’s Table I timings (3 camera images, RTX 4090) by these compute figures gives the effective throughput:

PhaseCompute (TFLOPs)Time (ms)Effective throughput (TFLOP/s)
Image encoders0.6561446.9
Prefix forward3.21532100.5
10 flow steps0.3812714.1
  • The action phase has 9.0% of the compute and takes 37.0% of the time (27 ms of 73 ms). The 10 steps are sequential, each processes only 51 tokens, and the weights must be read in full every time, so the throughput is only about one seventh of the prefix phase. The bottleneck of inference is the number of sequential steps, not FLOPs, so fewer steps mean lower latency; the paper does not explain why it uses 10 steps and does not compare other step counts.
  • The price of not caching: recomputing the images and the prefix at every step would cost 39.1 TFLOPs, 9.2 times the 4.25 TFLOPs with caching.
  • The conclusion is insensitive to the token count: with 64, 128 or 512 tokens per image instead of 256, the action phase has 25.1%, 15.3% or 5.3% of the compute, always below its 37% share of the time.
  • These throughputs are effective values, not measurements: the paper does not state the precision, the framework or the batch size, and the compute is an estimate; the numbers only compare the relative efficiency of the three phases.

The control loop: the cost of one inference is a few milliseconds per executed action

The paper’s Appendix D states that the 20 Hz UR5e and Franka robots run inference after every 16 executed actions (an interval of 0.8 s), and the other 50 Hz robots after every 25 actions (0.5 s), instead of executing the whole 50-step chunk; the authors tried temporal ensembling, found that it hurt performance, and therefore run the chunks open loop.

  • Duty cycle of inference: 73 ms on board is 9.1% of 0.8 s and 14.6% of 0.5 s; 86 ms over Wi-Fi is 10.7% and 17.2%. A chunk of 50 steps covers 2.5 s at 20 Hz and 1.0 s at 50 Hz, so only 32% or 50% of each chunk is executed before the next plan.
  • Compared with OpenVLA: the OpenVLA paper reports about 6 Hz on an RTX 4090, 167 ms per action; π0’s 73 ms spread over 16 or 25 actions is 4.6 ms or 2.9 ms per action. Both numbers are on an RTX 4090, but π0 looks at 3 images and OpenVLA at 1, and the software stack and precision differ, so read this as one to two orders of magnitude, not as an exact ratio.

The timestep distribution: biased toward noise, and consistent with the openpi code

DistributionMean of ττ<0.1τ<0.5τ>0.9
Uniform0.50010.0%50.0%10.0%
Logit-normal (SD3)0.5001.4%50.0%1.4%
π0 Beta0.40014.6%64.7%3.1%
  • π0’s distribution puts about two thirds of the training samples on the noisy side, τ<0.5, with a mean of 0.400; SD3’s logit-normal is symmetric around the middle and puts only 1.4% at each end. The closed form P(τ<0.5)=1−((s−0.5)/s)1.5=0.6470P(\tau<0.5)=1-((s-0.5)/s)^{1.5}=0.6470 agrees with the sample.
  • It matches openpi: the code has time = beta(1.5, 1) * 0.999 + 0.001 with t=1t=1 as pure noise, and a comment admitting that this is the opposite direction from the paper; tt equals the paper’s 1−τ1-\tau point by point (maximum difference 1.1×10⁻¹⁶). The 10-step grid at inference is τ=0,0.1,…,0.9\tau=0,0.1,\dots,0.9, far below the training cutoff s=0.999s=0.999.
  • This distribution has no ablation. The paper offers a hypothesis: predicting the “mean action given the observation” is harder than predicting the “mean image given the text”, so high-noise steps should be sampled more often. The numbers above only pin down the shape of the distribution; they do not show that it beats uniform sampling.

The resolution of the evaluation: only 10 trials per bar

The paper evaluates 10 episodes per task and method, scored with partial credit. The script treats each episode as a 0/1 success to estimate the resolution (partial credit is ignored, so this is an order-of-magnitude estimate):

  • The intervals are wide: the 95% exact interval (Clopper–Pearson) for 5/10 is [0.19, 0.81], and for 9/10 it is [0.55, 1.00].
  • The gap needed for significance is large: if the baseline has k2 successes, π0 needs at least k1 successes for Fisher’s exact test to give p<0.05: k2 = 0, 1, 2, 3, 4, 5 need 5, 7, 8, 9, 10, 10 respectively, and once the baseline reaches 6/10, even a perfect 10/10 is not significant.
  • How to read the paper’s figures: the gap between π0 and OpenVLA or Octo is large (the paper’s wording is that π0 leads across the board, with near-perfect shirt folding and easy bussing), and a gap that large is visible at this resolution; the small gaps between π0 and the compute-parity or from-scratch versions, and the fine structure of the curves at different amounts of fine-tuning data, are beyond what 10 trials can resolve. No multiple-comparison correction is applied; the p-values are only meant to indicate the order of magnitude.

Arithmetic on the data mixture

  • The paper’s 106M (single-arm) plus 797M (dual-arm) is indeed 903M timesteps.
  • 903M timesteps are 5,017 hours at 50 Hz and 12,542 hours at 20 Hz; the paper says “about 10,000 hours”, between the two, consistent with its robots mixing 20 Hz and 50 Hz. This is only an order-of-magnitude check; the paper does not give the timesteps per robot.
  • Each task-robot combination is weighted by n0.43n^{0.43}: 10 times more data gets only 2.69 times the weight, 100 times gets 7.24 times and 1000 times gets 19.5 times. This is what “laundry folding, which has the most data, does not drown out the rest” means.

Limitations and What to Keep in Mind

The limitations the paper states itself:

  • It does not clarify how the pre-training data should be composed: the authors put in all the data they had, and which kind of data helps most and how to weight it remain open questions.
  • Not every task works reliably, and it is unclear how much data, and of what kind, is needed to reach near-perfect performance.
  • How much positive transfer there is between very different tasks and robots remains to be seen, and whether such universality extends to autonomous driving, navigation and legged locomotion is left to future work.

After reading the paper and the code, I would add:

  • Several architectural choices have no ablation. Putting robot tokens into a separate action expert, sampling timesteps from a Beta distribution, the chunk length of 50 and the 10 integration steps are supported in the text only by statements that the authors “found” an improvement or by hypotheses, not by comparison data.
  • The π0-small comparison is confounded. It lacks the VLM initialization, has fewer parameters, encodes language with DistilBERT, has an action expert that cross-attends to the observation encoder (Appendix C also lists a DiT-style action expert) and uses a smaller vision encoder; the paper itself admits that this comparison is hard to make fair (π0-small has fewer parameters, but larger models are difficult to use without pre-training), so “VLM pre-training helps” has a direction but no magnitude.
  • The comparison with OpenVLA favors π0. OpenVLA is trained on π0’s whole mixture, which it cannot exploit because it supports neither action chunks nor high-frequency control; the paper itself calls this a very difficult mixture for OpenVLA, and it was trained for only 160k steps.
  • Each bar has only 10 trials, on the authors’ own robots and tasks, which makes the results hard to reproduce and unable to resolve small gaps (see the script above).
  • Inconsistencies in the text. The overview says the whole OXE dataset was used, while the caption of Figure 4 says a subset, OXE Magic Soup; the appendix gives Gemma 2B 18 heads (it should be 8). Such small things do not change the conclusions, but they are a reminder to check the numbers in a paper against the source.

What came next: Physical Intelligence released FAST in January 2025 (an action-compression tokenizer based on the discrete cosine transform; with π0 turned autoregressive it matched diffusion VLAs on 10,000 hours of data, with training time reduced by up to 5x) and π0.5 in April (co-trained on multi-robot data, web data and high-level semantic prediction, performing long-horizon manipulation in entirely new homes). The code and pre-trained base weights of π0 were later published in the openpi repository, whose README says it provides base checkpoints pre-trained on more than 10,000 hours of robot data and supports π0, π0-FAST and π0.5.

What to Take from This Paper

  1. A way to attach continuous output to a VLM: a new set of small weights (the action expert) plus a block-causal mask keeps the VLM’s knowledge while letting the output be a continuous action chunk.
  2. The structure of inference cost: the prefix is computed once and the action expert runs 10 small passes; the cost is set by the number of sequential steps, not by FLOPs.
  3. The training recipe: low-quality but diverse pre-training data plus high-quality post-training data, with the same division of labor as in large language models.
  4. The strength of the evidence: the results are bar charts of 10 trials each and several key design choices have no ablation; the direction is believable, but the magnitude should be discounted.

Further Reading

FAQ

How does π0 differ from RT-2 and OpenVLA?
RT-2 and OpenVLA discretize every action dimension into 256 bins, turn actions into tokens and generate them one token at a time (OpenVLA runs at about 6 Hz). π0 adds a roughly 300M action expert next to the 3B PaliGemma and uses flow matching to generate a 50-step chunk of continuous actions at once; the paper reports control at up to 50 Hz. The two sets of weights share self-attention, and the attention mask splits the sequence into image and language, state, and action blocks, so the keys and values of the prefix are computed once per inference. The price is 10 integration steps, and the paper gives no ablation for these architectural choices.
What is the action expert, and is it a mixture of experts?
The action expert is a separate set of weights next to the backbone that processes the robot state and the noisy action tokens and exchanges information with the backbone only inside self-attention. In π0 the backbone is PaliGemma (width 2048, MLP dimension 16384) and the action expert has width 1024 and MLP dimension 4096; this page recomputes it as 311.5M parameters from Gemma's dimensions, consistent with the paper's roughly 300M. The paper likens the design to a mixture of experts with two elements, but unlike a usual MoE the assignment is hard-coded by token type: there is no learned router and no sparse top-k selection, and each token goes through one fixed set of weights.
How long does one π0 inference take, and why is it fast?
The paper's Table I (RTX 4090, 3 camera images) lists 14 ms for the image encoders, 32 ms for the observation forward pass and 27 ms for the 10 action steps, 73 ms in total on board and 86 ms when inference runs off board over Wi-Fi. The keys and values of the prefix are computed once and the action expert is small. This page verifies on a toy model that the cache is exact (maximum difference 1.4×10⁻¹⁵) and estimates that without it the compute would be 9.2 times larger; the action phase has about 9% of the FLOPs but 37% of the time, because its 10 steps are sequential.
How large is π0's pre-training data?
The authors' own data has 903M timesteps (106M single-arm, 797M dual-arm) across 7 robot configurations and 68 tasks, plus open-source data (OXE, Bridge v2, DROID) that makes up 9.1% of the mixture; the paper puts the total at about 10,000 hours. Every task-robot combination is weighted by its sample count to the power 0.43: 10 times more data gets only 2.69 times the weight, and 1000 times more gets just 19.5 times.
Why does π0 not sample the flow-matching timestep uniformly?
The paper samples τ from Beta((s−τ)/s; 1.5, 1) with s=0.999 and τ=0 as pure noise, which favors the noisy side: the mean is 0.400 and 64.7% of the samples fall below τ=0.5, against 50% for a uniform distribution. The reason is a hypothesis: predicting the mean action given an observation is harder than predicting the mean image given a text, because an observation constrains the action much more. The paper has no ablation for this choice; this page only pins down the shape of the distribution and checks that it matches the openpi code (where t=1 is noise, the opposite of the paper).