NCM-MLX
Next-Concept Modeling in MLX
Parallel within a level. Coarse to fine across levels.
Documentation · Quickstart · Results · Working paper · Demo
An independent MLX implementation of Next-Concept Modeling, the method of Kumbong et al. (HazyResearch). NCM writes a whole level of the output in one model call, coarse to fine, instead of one token per call. This repository runs the released TinyStories, Sudoku and XSum checkpoints on the Apple Silicon GPU, with the same outputs as upstream PyTorch in the tested cases, and trains small NCM models from scratch on Metal or CUDA. The models trained here still lose clearly to an autoregressive baseline on text. It is research code, not a chat model, and it is not affiliated with Stanford or HazyResearch.
A real NCM sample from an 87M generator trained here on 4× more data in bf16 (GPT-2 large generative perplexity 24.40 over the whole model, against 11.48 for its AR baseline), not the released checkpoint: sample 0 of seed 0, the first of its seed and well formed by the selection rule, shown in full. The AR panel is our 91M autoregressive baseline replaying the same 128 tokens one call per token (forced decoding) to compare model calls for identical output; it is not an independent AR sample. The counter counts model calls, not time: an NCM call is larger and NCM adds a codec decode. Checkpoint hashes, every level and the AR's log-probability of each token are recorded next to the figure; see demos, which also has the story and a Sudoku board in 12 passes.
How it works
Two models are trained one after the other. The codec compresses text into a ladder of discrete codes; each finer level corrects what the coarser ones got wrong, a bit like a progressive JPEG. With the codec frozen, the generator learns to produce the ladder from the top: given levels 0 to k−1, it predicts every code of level k in one forward pass. TinyWorld uses 6 levels for 32 characters, Sudoku 12 levels for 81 cells. The architecture page walks through a real refinement trace and lists what matches upstream and what does not.
Quickstart
pip install ncm-mlx
python -m ncm_mlx official fetch --task tinystories
python -m ncm_mlx official convert --task tinystories
python -m ncm_mlx official generate --task tinystories --n 2 --levels # stories refined level by level
This runs the released TinyStories checkpoint on an Apple Silicon Mac; Linux with an NVIDIA GPU uses pip install "ncm-mlx[cuda]" (platforms). The Sudoku checkpoints, benchmarks and parity script are in released checkpoints. Converted weights are also on Hugging Face: ncm-tinystories-mlx, ncm-sudoku-mlx.
To train from scratch, clone the repository and run mise trust && mise install && mise run setup && mise run train; the TinyWorld model takes about 5.5 minutes on an M5 Pro. See training for TinyWorld and Sudoku, and text training for TinyStories and prompt continuation with official continue-text.
Results
| MLX | Reference | |
|---|---|---|
| Released Sudoku checkpoints, solved easy / medium / hard (2,000 boards each) | 99.40 / 96.30 / 86.20% | paper: 99.5 / 96.5 / 86.1% |
| Released XSum generator, greedy without guidance, ROUGE-1 / 2 / L on all 11,334 test articles | 34.93 / 12.71 / 27.94 | paper: 35.0 / 12.8 / 28.0 |
| Released checkpoints, greedy output against upstream PyTorch | identical on 8 TinyStories samples and all 2,000 easy boards | |
| Sudoku trained here, 6.44M generator, training seeds 0 / 1 | 98.10 / 83.40 / 40.30% 97.25 / 79.60 / 33.25% |
Original NCM, 25.46M generator: 99.5 / 96.5 / 86.1% |
| Sudoku, NCM against AR at the same 2.05M-sequence budget (E11) | 55.2 / 18.1 / 1.6% | MLX AR: 20.5 / 4.9 / 0.5% |
| TinyWorld, valid sentences at temperature 1.0 (E1) | 89.8% | MLX AR: 98.6% |
| TinyStories trained here, 12M generator, three corruption schedules (E21–E24), GPT-2 large generative perplexity, lower is better | 45.6–97.8 | MLX AR: 14.3–14.7 |
| TinyStories trained here, 87M generator, 4× data in bf16 (E32), one training seed | 24.40 | MLX AR (91M): 11.48 |
The Sudoku models trained here saw 16.384M generator presentations against the paper's 51.2M, and the codec comes on top of the generator size, so the comparison with Original NCM is not matched. Benchmarks has the full tables, latency and methodology; the checkpoint port article, the two-seed Sudoku assessment and the controlled-text assessment give the evidence and its limits. Capabilities lists what is not supported.
The TinyStories result is negative but useful. In both generator seeds, less conditioning corruption lowers the clean teacher-forced loss and makes the generated text worse:
A larger generator and more data narrow the gap without closing it. With the same frozen codec, the ratio of NCM to AR generative perplexity falls from 3.33 for the 12M generator to 2.38 for 87M at the original data, and to 2.13 for 87M with four times the data. Each point is one training seed (the step from 50M to 87M is smaller than the difference between two seeds), compute is not matched, and the 4× runs train in bf16; see E30 to E32.
Roadmap
The long-term aim is a model of about 1B parameters that writes good text and is no worse than an autoregressive baseline trained with the same compute. Nothing here shows that NCM can get there yet, and the larger steps only happen if the small-scale gap closes. The plans have no dates. Details and completion criteria are in NEXT, the current state in STATUS, and new versions appear in the research updates feed.
Citation
If you use the method, cite the paper by Kumbong et al.:
@misc{kumbong2026nextconcept,
title = {Next-Concept Modeling: Fast, Parallel Coarse-to-Fine Text Generation},
author = {Hermann Kumbong and Ishan S. Khare and Iddah Mlauzi and Andrew Woen and Charles Ding and E. Kelly Buchanan and Simran Arora and Azalia Mirhoseini and Christopher Ré},
year = {2026},
eprint = {2610.14162},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2610.14162}
}
To cite this implementation, use the archived software (this DOI covers all versions from 0.2.0 and resolves to the latest, 0.4.0; v0.3.0: 10.5281/zenodo.23898701) and the working paper v0.13 (all versions: 10.5281/zenodo.23620913), which reports the experiments and limitations and has not been peer reviewed. CITATION.cff has the metadata.
License and acknowledgements
MIT licence, see LICENSE, with provenance notes in THIRD_PARTY.md. The source release contains no model weights or downloaded evaluation data; the Sudoku and TinyWorld weights trained here are on Hugging Face as ncm-mlx-sudoku and ncm-mlx-tinyworld.
The method, the released checkpoints and the reference PyTorch code (MIT) are by Hermann Kumbong, Ishan S. Khare, Iddah Mlauzi, Andrew Woen, Charles Ding, E. Kelly Buchanan, Simran Arora, Azalia Mirhoseini and Christopher Ré. No upstream code is copied here. The XSum and WMT14 codec support and prompt-prefix training in 0.3.0 follow work by Red-fuchs in ncm-modular. Built with MLX.
To contribute or reproduce an experiment, start with CONTRIBUTING.md. Automated tools can start from AGENTS.md and llms.txt.
Metadata
Release files for ncm-mlx 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ncm_mlx-0.4.0.tar.gz | 101.5 kB | With provenance | Details for ncm_mlx-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ncm_mlx-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for ncm_mlx-0.4.0-py3-none-any.whl |
Total release size: 219.7 kB
Release files / ncm_mlx-0.4.0.tar.gz
| Download URL | ncm_mlx-0.4.0.tar.gz |
|---|---|
| Size | 101.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaff3a036ed6b35095bf7cb789e4120eaa018a740ed7ef0e688298a60c10e726
|
|
BLAKE2b-256 checksum How to use checksums |
1c41259614fec25afa018349b3d5243957e0d0270cb082726427bfb58e9cbca5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logRelease files / ncm_mlx-0.4.0-py3-none-any.whl
| Download URL | ncm_mlx-0.4.0-py3-none-any.whl |
|---|---|
| Size | 118.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f371a1581bc02f2e92af32a498790574cb97af30f4fab1a56141628950a33b5
|
|
BLAKE2b-256 checksum How to use checksums |
0e24312b3011cf890dfb6242ba5616ff94c35683926a795701fce36f604bb3c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logSecurity for ncm-mlx 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ncm_mlx-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.