# natolambert/rlhf-book

Textbook on reinforcement learning from human feedback

Repository: https://github.com/natolambert/rlhf-book
Canonical: https://ross.abutalabs.com/products/rlhf-book
Homepage: https://rlhfbook.com/
Language: Python
License: NOASSERTION
License Family: other
Topics: ai, alignment, rlhf
Last push: 2026-08-21T11:09:09+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 96, longevity 59
- inputs: {"age_days": 831, "days_push": 12, "days_rel": 26, "gap_med": 18, "n_releases_24m": 12}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2345, forks 254 (observed 2026-08-28T04:06:39.699961+00:00)

## What it is
An open-source textbook on Reinforcement Learning from Human Feedback (RLHF) and LLM post-training, available online and in print, with companion reference code implementations. It covers instruction tuning, reward modeling, policy gradients (PPO, GRPO, DPO), rejection sampling, and distillation.

## Use cases
- learn how RLHF works from first principles
- understand LLM post-training techniques like DPO and PPO
- study reference implementations of reward model training
- prepare for a career in LLM alignment or fine-tuning
- find a canonical reference for rejection sampling and GRPO
- teach a course on language model alignment

## When to choose
- you want a comprehensive, curated introduction to RLHF and post-training
- you need runnable reference code for RLHF algorithms
- you prefer learning from a structured book with a community and course materials

## When to avoid
- you need a production-ready RLHF training framework
- you want a maintained software library with API stability guarantees
- you need hands-on tooling rather than conceptual explanations

## Facets
- artifact type: learning-resource
- maturity: active
- function: machine-learning, llm-training, developer-tools
- domain: large-language-models, machine-learning, tutorials, education
- platform: python, cross-platform
- tags: rlhf, post-training, textbook, reinforcement-learning, preference-learning, open-source-book

## Member repositories
- natolambert/rlhf-book (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:39.699961+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:37:03.249560+00:00, confidence not recorded.
  - readme: https://github.com/natolambert/rlhf-book (fetched 2026-08-28T04:06:39.699961+00:00, sha 1cdbf3dd5dcc)
  - homepage: https://rlhfbook.com/ (fetched 2026-08-29T10:17:38.010613+00:00, sha 9d4b17ddb257)
- Data as of 2026-08-30T08:39:29.467469+00:00.
