Flight recorder + doctor for RL fine-tuning runs (GRPO/PPO): record everything, diagnose failures early.
Project description
rlprobe
Flight recorder + doctor for RL fine-tuning runs (GRPO / PPO and variants).
RL fine-tuning fails in ways that are slow, silent, and expensive: a run can look healthy on its loss curves for hours while the policy quietly collapses (entropy → 0), reward-hacks (padding answers for length), or escapes its reference model (KL blowup). rlprobe records a complete, replayable account of a training run at near-zero overhead, then diagnoses it against a catalog of 14 known failure signatures — live during training (with optional auto-halt) or post-hoc.
from rlprobe.integrations.trl import attach
trainer = GRPOTrainer(...) # your existing setup
attach(trainer, "runs/my-run") # ← one line
trainer.train()
$ rlprobe doctor runs/my-run
CRITICAL ENTROPY_COLLAPSE | onset ~step 212 | confidence 90%
entropy fell from ~2.31 to ~0.048 — the policy is (near-)deterministic and
exploration is dead, while reward has plateaued (classic collapse pair)
try:
• add/increase an entropy bonus
• raise the sampling temperature during rollouts
• check whether the reward is saturated (nothing left to explore for)
Install
pip install rlprobe[trl] # with the TRL integration
pip install rlprobe # core only (manual API + doctor; no torch needed)
What it does
- Flight recorder — per-step scalar metrics, per-sample forensics (prompts, completions, rewards, advantages, GRPO group ids), discrete events, and full run config, written to a self-contained run directory. Async writer, never blocks training, flushes on crash/SIGTERM, <2% step-time overhead, verified at 100k-step scale.
- Doctor — deterministic detectors (trend tests, sustained thresholds, changepoints — no ML magic) for 14 failure signatures: KL blowup, entropy collapse, length reward-hacking, format gaming, clip saturation, degenerate GRPO groups, advantage collapse, value divergence, NaN/grad pathology, truncation starvation, repetition spirals, reward-std death, positional KL asymmetry, throughput rot. Ranked findings with onset step, evidence, and remediations.
- Live guardian —
rlprobe watchtails a growing run and alerts (webhook support);attach(trainer, run_dir, halt=True)stops training automatically on critical, high-confidence findings. - Post-mortem suite —
rlprobe report(self-contained HTML),rlprobe diff(where did run B diverge from A?),rlprobe samples/rlprobe show(forensic queries down to individual completions). - Framework-agnostic core — the TRL callback is a thin layer over a manual API
(
Recorder.log_step / log_samples / log_event) that any training loop can call.
No GPU needed to try it — the synthetic run generator fabricates realistic pathological recordings:
rlprobe synth runs/demo --pathology entropy_collapse
rlprobe doctor runs/demo
rlprobe report runs/demo
Documentation
Full docs live in docs/ (mkdocs; pip install -e ".[docs]" && mkdocs serve): quickstart, the
failure-signature catalog — each signature explained as
RL-debugging documentation in its own right — the
recording format, and the
API & CLI reference.
Development
pip install -e ".[dev,trl]"
pytest
ruff check src tests examples benchmarks
Design history and phase-by-phase implementation notes: HANDOFF.md.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rlprobe-0.1.0.tar.gz.
File metadata
- Download URL: rlprobe-0.1.0.tar.gz
- Upload date:
- Size: 68.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5413655d0c605038c5a61aea0d4d759c8e84a355407728f7ff925c50a78732c6
|
|
| MD5 |
349e1e5eaaed5a9777579d297c4d77cd
|
|
| BLAKE2b-256 |
03f409df04129e97f7a9002429cbefffcf3b98df906fa7e28cece5f7ee7befd3
|
Provenance
The following attestation bundles were made for rlprobe-0.1.0.tar.gz:
Publisher:
release.yml on Nick-2908/rlprobe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rlprobe-0.1.0.tar.gz -
Subject digest:
5413655d0c605038c5a61aea0d4d759c8e84a355407728f7ff925c50a78732c6 - Sigstore transparency entry: 2180938590
- Sigstore integration time:
-
Permalink:
Nick-2908/rlprobe@8cf71082b7067da05f94dcd81dea66c2c955dbfa -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nick-2908
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf71082b7067da05f94dcd81dea66c2c955dbfa -
Trigger Event:
push
-
Statement type:
File details
Details for the file rlprobe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rlprobe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 60.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6bd91caaa81b5a04e06c78ada549c57dd70c968cbe6d070bf3184b728ff930c
|
|
| MD5 |
9d7aa98ccb7fef73eaa05c47fd35ae4f
|
|
| BLAKE2b-256 |
37b72e09d6dcc3071d832e520f6669daf3ca0930f65e8b59d24c4123d2fef9de
|
Provenance
The following attestation bundles were made for rlprobe-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Nick-2908/rlprobe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rlprobe-0.1.0-py3-none-any.whl -
Subject digest:
d6bd91caaa81b5a04e06c78ada549c57dd70c968cbe6d070bf3184b728ff930c - Sigstore transparency entry: 2180938746
- Sigstore integration time:
-
Permalink:
Nick-2908/rlprobe@8cf71082b7067da05f94dcd81dea66c2c955dbfa -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nick-2908
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf71082b7067da05f94dcd81dea66c2c955dbfa -
Trigger Event:
push
-
Statement type: