InstructGPT reports how often its labelers agree with each other, and tests whether a reward model fits only the people who labeled its training data: labelers are split into 5 groups with about the same amount of data, a reward model is trained on 4 groups, and its accuracy on the held-out group is compared with its accuracy on held-out comparisons from the training groups. Rebuild that experiment with a linear reward model.
agreement_rate(judgments)
judgments: list of (comparison_id, labeler, choice) with choice 0 or 1 (which of the two outputs was preferred) or None for a tie. Leave out ties. For every comparison with at least two remaining judgments, consider every unordered pair of its labelers; they agree when their choices are equal. Return (rate, n_pairs): the fraction of agreeing pairs rounded to 4 decimals and the number of pairs ((0.0, 0) when there are none).labeler_groups(counts, n_groups=5)
counts: dict labeler -> number of training comparisons. Visit labelers by decreasing count (ties by labeler name) and put each into the group with the smallest total so far (the lowest group index on ties). Return a dict labeler -> group index.train_linear_rm(features, pairs, steps=300, lr=0.5)
features: array (C, D), one row per completion; the reward is . pairs: list of (winner, loser) completion indices. Start from and take steps full-batch gradient-descent steps on . Return as a NumPy array.heldout_labeler_accuracy(features, comparisons, groups, held_out, steps=300, lr=0.5)
comparisons: list of (labeler, winner, loser, split) with split "train" or "valid". Train on the "train" comparisons of labelers whose group is not held_out. Return (in_group, held_out_acc): the accuracy (fraction with strictly, rounded to 4 decimals) on the "valid" comparisons of labelers outside the held-out group, and on the "valid" comparisons of the held-out group's labelers.labeler_cross_validation(features, comparisons, n_groups=5, steps=300, lr=0.5)
counts from the "train" comparisons, form the groups, and run heldout_labeler_accuracy with each group held out in turn. Return a dict {"in_group": [...], "held_out": [...], "mean_in_group": ..., "mean_held_out": ...} (lists in group order, means rounded to 4 decimals).