Skip to content
SurogateSurogateDocs
↑↓ to move↵ to openesc to close

Pretraining

These two configs train on raw text (Trelis/tiny-shakespeare, column Text) and compute the loss on all tokens. Run them from the repository root. The small corpus shows the workflow; it is far too little data to train a useful 0.6B model from scratch.

bash
# Randomly initialize Qwen3's architecture and train all weights with NorMuon.
surogate pt examples/pt/qwen3.yaml
# Continue from Qwen3's pretrained weights with raw-text SFT and AdamW 8-bit.
surogate sft examples/pt/qwen3-continue.yaml

surogate pt always sets from_scratch: true and initializes projections to zero, so use surogate sft for continued pretraining. Both configs use lora: false, loss_scale: all, packing, a cosine learning-rate schedule, explicit validation, and checkpoints. Replace model with a compatible checkpoint or architecture and datasets with your corpus. If full-model training runs out of memory, reduce the sequence length or batch size, or use the offload and multi-GPU recipes.

Next: the pretraining quickstart walks through a first run, and optimizers explains NorMuon and AdamW 8-bit.