Choosing settings
Every training run needs a few settings, such as the model, the learning rate and how long to train. This page gives starting settings that work for a first run, explains what each one does, and says when to change it.
You don't need to get these right before you start. Start with the settings below, look at the results, and change one thing at a time.
This page covers:
- Starting settings: the settings to use for a first run.
- The model: which model to train.
- LoRA or full parameters: train a small set of extra weights, or every weight.
- Learning rate: how big each update is.
- How long to train: steps, passes and batch size.
- Sequence length: the longest example or answer.
- Signs to watch for: what the numbers tell you, and what to change.
Starting settings
These are the defaults of the cookbook's ready-made scripts, sft_basic and rl_basic. The pages SFT with the cookbook and RL with the cookbook use them too.
| Setting | SFT | RL |
|---|---|---|
| Model | Qwen/Qwen3.5-9B |
Qwen/Qwen3.5-9B |
| Training kind | LoRA, rank 32 | LoRA, rank 32 |
| Learning rate | 5e-4, lowered to 0 over the run | 8e-5, the same for every step |
| How long | 1 pass through your data | 50 steps |
| Batch size | 64 conversations per step | 32 problems per step |
| Answers per problem | 16 | |
| Longest example or answer | 2,048 tokens per conversation | 512 tokens per answer |
The model
Start with Qwen/Qwen3.5-9B. It's the model the cookbook's scripts and tutorials use, and the settings on this page are written for it. You can try any model on Available models, and it's often worth comparing a few. With another model, start from the same settings, and use Signs to watch for to see what to change.
Choose a different model when:
- 9B isn't good enough for your task, even after training.
Qwen/Qwen3.8-27BandQwen/Qwen3.5-35B-A3Bare larger. - You want cheaper experiments.
Qwen/Qwen3.5-4Bis smaller.
A quick way to choose is to ask a few base models some of your questions first, for example with try.py from Try the trained model, using a base: name. Training improves a model, but it helps to start from one that's already close. Available models lists every model and its limits.
LoRA or full parameters
Start with LoRA, at rank 32. LoRA trains a small set of extra weights on top of the model, instead of changing every weight. It needs fewer GPUs, its checkpoints are small, and it's enough for most tasks.
- The rank sets how big LoRA's set of extra weights is. 32 is a good start. A higher rank can learn more, and it costs more. Each model has a largest rank, listed in Available models.
- Full parameters trains every weight. Try it if LoRA stops improving and you need more. It takes many more GPUs, and its checkpoints are much larger. It also needs a much lower learning rate, as the next section says.
Learning rate
The learning rate sets how big each update to the weights is. It's the setting that most often needs changing.
| Training | LoRA | Full parameters |
|---|---|---|
| SFT | 5e-4 | 1e-5 |
| RL | 8e-5 | 1e-6 |
- LoRA needs a much higher learning rate than full parameters, because it trains far fewer weights.
- For SFT, the cookbook's loop lowers the learning rate over the run, from the value you set down to 0 at the end. This is the
linearschedule.cosinelowers it along a curve instead, andconstantkeeps it the same. - For RL, the learning rate stays the same, because the cookbook's RL loops don't change it.
- To change it, move it by a factor of 2 or 3 at a time, not by a little. If a run goes badly, try a third of the learning rate. If it learns too slowly, try twice as much.
How long to train
SFT
- Passes. One pass, where the model sees each conversation once, is a good start. With a small dataset, of a few hundred conversations, 2 to 4 passes can help. Too many passes and the model memorizes your examples instead of learning from them. Signs to watch for says how to tell.
- Batch size. Each step trains on one batch, so your number of steps is your number of conversations divided by the batch size, times the passes. With little data, use a smaller batch, so the run still takes enough steps to learn. For example, 300 conversations at 64 per batch is only 5 steps a pass, while at 16 per batch it's 19.
RL
- Steps. 50 steps is a good first run. If the held-out score is still rising at the end, train for longer.
- Batch size, the number of problems each step uses. A bigger batch gives each step more to learn from, and makes each step slower.
- Answers per problem, the size of each group. The model learns by comparing the answers in a group, so more answers give a better comparison. 16 is a good start. Fewer than 8 makes the comparison noisy.
Sequence length
SFT
max_seq_len is the longest conversation the run can train on, in tokens. A token is roughly three quarters of a word in English.
- Set it to fit your longest conversation, not the model's maximum. Looper chooses the run's GPUs based on it, so a larger value can cost more.
- A reply that ends past it is cut off, and the model only trains on the part that fits. A reply that starts past it is refused, with an error, when the data is built.
RL
max_turn_tokens is the longest answer the model can write, in tokens. An answer that runs out of room scores 0.
- 512 is enough for short worked answers, such as math problems.
- Raise it if many answers are cut off. The loop's report shows the share of answers that were cut off, as the
truncatedmetric. - With thinking on, the model writes its reasoning first, so it needs much more room, often several thousand tokens.
Signs to watch for
| What you see | What it usually means | What to try |
|---|---|---|
| SFT loss doesn't go down | The learning rate is too low, or the data isn't what you think | Check what each example trains, as Supervised learning shows. Then try twice the learning rate. |
The loss shoots up, or becomes nan |
The learning rate is too high | Try a third of the learning rate. |
| SFT loss falls close to 0, and the model repeats your examples word for word | The model has memorized your examples | Train for fewer passes, or add more data. |
RL reward stays flat, and groups_trained is near 0 |
Your problems are too easy or too hard for the model | Change your problems. See Choose your problems. |
| RL reward rises, but the held-out score doesn't | The model is learning your training problems, not the skill | Add more varied problems, or lower the learning rate. |
| Many RL answers are cut off | max_turn_tokens is too small |
Raise it. |
Change one setting at a time, so you can tell what made the difference.