XIAOMAI LABIndependent research, open to collaboration

Update #5Nov 16–22Development

Build a ruler first, then let measured speed decide

We built a ruler for whether the system asks the right question; its closed tasks mostly measure priors, its discovery task is far from saturated. The main model is now a local 35B-A3B. In 16 rounds, none of its own launch settings passed the margin; a separate check found its best one about 2.9% faster, with half the context. It then began editing its engine's code: 5 of 13 measurements used, no speed-up yet. A Rust rewrite has started, with no end-to-end result.

W47 / RESEARCH ATLAS

The plan can change; the body does not lie. Measured speed decides.

Ten figures: build a ruler to see what is being measured, move the main model to a local 35B, then let measurement judge the settings and engine code the model changes. The measurement itself is checked, and a Rust rewrite of the engine has started. Stopped and unfinished work is marked.

Week: Nov 16–22, records read until 15:14 Nov 22Self-tuning: 16 rounds, 0 acceptedEngine edits: running, 5 of 13, no gain yetRust engine: assembling
AI-generated concept illustration of a precision test bench: a row of interchangeable clear cartridges on a rail at the left, a transparent layered engine in the middle, a long machined ruler with unnumbered graduation marks in front, and a needle on a curved unnumbered scale at the right; dark navy background, cyan light with small amber accents. Not actual hardware or execution.
Concept art · AI generated · Not actual model internals or execution
01

How the ruler measures

Closed tasks test whether a false premise gets corrected; the discovery task asks for none and counts pitfalls found.

This week · ruler v1
01TaskThe description may hide one false premise
02Model queriesOnly permitted tables
03Hidden-case scoringMechanical, with queries rerun as evidence
01Discovery taskNo question, only the database
0230 queriesClaims must come from queries actually run
03Hidden list25 known pitfalls
04Two readersOnly agreed judgments count
30closed tasks
22 / 8flawed / sound
11/11scorer fake-answer controls
Read chart data and scope
What the ruler contains
Closed tasks30
Flawed / sound22 / 8
Scorer controls11/11
Discovery hidden list25
Discovery query limit30
Reader control matched13/14

Evidence boundaryTasks, answers and the pitfall list are not published. One reader-control item had a wrong expected answer, so by rule that control did not fully pass.

02

Ceiling check: closed tasks mostly test priors

The same tasks, once with tools and once with none.

This week · Claude subagents
22/22closed flaws · with tools
20/22closed flaws · named blind
9/25 → 3/25discovery · tools vs blind
Read chart data and scope
Ceiling-check denominators
Closed sound · with tools8/8
Witness tasks answered with evidence10/10
Blind sound tasks kept7/8
Pitfalls found only with tools7
Tool claims: supported / not / unclear / disputed9 / 2 / 1 / 3 (of 15)
Reliable questions · tools vs blind4/5 → 1/5

Evidence boundarySubjects, task author, list author and readers are all Claude-family models: a family ceiling, not a general strong-model ceiling. One run per batch.

03

9B in 4 bits: faster, with only first-stage quality

CPU only; top choices compared at positions BF16 actually generated.

This week · single measurement
6.55tokens/s · generation
45.86tokens/s · prompt
222/242top-1 equal to BF16
Read chart data and scope
Speed and first-stage quality
Generation · vs BF16 engineabout 3.5–4x
Prompt · vs BF16 engineabout 5x
Base top-1 agreement222/242 (Wilson 95% 87.6%–94.6%)
Two sequences with the research module261/285, 77/85
BF16 choice outside Q4 top 200
KL and answer correctnessnot measured

Evidence boundaryThe ratios compare different times and engines, not a same-run A/B. Only two base sequences; positions within a sequence are correlated.

04

The main model moves to a local 35B-A3B

A laptop with 6 GB of GPU memory: most layers on the GPU, most expert weights on the CPU.

This week · speed and memory
9.16tokens/s · CPU only
21.76tokens/s · GPU split (36 layers of experts on CPU)
13.8tokens/s · each of two streams
Read chart data and scope
Single-stream generation (tokens/s)
CPU only9.16
GPU split · 40 layers of experts on CPU16.92
GPU split · 36 layers of experts on CPU21.76
GPU split · 33 layers of experts on CPU21.79
30 or 27 layers of experts on CPUout of GPU memory
Single stream with MTP (mean of 2)19.2 → 22.3

Memory is tight: with two streams, paging reached about 24,903 events per second with MTP and about 2,363 without, so the test runs left MTP off.

Evidence boundaryThe switch rested on model-card scores, such as 39.8 versus 20.6 on code question answering. These are self-reported by the publisher; we did not re-measure them.

05

Hinted and unhinted (interim)

How the 35B model differs when told the description may be wrong versus not told.

Interim · stopped early
7/10hinted · flaw handled
2/10unhinted · correct SQL, same 10
3/14unhinted · all scored flawed tasks
Read chart data and scope
Interim mechanical scores
Hinted · flawedhandled 7, missed 2, revised_wrong 1 (of 10)
Hinted · sound2/2
Unhinted · sound3/4
Completed tasks (hinted / unhinted)18 / 19
Keep-reasoning check3/12

Evidence boundaryThe two measures differ and cannot simply be subtracted. Whether unhinted notes named the flaw has not been judged by readers. Each condition was planned for 30 tasks; both stopped early.

06

The plan can change; the body does not lie

The model proposes launch flags and a hypothesis; a fixed rule in the program judges them by measured speed.

