# Slayer1B-1.09 SFT — chat format + tool calling (stage 1, before RL) Goal: the 1B base model (4k context) learns (A) the ChatML chat format and (B) a short tool loop — emit a valid ``, read the ``, answer using it, no reasoning. Measured as 0/1 outcomes (`evals.py`). | File | Role | |---|---| | `chatfmt.py` | ChatML + Hermes-style tool blocks on the tokenizer's existing `<|im_start|>/<|im_end|>`; exact assistant-only masks | | `configs/s1_toolcall.yaml` | data policy and budget (60 M Slayer-token targets, 50 % tool calling) | | `prepare.py` | selection from the unified index → `data/s1_toolcall/{train,val}.parquet` + `eval/` + `manifest.json` | | `tools_suite.py` | executable local tools (weather, calculator, search, FX, time, distractor) and 60 PL/EN loop cases | | `evals.py` | chat_format, tool_replay (held-out tool records), tool_loop natural + forced (`` prefill) | | `train.py` | full fine-tune, FSDP2 bf16, no packing (plain causal attention would leak across packed examples), tool example in (almost) every microbatch and every optimizer step | | `vast_run.sh` | `setup` / `baseline` / `train` / `eval` on a multi-GPU box | ## Data s1_toolcall (built 2026-11-25) 107,437 conversations, 135.0 M tokens, 60.0 M target tokens (Slayer tokenizer), every conversation ≤ 4,096 tokens: tool calling 43,131 (nemotron_agentic_v1 14,896, nemotron_sft_agentic_v2 23,757, toucan_sft 4,478; 1–6 valid calls, final text answer, ≤ 12 declared tools); chat 64,306 (pl 46,558, en 16,168, pl+en 1,580). Validation 1,975; eval: 300 chat prompts, 400 tool-replay prompts (test splits), 60 loop cases. Excluded: closed-model text (UltraChat, GPT-4o prompts), Llama/Qwen-obligation rows, identity rows, near duplicates; 22 rows removed as overlapping Slayer's eval suite (ARC 15, BoolQ 4, SST-2 3). Tool-calling examples are English only (no Polish tool data exists in the admitted sources); the loop eval measures Polish transfer. ## Local checks done (RTX 5060 Ti 16 GB, `Oris_Polish_Model_Family/.venv-gpu`) - format: segment tokenisation == joint tokenisation; masks cover assistant text, tool calls and `<|im_end|>` only - base model (update 95,000) on the loop eval: 0/2 (continues the prompt; no protocol) — harness works - smoke training (bf16 + SGD, 20 steps, 8k-token microbatches): loss 2.14 → 1.51, checkpoint saved in native format, re-loaded by `evals.py`; after 20 steps the model already emits ``/`` tags (not yet coherent) - microbatching: 8,192-token budget never exceeded, padding efficiency 99.9 %; 96 % of 16k-token microbatches and all but one of 20 smoke optimizer steps contain a tool example ## Run on vast (8 × RTX 4090) ```bash rsync -a slayer1b/ box:/workspace/slayer1b/ # code + data/s1_toolcall (≈ 260 MB) bash vast_run.sh setup && bash vast_run.sh baseline && bash vast_run.sh train s1 && bash vast_run.sh eval runs/s1/sft_stepN.pt ``` Starting hyper-parameters: lr 2e-5, cosine to 2e-6, warm-up 3 %, 1 epoch, 16k padded tokens per GPU microbatch, accum 2 (≈ 260k tokens per optimizer step, ≈ 520 steps per epoch).