Skip to main content
What you’ll learn: how to use Miles for plain supervised fine-tuning. No RL, no rollout, no reward — just data → loss → optimizer. Why use Miles for SFT? Two reasons:
  1. Same launch convention as your RL run — one config, one Ray cluster.
  2. Async data prefetching — the SFT loop reuses the rollout machinery to overlap data loading with training.

Prerequisites

  • You completed the Qwen3-4B recipe (we reuse the conversion).
  • ~50 GB free disk for OpenHermes-2.5.

Quick start

1. Convert Qwen3-4B-Base

If you don’t already have it:

2. Prepare the dataset

OpenHermes ships in a custom shape. Convert to OpenAI messages format:

3. Run

What changes vs. the GRPO recipe

Compare to run-qwen3-4B.sh. The deltas:

Why each flag

What to watch

If data/prefetch_queue_depth stays at 0, your data loader is too slow — increase worker count or use parquet (we already do).

Tuning knobs

Variations

Mix datasets

Pass multiple --prompt-data entries:
Per-source loss is logged separately.

Continue with RL

After SFT, point the RL run at the SFT checkpoint:

LoRA SFT

Use the LoRA hooks (--lora-rank 16) to keep VRAM low when fine-tuning a larger model. See examples/lora/ in the repo.