Skip to content

Allow token capture to be turned off per rollout (validation rollouts are captured today) #5340

Closed

Description

@zyzhou5

Use cases, pain points, and background

Token capture can only be turned on per agent, from config. A model call is captured when its URL carries the /training-token-capture segment, and Gym adds that segment when token_id_capture.enabled is set and the agent has token_id_capture: true, or when all_agents: true is set. The decision is made in three places:

  • Agent servers: _token_id_capture_enabled() in nemo_gym/base_responses_api_agent.py.
  • single_agent_turn: _agent_responses_path() in environment_servers/single_agent_turn/app.py.
  • nemo_user_sim: per participant, for the assistant only.

Nothing in a rollout request can change it. So every rollout that runs through a capturing agent is captured, including validation and other eval-only rollouts that are never trained on.

For each captured call, the training framework writes the generated token ids and logprobs into its training data store. When the request sets top_logprobs, it also writes the k alternatives per token. For rollouts that are never trained on, all of this is wasted storage and transfer, and with top_logprobs the waste is large.

NeMo RL does not hit this yet, because token capture only runs in its single-controller runner, which has no validation loop. It will as soon as validation runs with capture enabled.

Description

Let the caller turn token capture off or on for each rollout, without changing agent config. A training framework could then run validation rollouts through the same agents and environments without capturing them.

Design

Open for discussion. One sketch:

  • Add a rollout-level setting to the rollout request: the run body for agent /run, and the episode request for Environment Servers.
  • When an agent or Environment Server builds the /ng-rollout/... URL prefix, use that setting to decide whether to add /training-token-capture.

Related work:

Out of scope

Metadata

Metadata

Assignees

Labels

area:trainingfeature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions