{"data":{"kind":"file","path":"README.md","version_id":"dlrmm6kg5da7m7bu5ftaec2r","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2844,"modified_at":"2026-08-28T17:07:52.589000","content_hash":"5cd1122def8281384bd0cd6f8d1fc9fa83d425e0c7401b5d1b5ea8023b1c8b78"},"entries":[],"content":"# if-rlvr — verifiable instruction following\n\nReinforcement-learning environment for **precise instruction following with\nverifiable rewards**. Prompts come from\n[`allenai/IF_multi_constraints_upto5`](https://huggingface.co/datasets/allenai/IF_multi_constraints_upto5)\n(~95k multilingual instructions, each carrying 1–5 verifiable constraints — the\nIF-RLVR training set of *Generalizing Verifiable Instruction Following*,\nPyatkin et al. 2025). Each answer is checked with the **official IFEvalG\nconstraint checkers** from `allenai/open-instruct` (vendored, 54 constraint\ntypes, 100% coverage of the dataset's constraint ids) — no LLM judge.\n\n## Reward\n\n- `constraints_satisfied` (weight 1.0): fraction of the prompt's constraints the\n  final message satisfies, IFEval-*strict* (the raw final reply is checked, no\n  loose transformations). Continuous in [0, 1] — a smooth GRPO signal even when a\n  prompt has five constraints.\n- `all_satisfied` (metric): 1.0 iff every constraint is satisfied — the\n  IFEval-style prompt-level strict accuracy, logged for monitoring.\n\nNative `<think>…</think>` blocks and stray `<tool_call>` markup are stripped\nbefore checking; only the answer is scored.\n\n## Configuration\n\n| key | default | meaning |\n|---|---|---|\n| `split` | `train` | `train` (everything but the holdout) or `holdout` |\n| `holdout_size` | `500` | prompts reserved for evaluation, taken after a seeded shuffle |\n| `num_examples` | `-1` | cap on tasks (`-1` = all) |\n| `seed` | `0` | seed of the shuffle that defines split and order |\n| `use_think_tool` | `false` | expose a no-op `think(thought)` tool for drafting/verifying before answering (needs a harness with MCP tool support) |\n\nThe `train` split is deliberately huge relative to typical RL budgets: 100 GRPO\nsteps of 64 prompts see ~6% of one epoch, so every prompt is fresh and the\nin-training holdout reward measures generalization rather than memorization.\n\n## Usage\n\n```bash\nprime env install hugoabonizio/if-rlvr\n```\n\nWith the released `verifiers` (0.1.x) — what `vf-eval` uses:\n\n```bash\nvf-eval if-rlvr -n 100 -a '{\"split\": \"holdout\"}'\n```\n\n```python\nimport verifiers as vf\nenv = vf.load_environment(\"if-rlvr\", split=\"train\", use_think_tool=False)\n```\n\nWith verifiers v1 (GitHub main), the package also exports the `IFRLVRTaskset`\ntaskset: `uv run eval if-rlvr -n 200 --env.taskset.split holdout`. For training\nwith prime-rl, point the train source at `if-rlvr` (split `train`) and an eval\nsource at the same taskset with `split = \"holdout\"`.\n\n## Licenses / attribution\n\n- Dataset and checkers: Allen Institute for AI — `IF_multi_constraints_upto5`\n  and `open_instruct/IFEvalG` (Apache-2.0; the checkers derive from Google's\n  IFEval, Apache-2.0). The vendored copy under `if_rlvr/ifevalg/` only has its\n  import paths changed.\n- This environment: Apache-2.0.\n","encoding":"utf-8","truncated":false,"total_bytes":2844},"status":null}