# tinker_cookbook.renderers.TrainOnWhat ## *class* [**tinker_cookbook.renderers.TrainOnWhat**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/renderers/base.py#L1279)(*StrEnum*) Enum controlling which parts of the sequence to compute loss on. **Members:** LAST_ASSISTANT_MESSAGE: Train only on the final assistant message. LAST_ASSISTANT_TURN: Train on the last assistant turn (including any tool calls and tool responses leading to the final assistant reply). ALL_ASSISTANT_MESSAGES: Train on every assistant message in the conversation. ALL_MESSAGES: Train on all messages regardless of role. ALL_TOKENS: Train on every token in the sequence (including special tokens). ALL_USER_AND_SYSTEM_MESSAGES: Train on user and system messages only. CUSTOMIZED: Use per-message `train` flags from the dataset. ## Referenced by - [tinker_cookbook.renderers.Renderer.build_supervised_example](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/renderers/renderer/#renderer-build_supervised_example) - [tinker_cookbook.renderers.Renderer.build_supervised_examples](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/renderers/renderer/#renderer-build_supervised_examples) - [tinker_cookbook.supervised.ChatDatasetBuilderCommonConfig](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/supervised/chatdatasetbuildercommonconfig/index.md)