zen-rl
Diagnose failed RL training runs from TensorBoard logs.
No LLM. No API key. No network. Instant.
pip install zen-rl
zen runs/my_experiment
LR_TOO_HIGH
Drop learning rate to 3e-4 and add a 500 step warmup, then rerun.
Evidence: train/approx_kl = 21.73 at step 4096
What it does
You point it at a TensorBoard log directory. It tells you what went wrong, shows you the number that proves it, and tells you what to try next.
Every claim cites a metric, a value, and a step. You can check its work.
What it detects
| Mode | Signature |
|---|---|
LR_TOO_HIGH |
approx_kl spikes above 5.0 |
POLICY_COLLAPSE |
entropy_loss hits ~0 and stops moving |
ADVANTAGE_NOT_NORMALIZED |
|policy_gradient_loss| above 1.0 |
DEAD_RUN |
final ep_rew_mean under 50 |
CAPPED_PERFORMANCE |
final ep_rew_mean between 50 and 250 |
When it finds nothing, it says so and lists what it checked. It does not claim your run is fine — only that these five things didn't fire.
Root cause, not symptom list
A high learning rate causes entropy collapse, which kills the run. That's one problem, not three. zen-rl reports the cause and suppresses the consequences.
Scope
Built and tested against PPO / Stable-Baselines3 / TensorBoard. Other algorithms and loggers may work if the metric names match.
Thresholds were derived from 16 deliberately broken CartPole runs. They are a starting point, not gospel — different environments will need different numbers. Issues and PRs welcome, especially with a log attached.
Why no LLM
The failure modes are deterministic. approx_kl = 21.7 means the same thing
every time. A model would be slower, cost money, and hallucinate. An
if-statement is the right tool.
Install
pip install zen-rl
Requires Python 3.11+.
Usage
zen path/to/run # diagnose a run
zen history # what zen has seen before
Status
Early. 5 failure modes, 24/24 on the internal eval set, zero false positives. The eval set is synthetic — runs broken on purpose. If you have a real failed run it gets wrong, that's the most useful bug report you can file.
License
MIT
Metadata
Release files for zen-rl 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zen_rl-0.1.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zen_rl-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / zen_rl-0.1.0.tar.gz
| Download URL | zen_rl-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92b3d64c5507f288375feee37105e7ac5f5bf70603a8e77fda9dd7528d1a567a
|
|
BLAKE2b-256 checksum How to use checksums |
411b7eea3cfb8a6d0713547db2d348f4836b10c91d154a2c741a5231dac7ce31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / zen_rl-0.1.0-py3-none-any.whl
| Download URL | zen_rl-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9321bb63f6d11ac3f884ce112250dbd56762f68b750058f26aadb7930a5fc403
|
|
BLAKE2b-256 checksum How to use checksums |
cf8f940de84f88e45f6126b970214d3e8ff1faebcc2bcc5e38c1c3ab58dfa51e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|