What we learned post-training a model on the AIX design system
Project: teach Nemotron 3.5 Super VL (LoRA, 8 x H100) to write admin pages in the AIX theme (Metronic 8.3.2), with no rules in the prompt, then reach the vendor demo dashboards and exceed them.
Status as of 2 Dec 2026: the model matches the vendor median on charts, chart types, KPI cards and cards; it does not yet exceed the vendor 75th percentile, and it is below the vendor median on tables. All numbers are static rule conformance, not design taste. This file is a living log: add to it every round.
1. The result in one table (same brief, weekly sales dashboard)
| Stage |
v3 score |
Size |
Charts |
| Untouched model |
44.4 |
12.2 KB |
0 ApexCharts, 1 Chart.js |
| Round 2 (rules learned, neutral prompt) |
76.7 |
4.8 KB |
1 |
| Round 3 (vendor card rows added) |
39.1 |
9.8 KB |
0 |
| Round 3f (vendor rows removed) |
76.7 |
4.7 KB |
1 |
| Round 3g (26 rich pages, labels broken) |
53.3 |
5.7 KB |
1 Chart.js |
| Round 3h (labels fixed) |
100 |
19.4 KB |
5 ApexCharts |
Round 3h: 8 of 8 pages (4 held-out, 3 paired terse briefs, 1 new topic) score 100 on v1, v2 and v3, 17 to 21 KB, 4 to 6 ApexCharts, 0 Chart.js. Vendor-relative score 86.4 (n=8) against 79.8 for the vendor pages (n=16), by our own formula.
2. The biggest lesson: a low loss proved nothing
Rounds 3f and 3g trained to a loss of 0.008 and still produced worse pages. The cause was in the training framework, not the data or the model.
- NeMo AutoModel's
nemotron_omni_collate_fn builds labels with a legacy build_labels() that re-tokenises the answer and searches for it. On long HTML the search fails ("Unable to find answer segment ... Skipping labeling"), and the row is silently left with no labels.
- CPU test on 4 rich pages: stock collate labelled 0 of 26,651 answer tokens; the fix labels 26,655 of 26,651 (100%).
- So r3f and r3g never trained on a single rich dashboard. The 0.008 loss came from the small rows that did get labels.
- Fix:
posttrain/aix_collate.py, a marker-based label builder (assistant start marker to <|im_end|>), 30 lines, plugged in through the YAML collate_fn._target_ and PYTHONPATH.
- Gate we now use before paying for GPU time: run
aix_collate_test.py on a few rows, and after launch read the first num_label_tokens. It should be about rows x mean answer tokens (49k to 73k a step for r3h), not about 14.5k.
- Rule: never read a low loss as success until the label count matches the data.
3. How we found it (what to repeat)
- We compared expected and logged label tokens per step. That mismatch (14.5k against about 62k) was the first hard evidence.
- We ruled out causes one at a time, with a test each: adapter merge (272 modules merged, and an unmerged fp32 hook path failed the same way), chat template (train and generation both start with
<think></think>), truncation (longest row 7,746 of 8,192 tokens), prompt masking.
- A decisive diagnostic: a TRAINED brief given word for word still produced a small Chart.js page. A model that had learned the page would reproduce it.
- Earlier wrong hypotheses cost rounds: "brief wording is the cause" (it was not), "too few rich pages" (partly, but not the root), "memorisation" (the loss was low for the wrong reason). Form a hypothesis, then test it before spending.
4. Data lessons
- Vendor demo HTML is a poor training source. Round 3 added vendor card fragments and pages lost their charts, because the theme's chart code lives in a separate JS bundle (
widgets.bundle.js) and the demo HTML has empty chart divs. Rebuild whole pages with real ApexCharts instead.
- Whole rich pages beat fragments. 47 hand-built rich pages x 3 brief styles, plus 100 other rows, 60 steps, about 8 minutes of training, was enough once labels were right.
- Three brief styles per page (rich, informal, terse) and at most 2 exact repeats. Held-out pages were never trained on (at most 11% 8-gram overlap with any trained page).
- Briefs must not name components or layout. Some of our brief3 files name components; those need cleaning before they go into training.
- Small and rich rows do not mix well in the mix: greedy decoding picks the modal small page. Down-weight or drop small dashboard rows.
- Rewrite-in-place does not work: the model regenerates from the brief rather than editing (lists kept their columns, dashboards lost content and shrank to 40 to 90% of size).
- Context budget matters: max_length 8192 and about 3.2 characters per token means a page over about 24 KB will not fit. Denser HTML (shared chart helper, short class lists) is how the next pages get more content.
5. Scorer lessons
- A scorer that cannot see a defect cannot teach against it. v1 and v2 scored a small chart-less dashboard 93 to 100 because there was no richness rule. v3 added R1 to R6 (4+ charts, 3+ chart types, 4+ KPI, a table, 10+ cards, no repeated table values).
- v2 skipped dashboard rules for files not named
dash*, so "g2_*_heldout" pages scored 100. Fixed in v3 by name matching and reporting a corrected v2.
- Chart-type detection needs unquoted
type:"x" keys.
- Vendor-relative scoring (v4) is better than a pass or fail line: it shows how far each dimension sits from the vendor median and 75th percentile, so we can see "matches" and "exceeds" separately. Its thresholds are our own choice and must be said out loud.
- Known blind spots, found by looking at screenshots: a rate line plotted on the occupancy axis (hotel, flat line), unlabelled treemap boxes (stock health), currency symbols, short chart series, and tables (1 per page against a vendor median of 3).
- Always look at the rendered page. Passing every scorer and being readable are different.
6. Where we stand against the vendor (round 3h, n=8)
| Dimension |
Ours |
Vendor median |
Vendor 75th percentile |
| Charts |
4 to 6 |
5 |
7.25 |
| Chart types |
3 to 4 |
2 |
4 |
| KPI cards |
about 4 |
1.5 |
5 |
| Cards |
12 to 47 |
10 |
12 |
| Tables |
1 |
3 |
6 |
| Component kinds |
12 to 13 |
14 |
16 |
Our per-page exceed_p75 is 0.333 on every page, so "vendor level" is reached on four dimensions and "beyond" is not established. The next round (r3i) targets charts 8+, KPI 5+, tables 6+, kinds 16+ with 24 new pages.
7. Process and harness lessons
- Evaluate on a graded ledger, not pass or fail.
rsi/ledger.jsonl keeps every scored page per run, so improvement and regressions are visible (r3g was worse than r3f, and we only knew because of paired scores).
- Paired comparison: same brief, same neutral prompt, different round. Report n every time. n=1 per round for the progression page, and it says so.
- Render in the real route:
admin-index.php?page=<name>&folder=render shows pages in the real shell. It shows the user's logged-in header, so screenshots from it stay local. Published visuals use the standalone wrapper.
gen_eval.py decodes one brief at a time and uses about 10% of the GPUs; the model needs 4 GPUs, so two containers is the maximum without batching. A batched generator exists but is not yet verified on a GPU.
- A cold disk after a restart idled the GPUs for about 10 minutes (model read at about 420 MB/s). Warm the cache right after start.
- Wrapper pages must sit directly in
render/. ledger.py add needs absolute paths.
- Background watchers pile up. Check and stop duplicates; note that stopping a bash timer can leave its
sleep child running.