Measuring User Exposure to Policy-Violating Posts
Statistics & ExperimentsModel answerLast updated
Design a metric framework for how often users see harmful content: definitions, timing rules, north-star choice, uncertainty-aware alerts, and an A/B test under delayed labels.
You are the data scientist for a social platform where users post content, and moderation combines automated classifiers with human reviewers. Leadership wants a trustworthy way to track how much policy-violating content people actually see, and a plan to bring that number down.
Answer the following.
-
Core metrics. Give exact formulas for three daily metrics and their 7-day rolling versions:
- the share of all views that land on violating content,
- the share of sessions that contain at least one violating view,
- the number of violating views per daily active user.
-
What counts as a violating view. Write precise inclusion and exclusion rules under two timing regimes: ex-ante (only violations already known when the view happened) and ex-post (the final decision after all reviews). Say how you treat late-arriving labels, appeals, deleted content, repeat views, and bot traffic.
-
Choosing a north-star. Is the view-share metric a good north-star? Compare it with:
- the fraction of newly created items that turn out to be violating, and
- the fraction of daily active users who were exposed at least once.
Discuss detection lag, denominator gaming, shifts in classifier precision and recall, Simpson's paradox across countries and surfaces, and Goodhart's law.
-
Weekly alerting. Propose an alerting method with thresholds that accounts for uncertainty (for example Wilson or Bayesian beta-binomial intervals). List the guardrail metrics you would pair with it, such as wrongly actioned content, creator churn, and review-queue SLA.
-
Experiment. Sketch an A/B test intended to reduce the view-share metric. State the primary metric, key segments (country, surface, creator cohort), power assumptions, and how you correct for label latency and selection bias when violations are only discovered after they were seen.
Expect a structured answer with concrete definitions, trade-offs, and rough numbers where they help.
Hints
Hint 1
Define a 'view' first (visibility threshold, deduplication, eligible non-bot viewer). Then use ratio-of-sums for rolling windows, not an average of daily ratios.
Hint 2
Labels come from the enforcement system you are evaluating, so counting only removed items measures recall, not exposure. Think about an independent, probability-sampled, blind human-rated measurement and how to reweight it.
Hint 3
For alerting, remember views are clustered by item, so a plain binomial interval is too narrow; adjust for design effect and multiple segments. For the A/B test, think about a fixed maturity window and a nowcast so late labels do not bias arms differently.
Hint 4
Separate the ex-ante number (enforcement leakage, immutable at view time) from the ex-post number (ground truth at a fixed maturity window), and report both.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Framing
Two themes drive a strong answer. First, get numerators, denominators, and timing exactly right. Second, measure exposure independently of enforcement; otherwise the metric grades itself (a weaker detector makes the number look better).
1. Metric definitions
View: a deduplicated impression (for example at least 50% of the item visible for at least 500 ms) by an eligible, non-bot viewer on an in-scope surface. Compute everything per policy area, plus a severity-weighted total.
Daily, for day d:
view_prevalence_d = VV_d / V_d(violating views over eligible views)violating_session_rate_d = S⁺_d / S_d(sessions with at least one violating view over all sessions). A session closes after 30 minutes of inactivity and is attributed to its start day.violations_per_active_user_d = VV_d / DAU_d, where DAU is users with at least one eligible view.
Rolling 7-day: ratio of sums, e.g. VP_7d = Σ VV / Σ V over days d-6..d. An average of daily ratios over-weights quiet days. For per-user, Σ VV / Σ DAU is the average daily exposure; use WAU if you want a weekly figure and label it differently.
Severity-weighted variant: Σ w_policy · VV_policy / V, with weights reflecting harm.
Estimating VV. Do not count "views of items we removed"; that only reflects recall.
- Sample views each day, stratified by surface and country, oversampling high classifier scores with known inclusion probabilities.
- Have human raters label them without seeing the enforcement outcome.
- Estimate VV with Horvitz-Thompson (inverse-probability) weights.
Enforcement-derived counts remain a cheap secondary signal.
2. Ex-ante vs. ex-post
- Ex-ante: a view counts if the item already had a violating decision with
decision_ts <= view_ts. This measures enforcement leakage (caches, demotion-only actions, click-through interstitials, propagation delay). It is immutable once logged and highly actionable. - Ex-post: a view counts if the item's final label is violating, evaluated at a fixed maturity window (say view time + 14 days). This is the closest to ground truth.
| Case | Rule |
|---|---|
| Late labels | Publish a provisional number at T+1 and an official one at T+14; restate only inside the window, then freeze. Track the provisional-to-mature ratio to nowcast. |
| Appeals | Final post-appeal decision at maturity wins. Overturned means not violating and feeds the false-positive guardrail. Later reversals are footnoted, not restated. |
| Deleted content | Keep a snapshot for labeling whoever deleted it; deleted-by-user content still counts if raters judge it violating. Unlabelable items go to a reported "unknown" bucket. |
| Repeat views | Count every view in view prevalence (it measures exposure); dedupe per user-item for user-level metrics. |
| Bots | Exclude flagged accounts from numerator and denominator, using the flag as of maturity. Publish a with-bots sensitivity series. |
3. Is view prevalence a good north-star?
| View prevalence | Incident rate (violating / created) | User prevalence (exposed / DAU) | |
|---|---|---|---|
| Captures | Harm weighted by reach | Supply of bad content | Breadth of harm |
| Weakness | Denominator gaming | Ignores reach; a viral item counts once | Saturates; blind to heavy exposure |
| Lag | Moderate | High | Moderate |
Trade-offs:
- Precision/recall shifts: with enforcement-derived labels, a recall drop lowers measured prevalence, and a precision drop makes it look better while creators are harmed. Independent sampling fixes the first; a false-positive guardrail catches the second.
- Simpson's paradox: if traffic shifts toward a high-prevalence surface or market, global prevalence can rise while every segment improves. Report mix-standardized prevalence (fixed baseline traffic shares) and a decomposition into within-segment and mix effects.
- Goodhart: teams can push the number down by boosting benign high-volume content, narrowing definitions, or relabeling borderline items. Freeze guidelines per measurement period, keep raters independent, and pair with guardrails.
Verdict: severity-weighted, sample-based view prevalence is the north-star because it matches user harm. Keep user prevalence and incident rate as diagnostics, never alone.
4. Weekly alerting
For a segment with x violating out of n sampled views, use p ~ Beta(α₀ + x, β₀ + n − x), with the prior built from the trailing 8 weeks and down-weighted to about one week of effective sample. Alert when P(p_week > 1.2 · p_baseline) > 0.95. A frequentist equivalent: this week's Wilson lower bound exceeds the baseline's Wilson upper bound.
Sizing example: p = 0.05%, n = 200k gives SE ≈ √(0.0005/200,000) ≈ 5×10⁻⁵, so a 95% interval of about ±0.01 pp, roughly ±20% relative. Thresholds tighter than that need more samples.
Corrections:
- Clustering: one viral item yields many correlated views, so use an item-level bootstrap or inflate variance by a design effect (often 2-5x).
- Multiplicity: apply Benjamini-Hochberg across country × surface × policy. Page on-call only for severe policies or a segment firing two consecutive weeks.
Guardrails:
- False-positive exposure: benign content wrongly actioned, from audit samples and appeal overturn rate.
- Creator churn / posting rate: 28-day retention of actioned creators versus a matched control.
- Review queue SLA: p50/p90 time to decision and backlog age; rising lag silently delays labels.
- User report rate: should move with prevalence; divergence suggests a measurement problem.
5. A/B test
- Unit: user-level randomization (consider cluster or creator-level when treatment changes content supply, to limit interference).
- Primary metric: sample-based, severity-weighted view prevalence, ex-post at the maturity window, computed as a ratio of sums with delta-method or item-clustered variance.
- Secondary / guardrails: ex-ante leakage, false-positive exposure, creator churn, engagement/session time, queue SLA.
- Segments: country, surface, creator cohort (new vs. established, prior-violation history). Pre-register these and use multiplicity control; check heterogeneity, not just the average.
- Power: with a rare base rate such as 0.05%, detecting a 10% relative drop needs very large exposure, so use CUPED or stratification, oversample high-risk strata, and run at least one full weekly cycle. Inflate sample size by the design effect.
- Label latency: analyze only at a fixed maturity window for both arms, and use provisional-to-mature ratios (estimated on pre-period or control) for an early read. Make sure rater queues are arm-blind and equally prioritized, otherwise treatment changes label timing.
- Selection bias: do not label only content that was flagged or reported, since treatment may change what gets flagged. Use the same probability-sampled, blind rating in both arms and weight by inclusion probabilities.
Common mistakes
- Averaging daily ratios instead of ratio of sums.
- Using enforcement outcomes as ground truth.
- Ignoring item-level clustering in intervals.
- Reporting only global numbers and missing mix shifts.
- Restating metrics forever with no maturity cutoff.