# Hh Preference Eval

> Evaluates a model's ability to rank pairs of dialogue responses according to human preferences for helpfulness and harmlessness. It probes the model's alignment capabilities by measuring how well it captures human judgments on multi-turn conversations. Use when the user wants to benchmark on HH (Helpful and Harmless) Preference, or asks about evaluating this task. Reports accuracy.

- Skill: `qhjqhj00/hh-preference-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/hh-preference-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/hh-preference-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/hh-preference-eval

---


# hh-preference-eval

> Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback — Bai et al. (2022) (arXiv:2204.05862, 2022)

## What this evaluates

Evaluates a model's ability to rank pairs of dialogue responses according to human preferences for helpfulness and harmlessness. It probes the model's alignment capabilities by measuring how well it captures human judgments on multi-turn conversations.

## Datasets

- **HH (Helpful and Harmless) Preference** — total ?; splits: test (-1); repo https://github.com/anthropics/hh-rlhf

## Metrics

- `accuracy` **(primary)** — range: [0, 1]
  - Fraction of test instances where the model's predicted score for the human-preferred response exceeds that of the dispreferred response. Reported separately for helpfulness and harmlessness subsets, and as an unweighted mean.

## Input / output format

**Input**: A multi-turn dialogue prompt alternating between Human and Assistant, always starting and ending with Human, followed by two candidate assistant responses.

**Output**: A scalar score for each response, computed by appending a special 'end-of-context' token and predicting a value on top of it.

## Scoring recipe

```python
correct = 0
for prompt, resp_A, resp_B, preferred in dataset:
    score_A = model(prompt, resp_A)
    score_B = model(prompt, resp_B)
    if (score_A > score_B and preferred == A) or (score_B > score_A and preferred == B):
        correct += 1
accuracy = correct / len(dataset)
```

## Common pitfalls

- Preference models are only trained to evaluate the final response, but the full conversation context is provided, which may bias scores.
- Scaling behavior differs sharply between helpfulness and harmlessness datasets, making cross-dataset accuracy comparisons misleading.
- Training is limited to one iteration to prevent overfitting, which can cap performance on larger models.

## Evidence (verbatim from paper)

> Our preference models are trained on comparison data, with each data point consisting of a prompt and a pair of responses. The prompt is a multi-step dialogue between human and model that always begins and ends on the human side, and each response is a continuation of the dialogue. The PM then assigns a score at the end of each response. We show learning curves on the helpfulness test set when training on a mix of static helpful and harmless data. (right) Learning curves on the harmfulness test set. Accuracy can be roughly fit by Accuracy ≈ 0.72 + 0.007 log(P/10^11) + 0.015 log(D/(8·10^4))

## Citation

```bibtex
@misc{bai2022helpfulharmless,
  title={Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback},
  author={Bai et al. (2022)},
  year={2022},
  note={arXiv:2204.05862}
}
```

- arXiv: 2204.05862

