lm-human-preferences is the official OpenAI codebase that implements the method from the paper Fine-Tuning Language Models from Human Preferences. Its purpose is to show how to align language models with human judgments by training a reward model from human comparisons and then fine-tuning a policy model using that reward signal. The repository includes scripts to train the reward model (learning to rank or score pairs of outputs), and to fine-tune a policy (a language model) with reinforcement learning (or related techniques) guided by that reward model. The code is provided “as is” and explicitly says it may no longer run out-of-the-box due to dependencies or dataset migrations. It was tested on the smallest GPT-2 (124M parameters) under a specific environment (TensorFlow 1.x, specific CUDA / cuDNN combinations). It includes utilities for launching experiments, sampling from policies, and simple experiment orchestration.

Features

  • Training a reward model from human preference comparisons
  • Fine-tuning a policy (language model) guided by the reward model
  • Sampling / inference utilities to generate outputs from the trained policy
  • Experiment orchestration (launch.py) to combine stages (reward + policy)
  • Label handling and mapping from human comparisons to scalar reward signals
  • Support for small GPT-2 (124M) model as reference environment

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow LM Human Preferences

LM Human Preferences Web Site

Other Useful Business Software
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of LM Human Preferences!

Additional Project Details

Programming Language

Python

Related Categories

Python Large Language Models (LLM)

Registered

2025-10-03