Skip to main content

Reward Modeling

Train reward models that score text responses for use in PPO/RLHF training.
Important: Reward models are NOT text generators. They output a scalar score for a given text, used to provide rewards during PPO training. You cannot use a reward model as a normal LLM for text generation.

Quick Start

Python API

Data Format

Reward training requires preference data with three columns:

Example Data

Required Parameters

Reward training requires all three column parameters to be specified:
  • --prompt-text-column
  • --text-column (for chosen responses)
  • --rejected-text-column

Parameters

Output Model

The trained model is an AutoModelForSequenceClassification that:
  • Takes text input
  • Returns a scalar reward score
  • Higher scores indicate better responses
  • Used as input to PPO training via --rl-reward-model-path

Using the Reward Model

With PPO Training

Direct Inference

Best Practices

  1. Quality preference data - The reward model is only as good as your annotations
  2. Diverse examples - Include varied prompts and response quality levels
  3. Clear preference signals - Chosen should be clearly better than rejected
  4. Balanced dataset - Avoid bias toward certain response types
  5. Sufficient data - Aim for 1,000+ preference pairs minimum

Example: Building Preference Data

Next Steps

PPO Training

Use your reward model

DPO Training

Direct preference optimization