Skip to main content

Diagnose failed RL training runs from TensorBoard logs. No LLM, instant, free.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zen_rl-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zen_rl-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file zen_rl-0.1.0.tar.gz.

File metadata

  • Download URL: zen_rl-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for zen_rl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92b3d64c5507f288375feee37105e7ac5f5bf70603a8e77fda9dd7528d1a567a
MD5 4e2ced4ec4daceb6030f5e92e547ef1f
BLAKE2b-256 411b7eea3cfb8a6d0713547db2d348f4836b10c91d154a2c741a5231dac7ce31

See more details on using hashes here.

File details

Details for the file zen_rl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zen_rl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for zen_rl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9321bb63f6d11ac3f884ce112250dbd56762f68b750058f26aadb7930a5fc403
MD5 e0bf6986e2c510e5fe86888594ac4c04
BLAKE2b-256 cf8f940de84f88e45f6126b970214d3e8ff1faebcc2bcc5e38c1c3ab58dfa51e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page