LLM post-training from scratch: SFT, reward model, PPO, DPO; parity-tested against TRL
HEALTH ? 78 / Stable
LLM post-training from scratch: SFT, reward model, PPO, DPO; parity-tested against TRL
// readme
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.
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.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.
| Path | What it is |
|---|---|
src/rlpost/config.py | Pydantic configs. TrainingConfig.toy_mode() and from_yaml. Tested in tests/test_config.py. |
src/rlpost/ops.py | gather_logprobs: logits at position t score token t+1. Shape [B, T, V] in, `[B,โฆ |