ML-SYSTEMS
    intermediate

    Labeling & Weak Supervision

    ML Engineer path · lesson 68 of 80
    The idea
    Marking exam papers. You can hire markers, which costs money and time and means strangers read every script. Or you can set questions that mark themselves — and most of the craft is in finding which questions those are.
    How to use
    On the natural-labels tab, drag the labeling window: a short one gets you data fast and quietly undercounts the positives.
    Accurate phonetic-level transcription of speech can take 400 times longer than the utterance — so one hour of speech is 400 hours of work, almost three months for one person. In a lung-cancer X-ray study the author's colleagues waited almost a year for sufficient labels.
    The 400× transcription figure, priced
    1
    1
    hours of speech
    400
    hours of labeling work
    2.3
    person-months (8h × 22d)
    One hour of speech is 400 hours, almost three months, for one person. That is what “we just need it labelled” costs when the labelling is phonetic-level and accurate.
    Slow labeling slows iteration, not just delivery
    The book's worked case: a two-class sentiment model with NEGATIVE and POSITIVE has to become three-class — adding ANGRY — because PR wants to attend to angry messages faster. That requires a relabeling pass and possibly new data collection, and while it runs, the existing model continues to degrade. The labeling cost is not paid once at the start; it is paid on every change of mind.

    Key insight

    Karpathy's answer reframes the whole thing. If labeling is an ongoing function rather than a project, the right question is not “how do we get these labelled” but “what does our labeling capability look like in two years” — which leads to very different tooling decisions.

    Where do the labels come from?

    Sort

    Sort each description into the labeling approach.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Hand labeling

    Drop items here

    Weak supervision

    Drop items here

    Semi-supervision

    Drop items here

    Active learning

    Drop items here
    5 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    Asked how long his team would need an in-house labeling team, Andrej Karpathy replied:

    The short version

    Marking exam papers. You can hire markers, which costs money and time and means strangers read every script. Or you can set questions that mark themselves — and most of the craft is in finding which questions those are.

    In more depth

    Labeling & Weak Supervision

    Asked how long he'd need an in-house labeling team, Andrej Karpathy replied: "How long do we need an engineering team for?"

    Hand labels — three problems

    1.Expensive — 20 crowdsourced annotators trained in 15 minutes can classify spam comments; chest X-rays need board-certified radiologists.
    2.Threatens data privacy — someone must look at the data.
    3.Slow — accurate phonetic transcription can take 400× longer than the utterance, so 1 hour of speech = 400 hours, almost 3 months for one person.

    Slow labeling slows iteration: adding an ANGRY class to a NEGATIVE/POSITIVE sentiment model needs a relabeling pass, and the existing model degrades meanwhile.

    Label multiplicity

    On one sentence: annotator 1 found 3 entities, annotator 2 found 6, annotator 3 found 4. "The higher the level of domain expertise required, the higher the potential for annotating disagreement." If experts can't agree, what does human-level performance even mean?

    Two fixes: a clear problem definition ("pick the entity that comprises the longest substring") and incorporating it into annotator training.

    Data lineage: a good model on 100K samples gets another million crowdsourced samples and performance decreases — and you can't fix it once the data is mixed and indistinguishable.

    Natural labels

    The system evaluates its own predictions: Google Maps ETA, stock prices, and recommender systems (click = POSITIVE, no click after a window = NEGATIVE). Survey of 86 companies: 63% work with tasks that have natural labels.

    Feedback loop length — prediction to feedback. Amazon related products: minutes. Articles and videos: hours. Stitch Fix-style clothing: weeks. Fraud detection: a dispute window of one to three months.

    Window length is a speed/accuracy trade-off. Twitter Ads (early 2021): most ad clicks happen within five minutes, but some happen hours later — so the label type underestimates the actual click-through rate.

    Four techniques (Table 4-2)

    MethodHowGround truths required?
    Weak supervisionNoisy heuristics generate labelsNo, but a few help guide development
    Semi-supervisionStructural assumptions generate labelsYes — a small number of seeds
    Transfer learningReuse a model pretrained on another taskNo for zero-shot; far fewer for fine-tuning
    Active learningLabel the samples most useful to the modelYes

    Snorkel's labeling functions come in four kinds: keyword heuristics, regular expressions, database lookups, and the outputs of other models. They're noisy and may conflict, so you must combine, denoise and reweight them.

    Stanford Medicine (Dunnmon et al.): labels from a single radiologist after eight hours of writing labeling functions performed comparably to almost a year of hand labeling.

    Interview Questions

    Snorkel AI
    Google
    Stanford
    Scale AI
    Snorkel AI
    Stanford
    Google Health
    Tempus
    Twitter
    Amazon
    Netflix
    Stitch Fix
    Scale AI
    Google
    Meta
    Appen

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required