Blog/Models

Post-training GLM-5.3 on its own passing agent runs: the data, three silent failures and the cost

Lucia III is GLM-5.3 post-trained on 1,195 of its own passing agent runs, on one spot node. The data, the training run, three failures that raised no error, what it cost, and what the benchmark numbers do and do not show.

Base
GLM-5.3, about 753B parameters
Data
1,195 of its own passing runs
Compute
about 530 B200 GPU-hours
Weights
open on Hugging Face
On this page
  1. The result, with its labels
  2. Why I started from Faber II, not from plain GLM-5.3
  3. The data: the model's own passing runs
  4. The training run
  5. Three failures that raised no error
  6. Serving it and running the benchmark
  7. What it cost
  8. What I would do differently
  9. Limits
  10. Try it
  11. Links

I build Praex, an open-source coding agent. The CLI is a fork of OpenCode and stays MIT licensed. Praex runs on models I post-train from open-weight bases and serve myself, and I do this alone: the agent, the training runs, the serving boxes and the benchmark runs.

This post is the full record of Lucia III, the largest of those models. Its weights are public on Hugging Face.

The result, with its labels

All numbers here are my own runs, not an official leaderboard entry. The agent in every run is the Praex CLI with a 4k thinking budget per turn: v0.1.32 everywhere except the Terminal-Bench 2.1 run, which used v0.1.40.

Same 74 Terminal-Bench 2.0 tasks · one try each · same agent · self-run
GLM-5.3 (open base)43/74 · 58.1%
Faber II (my earlier post-train)+548/74 · 64.9%
Lucia III (post-trained from Faber II)+351/74 · 68.9%

solvedmore than the row abovenot solved

One cell is one task; the 74 tasks are the ones graded in all three runs. The cells show how many tasks each model solved, not which ones: Faber II solved 10 tasks the base did not and missed 5 the base solved. The whole difference is a handful of cells, which is why none of these gaps is statistically proven at one try per task. The tests follow.

How to read this:

  • From GLM-5.3 to Faber II: 6.8 points. From Faber II to Lucia III: 4.0 points.
  • Neither step is proven on its own. Head to head, Faber II solved 10 tasks plain GLM-5.3 did not, and plain solved 5 that Faber II did not: an exact test on those tasks gives p of about 0.30. Lucia III solved 6 that Faber II did not, against 2: p of about 0.29.
  • The 10.8-point total is not proven either. I did not keep the per-task file of the plain GLM-5.3 run, so I cannot run the paired test. An unpaired Fisher exact test on 51/74 against 43/74, which ignores that the tasks are the same, gives p of about 0.23.

So read the chart as a direction, not a proof. The 5-try runs below are the more reliable measure of where Lucia III stands, but I have no 5-try run of the base model to set them against.

Full runs, all 89 tasks, 5 tries each, self-run:

  • Terminal-Bench 2.0, under the leaderboard rules: 61.3% (273/445). 95% confidence interval plus or minus 8.5 points. pass@5: 80.9%.
  • Terminal-Bench 2.1, the current version: 68.8% (306/445). 95% confidence interval plus or minus 8.0 points. pass@5: 82.0%. In 3 of the 445 trials the model searched the web, found the benchmark's own solution files and used them. I count those 3 as failures. Uncorrected, the score is 69.4%.

The 74-task single-try numbers and the 89-task 5-try numbers measure different things. Do not compare them with each other.

Why none of this is "official": Terminal-Bench 2.0 no longer takes submissions. For 2.1, the repo says community submissions are closed and only maintainer-run entries are added. So both runs are public self-runs, with every trial log on Harbor Hub (links at the end).

GLM-5.3's makers report much higher numbers for it, from a different agent with multi-hour timeouts. Those do not compare with mine. The same-agent table does.

Why I started from Faber II, not from plain GLM-5.3

GLM-5.3 has 78 layers and 256 experts, ships as an FP8 checkpoint and comes under an MIT-style license. Faber II was my earlier post-train of it: an attention-only LoRA.

Before training Lucia III, I ran plain GLM-5.3 under the same benchmark settings as Faber II. Plain scored 43/74 and Faber II 48/74, with 5 tasks solved only by plain and 10 only by Faber II. Faber II had not lost anything, so Lucia III started from Faber II.

The data: the model's own passing runs

The method is rejection sampling on agent runs: let the model attempt real terminal tasks inside my agent, keep the runs that pass the tests, and fine-tune on them.

Picking the difficulty. A pilot of plain GLM-5.3 on Nemotron-Terminal-Synthetic tasks (NVIDIA, CC BY 4.0) passed 109 of 301 graded trials, 36%: hard enough that failures are common, easy enough to leave passes to learn from.

