Reinforcement Learning & Agentic Training

Train reasoning, coding, and multi-turn tool-using models on one GPU with 4-bit QLoRA or scale across multiple GPUs with decoupled asynchronous rollouts — no hosted accounts required.

Install the RL extra first:

pip install "actuator-train[cuda,rl] @ git+https://github.com/IluvatarLabs/actuator.git"

1. Two RL Execution Paths (Automatic by GPU Count)

Setup Command Architecture
1 GPU (--gpus 1) actuator train openai/gsm8k --goal grpo --reward trl:accuracy_reward Colocated ActuatorGRPOTrainer: chunked fp32 LoRA fold into colocated vLLM, zero-advantage group dropping, skipped redundant old-policy forwards. Fits 4B–8B QLoRA on a single 15–24 GB card.
2+ GPUs (--gpus 2+ or --async) actuator train vf:math-python --gpus 2 Decoupled Async Rollout Orchestrator: dedicated vLLM inference GPU(s) + concurrent asyncio multi-turn rollout pool + AdvRangeGate dynamic oversampling + exact token-level trajectory stitching ↔ DDP/FSDP2 trainer with clipped importance-sampling correction.

2. Quick Start: Math Reasoning on One GPU

actuator train openai/gsm8k \
  --model Qwen/Qwen3-4B \
  --goal grpo \
  --reward trl:accuracy_reward \
  --max-length 2048 \
  --no-enable-thinking \
  --low-memory \
  --out runs/qwen3-4b-math

Actuator evaluates the untouched base model and the RL-trained model on held-out GSM8K problems using an exact paired McNemar Verdict alongside greedy generation health checks.


3. Built-In Starter RL Environments (Zero Config)

Start training agents immediately without writing environment glue or provisioning sandboxes:

Environment Description
env:math-verify Exact symbolic and numeric math reasoning verified with math-verify
env:python-exec Sandboxed Python code execution against hidden unit tests
env:json-schema Strict JSON validity and recursive JSON Schema conformance
env:tool-call Multi-turn calculator, search, and KV-store function calling
env:sql-exec In-memory SQLite query generation verified against real query results
env:format-follow Verifiable structural and instruction-following constraints (IFEval-style)

Run any built-in environment directly:

actuator train env:python-exec --model Qwen/Qwen3-4B --low-memory --out runs/python-agent

4. Prime Intellect verifiers Environments (vf:)

Actuator natively loads verifiers-compatible single-turn and multi-turn environments via the vf: prefix:

actuator train vf:math-python --model Qwen/Qwen3-8B --gpus 2 --out runs/vf-math-python

Under the hood, Actuator's async rollout orchestrator runs concurrent asyncio episodes against your vLLM inference worker, stitches token IDs and logprobs directly (preventing re-tokenization drift across tool turns), filters zero-variance prompt groups via AdvRangeGate, and synchronizes updated weights to vLLM asynchronously.

See rl/grpo-verifiers-env.yaml.


5. Harbor Docker Container Sandboxes (harbor:)

Train software-engineering agents inside real Docker containers rewarded by each task's own test suite:

pip install "actuator-train[cuda,rl,harbor] @ git+https://github.com/IluvatarLabs/actuator.git"
actuator train harbor:terminal-bench-sample --model Qwen/Qwen3-8B --gpus 2 --out runs/harbor-agent

Container timeouts and transient failures are isolated per episode so a single bad container never crashes a multi-hour run. See rl/grpo-harbor-coding-agent.yaml.


6. Rewards: Verifiers, Custom Python & LLM-as-a-Judge

Actuator supports four composable reward sources (combine multiple with name1=0.7,name2=0.3):

  1. Built-in / TRL verifiers: trl:accuracy_reward (math-verify), format-invariants.
  2. Environment rewards: Automatic when using env:*, vf:*, or harbor:*.
  3. First-class LLM-as-a-Judge (judge:): Works with any OpenAI-compatible endpoint — local vLLM, local Ollama, or a cloud API key (OPENAI_BASE_URL / OPENAI_API_KEY) — with async retries, structured rubric parsing, and token/cost accounting:
actuator train my-prompts.jsonl \
  --model Qwen/Qwen3-4B \
  --goal grpo \
  --reward judge:openai/gpt-4o-mini \
  --eval judge:openai/gpt-4o-mini \
  --out runs/rubric-rl
  1. Custom Python function (FILE.py:FUNCTION):
# rewards.py
def concise_json_reward(completions, **kwargs) -> list[float]:
    import json
    scores = []
    for text in completions:
        try:
            obj = json.loads(text)
            scores.append(1.0 if isinstance(obj, dict) and len(text) < 400 else 0.3)
        except Exception:
            scores.append(0.0)
    return scores
actuator train prompts.jsonl --goal grpo --reward rewards.py:concise_json_reward

7. Online RL Curriculum & Entropy Control

Enable Actuator's optional ML-native RL controls in YAML or CLI to eliminate wasted steps and prevent mode collapse:

control:
  curriculum:
    filter_zero_variance: true      # drops 0%-pass and 100%-pass groups before AdamW steps
    target_pass_rate: [0.2, 0.8]    # prioritizes mid-difficulty prompts with highest learning signal
  adaptive_entropy:
    floor: 0.15                     # raises exploration / relaxes KL if policy entropy collapses
    factor: 1.2

For full multi-GPU RL examples, see recipes/catalog/rl/ and Notebooks 07 and 08.