This week · 16 rounds · finished
01Propose flagsModel reads help and machine info; logs and source in the last 6 rounds
02Restart serverOnly output-neutral flags
03Fixed workloadMeasure generation and prompt speed
04Fixed rule decidesThe model cannot change it
05Ledger and notesCarried to the next round
22.9tokens/s · baseline median
11.3%margin (restart noise 5.6%)
0/16accepted · 11 measured, 5 failed to start

Swipe horizontally to see the full chart, or open the data table below.

None of 16 trials passed the marginMedian generation speed per trial (tokens/s). Baseline 22.9, threshold 25.5. The first 10 rounds had help text and machine information only; the last 6 added read-only investigation tools. ✕ means the server failed to start.baseline 22.9threshold 25.522.4E1✕E25.1E35.1E423.2E522.9E614.7E7✕E8✕E9✕E1020.9E11✕E1224.7E1324.7E1425.1E1525.1E16Rounds 1–10: help and machine infoRounds 11–16: plus tools

On the first tool-enabled attempt the model thought for 4 turns of 2,048 tokens each and used no tool; those turns were voided and the rounds restarted with a 700-token cap per turn. Rounds 13–16 moved experts to 35 or 34 layers and halved the context; they came closest but none passed, and the rule was not changed afterwards.

Swipe horizontally to see the full chart, or open the data table below.

Alternating check: all three B runs above all three A runsOrder A B A B A B with a restart each time. A 24.4, 24.3, 23.6 (mean 24.1); B 24.6, 24.9, 24.9 (mean 24.8), about 2.9% faster. The axis starts at 23.Separate alternating check (recorded apart from the formal verdict)23.023.524.024.525.025.5A baselineB 34 layers, half contextA1 24.4A2 24.3A3 23.6B1 24.6B2, B3 24.9token/s (axis starts at 23)
24.1tokens/s · A mean
24.8tokens/s · B mean
2.9%B faster, by the prior rule
Read chart data and scope
What each trial changed from the baseline
Trial 1 · -t 822.4 token/s
Trial 2 · --moe-cache-mib 2048failed to start
Trial 3 · --moe-cache-mib 5125.1 token/s
Trial 4 · --moe-cache-mib 10245.1 token/s
Trial 5 · --prio 223.2 token/s
Trial 6 · -c 1638422.9 token/s
Trial 7 · -t 2014.7 token/s
Trial 8 · --prio 2 --moe-cache-mib 1536failed to start
Trial 9 · --n-cpu-moe 30failed to start
Trial 10 · --n-cpu-moe 30 -c 16384failed to start
Trial 11 · with tools · --prio 2 --cpu-range 0-720.9 token/s
Trial 12 · with tools · --n-cpu-moe 33failed to start
Trial 13 · with tools · --n-cpu-moe 35 -c 1638424.7 token/s
Trial 14 · with tools · --n-cpu-moe 35 -c 16384 --prio 224.7 token/s
Trial 15 · with tools · --n-cpu-moe 34 -c 1638425.1 token/s
Trial 16 · with tools · --n-cpu-moe 34 -c 16384 --prio 225.1 token/s

Evidence boundaryThe alternating check has only 3 runs per side; equal settings would give this ordering about 1 time in 20. 2.9% is far below the 8–10% seen in the loop, mostly from time of day (the baseline measured 22.9 in the morning and 24.1 here); B has half the context. It is recorded apart from the formal verdict. No random-search control; the last 6 rounds saw the earlier ledger, so they are not a fair comparison.

07

The model edits its own engine code

It edits the CPU-only compute path in a sandbox copy of the llama.cpp source; the program fixes measurement and decision.

Running · 5 of 13
01Sandbox copyCPU compute path only
02Read, edit, compile, profileThree undo buttons; notes carry over
03QualityMean KL ≤ 0.0005, top-token agreement ≥ 99%
04SpeedAt least 5% faster, then 2.5% again
5/13measurements used
0improvements
1.01original-vs-original ratio

Swipe horizontally to see the full chart, or open the data table below.

Three MoE expert matrix ops take 58.2%Original engine, CPU only, 12 threads: 140.0 ms per generated token in graph nodes. Expert matrices down 21.9%, gate 18.4%, up 17.9%, everything else 41.8%.MUL_MAT_ID down21.9%MUL_MAT_ID gate18.4%MUL_MAT_ID up17.9%All other ops41.8%

Why bit-identical output became a KL rule: one token mostly reads about 1.8 GB of weights; at 40–51 GB/s the ceiling is about 22 tokens/s, while CPU-only runs at about 13–14.5. Almost every real speed-up changes floating-point summation order, which bit-identical output blocks. The KL threshold is about one hundredth of 4-bit versus 16-bit (about 0.05).

Read chart data and scope
Ledger as of 15:14 on Nov 22
Control: original vs original (current method)ratio 1.01, KL 0, top-token agreement 100%
v1 · One-token decode skips a fast routine that always gives upcorrect, not faster, ratio 0.997 (old method)
v2 · Skip one thread barrier when no conversion is neededcorrect, not faster, ratio 0.94 (v7 method)
v3 · Debug prints in the expert matrix opbuild failed
v4 · Remove the broken debug printsbuild failed
v5 · Hoist block bounds out of the data-packing inner loopcorrect, not faster, ratio 0.97 (v8 method)
Budget5 of 13 used (registered 12), 0 improvements
Another profile run165.8 ms per token (model notes)

Evidence boundaryThe code edits come from the 35B model itself. v1 used the old method (engine-reported timing) and is not directly comparable; profiles vary by run (140.0 and 165.8 ms). Still running, one run only; the engine is heavily optimized already, so no version passing is a likely outcome.

08

The measurement itself gets checked

A branch-level trace from the first input: where each step goes if right and if wrong; failure branches pushed as high as they go.

This week · flow trace
01DesignRemove the problem
02Deterministic checkTypes, tests, lint
03Runtime checkStop it while running
04Written ruleLast resort
62failure branches
17bugs found
3could record a fake gain

Deployed: measurement no longer proceeds on a busy machine. The shared machine-lock crate has 9 tests; its race test was first too weak, passing 3 of 3 with the protection removed, and after a rewrite that forces the race it fails without the protection.

Read chart data and scope
What changed during the day and why, and the holes the trace found
Context overflowNotebook plus a fresh context when full
Two rounds of reading onlyA fixed nudge: make one small edit and measure it
Edit tool rejected 6 editsA CRLF/LF tool bug, not counted against the model
Measurement hardening (v7)Harness timing, random prompts and order, prewarm, separate fingerprinted original, server and common no longer editable
13:06 quality rule (v8)Bit-identical replaced by KL; profiler added
A real measurement used for debuggingFree trial run added; budget 12 → 13
14:19 busy machine (v11)Errors out; shared-CPU speed runs voided and redone at no cost
Possible fake improvement 1Quality checked only the batch path (512 tokens at once); speed measures token-by-token decoding · written into v12, not yet used on any version
Possible fake improvement 2Speed assumed exactly 128 tokens, so a version that stops early would look faster · written into v12, not yet used on any version
Possible fake improvement 3The KL number was read from the candidate’s own process output · written into v12, not yet used on any version
14:42 measurement v12Harness restarts: 14:57 selfedit-v12, 15:04 selfedit-v12b; original-vs-original control not finished by 15:14

Evidence boundaryThe flow trace was a read-only review. No version has passed, so no recorded result is affected by the three holes. The fixes were written as measurement v12 and the harness was restarted with it, but by 15:14 its original-versus-original control had not finished; versions measured with v12: none. Other examples this week: the shared machine-lock crate and the build-jobs rule moved from a document into configuration.

09

Rewriting the 35B engine in Rust

Written for this one architecture so every part is visible, measurable and changeable; milestone one only asks to match llama.cpp layer by layer.

From 13:35 · assembling
01Five parts in parallelGGUF, quantized math, two layer types, MoE, dumper
02Assemble 40 layers30 Gated DeltaNet + 10 full attention
03Layer-by-layer checkFeed llama.cpp’s exact inputs, compare one layer
04End to endJudged against llama.cpp’s own mode-to-mode noise
40layers, CPU only
3.7e-2llama.cpp logits gap between modes
5/5steps with the same next token

Swipe horizontally to see the full chart, or open the data table below.

llama.cpp against itself: the two modes diverge from layer 3Five-token prompt, last step, maximum relative difference of each layer output (log axis): layer 0 2.9e-8, layer 1 2.4e-8, layer 2 3.9e-8, layer 3 1.4e-3, layer 19 1.9e-2, layer 39 7.3e-2; final logits 3.7e-2; the next token matched at all 5 steps.1e-81e-61e-41e-2layer 3: first full-attention layer1.4e-31.9e-27.3e-2layers 0–2 ≤ 3.9e-8031939layer (only layers with figures are marked)
Read chart data and scope
One token at a time versus the whole prompt (unmodified llama.cpp)
Layer 0 output2.9e-8
Layer 1 output2.4e-8
Layer 2 output3.9e-8
Layer 3 output1.4e-3
Layer 19 output1.9e-2
Layer 39 output7.3e-2
Final logits3.7e-2 (largest difference 0.61, largest |logit| 16.6)
40-layer assemblyin progress
End-to-end resultnone yet

Evidence boundaryThis figure measures llama.cpp against itself, not our engine. Each part was compared against llama.cpp’s own code while being built; the 40 layers are still being assembled and there is no end-to-end result. No GPU and no speed work.

10

How do the ruler, model and loops connect?

The ruler checks whether questions are asked well; two loops check how fast the model runs. All are judged by measurements the model cannot change; the Rust engine is a tool for later.

Methods and scope
01RulerCode-index database built by CodeGraph
02Local 35Bllama.cpp inference
03Tune flags, edit the engineMeasurement decides
04Ledger and notesA checkable record
05Rust engineMatched layer by layer to llama.cpp

llama.cpp

b11669
Runtime actually executedhttps://github.com/ggml-org/llama.cpp

The Vulkan llama-server ran the 35B with a GPU split; llama-perplexity computed the KL quality check for engine editing; the source tree is the sandbox the model edits and the untouchable original; ggml dumps are the layer-by-layer reference for the Rust engine. The model edits a local sandbox copy, not the upstream project.

MIT · license ↗

CodeGraph

1.6.2
Produced the ruler input datahttps://github.com/colbymchenry/codegraph

It built the code-index database behind the ruler in October; the database records version 1.6.2, and it was not re-indexed this week. Tasks, pitfall list and scoring are our own, not CodeGraph features.

MIT · license ↗

Our Rust tools also use memmap2 0.9.12, rayon 1.12.0, half 2.7.1, libloading 0.8.9, anyhow 1.0.104, serde_json 1.0.154 (versions from Cargo.lock; libloading is ISC, the others MIT or Apache-2.0). These are library dependencies only.

All speeds were measured on one laptop: MSI Stealth 15M B12UE; Intel Core i7-1280P (6 performance + 8 efficiency cores, 20 threads; llama.cpp used 12); 32 GB DDR4-3200; RTX 3060 Laptop 6 GB (Vulkan) plus Iris Xe; 4 TB NVMe; Windows 11 Home. The ceiling of about 22 tokens/s comes from reading about 1.8 GB of weights per token at about 40–51 GB/s of DDR4 bandwidth.

Evidence boundaryThis diagram combines steps from different dates; it does not imply they occurred in one run.

Continue to the complete update for context, failures and next steps.

What we got done

Xiaomai asks whether a system can form and revise its own research questions and improve from experience. Looking back over the past month, I had done tool wiring, engine speed and state restoration in detail, yet nothing measured whether the system asks the right question, so no amount of detail could show progress toward the goal. On November 21 I stopped to build a ruler.

The ruler has two parts, both drawn from one real code-index database produced by CodeGraph. The first is 30 closed tasks: 22 contain one false premise in the task description and 8 are sound. Each is scored mechanically on hidden cases, and the scorer reruns the logged queries to check whether the model actually looked at the data that exposes the problem. To check the scorer itself, I ran eleven fake-answer controls first; all produced the expected scores. The second part, the open discovery task, poses no question. It gives the database and 30 queries and asks the model to find what one must know before using this data to answer questions. Findings are compared with a hidden list of 25 known pitfalls by two readers, and only agreed judgments count. Tasks, answers and the list are not published. In the reader control, 13 of 14 items matched expectations; the remaining item had a wrong expected answer, but by rule the control still did not fully pass, so I added a sentence to the rule.

With the ruler built, I first tried it on a strong general model: fresh Claude subagents, one run per batch. With tools, it handled 22/22 flawed and 8/8 sound closed tasks with no false revisions. But a blind run with no tools at all also named 20 of the 22 flaws, so the closed tasks mostly measure prior knowledge and serve only as a floor. The discovery task was different: it found 9 of 25 pitfalls with tools and 3 blind, and 7 were found only by querying. That part is far from saturated and separates models better.

The same day I measured the 9B model quantized to 4 bits (Q4_K_M, CPU only). Generation took about 0.15–0.18 seconds per token and prompt reading about 0.02, roughly 3.5–4 times faster generation and 5 times faster prompt reading than the earlier BF16 engine. That comparison spans different times and engines; it is not a same-run A/B test. For quality I did a first stage only: at 242 positions previously generated by BF16, the Q4 top choice matched BF16 at 222 (91.7%). Most mismatches were near-ties in explanatory text; a few changed the next action.

That evening I switched the main model to Ornith-1.5-35B-A3B (Q4_K_M), running locally. On CPU alone a single stream generated about 9.2 tokens per second. With most layers on a laptop GPU (6 GB) and most expert weights kept on the CPU, it reached about 21.8; moving more experts to the GPU ran out of memory. I switched because of public benchmark gaps between the two model cards, such as 39.8 versus 20.6 on code question answering. Those numbers are self-reported by the model's publisher; we did not re-measure them.

On November 22, I set a principle: the plan can change at any time; the body does not lie. Xiaomai's first "body" is its own inference speed. In each round the 35B model reads the server's help text and machine information, then proposes launch flags and a one-sentence hypothesis. A program then restarts the server with those flags, runs a fixed workload and records the result in a ledger. The model does not remember earlier rounds; it sees only the ledger and its own notes. Fixed rules in the program decide whether a setting replaces the current best: generation must exceed a margin, it must still lead on a second measurement, prompt reading must not slow noticeably, and the start of the output must match the baseline. I allowed only flags that do not change model output.

The baseline is the setting tuned by hand the day before: a median of about 22.9 tokens per second over three restarts, with about 5.6% noise between restarts, so a candidate must be at least 11.3% faster, about 25.5 tokens per second. In the first 10 rounds the model saw only help text and machine information. It tried fewer threads, higher process priority and a shorter context; all stayed within noise (22.4–23.2 tokens per second), and raising the thread count to 20 dropped it to about 14.7. It made four attempts to cache some expert weights on the GPU: two did not start for lack of GPU memory and two fell to about 5.1 tokens per second. The model had found this cache flag in the help text by itself during the trial run; it was not on the original allow list. Two more experiments tried to move experts of more layers to the GPU and could not load for lack of GPU memory; the hand measurements of the day before had already shown this, but the model could not see that record. The trial run also showed me the other side: the model spent two turns of 4,096 tokens each thinking without proposing an experiment, so before the real run I cut the turn limit to 2,048 and stated in the prompt that one experiment costs about two minutes.

The run was planned for 20 rounds and stopped after round 10. I then ran six more rounds on the same ledger with four read-only investigation tools: the server log, the machine's current state, and search and reading of this engine version's source. I added them because, while trying the expert cache, the model could not see the server log and could only try another number. On the first attempt it thought for 4 turns of 2,048 tokens each and used no tool; its reasoning even said that looking things up costs rounds. So I voided those 4 turns, with the ledger unchanged, capped each turn at 700 tokens, made the sentence inserted at a cut-off neutral (use one tool, either to look something up or to run an experiment), and restarted from round 11. I added no hint about the answer to the prompt. The 16-round verdict: no setting passed the margin, and the best is still the baseline.

