Prerequisites
Start with a working interactive training loop from the Decoder Quickstart and confirm that a baseline datum trains successfully. This guide reuses itscall and
wait helpers, tokenizer, and job_id.
Your application samples responses, grades them, and converts rewards into
per-token advantages. Fastino applies those advantages with a supported loss:
importance_sampling, ppo, cispo, or dro. Custom loss functions do not
run inside the training job.
1. Define a narrow grader
Separate parsing from scoring so malformed output is observable:2. Snapshot the job for sampling
Save a sampler checkpoint from the current weights, then sample a group from it:3. Convert rewards to advantages
4. Build aligned datums
The prompt is context, so prompt positions receive zero advantage. Completion positions receive the response’s group-relative advantage and the sampler’s log probabilities. Every tensor has one value per input position:base_model for both prompts and decoding.
5. Update the interactive job
loss_fn_config fields and defaults:
The reward-loss safeguards in the last row are enabled by default. Unknown
configuration fields are rejected.
6. Save a recovery boundary
path with:
- Job ID
- Application step and dataset cursor
- Dataset and reward implementation revisions
- Base model and training configuration
- Evaluation metrics
7. Run the reward loop
Define the training examples in your application, then compose the helpers inside the loop.continue now skips only the current group when all rewards
are equal:
Verify before scaling
- The grader distinguishes known correct and incorrect fixtures.
- Malformed responses don’t crash the application loop.
- At least one sample group has reward variance.
- Every datum’s tensors have one value per input position.
- Forward-backward passes and optimizer steps complete on the same job.
- A new job can start from a state checkpoint with its client-owned resume metadata.
- Held-out evaluation remains separate from the training reward batch.

