Alignment Data Quality and Rater Populations › A Deterministic Synthetic Experiment

Michael BrenndoerferNovember 29, 20264 min read
Language AI HandbookAll chapters
Part 38 of 67Scalable Oversight and Safety Training
Chapter 291Alignment Data Quality and Rater Populations › A Deterministic Synthetic Experiment
Reading section 7 of 17 · A Deterministic Synthetic Experiment · 4 minSection 7 of 17 · 4 min

Section 7 of 17 · 4 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

We now build a self-contained experiment that reproduces a composition-driven reversal and demonstrates a defensible reporting protocol. The synthetic groups are labeled G1 and G2. They are not stand-ins for any culture or demographic. They stand in for structured rater subgroups whose vote distributions differ: for example, two vendor teams, two skill bands, or two entry waves. The exercise will show what the data can and cannot tell us.

The experiment has three parts:

  1. Simulate two waves of rater votes with fixed per-group preference rates but different group-size mixes.
  2. Show that the pooled preference flips between waves while the generating probabilities stay fixed.
  3. Compute a target-weighted estimand with bootstrap confidence intervals and report it alongside the per-group rates and the naive pooled value.

Each synthetic person casts one Bernoulli vote with the probability assigned to that group. The simulation fixes the counts per wave and initializes the generator with seed 42. The subgroup probabilities remain the same, while observed fractions can fluctuate between draws.

PythonIn [5]
CollapseExpand
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

rng = np.random.default_rng(42)

# Population preference rates ("ground truth" of our synthetic world).
# Each value is P(rater in this group prefers response Y over response X).
group_p_Y = {"G1": 0.70, "G2": 0.40}

# Two recruitment waves with different group mixes.
wave1_sizes = {"G1": 900, "G2": 100}
wave2_sizes = {"G1": 100, "G2": 900}


def simulate_wave(sizes, true_rates, rng, wave_label):
    rows = []
    for g, n in sizes.items():
        votes = rng.binomial(1, true_rates[g], size=n)
        for i, v in enumerate(votes):
            rows.append(
                {
                    "wave": wave_label,
                    "group": g,
                    "rater_id": f"{wave_label}-{g}-{i:05d}",
                    "vote_prefer_Y": int(v),
                }
            )
    return pd.DataFrame(rows)


df1 = simulate_wave(wave1_sizes, group_p_Y, rng, "W1")

df2 = simulate_wave(wave2_sizes, group_p_Y, rng, "W2")

votes = pd.concat([df1, df2], ignore_index=True)
ConsoleOut [6]
CollapseExpand
wave  group
W1    G1       900
      G2       100
W2    G1       100
      G2       900
Name: n_votes, dtype: int64

Total rows: 2000

Wave 1 draws 900 votes from G1 and 100 from G2. Wave 2 swaps those counts and draws fresh votes from the same group probabilities. The design isolates the composition effect on the expected pooled rate. Realizations still vary with sampling.

Both the direct calculation and the bootstrap use the same cleaned table. In this example each independent rater contributes one row, with a known group label and a valid binary vote. The helper rejects missing or invalid entries instead of silently giving the two procedures different input rows.

PythonIn [7]
CollapseExpand
def validate_vote_rows(df):
    """Require a nonempty table with a known group and binary vote per row."""
    groups = df["group"]
    has_blank_group = groups.map(
        lambda value: isinstance(value, str) and not value.strip()
    )
    if df.empty or groups.isna().any() or has_blank_group.any():
        raise ValueError(
            "Every vote requires a known group in a nonempty table."
        )
    if not df["vote_prefer_Y"].isin([0, 1]).all():
        raise ValueError("Every vote must be either 0 or 1.")


def summarize(df):
    validate_vote_rows(df)
    pooled = df["vote_prefer_Y"].mean()
    by_group = df.groupby("group")["vote_prefer_Y"].mean()
    sizes = df.groupby("group").size()
    return pooled, by_group, sizes


pooled_w1, group_w1, size_w1 = summarize(df1)
pooled_w2, group_w2, size_w2 = summarize(df2)
ConsoleOut [8]
CollapseExpand
Wave 1:
  pooled P(prefer Y) = 0.667
  group rates       = {'G1': np.float64(0.699), 'G2': np.float64(0.38)}
  group sizes       = {'G1': np.int64(900), 'G2': np.int64(100)}

Wave 2:
  pooled P(prefer Y) = 0.434
  group rates       = {'G1': np.float64(0.71), 'G2': np.float64(0.403)}
  group sizes       = {'G1': np.int64(100), 'G2': np.int64(900)}

The observed pooled rates are 0.667 and 0.434. In the model that generated the votes, the pooled probabilities are 0.9(0.70)+0.1(0.40)=0.670.9(0.70)+0.1(0.40)=0.67 and 0.1(0.70)+0.9(0.40)=0.430.1(0.70)+0.9(0.40)=0.43. The group probabilities stay fixed while the sample weights change. The observed group fractions vary because each wave draws new votes.

VisualizationOut [9]
CollapseExpand
Bar chart of pooled P(prefer Y) in Wave 1 versus Wave 2; the two bars fall on opposite sides of 0.5.
The sampled majority moves from Y in Wave 1 to X in Wave 2 as the two strata change in relative size. The generating probability for each group is fixed across waves.

The pooled rate estimates preference in the recruited mixture. If the deployment target uses different weights and preferences vary by group, the two estimates can differ. The pooled intervals are narrower in these two simulated waves. In Wave 1 the widths are 0.0560 for the pooled estimate and 0.0995 for equal group weights. In Wave 2 the corresponding widths are 0.0620 and 0.0950. The width depends on how you weight each group and how much uncertainty each group contributes.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy