Thriving Thriving Python PY
โ†‘ 54 ?
rlpost Mattral/rlpost

LLM post-training from scratch: SFT, reward model, PPO, DPO; parity-tested against TRL

HEALTH ? 78 / Stable
// solo builder// hidden gem dpolarge-language-modelsllm-alignmentmachine-learningpolicy-optimizationpporeinforcement-learning-from-human-feedbackreward-modelingrlhf ?

// readme

rlpost

Code for language-model post-training: supervised fine-tuning, a reward model, PPO, and DPO.

The repository was formerly Improving-LLM-Models-with-RLHF-PPO-DPO.

Measured scope

Unit-tested on CPU. No GPU benchmark yet.

Check on 2026-10-30, Python 3.12, torch 2.15.0+cpu, PYTHONPATH=src:

  • pytest -q -m "not slow and not gpu" collects 80 tests: 69 passed, 11 failed.
  • The 11 failures are DPO and PPO tests. A judgment on each one is in ROADMAP.md under S0.6. They are not marked xfail.
  • ruff check . and ruff format --check . pass under the config in pyproject.toml.

Recount after you change tests:

PYTHONPATH=src pytest --collect-only -q

There is no coverage number in this README. A green coverage run has not been recorded.

What is in the tree

PathWhat it is
src/rlpost/config.pyPydantic configs. TrainingConfig.toy_mode() and from_yaml. Tested in tests/test_config.py.
src/rlpost/ops.pygather_logprobs: logits at position t score token t+1. Shape [B, T, V] in, `[B,โ€ฆ