Instructions to use jkminder/d16_235m_seed4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jkminder/d16_235m_seed4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jkminder/d16_235m_seed4", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("jkminder/d16_235m_seed4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jkminder/d16_235m_seed4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jkminder/d16_235m_seed4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jkminder/d16_235m_seed4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jkminder/d16_235m_seed4
- SGLang
How to use jkminder/d16_235m_seed4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jkminder/d16_235m_seed4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jkminder/d16_235m_seed4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jkminder/d16_235m_seed4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jkminder/d16_235m_seed4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jkminder/d16_235m_seed4 with Docker Model Runner:
docker model run hf.co/jkminder/d16_235m_seed4
Scaling Ladder β d16 (235M scaling parameters), seed 4
Research artifact. One of 24 base language models (3 sizes x 8 random seeds) trained to study seed-to-seed variance in language-model pretraining. Every model is a plain next-token predictor trained on the same data for 200 tokens per parameter. No instruction tuning, no safety training.
This repository holds size d16, seed 4. The seed sets both the weight initialization and the data order; everything else is identical across the eight seeds of a size.
This revision (main) mirrors TPP_80, the latest available mark; training continues.
Validation loss in bits per byte (lower is better) against realized tokens
per parameter, measured at each checkpoint save on the training run's
held-out validation split. One series is the annealed models (the TPP_X
revisions); the other is the un-annealed main-run (constant learning rate)
checkpoints they forked from (the TPP_X_preanneal revisions). A thin
connector joins each annealed model to the fork checkpoint its anneal
started from. This repository's single run only β no averaging across
seeds.
The ladder
| repos | layers | hidden size | scaling parameters | total parameters |
|---|---|---|---|---|
| d12_110m_seed1..8 | 12 | 768 | 110M | 286,261,730 |
| d16_235m_seed1..8 | 16 | 1024 | 235M | 536,871,738 |
| d20_435m_seed1..8 | 20 | 1280 | 435M | 896,533,746 |
"Scaling parameters" is the count the 200-tokens-per-parameter budget is based on. The totals are larger because the nanochat architecture adds vocabulary-sized value-embedding tables (see Architecture).
Revisions: checkpoints along training
Each model's main run trains with a constant learning rate for 200 tokens per parameter, saving checkpoints on a fixed step cadence; the main run's learning rate is never decayed. Every annealed checkpoint comes from a separate anneal run: it forks the main run at the saved checkpoint closest to (mark minus 1.60B tokens) β before the mark β then trains a fixed 1.60B tokens (for this size) while the learning rate decays linearly to 5% of the constant value, landing at the mark. The annealed model's total token count is therefore the mark itself, not the mark plus the anneal. Because the fork snaps to the nearest saved checkpoint, the realized total can deviate from the nominal mark; the table below records it exactly, and the deviation is largest at the lowest marks. Both stages are published as git revisions (branches) of this repository:
TPP_X(X = 10, 20, ..., 200): the annealed model at the X-tokens-per-parameter mark. Use these for measurements β the anneal brings the model to its proper quality for that budget.TPP_X_preanneal: the constant-learning-rate checkpoint of the main run that the TPP_X anneal forked from. Nominally the fork point sits about 6.8 tokens per parameter before the mark (the anneal length), but the snap to the nearest saved checkpoint can place it substantially earlier β a TPP_10 fork can sit at only a few tokens per parameter. The table below records every pre-anneal position exactly.main: identical toTPP_200once it exists; while the ladder is still training,mainholds the latest availableTPP_X.
Marks are added incrementally while training continues, so a missing revision only means it has not landed yet.
Currently available marks in this repository:
| mark | annealed step | annealed tokens/param | pre-anneal step | pre-anneal tokens/param |
|---|---|---|---|---|
| TPP_10 | not landed yet | - | 1474 | 3.29 |
| TPP_20 | not landed yet | - | 6000 | 13.39 |
| TPP_30 | 13558 | 30.26 | 10500 | 23.44 |
| TPP_40 | 18058 | 40.31 | 15000 | 33.48 |
| TPP_50 | not landed yet | - | 19000 | 42.41 |
| TPP_60 | not landed yet | - | 23500 | 52.46 |
| TPP_70 | not landed yet | - | 28000 | 62.50 |
| TPP_80 | 35558 | 79.37 | 32500 | 72.54 |
| TPP_90 | not landed yet | - | 37000 | 82.59 |
| TPP_100 | not landed yet | - | 41500 | 92.63 |
| TPP_110 | not landed yet | - | 46000 | 102.68 |
"Annealed tokens/param" counts every token the annealed model saw, the anneal's own tokens included. "Pre-anneal tokens/param" is the fork point's position in the main run: fork step x tokens per step / scaling parameters.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "jkminder/d16_235m_seed4"
revision = "TPP_100" # or any revision above
tok = AutoTokenizer.from_pretrained(repo, revision=revision, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo, revision=revision, trust_remote_code=True, dtype="bfloat16")
trust_remote_code=True is required: the architecture matches no stock
transformers class, so the modeling code ships in the repository
(modeling_nanochat_gpt.py, plain PyTorch). generate() is supported
with a KV cache, greedy, sampling and beam search alike β the
previous-token gate keeps its per-sequence state aligned with beam
reordering. Assisted decoding (an assistant model) is refused: it
requires cache cropping, which that state does not support.
Architecture
Full nanochat GPT architecture: depth 16, hidden size 1024, 8 attention heads (head dimension 128), sequence length 2048, vocabulary 32,768. All of nanochat's architecture mechanisms are active: value embeddings on alternating layers (the vocabulary-sized tables behind the scaling-vs-total parameter gap), re-injection of the input embedding at every layer, per-layer residual scaling, a learned gate that mixes each token's embedding with the previous token's, a mid-network subtraction of the stored input contribution, query-key sharpening, logit softcap 15, and attention that alternates short sliding windows with full-context layers (pattern "SSSL"). Also: parameter-free RMSNorm, rotary embeddings (base 100,000) with query-key RMS normalization after rotation, relu(x)^2 MLP, no biases, untied embeddings.
Weights are bfloat16 safetensors β the training compute precision
(training keeps fp32 master weights but casts every matrix to bfloat16 for
each forward, so this export reproduces the training-time compute exactly).
Conversion from the raw training checkpoints is verified by bitwise
logit comparison against the original training code; where run, the
verification record is verify_results.json in the revision.
Tokenizer
nanochat byte-pair encoding, 32,768 tokens (32,759 learned + 9 special;
only <|bos|>, id 32759, appears in pretraining). Trained once on
ClimbMix and pinned across every model of the study. Load it with
trust_remote_code=True as in the snippet (the config carries an
auto_map, and resolving it without the flag triggers an interactive
prompt).
Training data
ClimbMix (NVIDIA,
filtered English web text), pinned snapshot climbmix_1201, single pass,
sequences of 2048 tokens. The base data carries a CC BY-NC 4.0,
research-and-development-only license, which this model mirrors.
License
- Model weights: cc-by-nc-4.0 (mirrors the ClimbMix training data; research use).
- Modeling/configuration code: MIT (derived from karpathy/nanochat; see the bundled LICENSE file).
- Downloads last month
- -