Rounds 13–16 did move in one consistent direction: experts of 35 or 34 layers on the CPU instead of 36, with the context halved to free GPU memory. They measured 24.7, 24.7, 25.1 and 25.1 tokens per second, all below the 25.5 threshold, so by rule none was adopted. The margin is estimated from the widest gap among three baseline runs and is on the cautious side, but I did not change the rule afterwards to let them pass. Instead I specified a separate alternating check before running it: order A B A B A B, with a server restart each time. A, the baseline, gave 24.4, 24.3 and 23.6 (mean 24.1). B, 34 layers with a context of 16384, gave 24.6, 24.9 and 24.9 (mean 24.8). All three B values are above all three A values, so by the rule written beforehand B is faster, by about 2.9% on average. There are three limits. There were only three runs per side, and if the two settings were equal this ordering would still appear about 1 time in 20. The 2.9% is far below the 8–10% seen inside the loop, mostly because of time of day: the same baseline measured 22.9 in the morning and 24.1 here. B has half the context of A, a cost this measurement does not capture. So I keep this result recorded separately from the formal 16-round verdict. There was also no random-search control, so this can only show whether the loop found a faster setting, not that model-led search beats random trials.

The next stage lets the model edit the code of its own inference engine, and it started on November 22. I went this way because the bottleneck is the CPU: with 6 GB of GPU memory, experts of 36 of the 40 layers are computed on the CPU. So, in a sandbox copy of the llama.cpp source, I had the model edit the CPU-only compute path. It can search, read, edit, compile and keep notes, with buttons to return to the previous version, the original, or the current best. It thinks with a separate, untouched engine, so a broken edit does not stop its thinking. The program fixes the measurement and the model cannot change it: a candidate must beat the original in two measurements (first by at least 5%, then by at least 2.5%) and must also pass the quality check.

I changed the rules and tools several times during the day, each time for a stated reason that I recorded in dated addenda. In the first round the model read a lot of source and the round ended with an error when the context filled up, so I added a notebook: near a full context it writes what it learned into notes and continues with a fresh context. The next two rounds only read and changed nothing, so I added a fixed nudge: make one small, safe edit and measure it. Its second edit was then rejected six times by the edit tool, and checking back showed the cause: the source uses CRLF line endings and its text used LF. That was a tool problem and is not counted against the model. Next I asked for the whole environment to be rechecked; besides our own check, an independent auditor that did not write the code read it, and I then hardened measurement (v7). Speed is now timed by the harness from outside instead of the engine's own report, because that timing code was within the editable area. Each measurement uses random prompts in a random order after a prewarm. The original is built from its own separate worktree and its binaries are fingerprinted before each measurement. The server and common folders were removed from the editable area.

At 13:06 I decided to drop bit-identical output in favour of a quality rule (v8). The reason is physical. Generating one token mostly means reading about 1.8 GB of weights once; at 40–51 GB per second of memory bandwidth the ceiling is about 22 tokens per second, while CPU-only now runs at about 13–14.5. Almost every real speed-up changes the order of floating-point sums, which bit-identical output would block. The new check is computed by llama-perplexity, which is outside the editable area, on text drawn at random from the original documentation: mean KL divergence must be at most 0.0005 and the top token must match the original at least 99% of the time. That threshold is about one hundredth of the mean KL between 4-bit and 16-bit weights (about 0.05). At the same time I added a profiler tool. Later the model used a real measurement as a debug probe to see which code path ran, so I added a free trial-run tool and raised the budget from 12 to 13 measurements.

The profile of the original engine, CPU only with 12 threads: 140.0 ms per generated token in graph nodes, of which the three MoE expert matrix operations take 58.2% (down 21.9%, gate 18.4%, up 17.9%). The model's notes record another profile run at 165.8 ms per token, so profiles vary between runs. The ledger at 15:14: v1 stops one-token decoding from calling a fast matrix routine that always gives up; correct but not faster (ratio 0.997, measured with the old method). v2 skips one thread barrier when no data-type conversion is needed; also correct but not faster (0.94). v3 added debug prints and failed to build; v4 tried to remove the broken prints and also failed to build. v5 hoists loop-invariant block bounds out of the data-packing inner loop of the expert matrix operation; it entered the ledger at 14:53, again correct but not faster (ratio 0.97, KL passed), measured with the v8 method. Five of the 13 measurements are used, with no improvement yet. Under the current method the original-versus-original control gives a ratio of 1.01.

From 13:35 I started a separate line: rewriting the 35B model's engine in Rust. llama.cpp has hundreds of thousands of lines, and most of the model's engine-editing time went to finding code. An engine written for this one architecture keeps every part visible, measurable and changeable, and later research on the model's internal states needs it too. The first milestone is to load the 35B Q4_K_M in our own engine, run all 40 layers on the CPU and match llama.cpp layer by layer, with no GPU and no speed work. Five parts were built in parallel: GGUF reading, quantized matrix math, the two layer types, MoE experts, and a dumper that records llama.cpp's own intermediate values. Each part was compared against llama.cpp's own code while being built.

The dumper found something first: llama.cpp disagrees with itself between one-token and batch mode. On a five-token prompt the first three layers match almost bit for bit; differences start at layer 3, the first full-attention layer, and grow from there. The final logits differ by 3.7e-2 relative (largest difference 0.61, largest logit magnitude 16.6), yet the predicted next token is the same at all five steps. So I changed the comparison standard: each layer is fed llama.cpp's exact inputs and only that layer's output is compared, and the full run is judged against llama.cpp's own one-token-versus-batch noise. Assembly of the 40 layers is in progress; there is no end-to-end result yet.

