Skip to content

LongProc RL driver: long procedural generation with verifiable rewards - #6

Open
mmjerge wants to merge 7 commits into
experimentsfrom
rl-longproc
Open

LongProc RL driver: long procedural generation with verifiable rewards#6
mmjerge wants to merge 7 commits into
experimentsfrom
rl-longproc

Conversation

@mmjerge

@mmjerge mmjerge commented Aug 10, 2026

Copy link
Copy Markdown
Owner

GRPO/RLOO on LongProc

Driver for the candidate genuinely hard flagship task (per docs/RL_STATUS_REPORT.md): LongProc long procedural generation, integrated as an RL environment.

Why LongProc:

  • Outputs are 0.5k–8k tokens and rule-checkable (row-F1 for html_to_tsv, constraint satisfaction for travel_planning, exact trace checks for tom_tracking/countdown) — the evaluators serve directly as RLVR rewards, no style-gaming possible.
  • Base models genuinely struggle (base-7B capability probes queued on the idle box, gating before any training spend).
  • Long decode stresses cache eviction during generation — the HELMET QA campaigns (long prefill, 32-token decode) never touch this regime, so it's new scientific ground for the eviction analysis.

Contents: examples/grpo_longproc.py — RLOO/GRPO training + --eval-only probe mode; deterministic train/eval partition; reward = each task's primary metric with crash-safe scoring; memory defaults match the validated 7B/48GB recipe (paged 8-bit AdamW, group 4 x 2 accumulated prompts). Verified locally: reference output scores 1.0, garbage scores 0.

Setup: git clone --depth 1 https://github.com/princeton-pli/LongProc.git repos/longproc (data ships in-repo, ~100MB; repos/ is gitignored).

… rewards)

LongProc outputs are 0.5k-8k tokens and rule-checkable (row-F1 for
html_to_tsv, constraint satisfaction for travel_planning, ...), so the
programmatic evaluators serve directly as RLVR rewards -- and the long
decode exercises cache eviction during *generation*, a regime the HELMET
QA campaigns (long prefill, 32-token decode) never touch. Includes
--eval-only for base-model capability probes; memory recipe defaults
match the validated 7B/48GB configuration.
…ature 0.7)

At temperature 1.0 no sampled rollout produces the strict fenced output
format the checkers require, so the primary metric is 0.0 for every group
member and RLOO has no gradient (observed: 30+ steps of all-zero rewards
while greedy eval scores 0.157). Shape the training reward with a small
bonus on the evaluator's extraction_rate (format adherence) and default
rollout temperature to 0.7. Eval stays unshaped greedy.
…c key

Evaluators follow HELMET's convention of eval_fn(prediction, full_record);
passing record['item'] crashed travel_planning's checker, and the crash
guard scored it 0.0 -- the earlier capability-gate exclusion of
travel_planning was OUR bug, not model incapability (reference output
scores accuracy 1.0 through the fixed path). countdown/travel_planning
return 'accuracy', not 'success'. html_to_tsv accepts both record forms,
so the in-flight html runs are unaffected.
… ahead

Port of upstream PR awslabs#149 onto the RL branch:
- _unpack_from_annotation walks the scatter/cat annotation chain across
  multi-chunk gaps, parking early-applied intermediate states
- grpo_step passes may_match_twice=may_match_twice_flex_attention_sdpa
  (kept alongside the KV_DEBUG_ANNOTATIONS tracing hook)
- regression test for chunk gaps 1/2/4

Unblocks long-generation runs (lm32k, lp*_html).
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