Repository navigation
RFC: Task sampling and in-training evaluation (RFC 013, #1256) #1445
Description
Problem Statement
The Task API lets an environment publish its tasks, but nothing in OpenEnv decides which task a training episode runs, and there is no shared way to evaluate a checkpoint on an environment's test split with fixed seeds. Small models also waste most GRPO groups on tasks they always or never solve. RFC 013 (#1256) proposes both pieces; this issue tracks it and asks three questions about its scope.
Proposed Solution
Trainer-side task sampling and in-training evaluation, with no change to the environment boundary: a TaskSampler protocol with SequentialSampler and UniformSampler in core, a CurriculumSampler that targets GRPO signal offered as an example, a generic TaskAPIClient, an EnvEvalHarness built from the collect pipeline's pieces with compare_eval_results, an EvalSchedule, and openenv eval. Preliminary results from a laptop (the pilot's seed and three more) are in the RFC's Preliminary Results.
Alignment with Principles
Principles Addressed
- Minimize lifecycle deltas (training = production)
- Minimize human-agent divergence
- Be hands-on (working implementations)
- Design for LLMs
Training and evaluation share one interface and one rollout path. The samplers were run before they were proposed; the pilot's code and logs are public, and so are the trial's.
Trade-offs
| Option | Pros | Cons |
|---|---|---|
| Proposed approach: samplers on the trainer side, evaluation from the collect pipeline's pieces | No change to reset/step/state; rewards stay in the environment; one rollout path for training and evaluation |
Each trainer process keeps its own sampler state; evaluation inherits the collect pipeline's coverage |
| Curriculum inside the environment | Trainers need no sampler | The environment becomes stateful across episodes; breaks when workers share or stack instances |
| Evaluation through Inspect AI only | Already supported | Runs its own task and solver definitions, not the environment's tools and rollout path |
Impact
Files/Systems Affected
src/openenv/core/:TaskSampler,SequentialSampler,UniformSampler,TaskAPIClient,EnvEvalHarness,compare_eval_results,EvalSchedulesrc/openenv/core/harness/: the seed passed to the session, a record for failed episodes, generated token counts in the episode record, and a model step that turns a text answer into a single-turn environment's tool callsrc/openenv/core/llm_client.py: the provider's usage numbers kept- the CLI:
openenv eval, and tasks passed byopenenv collect envs/reasoning_gym_env/andenvs/finqa_env/: Task API support, with difficulty tiers forreasoning_gym_envdocs/source/guides/task-api.md: reserved task spec keys, and guidance on tiers and on train and test overlapexamples/: the curriculum sampler and the reference experiment
Related RFCs
- RFC 000 (phase three, evals), RFC 004, RFC 005, RFC 006, RFC 008 and its repeatability checks (Restore runtime repeatability #1321), RFC 012
- RFC: GRPO recipes #924 (recipes), docs: add hf rl environment datasets rfc #795 (environment datasets), RFC: Environment Services — brokered, budgeted access to external services (training, GPU jobs, evaluators, simulators) #1382 (environment services)
Implementation Sketch
class TaskSampler(Protocol):
def sample(self, n: int) -> list[Any]: ...
def update(self, task: Any, rewards: Sequence[float | None],
costs: Sequence[float] | None = None) -> None: ...
def state_dict(self) -> dict[str, Any]: ...
def load_state_dict(self, state: dict[str, Any]) -> None: ...
def metrics(self) -> dict[str, float]: ...Open Questions
- Should the curriculum sampler ship in core, next to the sequential and uniform samplers, or stay an example?
- Is a generic client for listing tasks (
TaskAPIClient) acceptable in core, given that the Task API guide leaves Task API methods out of the core clients? - Should the first version of the evaluation cover Harbor, whose server runs a whole agent per call (
run_rollout) and never goes throughreset?
Could RFC 013 go on the agenda of the technical committee?
cc @burtenshaw @adithya-s-k @sergiopaniego
This issue was prepared with AI assistance.
Activity
burtenshaw commentedon Oct 26, 2026
Maintainers: can we confirm the three scope decisions above before implementation—curriculum location, TaskAPIClient in core, and Harbor evaluation coverage?