Masking tool responses out of the training loss for agents

MediumConcept15 minRERSMLEPro outline

The question

When you train an agent model on trajectories with tool calls, why should tool responses be masked out of the loss? How would you build that mask?

What the interviewer is looking for

  • Model should learn its own actions, not to predict tool outputs
  • Tool text is not produced by the policy
  • Mask built from message roles during tokenisation
  • Same idea applies in RL loss
  • Checks for off by one in chat templates

Your answer

Saved in this browser only. Nobody else sees it.

Why this question

Written by BlogLLM in the style of a publicly reported Zhipu AI (Z.ai) question type: agent algorithm round: DPO intuition, why GRPO, masking tool responses out of the loss, KV cache size and parameter count estimates.

Reported in: keepkeen.github.io

Practice question written by BlogLLM based on publicly reported interview formats. Not an official Zhipu AI (Z.ai) question.