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 that keeps apart a reward ofNonefrom the environment, a failure of the policy and a failure of the harness or the model endpoint, 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) and RFC 014 (RFC 014: Environment Services (design only) #1508), whose
posttrain_env(Add experimental posttrain_env prototype (RFC 014) #1500) reports a spend for every episode, scored or not
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?
burtenshaw commentedon Oct 28, 2026
Closing for now because we haven’t received the requested details after 48 hours. Please reply with the information and we’ll be happy to reopen.
tiagoperrupato commentedon Oct 29, 2026
Thanks @burtenshaw. Here is what RFC 013 proposes on the three points, as revised on 2026-10-28 in #1256. Can you confirm them, or tell us what you would change? And if this issue should keep tracking the RFC, could you reopen it?
CurriculumSampleris offered as an example inexamples/; theTaskSamplerprotocol,SequentialSamplerandUniformSamplergo in core. The review on RFC 013: Task sampling and in-training evaluation #1256 agreed (open question 9). It can move to core if you prefer.TaskAPIClientin core: proposed as a separate class that returns untyped task specs and adds no methods toEnvClient, so the Task API guide's reason for keeping Task API methods out of the core clients still holds (D6). A trainer andopenenv evalneed one way to list the tasks of any environment, to hand them to a sampler or to the evaluation.resetand drives each turn withstep, while Harbor'srun_rolloutruns a whole agent in one tool call (open question 8).