Skip to content

Feature/rltraining grpo example - #226

Open
deepak-vij wants to merge 2 commits into
agent-infra:mainfrom
deepak-vij:feature/rltraining-grpo-example
Open

Feature/rltraining grpo example#226
deepak-vij wants to merge 2 commits into
agent-infra:mainfrom
deepak-vij:feature/rltraining-grpo-example

Conversation

@deepak-vij

Copy link
Copy Markdown

Title

feat(example): add GRPO RL training example with sandboxed rollout grading

Body

Summary

Adds examples/RLTraining, an example that uses AIO Sandbox as the reward
environment
for reinforcement learning rather than just as a code-execution
target.

It fine-tunes Qwen/Qwen2.5-Coder-1.5B-Instruct with GRPO (TRL), where the
reward comes from actually running each generated solution against hidden
tests inside the sandbox. Every rollout is graded in its own process-level
sandbox via nono run --allow-cwd, so generated code is confined to its
working directory and one bad generation cannot corrupt the environment that
grades the next one.

Completions are scored on a -1.0 to +1.0 scale:

Reward Condition
+1.0 ALL_TESTS_PASSED
-0.5 AssertionError or runtime traceback
-1.0 SyntaxError or execution failure

Contents

  • train_grpo.py — the training script and reward function
  • README.md, pyproject.toml — standard example scaffold
  • Dockerfile — sandbox image with the nono CLI added, since the stock
    image does not ship it and the example requires it
  • Registered in the examples/README.md index

Testing

Ran end-to-end against a locally built sandbox image (nono 0.61.1):

  • Completed with exit code 0; two full training passes averaged 181s
  • 64 rollouts graded: 46 × +1.0, 10 × -0.5, 8 × -1.0
  • All three reward branches exercised against the live sandbox

Notes

  • No breaking changes; additive only.

…ading

Adds examples/RLTraining/train_grpo.py, a GRPO fine-tuning demo that uses
AIO Sandbox as the reward environment. Each rollout writes the candidate
solution and its hidden tests into the sandbox and executes them under
`nono run --allow-cwd`, so every rollout is graded inside its own
process-level sandbox. Completions are scored on a -1.0 to +1.0 scale
based on whether the tests passed, failed, or crashed.
Brings the RLTraining example in line with the other examples: adds the
uv project definition, a README covering the reward shaping and why each
rollout is sandboxed, and registers it in the examples index.

Also adds a Dockerfile, since this example requires the nono CLI inside
the sandbox and the stock image does not ship it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant