Sobre
NCM: Modelagem do Próximo Conceito
Outros projetosCrescimento medido de estrelas
- em 24 h
- +4
- em 7 dias
- +38
- em 15 dias
- +136
- em 1 mês
- +676
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Original
Next-Concept Modeling
Fast, Parallel Coarse-to-Fine Text Generation
Next-Concept Modeling (NCM) is a two-stage framework for parallel text generation. A multiscale residual VQ tokenizer represents a sequence as a hierarchy of discrete codes, and a transformer predicts that hierarchy from coarse to fine. Positions within a level are generated in parallel, so generation requires one forward evaluation per level.
Highlights
Coarse-to-fine generation
NCM generates coarse to fine: each level predicts a longer sequence in parallel, and decoding every level shows a sample being refined from a rough sketch to the full output in a few steps.

Quality at a fraction of the cost
NCM beats or matches strong diffusion baselines on different tasks & datasets while generating 9-31× faster.
Released models
Weights and tokenized datasets are hosted in the NCM Hugging Face collection. Each released model consists of a frozen tokenizer and a next-concept generator.
| Task | Model | Tokenizer | Generator | Config | Data |
|---|---|---|---|---|---|
| XSum | – | tokenizer.pt | generator.pt | config.yaml | test set |
| WMT14 De–En | – | tokenizer.pt | generator.pt | config.yaml | test set |
| Sudoku | Easy | tokenizer.pt | generator.pt | config.yaml | test boards |
| Medium | tokenizer.pt | generator.pt | config.yaml | ||
| Hard | tokenizer.pt | generator.pt | config.yaml | ||
| LM1B | Small | tokenizer.pt | generator.pt | config.yaml | tokenized text |
| Medium | generator.pt | config.yaml | |||
| Large | generator.pt | config.yaml | |||
| TinyStories | – | tokenizer.pt | generator.pt | config.yaml | tokenized text |
| OpenWebText | – | tokenizer.pt | generator.pt | config.yaml | tokenized text |
Installation
git clone https://github.com/HazyResearch/ncm.git
cd ncm
pip install -r requirements.txt
Python 3.10 or newer and a CUDA-capable PyTorch installation are recommended.
Generation
Download just the TinyStories checkpoints and generate a sample in the terminal:
hf download hazyresearch/ncm-checkpoints --include "tinystories/*" --local-dir artifacts
python generate.py --config configs/generation/tinystories.yaml
For other tasks, choose a config from configs/generation/ and download the matching checkpoints and conditional inputs as described under Evaluation:
python generate.py --config configs/generation/<task>.yaml
python generate.py --config configs/generation/sudoku-hard.yaml --trajectory
Conditional examples show the prompt, generated answer and reference; Sudoku is rendered as a board. --trajectory shows each hierarchy prefix and is off by default. Override --seed or --samples, and add --out samples.jsonl to save the outputs. The default seeds select illustrative examples. LM1B displays the full packed sequence, including text after sentence separators.
Inference uses BF16 by default; add --precision fp32 to use FP32.
Evaluation
Download all released checkpoints and evaluation inputs:
hf download hazyresearch/ncm-checkpoints --local-dir artifacts
hf download hazyresearch/ncm-datasets --repo-type dataset --local-dir data
Then run:
# XSum or WMT14: <task> is xsum or wmt14
python evaluate.py --config config/eval/<task>.yaml --checkpoint-dir artifacts/<task> --data-dir data/<task>
# Sudoku: <difficulty> is easy, medium or hard
python evaluate.py --config config/eval/sudoku-<difficulty>.yaml --checkpoint-dir artifacts/sudoku/<difficulty> --data-dir data/sudoku/<difficulty>
# Unconditional text: <dataset> is tinystories or owt
python evaluate.py --config config/eval/<dataset>.yaml --checkpoint-dir artifacts/<dataset>
# LM1B: <size> is small, medium or large
python evaluate.py --config config/eval/lm1b-<size>.yaml --checkpoint-dir artifacts/lm1b/<size>
Evaluation runs one shard per visible GPU, merges the predictions, and prints task-specific scores. Add --gpus 0 to use one GPU, or --cfg <scale> for classifier-free guidance on XSum and WMT14.
XSum, WMT14 and Sudoku enable soft decisions by default. Set generation.soft_decisions: false to disable them, or adjust generation.soft_temperature. CLI overrides are --no-soft-decisions and --soft-temperature <value>; soft temperature is separate from sampling temperature.
Results below use BF16, no guidance, and one H100 80GB. XSum/WMT14 use --bs 16; other tasks use their config's batch size. Every conditional test example is included and scored against its complete reference, with no filtering by answer length.
| Task | Model | Results | ||
|---|---|---|---|---|
| XSum | – | ROUGE-1 ↑ | ROUGE-2 ↑ | ROUGE-L ↑ |
| 36.16 | 13.88 | 29.57 | ||
| WMT14 De–En | – | BLEU, cased ↑ | BLEU, lowercase ↑ | – |
| 25.27 | 26.20 | – | ||
| Sudoku | – | Solved (%) ↑ | – | – |
| Easy | 99.55 | – | – | |
| Medium | 97.75 | – | – | |
| Hard | 90.05 | – | – | |
| LM1B | – | Gen. PPL ↓ | Entropy ↑ | – |
| Small | 94.76 | 4.3158 | – | |
| Medium | 91.30 | 4.3469 | – | |
| Large | 83.27 | 4.3475 | – | |
| TinyStories | 15k EMA | Gen. PPL ↓ | Entropy ↑ | – |
| 15.54 | 3.9733 | – |
Benchmarking
python benchmark.py --config config/benchmark/<task>.yaml
Use the same task names as in config/eval/. Defaults are 1,024 samples, batch size 16, BF16, and three timed repetitions after warmup. Timing includes input preparation through decoded text; model loading, compilation and warmup are excluded. Add --precision fp32 to use FP32, or set benchmark.samples: null to time a full conditional test split. Results and settings are saved under outputs/benchmark/.
Measured on one NVIDIA H100 80GB with BF16, PyTorch 2.11, CUDA 12.8, and the default inference optimizations. Results are median total wall-clock times after 25 warmup requests; B is batch size and N is the total number of generated samples.
| Task | Model | Output tokens | Levels | B=1, N=1 (ms) | B=16, N=16 (ms) | B=32, N=32 (ms) | B=16, N=1024 (s) |
|---|---|---|---|---|---|---|---|
| XSum | – | 48 | 9 | 12.07 | 24.40 | 37.25 | 1.550 |
| WMT14 De–En | – | 64 | 11 | 13.00 | 21.27 | 29.61 | 1.310 |
| Sudoku | Easy | 89 | 12 | 7.31 | 9.24 | 11.97 | 0.574 |
| Medium | 7.29 | 9.10 | 12.00 | 0.575 | |||
| Hard | 7.25 | 9.27 | 12.03 | 0.575 | |||
| LM1B | Small | 128 | 12 | 14.35 | 24.44 | 34.41 | 1.537 |
| Medium | 28.16 | 46.92 | 70.92 | 2.836 | |||
| Large | 47.33 | 85.17 | 128.63 | 5.342 | |||
| TinyStories | – | 128 | 12 | 13.17 | 20.21 | 28.15 | 1.246 |
Output tokens is the fixed generated length before EOS trimming; Sudoku uses 81 cells plus eight row separators. Levels is the number of levels in the code hierarchy.
Reproduce each column with the command above, adding --batch-size B --samples N --repeats R: use R=30 for the first three columns and R=3 for the last.
Repository layout
generate.py,configs/generation/: terminal examples and optional generation trajectoriesevaluate.py: evaluation entry pointbenchmark.py,config/benchmark/: generation speed benchmarksscripts/: per-GPU generation shard and the merge that scores itconfig/eval/: one config per released checkpoint, identical to theconfig.yamlshipped with itmodels/,tokenization/: generator and tokenizer implementations
Citation
@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},
}
@inproceedings{kumbong2025hmar,
title={Hmar: Efficient hierarchical masked auto-regressive image generation},
author={Kumbong, Hermann and Liu, Xian and Lin, Tsung-Yi and Liu, Ming-Yu and Liu, Xihui and Liu, Ziwei and Fu, Daniel Y and Re, Christopher and Romero, David W},
booktitle={2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
pages={2535--2544},
year={2025},
organization={IEEE}
}
Released under the MIT license.
Explore projetos relacionados
Carregando…