This week I also set an engineering habit. After writing code, I write a branch-level text trace from the first input: at each step, where it goes if right and where if wrong. Then, following Lauren Tan's talk "All Code Is Slop (Except Mine)", I push each failure branch as high as it can go: first a design that removes the problem, then a deterministic check (types, tests, lint), then a runtime check, and a written rule last. Examples this week are the shared machine-lock crate, moving the build-jobs rule from a document into configuration, and the harness flow trace in the next section.

All speed figures this week came from one laptop: an MSI Stealth 15M B12UE with an Intel Core i7-1280P (14 cores, 6 performance and 8 efficiency, 20 threads; the llama.cpp runs used 12 threads), 32 GB (2 × 16 GB) DDR4-3200, an NVIDIA GeForce RTX 3060 Laptop GPU with 6 GB of memory used through Vulkan plus Intel Iris Xe integrated graphics, a 4 TB NVMe SSD, and Windows 11 Home 10.0.26200. Windows WMI reports the 3060 as 4 GB because it stores the value in a 32-bit field; the real memory is 6 GB, which the 35B split runs confirm. The ceiling of about 22 tokens per second mentioned above comes from this machine's memory: one token reads about 1.8 GB of weights, and the DDR4 bandwidth is about 40–51 GB per second.

The main open-source tools and model source used this week are listed below. Each has its own authors and license. This week's Xiaomai work connected them to the specified research tasks; what each was actually used for, and what it is not, is noted below.

  • llama.cpp b11669, under MIT: the Vulkan build of llama-server ran the 35B with a GPU split; llama-perplexity computed the KL quality check for engine editing; its source tree is the sandbox the model edits and the untouchable original; its ggml dumps are the reference for comparing the Rust engine layer by layer. The model edits a local sandbox copy, not the upstream project.
  • CodeGraph v1.6.2, under MIT: it built the code-index database behind the ruler in October, and the database records version 1.6.2; it was not re-indexed this week. The tasks, pitfall list and scoring are our own, not CodeGraph features.

The official Ornith-1.5-35B-A3B GGUF model source is credited separately from GitHub tools: the Q4_K_M file we used has the same SHA-256 as the file at this revision, and the model card declares the MIT license, although the LICENSE file it links to does not currently exist. Our own Rust tools also use memmap2 0.9.12, rayon 1.12.0, half 2.7.1, libloading 0.8.9, anyhow 1.0.104 (Rust engine) and serde_json 1.0.154 (Rust engine and the self-tuning and engine-editing harnesses), with versions from Cargo.lock; libloading is under ISC and the others are dual-licensed MIT or Apache-2.0. They are library dependencies, not research methods. Versions and usage roles are also recorded in this issue's public evidence summary.

What didn't work

I started the 9B discovery runs twice and stopped both times: first to test MTP speed-ups, then because the main model changed to 35B. None of the five records produced a final result, so none is scored or interpreted.

The 35B model nearly fills 32 GB of memory. With two streams, free memory fell below 1 GB, the disk paged heavily and each stream dropped to about 9 tokens per second. A smaller batch with MTP off gave about 13.8 per stream. In a single-stream test MTP raised generation from about 19.2 to 22.3 tokens per second, but under memory pressure it raised paging from about 2,400 to about 25,000 events per second, so I left it off for the test runs. Another run was interrupted when other work on the same machine took memory. Interrupted runs are archived separately and not scored.

The hint test asked how much the 35B model's behavior differs when it is told that the description may be wrong versus not told. Each condition was planned for 30 tasks; both stopped part-way. Interim figures: on the 10 flawed tasks completed under both conditions, the hinted run handled 7, and the unhinted run wrote correct SQL for 2. On the 14 scored flawed tasks without a hint, SQL was correct on 3 and wrong on 11. The record reads this as mostly following the false premise, but the causes have not been checked task by task. The two measures differ and cannot simply be subtracted, and whether the unhinted notes named the problem has not been judged by readers. The sample is small, there was one run, and no final result has been written.

A further check that keeps the model's earlier reasoning in context finished only 3 of 12 tasks, too few for a conclusion. The control-vector tool was not finished compiling, and the cross-domain experiment is on hold. The probability gap (KL) between Q4 and BF16 and answer correctness remain unmeasured.

Engine editing has not produced an improvement so far: 5 of 13 measurements used, three correct but not faster and two that did not build. They also used different methods (v1 the old one, v2 the v7 method, v5 the v8 method), so they are not directly comparable.

Following that habit, I ran a branch-level flow trace of the engine-editing harness; it listed 62 failure branches and 17 bugs. Three could have recorded a fake improvement: the quality check ran the batch path (512 tokens at once), not the token-by-token path that speed measures; the speed calculation assumed exactly 128 generated tokens, so a version that stops generating early would look faster; and the KL number was parsed from the candidate's own process output. Because no version has passed, no recorded result is affected. I wrote the fixes for these three into a 14:42 addendum as measurement v12: speed must generate exactly 128 tokens, KL is judged by the original's process, and quality is also checked on the token-by-token path. The records show the harness restarted as v12 at 14:57 and as v12b at 15:04, but up to my read at 15:14 the original-versus-original control that v12 requires first had not finished, so no version had been measured with the new method yet. v5 was measured by v11 before v12 started, still with the v8 method.

One problem is fixed. If the machine was busy after a long wait, measurement used to go ahead and still count. Since 14:19 (v11) I made it error out instead, and if the CPU was shared with other work during a speed run, that run is voided and redone without costing budget. The first v5 measurement hit exactly this: rustc and link were running, so that attempt was voided and redone before it entered the ledger. The shared lock crate behind this has 9 tests. One race test was first written too weakly: with the protection removed it still passed 3 out of 3. It was rewritten to force the race, and it now fails when the protection is removed.

What's next

First I will wait for the original-versus-original control under measurement v12 to finish, then let the engine-editing loop use its remaining measurements. The engine is already heavily optimized by many people, so no version passing is a likely outcome; a pass would still need checking on the GPU setup actually used. The Rust engine needs its 40 layers assembled and matched layer by layer against llama.cpp. After that I will write up the completed part of the hint test as a formal result and run the 35B model on the discovery task with the same ruler. A learning test needs a second database, because that is what separates remembering this data from learning to investigate. Later tuning also needs a random-search control. I will keep the stopped and failed records.

Where Xiaomai stands

The four research steps from the home page and where each stands this week.

  1. Start from unknowns. Examine how inquiry works.

    In progress

    A ruler exists; closed tasks mostly test priors, the discovery task discriminates.

  2. Check explanations against actual computation.

    In progress

    Model-proposed settings and code edits are judged by measurement; none has passed the formal bar.

  3. Turn new understanding into a change that runs.

    Not yet tested

    No evidence yet of improving from experience; the learning test has not started.

  4. Select and reuse the change after a restart.

    Not yet tested

    Rounds continue through a ledger and notes; reuse across tasks is untested.

Technical recordFull figures, scope limits and the daily log, for researchers to check

Daily log

  1. rulerRuler built: 30 closed tasks plus an open discovery taskRecord
  2. ceilingCeiling check: blind run caught 20/22 closed flawsPartly passed
  3. q4-speed9B Q4 on CPU ran about 3.5–5x faster than BF16Passed
  4. q4-qualityQ4 top-1 matched BF16 at 222/242; KL not measuredPartly passed
  5. 9b-discovery9B discovery runs stopped twice, unscoredDid not pass
  6. 35b-speed35B-A3B: 9.2 tokens/s on CPU, 21.8 with a GPU splitPassed
  7. hint-gapHint test stopped part-way; interim figures onlyPartly passed
  8. selftuneSelf-tuning, 16 rounds: no setting passed the marginDid not pass
  9. ab-checkAlternating check: model's setting about 2.9% faster, half the contextPartly passed
  10. kl-ruleEngine-editing quality rule changed from bit-identical to KLRecord
  11. ornith-rsRust rewrite of the 35B engine started; assembly in progressRecord
  12. flow-traceHarness flow trace: 62 failure branches, 17 bugsRecord
  13. harness-v12Measurement v12 swapped in; its control unfinished at the readRecord
  14. selfeditEditing its own engine: 5 of 13 measurements used, no speed-up yetPartly passed

Completed this week

Ruler v1 and its revision, the ceiling check, 9B Q4 speed and first-stage quality, 35B speed and memory measurements, part of the hint test, 16 rounds of self-tuning plus the alternating check, engine editing (in progress), the harness flow trace, and the first Rust-engine milestone (in progress). These are different tasks with different denominators and are not pooled. No issues were published for Nov 2–15, and that period is not reconstructed here. Engineering habit: after writing code, write a branch-level flow trace; each failure branch goes to a design fix first, then a deterministic check, then a runtime check, and a written rule last.

Validation and figures

Closed tasks: 22 flawed and 8 sound; all 11 scorer controls passed. Ceiling (Claude subagents, one run per batch): 22/22 and 8/8 with tools, and 10/10 of the witness-measurable tasks answered with evidence; the blind run named 20/22 flaws and kept 7/8 sound tasks. Discovery: 9/25 with tools (15 counted claims: 9 supported, 2 unsupported, 1 unclear, 3 disputed) and 3/25 blind; reliable questions 4/5 versus 1/5.

Hardware: MSI Stealth 15M B12UE; Intel Core i7-1280P (6 performance + 8 efficiency cores, 20 threads; llama.cpp used -t 12); 32 GB (2 × 16 GB) DDR4-3200; NVIDIA GeForce RTX 3060 Laptop 6 GB (Vulkan; WMI reports 4 GB because of a 32-bit field) plus Intel Iris Xe; 4 TB NVMe SSD; Windows 11 Home 10.0.26200. The ceiling of about 22 tokens/s ≈ about 1.8 GB per token ÷ 40–51 GB/s DDR4 bandwidth.

9B Q4 (llama.cpp CPU, 12 threads): 6.55 tokens/s generation and 45.86 tokens/s prompt processing. Q4 top-1 equal to BF16: base model 222/242 (Wilson 95% about 87.6%–94.6%); two sequences with the research module 261/285 and 77/85; every BF16 choice was within the Q4 top 20.

CPU only                                    9.16GPU split, experts of 40 layers on CPU      16.92GPU split, experts of 36 layers on CPU      21.76GPU split, experts of 33 layers on CPU      21.79Experts of 30 or 27 layers on CPU           ✕ out of GPU memorySingle stream with MTP (mean of 2)          19.2 → 22.3Two streams, smaller batch, no MTP          13.8 each
35B-A3B Q4_K_M, llama.cpp b11669 Vulkan, generation speed in tokens/s on one laptop; 3 or 2 runs per setting

Hint test (interim, mechanical scoring): 12 hinted tasks scored; flawed handled 7/10, missed 2, revised_wrong 1; sound 2/2. Six more were completed later and are unscored. Eighteen unhinted tasks scored; flawed SQL correct 3/14, sound 3/4. One more finished after interim scoring and is unscored.

