NCM-S1
A System One decision model built with Next-Concept Modeling, trained from scratch on a single AMD iGPU. It reads a decision context and fills a whole structured form at once, coarse to fine, so the fields come out mutually consistent, each with its own calibrated probability.
Run it live in your browser (the real model, exported to ONNX and computed on your device, nothing precomputed), alongside the full code and training repo.
Loading
from huggingface_hub import snapshot_download
from omegaconf import OmegaConf
import torch, ncm.ncm_build as ncm_build # from github.com/j-raghavan/s1-ncm
d = snapshot_download('j-raghavan/s1-ncm', allow_patterns='ncm-s1/*')
cfg = OmegaConf.load(f'{d}/ncm-s1/config.yaml')
codec = ncm_build.build_vqvae(cfg); codec.load_state_dict(torch.load(f'{d}/ncm-s1/tokenizer.pt')['model'])
gen = ncm_build.build_generator(cfg, codec); gen.load_state_dict(torch.load(f'{d}/ncm-s1/generator.pt')['model'])
Model card: NCM-S1
NCM-S1 is a System One decision model I built with Next-Concept Modeling. It reads a decision context and
produces a short structured verdict, a multi-field form, generating the whole form coarse to fine so the
fields come out mutually consistent. It is the Track B deliverable of this repo; the training and eval
code, the configs and every run's wall-clock are here, and the weights are the checkpoints under
outputs/s1-ncm-long on the machine I call EVO.
What it is
- Task. Given a decision context (a rendered state plus each field's instructions and lettered options), answer a form of interdependent typed fields at once. I train and evaluate on three families of structured forms (deploy gate, invoice approval, SLA triage), four fields each, whose gold answers are exact rule-computed functions of the state, the way a Sudoku board's cells are exact.
- Shape. A scaled-down conditional NCM on the paper's XSum template. The context is the prefix,
entered as raw GPT-2 tokens through the VQ-VAE encoder's embedding. The answer is one option letter per
field, padded to eight slots. A multiscale residual VQ-VAE tokenizes that short answer into a code
ladder
[1,2,4,8]; the Next-Concept Transformer generates the ladder coarse to fine, conditioned on the context, and the final level's logits at each slot, restricted to that field's option letters, give the answer distribution. This is exactly s1's letter readout, read from the NCM decode.
Architecture and size
- Tokenizer (multiscale residual VQ-VAE): 28.65M parameters total (15.77M non-embedding), 4 layers,
embedding dim 256, four codebooks of 512, residual ladder
[1,2,4,8], nested fine-drop, GPT-2 input vocab padded to 50304. - Generator (Next-Concept Transformer): 26.41M parameters total (26.27M non-embedding), 8 layers, 8 heads, embedding dim 512, block-diagonal attention, RoPE, QK-norm, prefix length 256 (context length 264), level-0 query, untied linear code heads.
- Baseline for comparison: the same backbone and trainer with a single-level
[8]ladder, so it decides all answer slots in one pass, fields independent given the context.
Full config: ncm/configs/decisions.yaml (NCM-S1) and
ncm/configs/decisions-baseline.yaml (one-pass baseline).
Training
- Hardware: EVO, an AMD Ryzen AI Max+ 395 with a Radeon 8060S iGPU (Strix Halo, gfx1151), 124 GiB
unified memory, Ubuntu 24.04, ROCm 7,
torch 2.10.0+rocm7.13, BF16 throughout. All compute is local. - Data: 12,000 training forms, 1,200 dev, 1,200 test, generated by
ncm/forms.pywith exact one-hot gold per field and self-checked rules. - Tokenizer: trained to 100% answer reconstruction on held-out forms before the generator, so the comparison between ladders is clean.
- Generator: hard-gold per-level code cross-entropy with conditioning corruption 0.3, about 1.35 s/step at batch 128. NCM-S1 was trained to 6,000 steps; its weighted loss falls from about 90 at the start to roughly 0.001 by step 5,500 (converged by about step 4,000). The single-level baseline converges in far fewer steps (weighted loss 0.031 by step 1,500).
Evaluation
Held-out, the generators trained to convergence, each eval re-run once to confirm (full detail and the matched-step comparison in COMPUTE_LOG.md):
| Model | ladder | test full-form exact | test per-field | dev full-form exact | dev per-field |
|---|---|---|---|---|---|
| NCM-S1 (coarse to fine) | [1,2,4,8] | 0.9400 | 0.9762 | 0.9333 | 0.9710 |
| One-pass baseline (independent) | [8] | 0.9117 | 0.9679 | 0.9208 | 0.9690 |
Full-form exact-match is the headline: every field of a form correct at once. NCM-S1 leads the one-pass baseline by 2.8 points on test and 1.3 on dev, and the full-form gap is wider than the per-field gap, which is the joint-consistency effect the design predicted.
Intended use
A System One decision service in the spirit of the parent s1 project: one call returns a whole structured verdict over interdependent typed fields, coherent across fields. The coarse-to-fine design earns its keep when the answer is a multi-field form. For a single-field question the hierarchy collapses and NCM-S1 is just a conditional classifier, so there is nothing for it to make consistent and no advantage over a one-pass model; that slice is the family tie-in, not where it wins.
Limitations and scope of the claim
- The positive result is a single training run at one seed, on rule-based synthetic forms, measured at convergence. It says coarse-to-fine wins here once trained enough, not that it wins cheaply: NCM-S1 needed roughly four times the steps the one-pass baseline needed to converge.
- The matched-step comparison (both at 1,500 steps) came out the other way, with the one-pass baseline ahead, because NCM-S1 had not converged. I keep that number on the record alongside the converged one.
- The forms are composed from the parent project's decision families with exact rule-computed gold, not drawn from production traffic.
Provenance and licence
Next-Concept Modeling is reused under its MIT licence; my training loop, decision adaptation and the forms are my own, Apache 2.0. The method, data and models this builds on, with their licences, are in LINEAGE.md. Origin paper: Next-Concept Modeling.
