liveBook · Manning

Ranked-preference dataset

As explained in Deep Learning with R, Third Edition

A ranked-preference dataset is a collection of prompts and candidate responses ordered according to human judgments of response quality.

A ranked-preference dataset contains prompts and several candidate responses, ordered by human judgments from most helpful to least helpful. It provides preference signals without requiring people to write every ideal response. section 16.4.1

A typical dataset can combine:

Listing 16.15 Pseudocode for the simplest possible RLHF algorithm
for (prompts in dataset) {
  responses <- model$generate(prompts)  #1
  rewards <- reward_model |> predict(responses)  #2
  good_responses <- responses[rewards > cutoff]
  model |> fit(good_responses)  #3
}

The rankings train a reward model, whose scores can filter or guide generated responses during reinforcement learning. section 16.4.1

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines collection and downstream use, but does not detail annotation protocols or ranking methodology.
Examples
Uses handwritten, model-generated, and chatbot-generated responses ranked by helpfulness.
What you can do after
Build it from scratch by collecting candidate responses and having evaluators rank them by preference.
How it connects
Links prompts and responses to reward models, reinforcement learning, and supervised fine-tuning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.