The rollouts. I took 2,000 medium tasks, 222 to 223 per domain, pilot tasks excluded. Faber II attempted each twice inside the Praex CLI v0.1.32 with the 4k thinking cap: 4,000 trials, served by vLLM on one 8xB200 node at about 280 trials per hour. At 51 to 53 running requests the node was saturated.

Recording. A small proxy between the agent and vLLM wrote down the exact request and the assembled response of every model call.

One training sequence per trajectory. Faber II's chat template keeps past reasoning and the CLI sends it back, so each request is the previous request plus the reply plus the tool results. One sequence per trajectory therefore holds every call's exact context, with loss only on the model's own turns. On the first 43 passing trials: median 31k tokens, p90 46k, maximum 58k, and 56% of tokens carried loss.

What I kept. 1,195 passing runs, 45.75M tokens.

Decontamination. I checked all 254,702 tasks in the Nemotron set against Terminal-Bench 2.0, 2.1 and 4.0: 13-gram overlap of the instructions, the task names and the canary string. Nothing matched, so nothing was removed.

The training run

Setup.

  • LoRA rank 64 on the attention layers, the same targets as Faber II: 424.6M trainable parameters.
  • The experts stay frozen in FP8 and are dequantised inside the forward pass. Attention runs in bf16.
  • One epoch: 149 steps of 8 trajectories, learning rate 5e-5 on a cosine schedule, a checkpoint to a bucket every 5 steps.
  • One 8xB200 spot node at a time.

Fitting 58k-token sequences. The stock Hugging Face attention for this architecture computes indexer scores as a [B, 32, S, S] fp32 tensor: more than 100 GB per layer at 32k tokens. I patched the attention forward with a chunked, no-grad indexer and FlexAttention over the top-k selection, then solved the rest of the memory with an explicit layer placement and the MoE in checkpointed token chunks. Peak memory per GPU: 109 GiB at 18k tokens, 124 GiB at 32k, 141 GiB at 58k, out of 178.

Peak memory per GPU while training, of 178 GiB on a B200
18k-token sequence109 GiB
32k-token sequence124 GiB
58k-token sequence141 GiB

With the chunked indexer, the explicit layer placement and the MoE in checkpointed chunks. The stock attention needed more than 100 GB per layer at 32k.

Making it fast enough. A profile showed FlexAttention at about 50% of CUDA time and the unfused expert dequant at about 33%. A fused, compiled dequant was 15x faster and bit-identical. Dense SDPA was 3x faster than Flex, so I trained with dense attention. That was a deliberate trade: the sparse attention's indexer is trained to mimic full attention, and serving keeps the sparse path. The benchmark check measured the model as served, sparse path included. Steady speed was about 394 tokens/s, about 12 minutes per step.

Spot boxes have a clock. Each spot box had a 30-hour limit. The first expired at step 21, with step 20 in the bucket, and a second box resumed from there. Average step time was 841 seconds. Training ended at that box's limit on step 147 of 149, and I used the step-145 checkpoint. By then the cosine schedule had reached its floor of 0.1 times the peak rate, so the last steps ran at about 5e-6 and a third box was not worth it.

The training run: 149 steps on two spot nodes with a 30-hour limit each
0149 steps

Spot node 1steps 0 to 21limit reached during step 21; step 20 was in the bucket

Spot node 2steps 21 to 147resumed from the step-20 checkpoint; limit reached on step 147

Checkpoint used for Lucia IIIat 145

Resume needed a fix. The first resume failed on a TypeError inside the peft and transformers adapter loader. I bypassed the loader and added an explicit check of missing and unexpected LoRA keys. A good resume now prints ADAPTER_RESUME_OK tensors=780 before training continues.

Three failures that raised no error

01

NaN from an index overflow

Symptom
Step 1 (18k tokens) was fine. Step 2 (58k tokens) had a loss of 7.8 and a NaN gradient norm.
Cause
My Flex mask function read a dense [S, S] boolean selection, and the flat index qi*S+ki passes 2^31 above about 46k tokens. On a 49k test, 33% of entries were wrong against the reference, and a 58k sequence gave a loss of 9.3 and NaN gradients even at learning rate 0.
Fix
Pack the selection into [S, S/32] int32 bits with an explicit causal check. The 49k test then differs by 0.24%, which is bf16 noise.
Also
Adam turns NaN gradients into NaN weights even at learning rate 0, so the trainer now skips any step whose gradient norm is not finite.
02

A throughput number that was too good

Symptom
Early smoke tests showed about 780 tokens/s, and my first time estimate was built on that number.
Cause
The NaN weights from the first failure routed every token to a few experts. With healthy weights the real speed was about 100 tokens/s with eager experts and about 149 with grouped experts at 32k.
Fix
Time only healthy weights. Check the loss before believing a speed.
03

