MacBrains LabsApple Silicon research

MacBrains Labs / Field notes / N/004

Every slice passed. The chain did not.

Each piece of LFM2.5-1.2B met a strict parity gate on the Neural Engine. Chained together, the same pieces missed it. Passing parts are not a passing model.

Note
N/004
Model
LFM2.5-1.2B
Gate
rel. L2 ≤ 0.005
Receipts
17 July 2026
Verdict
Slices pass, chain fails

01Slices on the Neural Engine

LFM2.5-1.2B has 16 layers. The model was emitted in Swift as separate Core ML packages: layers 0-4, 0-8, 8-16 and the final norm plus tied LM head. Each package ran under .cpuOnly and under .cpuAndNeuralEngine, and each output was compared with a pinned Hugging Face PyTorch oracle for the same layer range.

The gate here is strict: cosine ≥ 0.9999 and relative L2 ≤ 0.005, applied to the Neural Engine run as well as the CPU run. Every slice passed, and MLComputePlan placed every assigned compute operation on the ANE.

PackageInputANE / assigned opsANE rel. L2CPU rel. L2Verdict
Layers 0-4All-ones vector229 / 2290.0024010.000330Pass
Layers 0-8All-ones vector457 / 4570.0037640.000474Pass
Layers 8-16Oracle output of 0-8553 / 5530.0036600.001091Pass
Final norm + LM headOracle output of 0-1611 / 110.0003950.001287Pass

“Assigned ops” excludes operations MLComputePlan gives no device, such as constants. The 0-8 and 8-16 packages also passed a weight integrity check: 70/70 and 76/76 tensors byte-identical to the source. The final head’s top-1 token matched the oracle’s (21134).

02The chained run

Feeding the ANE output of layers 0-8 into the ANE package for 8-16, with no oracle in between, gave a 16-layer hidden state with relative L2 0.005975. That misses the 0.005 gate. The same chain on CPU stayed at 0.001204.

16-layer chainCosineRel. L2Verdict
CPU → CPU0.9999992760.001204Pass
ANE → ANE0.9999894190.005975Fail

A follow-up decomposition split the chained error into three parts of similar size: the 0-8 package’s own error (0.003764), the 8-16 package’s own error (0.003660), and the effect of passing a slightly wrong input forward (0.003949). None of them fails alone. Together they cross the line. The receipts route the cause to FP16 accumulation drift in chunked matrix multiplies on the ANE; that cause is a hypothesis, not yet isolated.

03Tokens

The full pipeline (host embedding lookup, ANE 0-8, ANE 8-16, ANE final head) was then compared with the oracle’s logits for single tokens.

CheckObservedVerdict
BOS token, top-1Matches the oracle (token 1)Pass
BOS token, full logitsRel. L2 0.0560, cosine 0.998441; 2nd and 3rd candidates swapFail
Seven-token sweep, top-15 of 7 matchFail
Seven-token sweep, full logitsRel. L2 from 0.056 to 0.470Fail

The sweep is recorded as a diagnostic: each token was run alone, with no prior context, so it tests the arithmetic path rather than generation.

04What this does and does not show

Experimental takeaway

Per-slice parity does not compose. An error budget that each package meets can still be exceeded by the chain, and a matching top-1 token can hide logits that are measurably wrong. Gate the exact chain you plan to run, at the output you plan to use.

It shows that the whole 16-layer LFM2.5 stack can be placed on the ANE in two packages plus a head, and that the per-package numerics are close to the oracle. It does not show a working ANE model: token-level parity failed, and no generation quality was measured. Later builds changed these packages; this note covers the 17 July receipts only.

05In progress: a larger output-projection gain

Related work on a later model, LFM3-1.7B, is testing one numerical lever: the output-projection gain setting (--attn-o-gain) of a single FP16 attention layer, layer 14. On 30 October 2026, five builds were compared against a teacher at seven positions.

GainWorst rel. L2Change vs gain 8ANE / CPU / GPU ops
10.012514+414.5%447 / 0 / 0
20.005786+137.9%447 / 0 / 0
40.003141+29.1%447 / 0 / 0
8 (current)0.002432—447 / 0 / 0
160.002180−10.4%447 / 0 / 0

Gain 16 improved all seven positions, and a follow-up on nineteen positions, ten of them held out, improved all nineteen (held-out worst −7.2%). The gain-8 rebuild reproduced the existing build’s hidden states exactly, which is the control.

Status · not a result yet

One layer, a few dozen positions, and a planned placement rather than a traced dispatch. It is not a full-model or release result, and it may not hold across 24 layers.

06Reproducibility boundary

The LFM2.5 receipts are JSON files dated 17 July 2026. Each records the git commit of the emitter, the runner executable hashes, input hashes and the gate it applied. The all-ones input has SHA-256 4e1896175eea3c475e4d4960087ee0d7bd161add337d0bc1d6b7a0705f162f12. The receipts do not record the device or OS version.

ReceiptStatusSHA-256 (first 16)
lfm25_paired_policy_parity_0_4PROVEN9d26dcc18b0990e7
lfm25_paired_policy_parity_0_8PROVEN278af461ad03faf4
lfm25_paired_policy_parity_8_16PROVEN472912535cbb6b81
lfm25_final_head_parityPROVENd7956fb20ff654ba
lfm25_m16_chained_parityFAILED9a78e6519e904d95
lfm25_t1_token_parityFAILED0eae5cd1cbc495ed
lfm25_stateless_token_sweepDIAGNOSTIC1fc85f8fb2a04084

The LFM3 sweep receipt (o-gain-seven-position-ranked.json, SHA-256 c1d524ae7ddb0ffc…) records a Mac17,5 on macOS 27.2 (26B123), the checkpoint revision, fixture and oracle hashes, and the program and weight hashes of each build.

Source: ane-re receipts directory, 17 July 2026; LFM3 run directory, 30 October 2026. Referenced artifacts are not public downloads.