FP4 has only 8 sizes of number, from 0 to 6. A shared scale per block of 16 or 32 values stretches that grid over real data. Inkling 2 trained and ships its expert weights this way, so nothing changes between training and use.
Learn the FP4 grid, the two block formats (MXFP4 and NVFP4), how a 4-bit forward pass and an 8-bit backward pass fit together, and why a model trained in its shipping precision loses nothing at shipping time.
Drag any bar up or down, or drag the outlier slider. Switch between MXFP4 and NVFP4 and watch the grid, the scale and the error. Then we build, piece by piece, the number line, the block scale, the training recipe and the shipped model.
You need a rough idea of a neural network layer (a matrix multiply) and a little Python. We build the rest from zero.
Based on Thinking Machines’ post End-to-End 4-Bit Training (Jack Cook and Thinking Machines Lab, November 2026), the Inkling 2 Mini and Inkling 2 Small releases and model cards, NVIDIA’s Pretraining Large Language Models with NVFP4, and the OCP Microscaling Formats (MX) specification v1.0.
The 32 values are illustrative, drawn once from a bell curve. The rules are real: the FP4 grid ±{0, 0.5, 1, 1.5, 2, 3, 4, 6}; MXFP4 with one power-of-two scale for 32 values (OCP MX spec, Table 1); NVFP4 with one E4M3 scale per 16 values and an FP32 tensor scale (Thinking Machines; NVIDIA). The MX spec leaves the scale rule open, so this page rounds the MX scale up to the next power of two and nothing clips.
Chapter 0
Weigh what 4 bits buy against what they cost, for one real model
You want to store the number 3.2. Your format can hold 3 and 4, and nothing between. You round to 3. The stored value is off by 0.2. That gap is the quantization error: the stored value minus the true value.
One error is small. Training rounds billions of numbers, at every layer, at every step. The errors add up and can steer learning wrong. So why would anyone train with fewer bits? Because the hardware pays well for it.
Each format stores numbers with a different number of bits. Pick one and read three bars: bits per value, speed on a GB300, and the memory for Inkling 2 Mini’s 26.4B weights.
Bits per value and GB300 PFLOPS are from Thinking Machines’ numerical formats table. The memory bar is our arithmetic: 26.4B parameters (Inkling 2 Mini model card) times bits per value. The shipped model is about 20 GB because it mixes NVFP4 and MXFP8.
How much memory do the weights take? Count the parameters and call that N. Call the bits each value costs b, scales included.
M equals N times b, divided by eight.
Multiply the count of weights N by the bits per weight b. Divide by 8 to turn bits into bytes. That is M.
N = 26.4 billion. In BF16, M = 26.4 × 16 ⁄ 8 = 52.8 GB. In NVFP4, M = 26.4 × 4.5 ⁄ 8 = 14.85 GB. The 4-bit copy fits on a laptop; the 16-bit copy does not.
Speed matters most where volume is high. Pretraining runs on trillions of tokens. Reinforcement learning (RL) samples tens of thousands of tokens in each rollout, and every sampled token reads all the weights from memory. Fewer bits mean fewer bytes to read.
Symptom: Thinking Machines tried full NVFP4 training first, with both passes in 4 bits. The loss suffered far more than they would accept. Measure: they track compute efficiency (CE), how much extra compute a change costs to reach the same loss. Fix: spend 4 bits only where error hurts least. The rest of this lesson is that placement.
Chapter 1
Read the 16 codes of E2M1 and see where its 8 magnitudes sit
Four bits give 16 codes. FP4 E2M1 spends them like a tiny float: 1 sign bit, 2 exponent bits and 1 mantissa bit. The 16 codes give 8 magnitudes, each with a plus and a minus sign: 0, 0.5, 1, 1.5, 2, 3, 4 and 6. Zero appears twice, as +0 and −0.
The orange ticks are every value FP4 can hold. Drag the value and watch where it lands. Turn on the gaps to see the spacing double.
The values and bit layout follow the OCP MX specification, Table 5 (FP4 E2M1: exponent bias 1, max normal 6.0, min subnormal 0.5). Rounding is to the nearest value, ties to the even code. Values past 6 saturate to 6.
How do 3 bits of magnitude turn into those 8 numbers? Name the fields. Call the sign bit S, the 2-bit exponent field E, and the mantissa bit M.
v equals minus one to the S, times two to the E minus one, times one plus M over two.
The exponent E picks a power of two. The mantissa M picks the low end or the middle of that octave. The sign S flips it. When E is 0 the rule changes: the value is M times 0.5, which gives 0 and 0.5.
S = 0, E = 3, M = 1: v = 22 × 1.5 = 6, the largest value. S = 0, E = 2, M = 0: v = 21 × 1 = 2. Each step of E doubles the value.
Look at the gaps. From 0 to 2 the step is 0.5. From 2 to 4 it is 1. From 4 to 6 it is 2. A float keeps relative error even, so big values get coarse steps. A value of 5 must round to 4 or 6: an error of 1, which is 20%.
Symptom: a weight of 40 has no FP4 code; it saturates to 6. A weight of 0.2 rounds to 0. Measure: count the values that clip and the values that flush to zero. Fix: do not feed raw numbers to FP4. Divide them by a scale first, so the largest one lands near 6. That is the next chapter.
Chapter 2
Stretch the FP4 grid over a block of real values with one shared number
Real activations run from tiny to large. The fix is block scaling: cut the tensor into blocks of consecutive values, and store one scale per block. Each value becomes an FP4 code times its block’s scale.
Which scale? Pick it so the block’s largest magnitude lands on 6, the top of the grid. Call the largest absolute value in the block amax.
s equals amax divided by six.
Find the biggest value in the block, amax. Divide it by 6. That is s. Then divide every value by s, round it to the FP4 grid, and multiply back by s.
From the Thinking Machines post: a block whose largest value is −54 gets s = 54 ⁄ 6 = 9. The value −54 becomes code −6 with scale 9. A value of 5.4 gives 5.4 ⁄ 9 = 0.6, which rounds to 0.5, so it comes back as 4.5.
Blue bars are 16 true values. Orange dots are what FP4 stores. Make the scale too small and big values clip; too big and small values flush to zero. Press amax / 6 for the rule.
The 16 values are illustrative. The scale here is exact (not rounded to a scale format); Chapter 3 shows what the scale format does to it.
The block is the trade. A small block fits its scale tightly, so small values survive. But every block costs one more scale to store. A block of 16 FP4 values plus one 8-bit scale costs (4 × 16 + 8) ⁄ 16 = 4.5 bits per value.
Symptom: one outlier in a block, say a value 20 times the others. Measure: count the zeros after quantization. The outlier sets amax, so the scale grows and the small values round to 0. Fix: smaller blocks, so one outlier spoils fewer neighbours. Go back to the hero, push the outlier, and switch to NVFP4.
Chapter 3
Compare blocks of 32 with power-of-two scales and blocks of 16 with finer scales
The scale needs a format of its own. That choice splits the two families on Blackwell GPUs.
| Format | Element | Block | Block scale | Outer scale |
|---|---|---|---|---|
| MXFP4 | FP4 E2M1 | 32 | E8M0 | none in the spec |
| MXFP8 | FP8 E4M3 or E5M2 | 32 | E8M0 | none in the spec |
| NVFP4 | FP4 E2M1 | 16 | FP8 E4M3 | FP32, per tensor |
E8M0 has 8 exponent bits and no mantissa and no sign. It can only hold powers of two, from 2−127 to 2127. E4M3 has a sign bit, 4 exponent bits and 3 mantissa bits. Its largest value is 448. So E8M0 has huge range and coarse steps; E4M3 has fine steps and a narrow range.
Each row is the FP4 grid stretched by a scale. The pink line is the block’s largest value. Slide it and see how much of the grid each scale wastes.
E8M0 and E4M3 limits are from the OCP MX spec (Tables 2 and 7). The power-of-two scale here is rounded up so the block never clips; the spec leaves the rule open. The 593.7 preset is the Thinking Machines example (stored as 96 × 6 = 576). Block values here are illustrative.
A power-of-two scale can miss by up to a factor of 2, so the block max lands between 3 and 6 and the top of the grid goes unused. An E4M3 scale lands it close to 6. On LLM data, Thinking Machines found NVFP4 gives less quantization error than MXFP4.
The cost is range. E4M3 tops out at 448, so FP4 times E4M3 covers magnitudes from 2−10 to 6 × 448 = 2688. A second scale, in FP32, slides that window for a whole tensor.
x-i equals x-i FP4, times x FP8 of block i floor-divided by sixteen, times x FP32.
Take the 4-bit code of value i. Multiply by the 8-bit scale of its block of 16. Multiply by the one 32-bit scale. The product is the value the matrix multiply uses.
From the Thinking Machines post: 593.7 becomes code 6 with block scale 96, so x = 6 × 96 × 1 = 576, an error of −17.7. Setting xFP32 to 2 moves the covered range from [2−10, 2688] to [2−9, 5376].
Bits per value: NVFP4 (4 × 16 + 8) ⁄ 16 = 4.5; MXFP4 (4 × 32 + 8) ⁄ 32 = 4.25; MXFP8 (8 × 32 + 8) ⁄ 32 = 8.25. NVFP4 pays a quarter bit more for a tighter fit.
Symptom: a block max of 5.4 with a power-of-two scale. Measure: 5.4 ⁄ 6 = 0.9, which rounds up to a scale of 1, so the max lands at 5.4 on the grid and 6 is never used. At 3.1 the scale is 1 too, and the codes 4 and 6 sit empty. Fix: a scale with mantissa bits, like E4M3.
Chapter 4
Follow one expert layer through an NVFP4 matrix multiply and see why the experts get the 4 bits
A Mixture of Experts (MoE) layer holds many small feed-forward networks, the experts. A router sends each token to a few of them (the MoE lesson builds this). In Inkling 2 Small each token goes to 8 of 384 experts. The expert matrix multiplies are most of the compute, and in Thinking Machines’ tests they lose the least accuracy when quantized. So the experts get the 4 bits.
One expert matrix multiply, a GEMM, takes the routed tokens x: tokens × d_in and the weights w: d_out × d_in.
y equals x-q times w-q transposed.
For each output, take 16 values from a row of x-q and 16 from a column of w-q transposed. Multiply the pairs and add them. Multiply that sum by both blocks’ scales. Repeat for every block along the row and add.
With made-up sizes: 4,096 tokens, d_in = 1,024, d_out = 2,048. The GEMM runs 4,096 × 2,048 × 1,024 multiply-adds, and each output adds 1,024 ⁄ 16 = 64 scaled block sums.
Orange is NVFP4, teal is MXFP8, blue is BF16. Press Step to move the highlight. The forward row comes first, then the backward row.
The flow follows Figure 4 of the Thinking Machines post (NVFP4 forward, MXFP8 backward, stochastic rounding on re-quantized saved tensors). The tensor sizes are made up; Inkling’s hidden sizes are not disclosed.
The backward pass needs two more GEMMs. The data gradient (dgrad) is dx = g wq; it carries the error signal to the layer below. The weight gradient (wgrad) is dw = gT xq; it updates the weights. Here g is the gradient arriving from above. Both use the quantized forward tensors, so the gradients match the network that ran in the forward pass.
The backward pass is sensitive to bias: values that round the same way every time. Random errors average out over a batch. A bias does not; it builds up across layers and steps. So the backward pass stays in MXFP8, as Chapters 5 and 6 explain.
Symptom: with NVFP4 GEMMs the MoE forward pass should be about 3 times faster than in MXFP8, but it was not. Measure: a timeline showed GPUs waiting on network transfers. Fix: quantize the transfers too (Chapter 8).
Chapter 5
See why the backward pass cannot reuse the forward pass’s blocks
In the forward GEMM, each block of 16 runs along a row of xq. The backward GEMMs multiply the transposed tensors. Now the 16 values that share a scale run down a column. Each value sits with 15 different neighbours, so it gets a different scale and a different code.
A 16×16 tile of values. Pick how the scales group the values, and pick the data. Red cells round to zero.
The two data shapes mirror Figures 2 and 3 of the Thinking Machines post; the values here are our own illustrative draw, so the counts differ from theirs. Exact scales, FP4 round to nearest.
So the forward pass and the backward pass see different numbers for the same weight. The gradient then belongs to a slightly different network. That mismatch can make the gradient wrong.
| Approach | How | Cost |
|---|---|---|
| 16×16 tiles (NVIDIA) | One scale per 16×16 square of weights, so the transpose has the same scales | One outlier among 256 values sets the scale; many values underflow. Thinking Machines found it too coarse. |
| Re-quantize (Thinking Machines) | Keep 1×16 blocks. Dequantize, transpose in high precision, quantize again with stochastic rounding | Extra arithmetic work, which their kernel hides |
Re-quantizing does not give bit-identical tensors. It does not need to. The backward pass needs the tensors to be equal on average: E[wq] = E[(wqT)T]. Here E[·] is the average over many roundings. Equal on average means no bias. Chapter 6 shows how a rounding rule gives that.
Thinking Machines then picked the precision for the second quantization: MXFP8. Saved activations and weights are re-quantized to MXFP8, and both backward GEMMs run in MXFP8. That was their best trade between accuracy and speed.
Symptom: in the “row of large values” tile, column blocks wipe out most small values. Measure: count the survivors with 1×16 and 16×1 grouping. Fix: never reuse a row-blocked tensor as a column-blocked one; rebuild the blocks after the transpose.
Chapter 6
Round up or down at random so that the average is exact
Round to nearest (RTN) always picks the closer grid value. The same input always rounds the same way. Across a million roundings that is a bias. Stochastic rounding (SR) rounds up or down at random, with odds set by the distance to each neighbour.
Name the parts. Call the value to round x, the grid value below it lo, and the grid value above it hi.
P of up equals x minus lo, divided by hi minus lo.
Measure how far x has climbed from lo toward hi, as a share of the gap. Round up with that chance; otherwise round down. The average of many roundings is x.
From the Thinking Machines post: a forward value of 4.5 lands in a new block with scale 2, so x = 2.25, lo = 2, hi = 3. P(up) = 0.25. The average is 2 × (0.75 × 2 + 0.25 × 3) = 4.5. RTN would give 2 × 2 = 4 every time.
Left: where each rounding lands. Right: the running average of everything rounded so far. Press Round and compare the two rules against the true value.
The value 2.25 between the FP4 values 2 and 3 is the post’s example. The random draws are real, from your browser. Blackwell GPUs do stochastic rounding in hardware.
SR trades bias for noise. Each SR result is further from x than RTN’s, on average. But the weight gradient sums over thousands of tokens, and noise averages out in a sum. Bias does not. That is why SR goes into the backward pass, not the forward pass.
Thinking Machines borrowed the re-quantize idea from two earlier recipes, TetraJet-v2 and Quartet II. Applying SR to dequantized values lets them pick any target precision; they chose MXFP8.
Symptom: slow drift in training that no single step explains. Measure: average the re-quantized tensor over many draws and compare it with the forward tensor; a gap is bias. Fix: stochastic rounding on every re-quantization in the backward pass.
Chapter 7
Protect the few layers that cannot live in 4 bits, and size the share
NVIDIA trained a 12B model on 10 trillion tokens in NVFP4. With every linear layer in FP4, training diverged. The cause was the final few layers. NVIDIA’s words: they “require more dynamic range and mantissa than FP4 provides.” Keeping the last four blocks in BF16 was enough for the loss to converge.
Why the end of the network? NVIDIA observed that the last layers have larger quantization errors in their weight gradients. Keeping the first few blocks in high precision did not help unless the last blocks were kept too. Their advice: leave a small share of the final layers, under 15%, in BF16 or MXFP8.
A 24-layer stack, like Inkling 2 Mini. Each bar is a layer’s gradient error in FP4 (illustrative shape). Slide how many final layers run in MXFP8.
The rising error shape is illustrative, drawn to match NVIDIA’s observation that the last layers have larger weight-gradient errors. Facts: 24 layers, last 4 in MXFP8 (Inkling 2 Mini); “fewer than 15%” (NVIDIA, arXiv 2509.25149); “the last 16.6% of layers” (Thinking Machines).
Thinking Machines keeps the last 16.6% of layers in higher precision. Their scaling ladder grows the layer count in steps of 6, so one sixth fits every rung. Inkling 2 Mini has 24 layers: 24 ⁄ 6 = 4 layers in MXFP8 and 20 in NVFP4. They chose MXFP8 for these layers, not BF16, which keeps them fast.
| Choice | What it does |
|---|---|
| Per-expert outer scale | Each expert’s weights get their own FP32 scale. |
| Per-token outer scale | Each token’s activations get their own FP32 scale. One token never changes another’s numbers, so results do not depend on the batch, and nothing leaks across positions. |
| Four Over Six (4/6) | For activations, try two scales: block max to 6, or block max to 4. Keep the one with lower squared error. Not used on weights. |
| Same numerics throughout | One recipe from the first pretraining step to the last RL rollout. |
Why would mapping the max to 4 help? The grid gap from 4 to 6 is 2, the widest one. Scaled so the max sits at 4, the top values use the steps 2, 3, 4, which are finer relative to the max.
Symptom: loss that converges for a while and then blows up with an all-FP4 model. Measure: compare quantization error per layer; NVIDIA suggests such metrics could pick which layers to protect. Fix: keep the final sixth or so in 8 bits.
Chapter 8
Quantize the network traffic once the math gets fast, and smooth outliers with a Hadamard spin
A large MoE layer spreads its experts over many GPUs. This is expert parallelism. The router dispatches each token to the GPUs that hold its experts. Those GPUs send the expert outputs back, where they are combined. Faster GEMMs leave the GPUs waiting for the network.
How much math must each byte bring with it? Call the GPU’s speed F and the link bandwidth B.
r equals F divided by B.
Divide the operations per second F by the bytes per second B. If a byte brings less work than r, the Tensor Cores sit idle waiting for data.
r = 15 × 1015 ⁄ 900 × 109 ≈ 16,700 operations per byte. Thinking Machines rounds this to “as many as 16,000”. Every bit removed from the traffic matters.
Dispatch was easy: send the tokens in NVFP4, which the GEMM wants anyway. Combine was harder. Expert outputs must stay in high precision (BF16 by default) or the model suffers. Plain MXFP8 hurt, because it handles outliers poorly.
32 expert outputs, two of them outliers. Turn on the Hadamard transform and watch the energy spread out, the scale shrink and the 8-bit error fall.
The vector is illustrative. The transform is a real 32-point Hadamard matrix with random signs, scaled to keep length. The 8-bit format is S2F6 as the post defines it (values from −128/64 to 127/64 in steps of 1/64) with one power-of-two scale per 32 values.
The random Hadamard transform (RHT) is a rotation. It mixes every value into every output, so one big value spreads thin across all 32. The total energy stays the same, and the rotation can be undone exactly. After it, a smaller scale fits the block, and the grid steps shrink.
Thinking Machines quantizes the rotated outputs to S2F6, an 8-bit fixed-point format with 2 signed integer bits and 6 fraction bits. One scale covers 32 values. The receiving GPU dequantizes, adds, and undoes the rotation. Combine traffic drops from 16 to 8.25 bits per value, with no measurable accuracy loss.
Symptom: MXFP8 combine hurt the model. Measure: look at the blocks with outliers; one value sets a large scale and the others lose resolution. Fix: rotate first, then quantize to an evenly spaced format.
Chapter 9
Remove the quantization step, and with it the quantization loss
The usual path trains in BF16, then squeezes the finished weights to 4 bits for shipping. That squeeze is post-training quantization (PTQ). Every weight moves a little, and the model never saw those new numbers. Some accuracy is lost, and teams spend time on calibration to pick good scales.
End-to-end 4-bit training removes the step. Every forward pass, from the first pretraining token to the last RL rollout, used the NVFP4 weights. The checkpoint stores those same numbers. There is nothing to convert.
Top row: the weights the forward pass used in training. Bottom row: the weights you ship. The yellow bars are the change at shipping time.
The 16 weights are illustrative; the shipping change is computed with the NVFP4 rules from Chapter 3. Sizes: Inkling 2 Mini about 20 GB (model card); BF16 and all-NVFP4 bars use M = N × b ⁄ 8 with N = 26.4B.
| Fact | Inkling 2 Mini | Inkling 2 Small |
|---|---|---|
| Size | 26.4B total, 3.4B active, 24 layers | 594B total, 17B active, 48 layers |
| Training numerics | NVFP4 expert forward passes from pretraining through RL; last 4 layers MXFP8 | Pretrained, midtrained and post-trained in NVFP4 |
| Shipped weights | 20 layers NVFP4, 4 MXFP8, about 20 GB | NVFP4 checkpoint (at least 500 GB of VRAM); MXFP8 option (at least 800 GB) |
| Conversion loss | “no conversion loss from quantization” | MXFP8 gains 1 to 2 points on evals, which TML calls not meaningful |
| KV cache | not disclosed | An NVFP4 KV cache variant, which “minimally” lowers evals |
Inkling 2 Small’s first pretraining phase covered 8.4 trillion tokens in 68 hours on GB300 NVL72 racks, natively in NVFP4. The KV cache holds each past token’s attention keys and values. In long agent runs it can outgrow the weights, so a 4-bit cache cuts serving cost.
In pretraining Inkling 2 Small, the recipe cost about 2% in compute efficiency: the MXFP8 run would reach the same loss with about 2% fewer FLOPs. In exchange, wall-clock time fell 8% in pretraining and 20% in RL, against full MXFP8. In RL they saw no difference in reward.
Symptom: a PTQ checkpoint scores a few points below the BF16 model it came from. Measure: evaluate both on the same suite. Fix: train in the shipping format, so the evaluated model and the shipped model are the same object.
Chapter 10
Keep the numbers, the terms, a checklist and the core code on one page
FP4 has 8 magnitudes, so it needs a scale per block. MX formats share a power-of-two scale over 32 values; NVFP4 shares an E4M3 scale over 16 and adds an FP32 outer scale. Inkling 2 runs its expert forward GEMMs in NVFP4, its backward GEMMs in MXFP8 with stochastic rounding, and its last sixth of layers in MXFP8. It ships in those numerics, so it has no quantization step.
| What | Number | Source |
|---|---|---|
| FP4 E2M1 magnitudes | 0, 0.5, 1, 1.5, 2, 3, 4, 6 | OCP MX spec, Table 5 |
| Block sizes | MX: 32; NVFP4: 16 | OCP MX spec, Table 1; Thinking Machines |
| Scale formats | MX: E8M0; NVFP4: E4M3 + FP32 | OCP MX spec; NVIDIA; Thinking Machines |
| Bits per value | NVFP4 4.5; MXFP4 4.25; MXFP8 8.25; BF16 16 | (d × k + 8) ⁄ k |
| GB300 speed | NVFP4 15, MXFP8 5, BF16 2.5 PFLOPS | Thinking Machines |
| NVFP4 range, one block | 2−10 to 2688 | Thinking Machines |
| Higher-precision share | TML 16.6% (MXFP8); NVIDIA under 15% | Thinking Machines; arXiv 2509.25149 |
| Combine traffic | 16 to 8.25 bits per value | Thinking Machines |
| Cost and gain | 2% CE; 8% faster pretraining, 20% faster RL | Thinking Machines |
| Inkling 2 Mini | 20 NVFP4 + 4 MXFP8 layers, about 20 GB | Inkling 2 Mini post and model card |
| Inkling 2 Small | 8.4T tokens in 68 hours, NVFP4; NVFP4 KV cache variant | Inkling 2 Small post |
| Term | Meaning |
|---|---|
| E2M1 | The FP4 element: 1 sign, 2 exponent and 1 mantissa bit. |
| Block scale | One number shared by a block of 16 or 32 values. |
| E8M0 | An 8-bit scale that holds only powers of two. |
| E4M3 | An 8-bit float with 3 mantissa bits, largest value 448. |
| Outer scale | An FP32 scale over a tensor, an expert or a token. |
| dgrad, wgrad | The backward GEMMs for the input gradient and the weight gradient. |
| Stochastic rounding | Round up or down at random so the average is exact. |
| RHT | A random Hadamard rotation that spreads outliers. |
| PTQ | Quantizing a model after training. |
| Compute efficiency | The extra compute a change costs to reach the same loss. |
pythonimport numpy as np FP4 = np.array([0, .5, 1, 1.5, 2, 3, 4, 6]) def e4m3(v): # round a positive scale to FP8 E4M3 v = np.clip(v, 2.0**-9, 448.0) step = 2.0 ** (np.maximum(np.floor(np.log2(v)), -6) - 3) return np.round(v / step) * step def to_fp4(y, stochastic=False, rng=np.random): # y already divided by its scale a = np.minimum(np.abs(y), 6) hi = np.searchsorted(FP4, a).clip(1, 7); lo = hi - 1 p_up = (a - FP4[lo]) / (FP4[hi] - FP4[lo]) # P(up) from Chapter 6 up = rng.random(a.shape) < p_up if stochastic else p_up > .5 return np.sign(y) * np.where(up, FP4[hi], FP4[lo]) def nvfp4(x): # x: (rows, cols), cols divisible by 16 t = 6 * 448 / np.abs(x).max() # FP32 outer scale (encode) b = x.reshape(x.shape[0], -1, 16) # 1x16 blocks along each row s = e4m3(np.abs(b).max(-1, keepdims=True) / 6 * t) / t # E4M3 block scale return (to_fp4(b / s) * s).reshape(x.shape) # dequantized view def mxfp4(x): # 32-value blocks, power-of-two scale b = x.reshape(x.shape[0], -1, 32) s = 2.0 ** np.ceil(np.log2(np.abs(b).max(-1, keepdims=True) / 6)) return (to_fp4(b / s) * s).reshape(x.shape) x = np.random.randn(4, 64); x[0, 5] = 14 # one outlier for f in (mxfp4, nvfp4): print(f.__name__, "RMS error", np.sqrt(((f(x) - x) ** 2).mean()))
The round-to-nearest branch breaks exact ties downward; hardware breaks them to the even code. That detail rarely moves the error.
Now press Present or Teach and explain from memory: the FP4 grid, the two block formats, the forward and backward precisions, and why shipping in the training precision removes a loss. Then go back to the hero, push the outlier to 16, and say why NVFP4 keeps half the block safe.
Jack Cook and Thinking Machines Lab, End-to-End 4-Bit Training, Connectionism, November 2026. Inkling 2 Mini (November 20, 2026) and its model card. Inkling 2 Small (November 5, 2026) and its model card. NVIDIA, Pretraining Large Language Models with NVFP4 (2025). Rouhani et al., OCP Microscaling Formats (MX) Specification v1.0 (2023). Cook et al., Four Over Six (2025). The explanations, toy values and devices are our own.