Files
trinity-rl/envs/decensor/README.md
T
carstenandClaude Opus 5.5 609e832572 Move to current prime-rl, verifiers and renderers; DeepSeek V4.1 support
Bump prime-rl to trinity-dsv41: upstream main, PR #4057 (DeepSeek V4.1
Flash) with the engram port onto the shared n-gram module, and renderers
tracking its trinity-dsv41 branch (v0.2.0 + the Hermes parser).

Port the envs to the current verifiers v1 API, rl.toml to the new config
schema (IPO loss kept as the new default), and bootstrap/launch/prepare
scripts to the new layout.

Decensor now runs DecensorEnv: the simulated user writes reviewed
follow-ups up to each row's target_turns and every assistant turn is
judged. Earlier runs trained on the first turn only.
tests/test_multiturn_env.py drives the full loop against a mock endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:39:44 +00:00

2.8 KiB

decensor_v1

The agentic-review Decensor environment for the modern verifiers v1 API. It is a multi-turn rollout with a simulated Gemma user, structured per-turn Gemma reviews, and a multiplicative refusal/quality/length reward.

What it does

  • Loads NewEden/RL-seed-Decensor-Difficulty, selecting one of easy, medium, or hard and stratifying examples by harm type. System prompts come from the V2 Markdown, plaintext, and style datasets.
  • Samples one to six model turns with a geometric decay, then uses a validated follow-up simulator. Follow-up generation has three attempts, deterministic per-task seeds, and a structured semantic review before a message is accepted.
  • Reviews every assistant turn with structured tool calls. Reviews include visible-answer clarity, reasoning-trace clarity, safety/policy discussion, refusal severity, markdown, and meta-commentary signals. Service failures are recorded as unscored rollouts.
  • Logs the transcript, review attempts, aggregation, response-validation reason, and every numeric reward factor in trace.info and trace metrics.

Configuration defaults

DecensorTasksetConfig defaults to 2,000 examples, seed 42, easy difficulty, six maximum turns, 25% style prompts, 50% Markdown prompts, and enabled length prompts. The task config uses the shared Gemma endpoint (google/gemma-4-26B-A4B-it) for both the simulated user and judge. Judges use temperature 0, min_p=0.05, thinking disabled, 1,024 output tokens, and a 24-request concurrency cap; the user uses temperature 1, min_p=0, 256 output tokens, and the same cap.

The working Trinity configuration is configs/rl.toml. It keeps the taskset ID decensor-v1, so replacing an existing installation with this package selects the new implementation without changing the run's environment name.

Install

uv pip install ./envs/decensor

The package exports DecensorTaskset and DecensorEnv. Without an env.id, verifiers runs DecensorEnv: the assistant role (env.assistant.*) and the simulated user alternate for up to the row's target_turns; configs/rl.toml runs it this way. Runs under verifiers b13ba60 (including 2026-09-15) never loaded DecensorEnv and trained on one assistant turn per row. tests/test_multiturn_env.py drives the full loop against a mock endpoint.

Runtime notes

  • The Trinity run uses the null harness on the subprocess runtime. DecensorUser keeps its own transcript of the conversation.
  • A rollout that hits its wall-clock timeout (agent_timeout) is rejected as truncated, as the old harness_timeout stop was.
  • Set VLLM_API_KEY in the environment of each env-worker process. Dataset and prompt sources are fetched from Hugging Face at runtime; no data is vendored here.
  • Run pytest envs/decensor/tests before launching a run.