A merge that silently dropped part of the training

Symptom
None. Nothing errors; the merged model just gets less of the training.
Cause
Faber II's attention is stored in bf16, and merging a LoRA delta with round-to-nearest drops any delta below half a bf16 step. On the step-55 adapter, o_proj kept only 40% to 43% of its delta in layers 39 and 77, q_a_proj 75% to 85%, and kv_b_proj 91% to 100%.
Fix
Stochastic rounding, which keeps 100% in expectation and adds noise of about 1 to 2 times the delta at the bf16 floor. The merge script now has a --check that measures how much of each delta survived. The released weights were merged this way.

Serving it and running the benchmark

Lucia III is large: about 716 GiB in FP8. I serve it on one 8xB200 node with vLLM, with a 262,144-token context. Pulling the weights from a bucket takes about 10 minutes, and the first vLLM start on a fresh box spent about 35 minutes compiling kernels with the GPUs idle.

Load changes the score. On a timed benchmark, the serving load is part of the measurement. My first 5-try attempt put two benchmark jobs on one node, about 23 running requests. Each stream dropped to about 45 tokens/s from about 90 at low load, and 52% of trials timed out, against 25% in the single-try run. Its pass rate of 46.6% was a load artifact, and I archived it as not publishable. My rule now: at most about 8 agents per node for timed benchmarks.

A restart that failed instantly. The restart of that job errored 351 of 356 trials at once: Docker had run out of address pools, because I had removed the containers of the killed run but not its networks. Every rerun on a reused host now starts with docker network prune -f, and I read the first ten finished trials' exceptions before leaving a job alone.

A bug in the agent, found by the benchmark. When a task ran make -j48 inside a memory-limited container, the kernel killed my agent instead of the build. Since v0.1.40 the agent marks every command it starts as the OOM killer's first choice and tells the model to retry with fewer jobs.

Checking the trajectories, not just the tasks. Besides decontaminating the training tasks, I scanned every benchmark trajectory for visits to the benchmark's site, repos and copies of its files. There were none in the 2.0 run. In the 2.1 run there were the 3 trials above, plus one search that found nothing.

What it cost

Compute for the Lucia III step, from my run notes (8 GPUs per node)
What ranNode-hoursB200 GPU-hours
Spot node 1: the rollouts and the first 21 training steps30240
Spot node 2: the rest of the training30240
Smoke-test node, about 1 hour of it idle because I filtered a log badly216
Node to merge, serve and run the 74-task checkabout 4about 32
Totalabout 66about 530

List prices I was paying at the time, GPU only, per B200-hour: $4.95 spot, $8.06 flex-start, $16.11 on-demand.

Total for the rollouts, the training and the 74-task check: about 530 B200 GPU-hours, roughly $2,600 to $3,000 in GPU time at those prices. That is the cost of the Lucia III step only. Faber II, the first step, is not included, and the 5-try benchmark runs came on top (the 2.0 rerun ran on a flex-start node; my estimate before it started was about $1,000).

Calendar time: the rollouts started on 24 October, and the 74-task result came in on 27 October.

What I would do differently

  • Count adapter keys before trusting a score. Every load, resume and merge should report how many tensors matched and how much of each delta survived.
  • Time only healthy weights. The 780 tokens/s number came from NaN weights. Check the loss first.
  • Treat serving load as part of the benchmark. Fix the concurrency per node before the run, and never put two timed jobs on one node.
  • Read the first ten trials. Both broken benchmark runs would have been caught in minutes.
  • Run 5 tries for the comparisons that matter. One try on 74 tasks could not separate any of the three models.
  • Keep every per-task result file. I deleted the box that held the plain GLM-5.3 run's results, which is why the headline gap has no paired test.
  • Test the resume before the first spot box expires. B200 spot capacity was often out in every zone I tried, and my resume path only worked after a fix.

Limits

  • All results are self-run in one agent. Independent runs by others would mean more than mine.
  • The three-model comparison is one try per task on 74 tasks, and none of its gaps is statistically proven.
  • There is no 5-try run of plain GLM-5.3 or Faber II, so the 5-try numbers stand alone.
  • Lucia III was trained with dense attention and is served with the model's sparse attention. The benchmark measured the served model.

Next: a 5-try run of all three models on the same tasks, so each step's gain is either proven or dropped.

Try it

  • Weights (GLM-5.3 license, MIT-style): praex/Lucia-III on Hugging Face
  • In Praex, Velox III is free. Lucia III comes to the Max plan, which opens soon; its weights are on Hugging Face today. You can also bring your own keys for other providers. The install line is just below.

All posts · Atom · RSS