DEV Community

Japan Open Data Lab
Japan Open Data Lab

Posted on

When Majority Voting Hurts: An Ensemble Post-Mortem on Production Data QA

TL;DR — We run automated QA over a production master of 2,934,784 Japanese facility records. Our strongest single model configuration scored 100% binary accuracy on a 100-item gold set; a majority vote with two weaker models dropped it to 89.0%. All 11 overturned cases were correlated misses — both weak models overlooked the same real anomalies the strong model had caught, and outvoted it 2-to-1. And of 508 anomaly flags we checked against the original sources, only 12.6% were confirmed data errors. The full notebook, with prediction files you can recompute every Part 1 number from, is on Kaggle (link at the end).

  1. An ensemble is a hypothesis, not a default. Majority voting helps when voter errors are independent. Ours were not: phi4 (0.760 binary accuracy) and qwen3:14b (0.740) missed the same records in the same way — bare lot-number strings, full street addresses sitting in the name field, a bare numeric code — all read as plausible names to both. The vote did not average the error away; it institutionalized the miss.
  2. A flag is not an error. The pipeline's initial screening extracted 723 candidate flags from 2,934,784 rows; the LLM stage cleared 215 as normal, leaving 508 to adjudicate against the original sources. Result: 64 confirmed errors in our master (12.6%, fixed and applied), 56 false positives (11.0%), and 388 undetermined (76.4%). Anomaly output is a triage queue, not a finished error list.
  3. The largest defect cluster was upstream, not ours. Of the undetermined 388, the biggest single cluster — 210 records — comes from care-service registries where the ministry's own source CSV places an address or postal code inside the facility-name field. The defect was faithfully copied from the source; no classifier upgrade can invent the missing facility name safely.

The setup

One QA stage reads each record's facility-name field and classifies it as NORMAL (a plausible facility name), SUSPECT (a human should look), or ANOMALY (the field clearly holds something that is not a name — an address, a postal code, a placeholder, mojibake). For the headline metric we collapse the three labels to binary: NORMAL vs {SUSPECT, ANOMALY}.

Three local models, one shared prompt (v2_1_spec_guard), two labeled sets:

  • gold_100 (n=100): stratified benchmark — normal records plus planted anomaly patterns.
  • hard_300 (n=300): held-out sealed hard set, evaluated once without tuning.

The production configuration (primary1) is deterministic Stage-1 rule screening, then a gemma4-bf16-5tier:12b judgment, then a deterministic guard that can override the LLM's label. The vote below uses primary1's final guarded label; for phi4 and qwen3 the guard changed none of their binary outcomes on gold_100, so the vote result is the same with or without it.

Part 1: the vote, recomputed

def majority(row):
    votes = [row['pred_gemma4_guarded_bin'], row['pred_phi4_bin'], row['pred_qwen3_bin']]
    top = Counter(votes).most_common()
    return top[0][0] if top[0][1] >= 2 else 'NO_MAJORITY'
Enter fullscreen mode Exit fullscreen mode

Binary accuracy on gold_100:

  • primary1 (gemma4 + guard): 1.000
  • phi4: 0.760
  • qwen3:14b: 0.740
  • majority of 3: 0.890 (delta −0.110)

In every one of the 11 overturned cases, the gold label was SUSPECT or ANOMALY, primary1 flagged it, and both weaker models voted NORMAL. Correlated misses, not correlated false alarms. (Three phi4 cells returned no prediction at all; all three were gold NORMAL, none is among the overturned cases, and the majority still classified them correctly.)

On the sealed hard_300, the production configuration reaches 92.0% binary / 88.7% three-class exact, against 89.0% binary for the same configuration without the post-LLM guard, and 85.3% binary for the best single model in the previous evaluation round (quoted from that round's sealed report; that run's predictions are not part of the attached files).

Honesty note. The hard_300 labels were constructed with knowledge of the same rule system that the v2_1_spec_guard prompt and the post-LLM guard encode — so part of the gain on hard_300 reflects alignment with those rules rather than purely generalizable model skill. The majority-vote reversal on gold_100 does not rely on hard_300's label construction; the flips are computed directly from the attached prediction CSV.

Our production configuration is therefore the boring one: the single strongest model plus deterministic rules — no voting.

Part 2: what 508 flags actually contained

The adjudication breakdown, after checking all 508 flagged records against the original public source documents:

  • Confirmed error in our master: 64 (12.6%) — name corrections (53) plus dummy/test rows (11). Fixed and applied.
  • False positive — the record is correct: 56 (11.0%) — real but unusual names, e.g. a bus stop literally named "14-1". Without explicit domain exceptions or allowlists, a QA model will keep flagging these.
  • Undetermined after source check: 388 (76.4%) — including the 210-record upstream cluster above.

The operational consequence: when a pre-filter flags roughly 0.02% of 2.9M rows and the queue narrows to 508 items, the deliverable is not "508 errors fixed" — roughly 1 in 8 queued items turned out to be a confirmed fix. Staffing, SLAs, and stakeholder expectations should be calibrated to triage queue volume, not raw flag counts.

What didn't work / Limitations

  • One pipeline, one prompt, three local models. These findings come from a single Japanese public-facility registry master and one shared prompt. Treat them as an empirical cautionary case, not a universal law about ensembling — with genuinely independent errors, the vote math runs the other way.
  • The hard set is partly aligned with our own rules. As the honesty note says, part of the hard_300 progression (85.3% → 89.0% → 92.0%) reflects alignment with the label construction. That is why the gold_100 reversal — which is free of that loop and reproducible from the CSVs — leads this post.
  • Part 2 is aggregate only. The adjudication breakdown is reported as counts from the 508-record audit; per-record triage data is not attached to the dataset. The production master itself is not published.
  • The gold set is small. 100 items means the 100% headline has wide error bars; what carries the argument is not the perfect score but the direction and mechanism of the 11 flips, each one inspectable in the prediction file.

We publish measurements, including the ones that argue against our first design. All Part 1 headline numbers recompute directly from the attached CSVs — if your numbers differ, we want to know.

When did adding voters last make your system measurably worse — and were the new voters' errors independent of the leader's, or the same misses twice?

Get the next release notes and our Kaggle experiment logs by email: https://jpopendata.jp/ (newsletter signup in the footer).

Top comments (0)