Debiasing Crowd Ratings with a Hierarchical Rater Model
Statistics & ExperimentsModel answerLast updated
Build a latent-quality estimator for ads scored by uncalibrated reviewers, quantify uncertainty, and rank by a confidence-adjusted score.
Context
You run an ad-quality ranking pipeline. A pool of about 100 human reviewers each scored roughly 100 ads on a 1–10 scale, producing around 10,000 ratings spread over roughly 1,000 ads (so ~10 ratings per ad on average, and the rating matrix is sparse). Reviewers are not calibrated against each other: some are systematically harsh or lenient (shifted means), some use only a narrow band of the scale (compressed range), and some are simply erratic (high noise). Because of this, the plain average of an ad's raw scores is a biased estimate of its true quality.
Your Task
- Specify a statistical model that separates each ad's latent quality from each reviewer's additive bias, multiplicative scale/sensitivity, and noise level.
- Explain how you compute the uncertainty of each ad's estimated quality, paying special attention to ads with few or mutually inconsistent ratings.
- Define a single ranking score per ad that trades off estimated quality against confidence in that estimate.
Input / Output
- Input: a ratings table with columns
[ad_id, reviewer_id, score]. - Output: a function
Q(ad_id)returning a de-biased, confidence-adjusted quality score usable for ranking.
Constraints and Edge Cases
- Treat reviewer harshness as an additive shift and reviewer range as a multiplicative factor on quality.
- Handle sparsity and low-count ads gracefully (no divide-by-zero, sensible fallback).
- Handle the identifiability problem: the model must be pinned down so quality, bias, and scale are separately estimable.
- Prefer a principled probabilistic estimator over hand-tuned per-reviewer re-weighting.
- Be explicit about what happens when the ad–reviewer graph is disconnected (a cluster of ads rated only by its own cluster of reviewers).
Hints
Hint 1
Write down a generative equation for the observed score with three separate terms: a global level, a reviewer shift, and a reviewer-scaled version of the ad's latent quality.
Hint 2
Adding a prior on the latent quality (e.g. standard normal) is what produces shrinkage and also resolves the scale/shift ambiguity between quality and reviewer parameters.
Hint 3
Conditioning on reviewer parameters gives a closed-form Gaussian posterior for each ad; its precision grows with the number and informativeness of its ratings, and that precision is exactly the uncertainty you need.
Hint 4
For ranking, a lower credible bound (posterior mean minus ~2 posterior SDs) naturally demotes ads with thin or noisy evidence.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What is really being tested
This is a measurement-model question disguised as a ranking question. The interviewer wants to see (a) a generative model that cleanly separates ad quality from reviewer behavior, (b) correct reasoning about identifiability and uncertainty, and (c) a ranking rule that does not reward lucky low-sample ads. Shortcuts like "z-score each reviewer's ratings and average" are worth mentioning only to explain why you are not doing them.
Step 1: Read the data geometry
- Reviewer parameters are well determined: ~100 ratings each.
- Ad parameters are weakly determined: ~10 ratings each, some far fewer, so shrinkage will matter most for ads.
- Check connectivity of the bipartite ad–reviewer graph. If a set of ads is only ever rated by a set of reviewers who rate nothing else, then "harsh reviewers" and "bad ads" are confounded within that island; you can only estimate quality relative to a reference. Practical fixes: anchor one reviewer's parameters, or report quality relative to the connected component's mean, or flag the component.
Step 2: The model
Treat the observed score as the outcome of a generative process:
y_ij = μ + b_j + s_j · q_i + ε_ij, ε_ij ~ N(0, σ_j²)
- q_i: latent quality of ad i (the target)
- b_j: additive bias of reviewer j (harsh ⇒ b_j < 0)
- s_j: sensitivity/scale of reviewer j (> 0; small ⇒ compressed range)
- σ_j: reviewer-specific noise (inconsistent raters)
Identifiability. The likelihood is invariant under q → a·q + c with compensating changes to s_j and b_j. Pin it down with priors:
- q_i ~ N(0, 1)
- b_j ~ N(0, τ_b²)
- log s_j ~ N(0, τ_s²) (log-normal keeps s_j positive, killing the sign flip)
- σ_j ~ half-normal or inverse-gamma
Put hyperpriors on τ_b, τ_s so the data decide how heterogeneous reviewers are. This is a Bayesian hierarchical model — equivalently a mixed-effects model with random reviewer intercepts and slopes, or a one-factor continuous-response IRT model.
Refinement worth naming: scores are ordinal with floor/ceiling effects. An ordered-probit likelihood with reviewer-specific cutpoints absorbs both bias and range more faithfully. The Gaussian version is fine as a first pass.
Step 3: Fitting and where shrinkage comes from
Fit with NUTS (Stan/PyMC) — ~1,200 parameters and 10k rows is seconds-to-minutes. Variational inference or alternating MAP/EM works if you need speed.
Conditioning on reviewer parameters makes the mechanism transparent. The posterior for q_i is Gaussian with
prec_i = 1 + Σ_{j∈R(i)} s_j²/σ_j² q̂_i = (1/prec_i) · Σ_{j∈R(i)} s_j (y_ij − μ − b_j)/σ_j² Var(q_i) = 1/prec_i
Each ingredient maps to a requirement:
- Subtract b_j → bias correction.
- Divide through by s_j and weight by s_j²/σ_j² → scale correction; discriminating, consistent reviewers count more, noisy or compressed ones count less. This weight is derived from the likelihood, not hand-tuned.
- The leading "1 +" is the prior pulling the estimate toward the population mean — the shrinkage that protects low-count ads.
- Var(q_i) falls with both the number and the informativeness of ratings — that is the uncertainty measure.
Inconsistent ratings. If reviewers disagree on an ad beyond what σ_j predicts, the Gaussian posterior understates uncertainty. Fixes: Student-t likelihood (robust to outliers), or add an ad-level variance ω_i² so σ_ij² = σ_j² + ω_i² ("controversial" ads get wider intervals). Full MCMC also propagates uncertainty in b_j and s_j into q_i, which the conditional formulas above ignore.
Step 4: Ranking metric
Rank by a lower credible bound:
Q(i) = q̂_i − k · sd(q_i), e.g. k ≈ 1.96 (2.5th posterior percentile)
An ad with three glowing ratings will not outrank an ad with fifteen consistently strong ones; the knob k sets risk aversion. Shrinkage penalizes thin data once, and the lower bound deliberately penalizes it again for decision risk. Alternatives: posterior probability that ad i is in the top-K (best when the decision is a cutoff), expected rank, or a Thompson-sampling-style draw for exploration.
Step 5: Reference implementation (alternating MAP)
import numpy as np
def fit_ad_quality(ad, rev, y, n_ads, n_revs, iters=50,
tau_b=1.0, tau_s=0.5, k=1.96):
mu = y.mean()
q = np.zeros(n_ads); b = np.zeros(n_revs)
s = np.ones(n_revs); sig2 = np.full(n_revs, y.var())
for _ in range(iters):
w = s[rev]**2 / sig2[rev]
num = np.bincount(ad, s[rev]*(y-mu-b[rev])/sig2[rev], n_ads)
prec = 1.0 + np.bincount(ad, w, n_ads)
q = num / prec
q = (q - q.mean()) / q.std() # identifiability
for j in range(n_revs):
m = rev == j
X = np.column_stack([np.ones(m.sum()), q[ad[m]]])
P = np.diag([1/tau_b**2, 1/tau_s**2]) * sig2[j]
beta = np.linalg.solve(X.T@X + P,
X.T@(y[m]-mu) + [email protected]([0., 1.]))
b[j] = beta[0]; s[j] = max(beta[1], 1e-3)
sig2[j] = max((y[m]-mu-X@beta).var(), 1e-3)
mu = np.mean(y - b[rev] - s[rev]*q[ad])
w = s[rev]**2 / sig2[rev]
prec = 1.0 + np.bincount(ad, w, n_ads)
q_sd = 1/np.sqrt(prec)
return q - k*q_sd, q, q_sd
Common mistakes
- Averaging raw scores or z-scoring each reviewer without a model — z-scoring distorts ad-to-ad comparisons and ignores noise levels.
- Forgetting identifiability, so quality and reviewer scale drift.
- Reporting only a point estimate and letting one-lucky-rating ads top the chart.
- Ignoring disconnected components, so the whole scale is arbitrary.
- Assuming homoscedastic noise; per-reviewer σ is what makes the weighting correct. Time/space cost: the alternating fit is O(iters · nnz) plus per-reviewer regressions; MCMC is heavier but still small at this scale.