Self-tuning run1 (16 rounds): three baseline restarts at 22.0, 23.2 and 22.9 tokens/s, median 22.9, noise 5.6%, margin 11.3% (about 25.5 tokens/s). First 10 rounds (help text and machine information only): 6 measured and 4 failed to start; measured generation medians 22.4, 5.1, 5.1, 23.2, 22.9 and 14.7 tokens/s. Last 6 rounds (four read-only investigation tools, 700-token cap per turn): 5 measured and 1 failed to start (the process crashed with experts of 33 layers on the CPU); measured 20.9, 24.7, 24.7, 25.1 and 25.1 tokens/s. Of 16 experiments, 0 were accepted; rounds took about 4–12 minutes. Greedy output matched the baseline for the first 268 characters with the expert cache, 803 in rounds 13–16 and 1,124 for other settings, all above the 40-character floor; the first two suggest these settings may change output, and the cause has not been checked.

A baseline: experts of 36 layers on CPU, context 32768     24.4   24.3   23.6   mean 24.1B model's setting: 34 layers, context 16384                24.6   24.9   24.9   mean 24.8All three B above all three A                              ✓ B faster by the prior rule, about 2.9% on average
Alternating check (reading rule written beforehand): order A B A B A B, server restarted each time, median of 3 generations (tokens/s)

Engine editing (CPU only, 12 threads, llama.cpp b11669 sandbox; as of 15:14 on Nov 22): budget registered at 12 and raised to 13; editable roots are now src, ggml/src, ggml/include and include. Quality rule (from 13:06): llama-perplexity, context 512, 4 chunks, about 1,000 scored positions, mean KL ≤ 0.0005 and top-token agreement ≥ 99.0%. Profile of the original: 140.0 ms per token in graph nodes; MoE experts down 21.9%, gate 18.4%, up 17.9%, 58.2% in total; another run in the model's notes gave 165.8 ms.

Control: original vs original (v8 method)                ratio 1.01, mean KL 0, top-token agreement 100%v1 one-token decode skips a fast routine that gives up   correct, not faster, 0.997 (old method: engine-reported timing, 4 x 48 tokens)v2 skip one thread barrier when no conversion needed     correct, not faster, 0.94 (v7 method: harness timing, random prompts and order)v3 debug prints in the expert matrix operation           ✕ build failedv4 remove the broken debug prints                        ✕ build failedv5 hoist block bounds out of the data-packing loop       correct, not faster, 0.97 (v8 method: batch KL mean 0, top-token agreement 100%)Budget                                                   5 of 13 used, 0 improvements
Engine-editing ledger (ratio = candidate ÷ original generation speed)

Harness flow trace (read-only, 14:20 on Nov 22): failure branches F01–F62 and 17 bugs found while tracing. Three could record a fake improvement (quality checked only on the batch path, speed assuming exactly 128 tokens, KL read from the candidate's own output). The fixes were written as measurement v12 (14:42 addendum) and the harness restarted as v12 at 14:57 and v12b at 15:04; up to 15:14 the v12 original-versus-original control had not finished and no version had been measured with v12. The busy-machine fix was deployed at 14:19 (v11), and the first v5 measurement was voided and redone because rustc and link were running; the shared machine-lock crate has 9 tests, and the rewritten race test fails when the protection is removed.

Rust engine (from 13:35): llama.cpp one-token versus batch mode on a five-token prompt: the first three layers differ by about 1e-7 relative, differences start at layer 3, final logits differ by 3.7e-2 relative (largest difference 0.61, largest |logit| 16.6), and the next token matches at all 5 steps. 40 layers = 30 Gated DeltaNet + 10 full attention; assembly in progress, no end-to-end result.

Failures and unfinished work

Five 9B discovery records from two batches were stopped and are unscored. The 35B test was interrupted twice by memory paging and once when the program that launched it was closed; abandoned half-finished tasks are not counted. The unhinted condition stopped early, a deviation from registration; the keep-reasoning check finished 3/12. Self-tuning changed from 20 rounds to 10 rounds plus 6 with investigation tools; the first tool-enabled attempt of 4 turns was voided and restarted; the last 6 rounds could see the earlier ledger, so they are not a fair comparison with the first 10. The alternating check has only three runs per side and halves B's context, and it is recorded apart from the formal verdict. Engine editing used 5 of 13 measurements with 0 improvements; v3 and v4 did not build, and v1, v2 and v5 used different methods; the three holes that could record a fake improvement were written into measurement v12 and the harness was restarted with it, but its control had not finished at the read and no version had been measured with v12. The Rust engine has no end-to-end result. Q4-versus-BF16 KL, answer correctness, the control-vector tool, the learning test and a second database are not done. Tasks, pitfall list, readers and the ceiling model all come from the Claude family, so independence is weak; everything ran once without variance estimates.

Author and AI contributions

The author set the research direction, the model switch, stopping points, the switch to a KL quality rule for engine editing, and publication scope. AI (Claude) helped write code, build the ruler, run tests, keep records and check them; the ceiling-check subjects and readers, the engine-editing auditor and the writers of the Rust engine's parts were also Claude subagents. Setting proposals in self-tuning and the code edits in the engine-editing loop came from the 35B model itself; the harness, measurement and decision rules are fixed by the program and the model cannot change them.

Next steps

Wait for the original-versus-original control under measurement v12 to finish and continue the engine-editing loop; assemble the Rust engine's 40 layers and compare them layer by layer; write up the formal hint-test result; run the 35B discovery task; prepare a second database for the learning test. Later tuning needs a random-search control.

Check the sources

All research updates