Sub topic 15
Failure modes: correlated sources, bias, leakage and feedback loops
This chapter assumes you can write labeling functions, build a label matrix, and read coverage, overlap and conflict numbers. It also assumes you know how a label model and an end model fit together, and that you can compute precision, recall and F1. The earlier chapters showed how to produce weak labels. This one covers how those labels go wrong without anything crashing.
Why weak supervision fails quietly
Hand labels have random noise. Weak labels have systematic noise: the same rule makes the same mistake on every example it touches. A label model can also turn that noise into confident probabilities such as 0.97, so the output looks cleaner than it is. The end model then learns the mistakes as if they were facts.
Four failure modes cover most cases:
- Correlated sources: several labeling functions make the same mistakes together.
- Bias: the labels are skewed toward certain kinds of text, classes or groups.
- Leakage: information from the evaluation data reaches training, or the evaluation measures the wrong thing.
- Feedback loops: model output flows back into the labels that train the next model.
Correlated sources
Most label models assume the sources are conditionally independent given the true label. Under that assumption, agreement between two sources is strong evidence that both are right. If two functions are near copies, the model counts one opinion twice.
This happens often in practice. One function matches great|excellent|love, and another matches great|excellent|awesome. Or an LLM labeler and a regex labeler both key on the word "refund". The label model gives each a high weight, and the shared errors win every vote.
A cheap first check is pairwise agreement on the examples where both functions vote:
from itertools import combinations
ABSTAIN = -1
def pairwise_agreement(L):
"""Return (i, j, n_both_voted, agreement_rate) for each pair of functions."""
report = []
for i, j in combinations(range(len(L[0])), 2):
both = [(row[i], row[j]) for row in L
if row[i] != ABSTAIN and row[j] != ABSTAIN]
if both:
rate = sum(a == b for a, b in both) / len(both)
report.append((i, j, len(both), rate))
return report
L = [
[1, 1, -1],
[1, 1, 0],
[0, 0, -1],
[0, 0, 1],
[1, 1, 1],
[-1, -1, 0],
[0, 0, 0],
[1, 1, -1],
]
for i, j, n, rate in pairwise_agreement(L):
print(f"LF{i} vs LF{j}: n={n}, agreement={rate:.2f}")The output is:
LF0 vs LF1: n=7, agreement=1.00
LF0 vs LF2: n=4, agreement=0.50
LF1 vs LF2: n=4, agreement=0.50LF0 and LF1 never disagree, so they are suspects. High agreement alone does not prove dependence, because two accurate and independent functions also agree often. The check only flags pairs for you to read. Look at the rules, and look at the examples where the pair is wrong together on your gold set.
Ways to fix it:
- Merge near-duplicate functions into one.
- Drop the weaker of the pair.
- Group functions by how they work (keywords, patterns, external resources, LLM) and make sure no single group dominates the matrix.
- Use a label model that can take explicit dependencies between sources, if your library supports it.
Bias in the labels
A label set can be noisy and still unbiased, or fairly accurate and still biased. Weak supervision tends to produce the second case, in four ways:
- Coverage bias. Labeling functions fire on text that is easy to describe with rules. Hard examples abstain and never reach training, so the end model sees an easier distribution than production.
- Class bias. Writing positive rules is often easier than writing negative ones, so the matrix leans toward one class. The label model's class prior can then exaggerate the imbalance.
- Language bias. Keyword lists written by one person miss dialects, slang, spelling variants and other languages. Texts in those varieties abstain or get labeled by a stray rule.
- Inherited bias. An LLM labeler brings its own associations, such as treating certain names or topics as more negative. A lexicon built from one domain mislabels another, for example "sick" in slang.
Check bias by slicing. Compute coverage and gold-set F1 per class, per source, per text length and per any group you can identify. A global F1 of 0.85 can hide a slice at 0.60.
Leakage
Leakage means the evaluation no longer measures what you think it measures. Weak supervision has several routes to it.
- Looking at the gold set while writing functions. If you tune rules until they score well on the gold set, it is now a development set. Keep a second, untouched test set.
- Duplicates across splits. Scraped text often contains repeats and near repeats. If a gold example also appears in the unlabeled training pool, the end model is tested on text it trained on.
- Source overlap with the end model's features. If the end model sees the same keywords the functions use, it can learn to copy the rules and score well on weakly labeled data without learning anything more. Check how well it does on examples where every function abstains.
- Resources built from test data. A lexicon or knowledge base compiled from a corpus that includes your test set carries the test labels into training.
- LLM contamination. A public benchmark may be in an LLM's pretraining data. Its labels on that benchmark can look better than they will on your private text.
An exact-match check after normalization catches many duplicates:
import re
def normalize(text):
return re.sub(r"\W+", " ", text.lower()).strip()
def find_leaks(train_texts, gold_texts):
train_set = {normalize(t) for t in train_texts}
return [t for t in gold_texts if normalize(t) in train_set]
train = ["I love this phone!", "Broken on arrival"]
gold = ["i love this phone", "Works fine"]
print(find_leaks(train, gold)) # ['i love this phone']This only finds exact duplicates after cleanup. For paraphrases and templated text, compare embeddings or shingled n-grams with a similarity threshold, and remove matches from the training pool rather than from the gold set.
Feedback loops
A feedback loop forms when a model's output becomes part of the next round's labels or training text. Common forms:
- Self-training. You use the end model to label more data, then retrain. Its early mistakes become training targets, and they get more confident each round.
- Model-written labeling functions. You write new rules by looking at what the end model gets wrong. If you only inspect examples the model flags, the rules inherit its blind spots.
- Synthetic text on synthetic text. Training on LLM-generated examples, then using the resulting model to generate or label more, narrows the vocabulary and style each round. Rare phrasings vanish first.
- Deployment filtering. If the deployed model decides which items get human review, future gold labels cover only what the model already finds interesting.
The common defense is an anchor that no model touches: a random sample of production text, labeled by people, refreshed on a schedule and never produced by any model in the loop.
Symptoms and checks
| Failure mode | Typical symptom | First check |
|---|---|---|
| Correlated sources | Label model accuracy estimates look too high for some functions | Pairwise agreement, and shared errors on the gold set |
| Coverage bias | End model is fine on easy text and poor on long or unusual text | Coverage and F1 by slice |
| Class bias | Predictions lean heavily toward one class | Label distribution against a gold sample |
| Duplicate leakage | Gold F1 far above any slice you did not tune on | Normalized and near-duplicate match |
| Rule copying | End model matches the label model but fails when all functions abstain | F1 on the all-abstain subset |
| Feedback loop | Score on a fixed, human-labeled sample drops across rounds | Compare each round on the same frozen sample |
A short review routine
Run these checks after every change to the functions or the pool:
- Print coverage, overlap and conflict, then pairwise agreement.
- Compare the weak label distribution with a small hand-labeled random sample.
- Remove duplicates between training and every evaluation set.
- Score the end model on the slices where functions abstain.
- Keep one frozen, never-tuned test set and report it only at the end.
Exercise
Your end model scores F1 0.91 on the gold set, but on examples where all labeling functions abstained it scores 0.58. You also find that 12% of gold texts have a near-identical copy in the training pool. Name two failure modes this points to, and give one action for each.
Show answer
The 0.58 on all-abstain examples suggests rule copying: the end model learned the labeling functions' cues instead of general features. Action: add or improve functions that cover the abstained text, or train with features the functions cannot see, and report F1 on the abstain slice. The 12% overlap is duplicate leakage, which inflates the 0.91. Action: remove the matching texts from the training pool (using exact and near-duplicate matching), then re-evaluate on the gold set.
Exercise
Two labeling functions agree on 100% of the examples where both vote. Does that prove they are correlated in a harmful way? What would you check next?
Show answer
No. Two independent, highly accurate functions also agree often. Check the rules to see if they use the same cue, and check the gold set for examples where both are wrong together. If they share errors, merge or drop one, or model the dependency.