{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "karpathy-nanochat--sweep-model-size-with-one-depth-dial",
 "repo": "karpathy/nanochat",
 "repo_url": "https://github.com/karpathy/nanochat",
 "repo_slug": "karpathy-nanochat",
 "title": "Train a compute-optimal miniseries by changing one depth dial",
 "page_title": "How to train a compute-optimal miniseries by changing one depth dial with Nanochat",
 "summary": "Run base training at different --depth values and compare validation bits per byte and CORE score.",
 "who": "A researcher testing an idea across model sizes.",
 "problem": "Changing model size usually means retuning width, heads, learning rate and training horizon by hand.",
 "outcome": "A set of compute-optimal models where only --depth changes and other hyperparameters follow.",
 "steps": [
  "Run base training with `torchrun --standalone --nproc_per_node=8 -m scripts.base_train` and `--depth=12`",
  "Repeat at other depths (GPT-2 capability is around d24 to d26)",
  "Compare `val_bpb` and `core_metric` across runs",
  "Check `train/mfu` and `train/tok_per_sec` for throughput"
 ],
 "agent_prompt": "Run nanochat base_train sweeps at depth 12, 16 and 20 on this node, then tabulate val_bpb, core_metric and train/mfu for each run.",
 "agents": [
  "claude-code",
  "codex"
 ],
 "difficulty": "Advanced",
 "time": "3 hours",
 "basis": "readme",
 "caveat": "Any change to the repo should work across all depth settings.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "uv",
  "An 8XH100 or 8XA100 node for the speedrun (a single GPU works, 8 times slower)",
  "CPU or Apple Silicon only for the tiny runcpu example"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/karpathy-nanochat/sweep-model-size-with-one-depth-dial/",
 "md": "https://dedupedai.com/use-cases/karpathy-nanochat/sweep-model-size-with-one-depth-dial/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/karpathy-nanochat--sweep-model-size-with-one-depth-dial.json",
 "api_version": "v1"
}
