alpamini: Alpamayo 2 Edge at Under a Third of the FLOPs
NVIDIA's Alpamayo 2 Edge is a genuinely interesting jump from its predecessor. Alpamayo 1 was a 10B-parameter reasoning driving model, and Edge does the same job in 2B, on the Nemotron backbone of Cosmos 3 Edge. It reads six cameras (22 frames), the ego history and a navigation instruction, writes a short chain of thought about what it's doing, and outputs a 6.4 s trajectory from a flow-matching action expert. It was trained on PhysicalAI-Autonomous-Vehicles and is evaluated in closed loop in AlpaSim on NuRec scenes.
On an RTX 5090, with torch.compile and CUDA graphs already on, the released model takes 264 to 305 ms per decision. That's 3 to 4 plans a second, and a driving stack wants 10.
So we made it faster. alpamini runs at 92 to 94 ms, 10.6 to 10.9 decisions per second on my RTX 5090, with no loss of accuracy on held-out data and the same closed-loop behaviour (side-by-side videos in Results). All of it is full bf16, with no quantization and no TensorRT, so quantizing alpamini is still on the table as later work. Weights and code are at Rohit-R-Rao/alpamini.
| native Alpamayo 2 Edge | alpamini | |
|---|---|---|
| Latency, short reasoning | 264.4 ms | 94.3 ms (2.80x) |
| Latency, 22-token reasoning | 305.4 ms | 92.0 ms (3.32x) |
| Decision rate | 3.3 to 3.8 Hz | 10.6 to 10.9 Hz |
| GT FDE | 4.60 m | 4.28 m |
| Mean lateral error | 0.241 m | 0.208 m |
| GPU memory | 5.9 GiB | 5.6 GiB |
Where the compute goes
I wanted to cut total compute, so first I measured where it goes. Deleting whole layers is the obvious move. It's a trap. At matched FLOPs, cutting 7 of the least influential vision blocks out of the 27 cost 3.7 m of ground-truth Final Displacement Error (GT FDE), while cutting the same FLOPs out of attention heads and MLP channels cost 1.0 m. Depth is load-bearing. So I kept every layer and counted FLOPs for one decision, stage by stage.
| Stage | GFLOP | share | latency |
|---|---|---|---|
| Vision tower + projector, 22 frames | 10,817 | 47% | 95 ms |
| LM prefill, 3,256 tokens | 11,609 | 50% | 67 ms |
| Action expert, 10 steps | 741 | 3% | 20 to 22 ms |
| Reasoning decode, 6 to 22 tokens | 25 to 91 | 0.1 to 0.4% | 25 to 76 ms |
| Preprocessing | ~0 | 40 ms |
Two stages own 97% of the math: the vision tower turning 22 camera frames into vision tokens, and the language model's prefill over the prompt those tokens make up. They are really one problem. About 2,900 of the 3,256 prompt tokens are image tokens, so every pixel that goes in is paid for twice, once in the vision tower and again in prefill.
Most of the optimizations here cut those two stages. The rest get around decode, which does under half a percent of the work and still eats up to a quarter of the time because it's memory-bound, not compute-bound (section 3). Preprocessing is 40 ms of plumbing, fixed in section 2.
1. Less input with per-camera resolution and a narrower vision tower
Resolution. Not every camera matters equally. I degraded one camera at a time on the native model and measured the error per driving situation. Halving the telephoto camera costs +3.41 m GT FDE when stopping behind a lead car, because that is how the model sees the car it must stop for. Halving a side camera costs +0.04 to +0.21 m, and blanking one entirely costs almost nothing. The front wide camera sits in between and drives lateral error on curves, turns and lane changes. At 62.5% of its side length, 3 s lateral error rose by 0.044 m, and at 75% by 0.028 m. alpamini keeps the telephoto camera at full resolution, the front wide at 75% and the four side cameras at 50%, so the vision tower sees 1,571 tokens' worth of frames instead of 2,892.
Width. The vision tower keeps all 27 blocks but goes from 16 to 12 attention heads and from 4,304 to 3,200 MLP channels, plus a small rank-64 adapter per block.
Choosing what to cut takes two steps. First, score every MLP channel by how much it can change the layer's output.
The first factor is how strongly the channel fires on calibration data (16 clips), and the second is how far its output weights can move the result. A head's score is the sum over its channels. The tower keeps the top 12 heads and the top 3,200 channels per block.
Second, repair the layer instead of leaving a hole. Channels aren't independent. Many of them fire together on the same inputs. If a removed channel almost always fires alongside a kept one, the kept one can do its job too, as long as its output weights are turned up. So the kept channels' output weights are re-fit to reproduce the original layer's output on the calibration data, which is ordinary least squares.
The Hessian explains why this works. The gradient tells you which way the loss goes downhill, and the Hessian tells you how curved the ground is. For this loss the Hessian is , and entry is just how much channels and fire together. That is the "who can cover for whom" table. The loss is a perfect bowl, so one step lands at the bottom, with no training. Take a toy case. Channels A and B are near-copies and A gets cut. The refit roughly doubles B's output weight, and the layer's output barely moves.
Hessian methods like Optimal Brain Surgeon and SparseGPT also use to choose what to cut. A weight is cheap to remove if it's small and other weights can cover for it. I used the simpler score to choose and the Hessian only to repair. Untrained, at matched FLOPs, that cost 1.0 m of GT FDE, against 3.7 m for removing whole blocks.
2. Don't recompute what you already know
Frame caching. At 10 Hz, every past frame in the input was the newest frame of an earlier decision. The vision tower attends within each frame only, so a frame's features never change once computed. Caching them means only the 6 new frames go through the tower, and vision drops from 54 to 25 ms. Frame caching isn't specific to alpamini. On native it alone gives 159 to 207 ms instead of 264 to 305, so of alpamini's 2.8 to 3.3× speedup, 1.7 to 2.3× comes from the other changes. The cache has to reach 2 s back (20 decisions × 6 cameras), and my first sim run used a 64-frame cache and quietly recomputed most of the 22 frames every step.
Past-frame token thinning. The language model still reads every past-frame token, and adjacent frames are very redundant. On the side cameras, 90 to 98% of tokens have a near-identical match in the next frame. Keeping a random 25% of past-frame tokens (with their original positions) beat every "smart" scheme.
| Past tokens kept | random | drop most similar | merge most similar | drop oldest frames |
|---|---|---|---|---|
| 50% | +0.14 m | +0.38 m | +0.44 m | +0.50 m |
| 25% | +0.34 m | +0.74 m | +0.93 m | +1.23 m |
Dropping by similarity removes whole regions of the image, while random keeps uniform coverage. The telephoto camera is exempt, for the reason in section 4.
GPU preprocessing. Each 1080p frame went CPU to GPU for the resize and back, then patchify and normalize ran on the CPU. Doing it all on the GPU, with the prompt tokens cached per layout and frames cached like the vision features, gives identical inputs, and 40 ms becomes 10 to 13 ms.
3. One-shot reasoning is a memory problem, not a FLOP problem
Before the trajectory, the model writes a short explanation ("Decelerate to a stop behind the queued lead vehicle for the red traffic light ahead."), and the action expert reads it. Native writes it one token at a time. Each token costs 4.1 GFLOP, almost nothing, and still takes 3.5 to 4.2 ms. A 22-token explanation costs 76 ms, more than the whole vision tower after caching.
Why decode is comparatively slower on every GPU/accelerator compared to prefill

