In this article
Answer-only loss removes selected prediction events from optimization without automatically removing prompt tokens from the model’s context.
Supervised fine-tuning uses examples of inputs and desired outputs. In a causal chat model, an answer-only loss can score assistant tokens while allowing the answer to attend to the prompt. This is a precise selection of training events, not a rule that every visible input token must also be a prediction target.
The prompt supplies conditioning information
A serialized training conversation contains prompt material and the reference answer under the checkpoint’s chat format. The answer predictions can use the permitted preceding prompt tokens. Those tokens remain part of forward computation even if their own target events are ignored. Removing a target from loss is therefore different from deleting a token or blocking attention to it. The distinction is especially important when examples contain system instructions, retrieved evidence or tool results that should inform an answer without being reproduced as the supervised response.
The first answer token tests alignment
Consider a prompt asking for the capital of a fictional country, followed by a labeled answer. The state immediately before the first answer token must predict that token under next-token alignment. A loss mask defined on input positions can become off by a position when interpreted as target events. Write a table of states, predicted identifiers and included-loss flags for a tiny example. This checks the answer boundary directly, rather than assuming that masking every visible prompt identifier necessarily creates the intended answer-only objective.
Reference answers define the supervised behavior
Cross-entropy on the included answer events rewards assigning probability to the demonstrated continuation under the reference prefix. It does not directly compare all possible answers or establish that a demonstration is true. A dataset can teach formatting, style and task responses while also transmitting its mistakes and preferences. Inspect demonstration quality and task coverage separately from mechanical loss masking. If multiple assistant turns are present, declare which turns are supervised and how tool messages and ending tokens participate in the target set.
Validate the objective before interpreting adaptation
A small fixture should show template rendering, token identifiers, shifted labels and the exact valid-target denominator. Confirm that prompt changes can affect answer logits while ignored prompt targets contribute no direct loss. Then evaluate held-out task behavior after training under the intended generation settings. Preserve data transformation and template revisions with the adapter or checkpoint. This connects an understandable supervision rule to a reproducible artifact and avoids treating a decreasing training loss as sufficient evidence of factual reliability or broad instruction-following quality.
Primary research and implementation references
Related engineering context
Reproducible inference stacks: preserving a GPU pilot’s result; A GPU inference benchmark you can trust.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.