1# Clone the repo
2git clone https://github.com/viniciusxpb/scaffold-tokens
3cd scaffold-tokens
4
5# Setup, download model, and generate
6make setup
7make download-model
8make generate
1import torch
2import tiktoken
3
4# Load model
5ckpt = torch.load("model.pt", map_location="cuda", weights_only=False)
6
7# The model uses a custom architecture (not HuggingFace Transformers).
8# See the full inference code at the GitHub repo.
For full inference with forced countdown generation, see the training repository:
Trained on
scaffold-tokens-dataset -- Portuguese news articles from
Folha de S.Paulo (public domain), pre-tokenized with
<ff_N> countdown tokens.
1{
2 "model": OrderedDict, # state_dict (weights only, no optimizer)
3 "step": 1750,
4 "val_loss": 1.381,
5}
1@misc{scaffold-tokens-2025,
2 title={Scaffold Tokens: Teaching LLMs to Plan with Countdown Tokens},
3 author={Vinícius França},
4 year={2025},
5 url={https://github.com/viniciusxpb/scaffold-tokens}
6}