A GPU is two things joined by a pipe. One side is compute, the streaming multiprocessors full of tensor cores, each doing a small matrix multiply every cycle. The other side is memory (VRAM), which holds the weights and the KV cache. Every weight a layer uses has to travel through that pipe before a tensor core can touch it. So the question for any step is how much math it does per byte it moves (its arithmetic intensity), against how much the GPU needs to stay busy.
Generating one token pushes a single vector through the whole language model. Every weight is read, used for one multiply-add, and thrown away. That's 3.8 GB moved (weights plus KV cache) for 4.1 GFLOP, about 1.1 FLOP per byte. Tensor cores need tens to hundreds of FLOPs per byte to stay busy, and that's true for all GPUs, from lower tier consumer cards all the way up to H100s. A faster GPU widens the pipe, but decode stays memory-bound on all of them, and the tokens still come out one after another, because each one waits for the last. Prefill is the opposite case. It pushes 3,256 tokens through the same weights in one pass, at about 3,000 FLOPs per byte, so it's compute-bound and fast for its FLOPs.
The way out is to give each weight read more work. Read the weights once, and use them for many positions at the same time.
Why one pass is enough here
Autoregressive decoding exists for open-ended text, where the next word really does depend on the words before it. This model is not answering an open question. Its reasoning is a short driving rationale with a tiny space of answers, and everything that decides it is already in the prompt (the cameras, the ego history and the nav command). I checked native's own reasoning on 10,378 training samples.
| Native's reasoning, 10,378 samples | |
|---|---|
<NOMINAL> (nothing worth explaining) |
30% of samples |
| Covered by the 20 most common explanations | 49% |
| Covered by the 200 most common explanations | 73% |
| Length, mean / 99th percentile / max | 16.7 / 32 / 41 tokens |
| Longer than 40 tokens | 1 of 10,378 |
The rest are mostly rephrasings of the same few templates, like "stop behind the lead vehicle", "proceed through the green light" and "turn at the intersection to follow the route". It's a menu. When the answer is short, bounded and fully determined by the input, nothing needs to be generated left to right. Every position can be filled at once, and each one can attend to the others in both directions (bidirectional instead of causal attention).
The action expert also doesn't read words. It reads the language model's key/value states at the reasoning positions. One-shot decoding only has to produce states the expert agrees with, not the exact sentence native would have written.
So alpamini appends 40 learned "slot" embeddings after the prompt, enough for 99.99% of native's explanations, and runs one bidirectional pass over all of them. A rank-128 LoRA is active on the slots only, so the prompt itself is processed exactly as native does it. The explanation ends at the first slot that predicts the end-of-reasoning token, and the action expert reads the prompt plus those slots, exactly as it reads a decoded explanation.
| native | alpamini | |
|---|---|---|
| Weight reads for a 22-token explanation | 22 | 1 |
| Reasoning decode, 6 tokens | 25 ms | 5.5 ms |
| Reasoning decode, 22 tokens | 76 ms | 5.5 ms |
But isn't autoregressive reasoning better?
The reasoning definitely matters. The order it's computed in doesn't. Before training anything, I gave native's own action expert three versions of the reasoning (32 samples, 4 seeds each).
| Reasoning the expert reads | Trajectory change vs autoregressive | GT FDE |
|---|---|---|
| Autoregressive, as native ships | (reference) | 3.58 m |
| The same words in one bidirectional pass, untrained | 0.09 m | 3.58 m |
| No reasoning at all | 2.04 m | 4.45 m |
Dropping the reasoning costs 0.9 m of error, so it does real work. Computing it in one parallel pass, with no training at all, moves the trajectory by 9 cm and leaves the error unchanged. After training, alpamini's one-shot model beats native's autoregressive one on held-out data (GT FDE 4.28 vs 4.60 m, 3 s lateral error 0.142 vs 0.150 m) and drives the closed-loop scenes in Results, with decode 14 times faster.
The cost is readability. The slots are trained for what the action expert reads (native's KV states and trajectories), not for exact words. Only 15 to 16% of explanations match native's text exactly, and some come out garbled. Training harder on the words made the trajectories worse, so I stopped optimizing for the text.
4. Keeping it on the road
Every step above was checked in closed loop, and closed loop caught three things that the open-loop numbers missed.
- The language model stays native. An early version also narrowed the language model's MLPs. Open loop it looked fine, but in AlpaSim it crashed into the car ahead in a stop scene. Swapping one component at a time back to native cleared the vision tower, the resolution and the expert, and isolated the narrowed LM. alpamini keeps native's LM weights and gets its LM speedup from reading fewer tokens.
- The telephoto camera is never thinned. With all cameras thinned to 25%, the same stop scene crashed again, and with the telephoto exempt it stops cleanly.
- Lateral error needs its own loss. The one-shot model then drifted off the road in a scene native drives cleanly. Distillation losses average over the whole action space, so a model can be close on average and still slowly leave its lane. Adding explicit lateral and longitudinal trajectory losses fixed it. These are Huber losses against the recorded future and against native's own trajectory, computed through the real 10-step sampler and balanced by gradient norm. Offroad frames in that scene went 76 → 48 → 0.
How it was trained
The final model trains the slot LoRA (rank 128) and the 40 slot embeddings, the action expert, and the vision tower with its adapters. The language model's own weights stay frozen. Training ran on 8,000 PhysicalAI-AV samples, a small subset of the dataset (the held-out set was never trained on), with AdamW, using a separate learning rate per part (LoRA 1e-4, slots 5e-4, expert 3e-5, vision 5e-6, adapters 5e-5). The checkpoint was picked by 2 s lateral error on the held-out set. Each stage started from the one before, going from the pruned vision tower to one-shot decode, then front wide at 75%, then the lateral losses, and finally this run, stopped at step 300.
Every loss term is there because something broke without it. Lateral error was the big one. Early versions looked fine on average but slowly drifted out of their lane, so I added losses that directly punish sideways error and leaning to one side, and offroad frames in the worst scene went from 76 to 0. The terms do three jobs. They make the 40 slots a drop-in replacement for native's reasoning, keep the smaller vision tower seeing what native saw, and get the trajectory itself right. The loss is one weighted sum.
Each row below is one term of that sum.
| Term | Matches | Why |
|---|---|---|
tok |
native's reasoning tokens (slot ↔ token $i$) | The slots should say what native would say. KL to native's top-64 distribution keeps its uncertainty instead of forcing one hard answer. A 0.5 × cross-entropy to padding makes the slots after the reasoning go quiet, because the reasoning length is read from where the end token lands. |
kv |
native's key/value states for those tokens, layers 1 to 27 | The action expert never reads the words, only their keys and values. If the cache looks like native's, the expert works as-is. The error is relative, , so every layer counts equally whatever its scale. Layer 0 is skipped because a slot's layer-0 KV can't depend on content yet. |
feat |
native's vision features at full resolution | The tower is narrower and gets fewer pixels. Matching native's features token by token keeps the language model's input looking the same. Cosine matches direction, normalized MSE matches scale. |
fm |
native's actions (4 noise seeds per sample) | The expert's actual job, copied from native with flow matching, . The 4 seeds carry native's spread of plausible plans, not just one. |
gt_fm |
the recorded future | Native isn't the answer key. The same loss with = the recorded trajectory pulls toward what the human driver actually did. |
lat_gt, lat_nat |
lateral offset vs the recorded future / native's mean trajectory | An earlier version drifted off the road because its losses only saw lateral position indirectly. Huber replaces squared error because typical errors are a few cm, and with a wide one 2 to 3 m lane-change miss had about 10× a typical sample's gradient. widens from 0.1 to 0.5 m over the 64 waypoints because errors grow with the horizon (~2 cm at 1 s, ~0.8 m at 6.4 s), and the weight falls from 1 to 0.25 because the next second matters most. |
bias_gt, bias_nat |
drifting consistently to one side | Per-sample errors can average to zero while the whole batch leans one way. That slow lean is exactly what walks a car out of its lane, so these terms penalize the running mean of the signed lateral offset. Each shares its lateral term's weight. |
lon_gt |
longitudinal offset vs the recorded future | GT FDE is mostly longitudinal error, about 5× the lateral, so its Huber is wider, at 0.2 to 1.0 m. |
The trajectory terms matter most. They're computed on what the model actually outputs. That's two trajectories per sample, each produced by running the real 10-step sampler inside the training step. Each step is gradient-checkpointed, so only one step's activations live in memory at a time.
Weighting matters as much as the terms. Every weight starts at 1 / L_k at step 0, so every term begins at 1. The trajectory terms are then gradient-balanced. Each weight is set so that its term's gradient on the action expert has the same norm as the flow-matching term's, and re-measured every 100 steps. Without that, terms of very different scale fight. Normalizing the trajectory terms by their value instead gave them weights around 1,000 and a gradient norm of 227, against about 20 for everything else. At step 100 the rebalance cut the longitudinal weight from 1.29 to 0.36 and the GT lateral weight from 13.9 to 4.5.
Evaluation setup
- Latency. Wall-clock time for one driving decision, from raw camera frames to trajectory, synchronized on the GPU. Median of 10 decisions after warm-up. RTX 5090, bf16, PyTorch 2.8. Both models use the upstream torch.compile + CUDA graph path.
- Decision rate. 1 / latency.
- GT FDE (final displacement error). The distance between the predicted position at 6.4 s and where the car really was, in metres. Lower is better.
- Lateral error. The part of the position error perpendicular to the recorded path, at 1, 2, 3 and 6.4 s, or averaged over all 64 waypoints. This is what keeps a car in its lane.
- Longitudinal error. The part along the path, where negative means the trajectory ends short (too slow).
- Held-out set. 132 PhysicalAI-AV samples the model never trained on, 12 for each of 11 driving situations (stop behind a lead car, other stops, waiting, start from rest, braking, left and right turns, lane changes, curves, low-speed cruise, cruise), with 4 flow-matching seeds each.
- AlpaSim score. 0 if the car collides at fault, drives offroad or leaves its lane corridor, otherwise progress along the route (capped at 1). Scored up to the end of the recorded drive.
- FLOPs. Floating-point operations for one whole decision on the real models, counted with PyTorch's FlopCounterMode (matrix multiplies and attention, since preprocessing has neither). Native runs the upstream inference path, and alpamini runs at 10 Hz steady state, where only the 6 newest frames are new.
Results
Latency per stage, RTX 5090.
| ms | native | alpamini |
|---|---|---|
| Preprocessing | 40 to 42 | 10 to 13 |
| Vision | 95 | 25 |
| LM prefill | 67 | 30 |
| Reasoning decode | 25 to 76 | 5.5 |
| Action expert | 20 to 22 | 17 |
| End to end | 264 to 305 | 92 to 94 |
Compute per decision, end to end (GFLOP, the 22-token reasoning sample, alpamini in steady state with 16 of 22 frames cached).
| GFLOP | native | alpamini |
|---|---|---|
| Vision tower + projector | 10,817 | 970 |
| Language model (prefill + reasoning) | 11,750 | 5,068 |
| Action expert and the rest | 746 | 517 |
| End to end | 23,314 | 6,555 (3.56× fewer, −72%) |
The 6-token sample is the same story, 23,193 vs 6,535 GFLOP (3.55×).
Accuracy, 132 held-out samples, 4 seeds.
| native | alpamini | |
|---|---|---|
| GT FDE | 4.60 m | 4.28 m |
| Lateral at 2 / 3 / 6.4 s | 0.073 / 0.150 / 0.764 m | 0.069 / 0.142 / 0.643 m |
| Lateral, mean | 0.241 m | 0.208 m |
Native is teacher-forced on its own reasoning here, while alpamini runs its one-shot decode. Differences at 1 to 3 s are within noise.
Closed loop covers 10 AlpaSim scenes with one rollout each, the 5 scenes I developed against plus 5 drawn at random from the public evaluation set. Bird's-eye view with each run's metrics, Alpamayo 2 Edge on the left, alpamini on the right. The camera view is cropped out because AlpaSim's scenes are reconstructions of real drives from NVIDIA's dataset, and its license doesn't allow redistributing that footage.
| Scene | score, native | score, alpamini | max lateral to GT, native | max lateral to GT, alpamini |
|---|---|---|---|---|
| cdb709d1 | 0.76 | 1.00 | 2.89 m | 0.64 m |
| 6f3be572 | 1.00 | 1.00 | 0.21 m | 0.07 m |
| 6f34d20b | 1.00 | 1.00 | 3.59 m | 0.63 m |
| 02eadd92 | 1.00 | 1.00 | 2.36 m | 0.24 m |
| fe0c2168 | 1.00 | 1.00 | 3.50 m | 0.54 m |
| e39fb49b | 1.00 | 1.00 | 1.28 m | 0.57 m |
| 07981e6a | 1.00 | 1.00 | 0.28 m | 0.24 m |
| d7a656c2 | 1.00 | 1.00 | 0.95 m | 0.73 m |
| 023b7fcc | 1.00 | 1.00 | 0.44 m | 0.52 m |
| Mean | 0.97 | 1.00 | 1.72 m | 0.46 m |
f41175b5 is left out of the table. Its navigation command says Continue straight for the whole scene, while the recorded driver turns left at the light, so the ground truth contradicts the command the model is given. alpamini follows the command and is scored 0 for leaving the recorded corridor, while Alpamayo 2 Edge drifts left with the recorded driver and scores 0.93. Its video is in the slideshow above. On the other 9 scenes, alpamini scores 1.00 everywhere, stays closer to the recorded path in 8 of 9, and has no collisions or offroad frames.
What did not work
- Depth cuts. Far larger accuracy loss than width cuts at the same savings.
- Narrowing the language model. Fine open loop, a collision closed loop.
- Similarity-based token dropping or merging. Worse than random at every budget.
- Training for thinning. No gain at 25%, and worse with all tokens kept.
- Matching native's words in one-shot decode. Better token accuracy, worse trajectories.
- Multi-frame super-resolution. Never more than 0.2 dB better than a single frame. H.264 had already removed the detail.
Limitations
- Closed-loop evidence. 10 scenes, one seed each. That shows it works, but it is not a safety validation.
- Not bit-identical to the eager path. Frame caching and CUDA graphs change bf16 rounding. Trajectories move by at most 0.03 m, and the reasoning text can change.
- Parameter count. About 2.68 B, roughly the same as native's 2.65 B. The speedup comes from fewer tokens, a narrower vision tower and one-shot decoding, not from a smaller model.
- Camera rigs. Everything was tuned on PhysicalAI-AV rigs, and others are untested.
Use it
Code and setup steps are on GitHub. Weights and closed-loop videos are on Hugging Face.
Next up, quantization
Every millisecond here came from doing less work, with fewer pixels, a narrower vision tower, fewer tokens for the language model, one pass instead of a loop. Nothing came from fewer bits. alpamini is plain bf16 PyTorch. No TensorRT, no quantization.
Embedl quantized native Alpamayo 2 Edge, with NVFP4 for the language model and MXFP8 for the vision tower and action expert, in TensorRT Edge-LLM. That took it from 603.7 ms to 91.9 ms per decision on Jetson AGX Thor, 10.9 Hz, with trajectory error no worse than the original. Seriously impressive.
The two stack. Quantization makes every FLOP and byte cheaper, and alpamini removes nearly three quarters of the FLOPs first. What's left is mostly the matrix math of vision and prefill, which FP8 tensor cores run at twice bf16's rate, plus a one-shot decode that is pure weight reads and shrinks with every bit you drop. On the same RTX 5090, FP8 alone should bring alpamini to roughly 55 to 65 ms, 15 to 20 decisions a second. That's an estimate, not a measurement.
What about in-car hardware? Everything here was measured on an RTX 5090, not on a Thor, and I haven't run alpamini on one. But the gain is structural. alpamini does 72% less math and reads far fewer tokens on any chip, so the speedup should carry over even though the absolute numbers won't. Embedl measured native at 603.7 ms in PyTorch bf16 on Jetson AGX Thor. If alpamini's 2.8 to 3.3× end-to-end speedup holds there, that's roughly 180 to 215 ms in bf16, before any quantization. Applied to Embedl's quantized 91.9 ms, the same ratio would put a quantized alpamini at roughly 28 to 33 ms, around 30 Hz, on Jetson AGX Thor. These are projections, not measurements. Thor has much less memory bandwidth than a 5090, so the share of time each stage takes will differ, and a quantized pipeline may hit fixed overheads that don't shrink.
I haven't done it. That's the invitation. The weights and code are open at Rohit-R-Rao/alpamini, along with the benchmark that measures the 93 ms. Calibrate FP8 or NVFP4 on driving data, export it, and run it closed loop. A reasoning driving model at 20+ Hz on in-car hardware looks like one good quantization pass away. If you get there, send it to me and I'll link it here.
Related work
Ishinca distills the 10B Alpamayo 1.5 into a 4B student and prunes vision tokens with DART. NVIDIA's Model-Optimizer shows quantization-aware distillation for Alpamayo 1. For Alpamayo 2 Edge itself, NVIDIA's deployment recipe uses TensorRT, FP8 and DFlash2 speculative decoding to reach 160 to 190 ms on DRIVE AGX Thor, and Embedl reaches 92 ms on Jetson AGX Thor with NVFP4/MXFP8 quantization. Both keep the architecture and make the same computation cheaper; alpamini changes what gets computed.
This is independent work, not affiliated with or endorsed by NVIDIA. Alpamayo is NVIDIA's model, and alpamini's weights are a modification of it, released under NVIDIA's OpenMDW-1.1 license. Evaluated offline and in simulation only. Not for use on public roads.