Upload folder using huggingface_hub
Browse filesFiles changed (6)
- README.mdAdded+102
- SHA256SUMS.txtAdded+1
- arch_facts.jsonAdded+29
- config.jsonAdded+10
- model.safetensorsAdded+3
- tokenizer.jsonAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102---license: mitlanguage: - codetags: - code-generation - python - instruction-tuned - supervised-fine-tuning - from-scratchlibrary_name: pytorch---
# code-llm-435m · sft — the instruction-tuned variant
The instruction-tuned version of the 435M from-scratch code model whose pretrained weights are in[`../base`](../base). Same architecture, same 32,000-token byte-level BPE vocabulary, same 1,024-tokencontext — only the weights differ. It reads a plain-English request (*"write a function that checkswhether a number is prime"*) or continues a bare `def` signature, and writes Python.
This is the checkpoint the post-training log selects for release: **first of seven candidates on atask set that never took part in any selection decision**, and still in the top tier on the tasksthat did.
## Architecture
Identical to [`../base`](../base) — see that card for the full table. In short: 434,680,832parameters, 22 layers, d_model 1,024 / 16 heads, SwiGLU (d_ff 4,096), RoPE (theta 500,000), RMSNorm,causal SDPA, untied embeddings, context 1,024, released file in bf16.
## Post-training
| | ||---|---|| Base | `base/model.safetensors` — the weight-soup of the pretraining run, not its last step || Data | 147 M tokens of **gold-standard instruction data** (only examples whose reference solution passes its unit tests) interleaved with 29.4 M tokens of signature→body pairs, **5:1** || Epochs | 1 || Learning rate | 2e-5, cosine to 10%, 50-step warmup || Batch | micro 8 × 4 accumulation = 32,768 tokens per step || Precision | bf16 + TF32 + `torch.compile` || Seed | 46 || Hardware / time | one RTX 5090 (32 GB), ~90 minutes |
Roughly 30 post-training runs were evaluated to reach this one. The approaches that did **not** work —instruction-free training, teaching the two objectives in two stages, self-distillation, weightaveraging ("soups"), ratio sweeps — are documented with their numbers, including the mistakes, in theGitHub repository.
## Results
| Suite | Protocol | Strict | Lenient ||---|---|---|---|| The 11 tuning tasks | 20 attempts per task per prompt style (reported on a 55-point-per-column scale: 82.2 / 110 = 74.7%) | **82.2 / 110** | 85.8 / 110 || **12 held-out tasks** (never used for selection) | 10 attempts per task per prompt style | **71.0%** of 240 | 76.5% |
Per column on the tuning suite: natural-language requests **49.8 / 55**, bare signatures **32.5 / 55**.
The held-out row is the point of the exercise. A model that led the tuning board at 81.6 (89.8 on the5-attempt protocol) finished **last** there — 55.8 against 59–65 for the rest — because part of itsadvantage was a formatting habit that those 11 tasks happened to reward. Selecting on a fixed set oftasks repeatedly is how a fake champion is manufactured; the honest number is the one from tasks theselection never saw.
## Limits
1. **The benchmark is 23 short algorithmic tasks.** It is a proxy for "writes small functions correctly" and says nothing about debugging, library use, or multi-file changes.2. **Seed variance is the largest effect measured: about ±6 points.** The released checkpoint is a single seed, so that is the honest interval around its quality.3. **The held-out set was used exactly once, but it is only 12 tasks.** It rules out the specific failure described above; it does not prove broad generalisation.4. **`quicksort` and `two_sum` are near-zero for every arm, including this one.** That is a capability boundary of a 435M model trained on 31 B tokens, not a tuning miss.5. **The signature column is sensitive to output convention** — returning a new list versus mutating in place — which is why a lenient metric is reported next to the strict one.
## Files
| File | What ||---|---|| `model.safetensors` | bf16 weights, 157 tensors — verified bit-identical to the training checkpoint after the fp32→bf16 cast || `config.json` | architecture config exactly as stored in the training checkpoint || `tokenizer.json` | byte-level BPE, 32,000 tokens (the same tokenizer as `../base`) || `SHA256SUMS.txt` | artifact hash |
Loading it requires the model class from the training repository (`src/train.py`, class `CodeLLM` with`ModelConfig(**config.json)`); a state dict built by hand will not reproduce the forward pass.
## Intended use and limits
Research and education: what a few-hundred-million-parameter model can learn end to end on real data,and what makes the difference between a checkpoint that looks good and one that is good. Not forproduction code generation, not a coding assistant, not a substitute for a competent developer: at1,024 tokens of context and 435 M parameters it neither plans nor reasons. Trained only on publiccode and instruction data; no personal data. Outputs may reproduce patterns (and licensing quirks)from the training corpus despite filtering and deduplication.
## Links
`DESIGN.md` (decisions and why), `CHALLENGES.md` (every bug and contaminant), the ablation report, thepost-training log with its corrections, and the evaluation harness are in the GitHub repository. MITlicensed.1d34eeb0ada7fb98b55a3d410ada830ff314859b79a6e1da223afbf53fa797d1e model.safetensors1234567891011121314151617181920212223242526272829{
"params_total": 434680832,
"n_tensors": 157,
"dtype": "bf16",
"vocab_size": null,
"d_model": null,
"n_blocks": 22,
"tensor_keys_sample": [
"blocks.0.attn.out_proj.weight",
"blocks.0.attn.qkv.weight",
"blocks.0.attn_norm.scale",
"blocks.0.ffn.down.weight",
"blocks.0.ffn.gate.weight",
"blocks.0.ffn.up.weight",
"blocks.0.ffn_norm.scale",
"blocks.1.attn.out_proj.weight"
],
"source_checkpoint": "the pretrained checkpoint this export was taken from (path omitted in the released copy)",
"source_keys": [
"model",
"optimizer",
"scheduler",
"config",
"training_state",
"timestamp"
],
"step": null,
"created_utc": "2026-09-22T15:20:45Z"
}12345678910{
"vocab_size": 32000,
"d_model": 1024,
"num_layers": 22,
"num_heads": 16,
"d_ff": 4096,
"max_seq_len": 1024,
"rope_theta": 500000.0,
"dropout_rate": 0.0
}123version https://git-lfs.github.com/spec/v1oid sha256:d34eeb0ada7fb98b55a3d410ada830ff314859b79a6e1da223afbf53fa797d1esize 869377400README.mdAdded+102
SHA256SUMS.txtAdded+1
arch_facts.jsonAdded+29
config.jsonAdded+10
model.safetensorsAdded+3
tokenizer.jsonAdded