add/update START_SFT_VPS.md (pre/post 200-duel vs 2023 king)
Browse files1234567891 unmodified line1112131415161718192021222324252627282930313233341 unmodified line3637383940414243444546474817 unmodified lines666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111 unmodified line1131141151161171181196 unmodified lines1261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711722 unmodified lines1751761771781791801813 unmodified lines1851861871881891901911921931941951 unmodified line197198199200201202203204205# SN38 Round 15 β quality SFT on the uploaded cryptoDev23 model**Copy this one file to a fresh GPU VPS.** Everything else is pulled from Hugging Face.Cutoff year **2024**. Submissions close **Monday 2026-10-12 12:00 UTC**.This job is **one epoch of quality SFT only**. Do not re-run CPT. Do not re-run GKD.---1 unmodified line| item | Hugging Face | notes ||---|---|---|| **Base model** | [`cryptoDev23/chrono-2024-a-gkd`](https://huggingface.co/cryptoDev23/chrono-2024-a-gkd) | private Β· sn38-nanochrono Β· ~2.02B Β· already uploaded || **SFT data** | [`cryptoDev23/sn38-quality-sft`](https://huggingface.co/datasets/cryptoDev23/sn38-quality-sft) | public Β· `sn38_quality_sft_r15.tar.gz` || Train rows | **10,670** | 13 / 13 validator categories || Held-out | **249** | local duel only, not for training || Answer format | conclusion first, then reason, **β€300 chars** | same window the GPT-5.4 judge sees || Teacher for the 6 new cats | Qwen2.5-72B (2024 cutoff) | never GPT-5.4 for completions |The six categories that used to be empty (reading / language_understanding / language_modeling / logical / temporal / word_sense) are now ~440β450 each, from SciQ, RACE, Fig-QA, Circa, HellaSwag, LogiQA, FOLIO, MCTACO, BIG-bench time, WiC, WordNet.`train.py` masks the prompt and keeps EOS in the loss. One epoch = `ROWS Γ 512` tokens β **5.46 M**. On one H200 this is about **10 minutes**. On one 80 GB H100, same, or drop `--micro-bs` to 8 if you OOM.If `known_rate` on the 2024 probes drops more than ~3 points vs the starting checkpoint, stop and keep an earlier `step-*`.---## 0. MachineOne NVIDIA GPU is enough (H100 80 GB or H200). Driver β₯ 550. ~50 GB disk. Internet.```bashnvidia-smi1 unmodified line---## 1. Token (required β the model repo is private)```bashexport HF_TOKEN=hf_... # write / read token for cryptoDev23```Do not paste the token into this file. Do not commit it.---17 unmodified lines---## 3. Download the model + the SFT set + this packβs scripts```bashexport HF_TOKEN="${HF_TOKEN:?set HF_TOKEN first}"cd /opt/sn38# base we already uploadeduv run hf download cryptoDev23/chrono-2024-a-gkd \--local-dir /data/base/chrono-2024-a-gkd# quality SFT + train.py + probes (this dataset)uv run hf download cryptoDev23/sn38-quality-sft \--repo-type dataset --local-dir /data/sft/_hftar -xzf /data/sft/_hf/sn38_quality_sft_r15.tar.gz -C /data/sftcp -f /data/sft/_hf/train.py /opt/work/train.pycp -f /data/sft/_hf/probes_2024.csv /opt/work/probes_2024.csvchmod +x /opt/work/train.pywc -l /data/sft/quality_sft.jsonl # expect 10670ls /data/base/chrono-2024-a-gkd/model.safetensors```Sanity: the first sentence of a random response must be the answer, not βSureβ.```bashpython3 - <<'PY'import json, randomrows=[json.loads(l) for l in open("/data/sft/quality_sft.jsonl")]print("rows", len(rows), "cats", len({r["category"] for r in rows}))for r in random.sample(rows, 5):print("---", r["category"], r["source"], "n=", len(r["response"]))print("Q:", r["prompt"][:160])print("A:", r["response"])PY```---## 4. Train β one epoch, one GPU```bashcd /opt/sn381 unmodified lineROWS=$(wc -l < /data/sft/quality_sft.jsonl)echo "rows=$ROWS tokens=$((ROWS*512))"# H200 / 80GB H100:tmux new -s sft -d "cd /opt/sn38 && PYTHONPATH=/opt/sn38 CUDA_VISIBLE_DEVICES=0 \uv run python /opt/work/train.py --mode sft \--base /data/base/chrono-2024-a-gkd \6 unmodified linestmux attach -t sft```If it OOMs:```bash# add --ckpt and drop micro-bs--micro-bs 8 --ckpt```Do **not** run a second epoch. Do **not** raise LR above `1e-5`.Watch the log:- `loss` should fall- `probes: known_rate=β¦ (need >=70%)` must not crash- final folder: `/data/ckpt/chrono-2024-a-sft/latest`---## 5. Smoke the finished weights```bashWIN=/data/ckpt/chrono-2024-a-sft/latestcd /opt/sn38 && PYTHONPATH=/opt/sn38uv run python debug/test_automodel.py "$WIN"uv run python -m sn38.neurons.chat "$WIN"# try a quality prompt, e.g.:# Why do some metals rust when exposed to water while others do not?# All roses are flowers. Some flowers fade quickly. Can we conclude that some roses fade quickly?```The completion must be answer-first, a few sentences, and stop (EOS). If it rambles, EOS was not learned β check the SFT log for the `EOS must be a training target` assert.---## 6. Upload the SFTβd model (after you like the smoke)```bashexport HF_TOKEN="${HF_TOKEN:?}"cd /opt/sn38uv run hf repo create cryptoDev23/chrono-2024-a-sft --exist-okuv run hf upload cryptoDev23/chrono-2024-a-sft "$WIN" . \--commit-message "R15 quality SFT 1 epoch on 10670 rows"uv run python - <<'PY'from huggingface_hub import HfApiimport os2 unmodified linesPY```Submit only after you decide to. Pin is `owner/repo@40-char-sha`. Repos must be **public** before Monday 13:00 UTC.```json{ "2024": "cryptoDev23/chrono-2024-a-sft@<40-char-sha>" }3 unmodified lines## Do not- Do not train on `quality_sft_heldout.jsonl`- Do not use GPT-5.4 / Claude / Gemini as a teacher for more answers- Do not start a second SFT epoch because loss is still falling- Do not blend this with a new CPT run in the same folder- Do not advertise the axon until the smoke looks answer-first and known_rate still clears---1 unmodified line| symptom | fix ||---|---|| `401` on model download | `HF_TOKEN` missing or no access to the private repo || `sn38-nanochrono` not registered | `PYTHONPATH=/opt/sn38` and you launched via `cd /opt/sn38 && uv run` || OOM | `--micro-bs 8 --ckpt` || `known_rate` drops hard | take an earlier `step-*`, do not finish the epoch || answers start with βSureβ | you pointed `--sft-jsonl` at the wrong file || never stops generating | `generation_config.json` must have `eos_token_id` 32763 and `do_sample` false |12345678910111213141516171 unmodified line19202122232425262728293031323334353637383940411 unmodified line434445464748495051525354555617 unmodified lines74757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631 unmodified line1651661671681691706 unmodified lines1771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482 unmodified lines2512522532542552562573 unmodified lines2612622632642652662672682692702712721 unmodified line274275276277278279280281282283284# SN38 Round 15 β duel the uploaded model, then one-epoch SFT, then duel again**Copy this one file to a fresh GPU VPS.** Everything else is pulled from Hugging Face.Cutoff year **2024**. Submissions close **Monday 2026-10-12 12:00 UTC**.This job is **quality SFT only**. Do not re-run CPT. Do not re-run GKD.Order is fixed:1. Download our uploaded model + the 2023 winner + the 200-prompt held-out set2. **Local quality duel BEFORE SFT** β `chrono-2024-a-gkd` vs `chrono-2023` on 200 samples, same code path as SN383. One-epoch SFT4. **Local quality duel AFTER SFT** β same 200 prompts, same king, same judge5. Smoke / upload only if after > before and known_rate still stands---1 unmodified line| item | Hugging Face | notes ||---|---|---|| **Our base (duel first)** | [`cryptoDev23/chrono-2024-a-gkd`](https://huggingface.co/cryptoDev23/chrono-2024-a-gkd) | private Β· ~2.02B Β· already uploaded || **2023 winner (the king)** | [`anacoluthe89/chrono-2023`](https://huggingface.co/anacoluthe89/chrono-2023) `@4b91d40ba1101ab0fb7da563b1048d2de93b4b77` | Round 14 winner, public || **SFT + duel pack** | [`cryptoDev23/sn38-quality-sft`](https://huggingface.co/datasets/cryptoDev23/sn38-quality-sft) | public |SFT train file: **10,670** rows, all **13** validator categories, conclusion-first, **β€300 chars**.Duel file: **`quality_sft_duel200.jsonl`** β 200 prompts sliced from held-out (never trained on). Same file before and after.Judge = production: `openai/gpt-5.4`, `prompt[:500]`, `completion[:300]`, A/B swap.Generation = production: `model.generate_batch(..., max_new_tokens=100)`, greedy, raw prompt, no chat template.One epoch = `10670 Γ 512` β **5.46 M** tokens β **83** steps. On 1Γ B200 the train loop is a few minutes. The two duels (2 models Γ 200 gens + 200 GPT-5.4 calls, twice) take longer than the train β budget **~20β40 min** for both duels.---## 0. MachineOne NVIDIA GPU (B200 / H200 / H100 80 GB). Driver β₯ 550. ~50 GB disk. Internet.```bashnvidia-smi1 unmodified line---## 1. Tokens```bashexport HF_TOKEN=hf_... # read the private chrono-2024-a-gkd repoexport OPENROUTER_API_KEY=sk-or-... # GPT-5.4 judge β same family as the validator```Do not paste keys into this file. Do not commit them.---17 unmodified lines---## 3. Download models + SFT + duel scriptsDownload the 2023 king **file by file** (config / weights / tokenizer only). Never `folderOpen` a random model repo.```bashexport HF_TOKEN="${HF_TOKEN:?set HF_TOKEN first}"export OPENROUTER_API_KEY="${OPENROUTER_API_KEY:?set OPENROUTER_API_KEY first}"cd /opt/sn38# our uploaded 2024 model (the one we duel FIRST, then SFT)uv run hf download cryptoDev23/chrono-2024-a-gkd \--local-dir /data/base/chrono-2024-a-gkd# 2023 winner β pinned commituv run hf download anacoluthe89/chrono-2023 \config.json model.safetensors tokenizer.json tokenizer_config.json generation_config.json \--revision 4b91d40ba1101ab0fb7da563b1048d2de93b4b77 \--local-dir /data/base/chrono-2023# SFT rows + frozen 200-prompt duel set + scriptsuv run hf download cryptoDev23/sn38-quality-sft \--repo-type dataset --local-dir /data/sft/_hftar -xzf /data/sft/_hf/sn38_quality_sft_r15.tar.gz -C /data/sftcp -f /data/sft/_hf/train.py /opt/work/train.pycp -f /data/sft/_hf/local_duel.py /opt/work/local_duel.pycp -f /data/sft/_hf/probes_2024.csv /opt/work/probes_2024.csvcp -f /data/sft/_hf/quality_sft_duel200.jsonl /data/sft/quality_sft_duel200.jsonlchmod +x /opt/work/train.py /opt/work/local_duel.pywc -l /data/sft/quality_sft.jsonl /data/sft/quality_sft_duel200.jsonl# expect 10670 and 200ls /data/base/chrono-2024-a-gkd/model.safetensors /data/base/chrono-2023/model.safetensors# validator-style load of BOTH checkpoints (must be clean)uv run python debug/test_automodel.py /data/base/chrono-2024-a-gkduv run python debug/test_automodel.py /data/base/chrono-2023```---## 4. BEFORE SFT β 200-sample duel vs the 2023 winnerThis is the SN38 quality path, not a chat sniff:- generate with `generate_batch` (`max_new_tokens=100`)- judge with `sn38.template.quality.Judge` + `duel` (A/B swap)- GPT-5.4 via OpenRouter (`openai/gpt-5.4`)- **same 200 held-out prompts** we will reuse after training```bashcd /opt/sn38export PYTHONPATH=/opt/sn38export OPENAI_BASE_URL=https://openrouter.ai/api/v1export OPENAI_API_KEY="${OPENROUTER_API_KEY:?}"export JUDGE_MODEL=openai/gpt-5.4tmux new -s duel_before -d "cd /opt/sn38 && PYTHONPATH=/opt/sn38 \OPENAI_BASE_URL=https://openrouter.ai/api/v1 \OPENAI_API_KEY=$OPENROUTER_API_KEY \JUDGE_MODEL=openai/gpt-5.4 \CUDA_VISIBLE_DEVICES=0 \uv run python /opt/work/local_duel.py \--cand /data/base/chrono-2024-a-gkd \--ref /data/base/chrono-2023 \--prompts /data/sft/quality_sft_duel200.jsonl \--n 200 --seed 0 --workers 12 \--dump /data/ckpt/duel_before.jsonl \--report /data/ckpt/duel_before.txt \2>&1 | tee /data/ckpt/duel_before.log"tmux attach -t duel_before```Read the TOTAL line:```bashcat /data/ckpt/duel_before.txt````win%` = our modelβs wins / 200. Ties count for nobody (same as the validator).This number is the **baseline**. Do not start SFT until this file exists.---## 5. Train β one epoch, one GPU```bashcd /opt/sn381 unmodified lineROWS=$(wc -l < /data/sft/quality_sft.jsonl)echo "rows=$ROWS tokens=$((ROWS*512))"tmux new -s sft -d "cd /opt/sn38 && PYTHONPATH=/opt/sn38 CUDA_VISIBLE_DEVICES=0 \uv run python /opt/work/train.py --mode sft \--base /data/base/chrono-2024-a-gkd \6 unmodified linestmux attach -t sft```OOM: add `--micro-bs 8 --ckpt`. Do **not** run a second epoch. Do **not** raise LR above `1e-5`.Watch:- `loss` falls- `probes: known_rate=β¦ (need >=70%)` does not crash (>3 point drop β keep an earlier `step-*`)- final folder: `/data/ckpt/chrono-2024-a-sft/latest`---## 6. AFTER SFT β same 200 prompts, same king, same judge```bashWIN=/data/ckpt/chrono-2024-a-sft/latestcd /opt/sn38export PYTHONPATH=/opt/sn38tmux new -s duel_after -d "cd /opt/sn38 && PYTHONPATH=/opt/sn38 \OPENAI_BASE_URL=https://openrouter.ai/api/v1 \OPENAI_API_KEY=$OPENROUTER_API_KEY \JUDGE_MODEL=openai/gpt-5.4 \CUDA_VISIBLE_DEVICES=0 \uv run python /opt/work/local_duel.py \--cand $WIN \--ref /data/base/chrono-2023 \--prompts /data/sft/quality_sft_duel200.jsonl \--n 200 --seed 0 --workers 12 \--dump /data/ckpt/duel_after.jsonl \--report /data/ckpt/duel_after.txt \2>&1 | tee /data/ckpt/duel_after.log"tmux attach -t duel_afterecho '===== BEFORE (gkd vs 2023 king) ====='cat /data/ckpt/duel_before.txtecho '===== AFTER (sft vs 2023 king) ====='cat /data/ckpt/duel_after.txt```Keep the SFT checkpoint only if **after win% β₯ before win%** and known_rate still looks like a pass. If after is worse, the SFT overwrote style β ship the original `chrono-2024-a-gkd` or an earlier `step-*`.---## 7. Smoke the winner of the two```bash# set WIN to whichever you keepWIN=${WIN:-/data/ckpt/chrono-2024-a-sft/latest}cd /opt/sn38 && PYTHONPATH=/opt/sn38uv run python debug/test_automodel.py "$WIN"uv run python -m sn38.neurons.chat "$WIN"# Why do some metals rust when exposed to water while others do not?# All roses are flowers. Some flowers fade quickly. Can we conclude that some roses fade quickly?```Answer-first, a few sentences, then stop. If it rambles, EOS was not learned.---## 8. Upload (only after after-duel looks better)```bashexport HF_TOKEN="${HF_TOKEN:?}"cd /opt/sn38uv run hf repo create cryptoDev23/chrono-2024-a-sft --exist-okuv run hf upload cryptoDev23/chrono-2024-a-sft "$WIN" . \--commit-message "R15 quality SFT 1 epoch; local 200-duel vs 2023 king"uv run python - <<'PY'from huggingface_hub import HfApiimport os2 unmodified linesPY```Submit only after you decide to. Pin is `owner/repo@40-char-sha`. Repo must be **public** before Monday 13:00 UTC.```json{ "2024": "cryptoDev23/chrono-2024-a-sft@<40-char-sha>" }3 unmodified lines## Do not- Do not train on `quality_sft_heldout.jsonl` or `quality_sft_duel200.jsonl`- Do not reshuffle the 200 prompts between before and after (`--seed 0`, same file)- Do not use a local Qwen judge if you want the SN38 number β use `openai/gpt-5.4`- Do not use GPT-5.4 / Claude / Gemini as a **teacher** for more SFT answers- Do not start a second SFT epoch because loss is still falling- Do not advertise until after-duel β₯ before-duel and known_rate still clears---1 unmodified line| symptom | fix ||---|---|| `401` on our model | `HF_TOKEN` missing or no access to the private repo || `401` on the judge | `OPENROUTER_API_KEY` not exported as `OPENAI_API_KEY` || `sn38-nanochrono` not registered | `PYTHONPATH=/opt/sn38` and `cd /opt/sn38 && uv run` || OOM during SFT | `--micro-bs 8 --ckpt` || OOM during duel | generate one model at a time (the script already unloads the first) || `known_rate` drops hard | take an earlier `step-*` || after win% < before | keep `chrono-2024-a-gkd`, do not upload the SFT || never stops generating | `generation_config.json` `eos_token_id` 32763, `do_sample` false |
START_SFT_VPS.md+140-61