Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium

      Intuition

      Invent the idea behind the formula.

      Each puzzle gives you a job, not a formula. Write any Python function you think works. Every run finds the first thing wrong with it, shows your answer next to the right one, and waits for your fix, until you’ve invented the idea yourself.

      Start: Fair share0 of 88 invented

      How a puzzle goes

      1. 1

        You write any function

        def typical(values):
            return values[0]
      2. 2

        Each run finds what’s wrong, with your numbers

        1 of 5 passed

        Complaint #1 · Order doesn’t matter

        Shuffling the list changed your answer from 3 to 9.

        values
        963
        your typical(…)
        9
        should be
        3
      3. 3

        Fix it until nothing’s left

        5 of 5 passed

        You invented it.

      Part 1

      What’s typical

      One number that stands for a whole list, and why there’s more than one right way to pick it.

      0/6
      • 01

        Fair share

        One number that stands for a whole list. Lots of choices work until four friends split a bill.

      • 02

        The billionaire

        A billionaire walks into a bar. Your fair share now says everyone is rich.

      • 03

        Grade calculator

        Homework, midterm, final: some count more than others. One grade has to stand for all of them.

      • 04

        Average growth

        +50% one year, −50% the next. Is that an average year of no change? Your money says otherwise.

      • 05

        Average speed

        60 km/h there, 30 km/h back. The average speed isn’t 45, and the clock can prove it.

      • 06

        Average on the go

        Values arrive one at a time and you can’t keep them. Keep their average anyway.

      Part 2

      How far apart

      How far two points are, how spread out a list is, how much to trust an average, and how to combine readings you trust differently.

      0/6
      • 07

        As the crow flies

        How far apart are two points? Walking the streets and flying straight give different answers.

      • 08

        How spread out?

        Biggest minus smallest seems fine, until it can’t tell two very different classes apart.

      • 09

        Who did better?

        Ana beat her class average by 10 points, Ben by 5. Ben still did better.

      • 10

        How sure is the average?

        Weigh a bag four times and average. The average wobbles less, but not four times less.

      • 11

        Odd one out

        One broken sensor drags the average and the spread toward itself, and hides.

      • 12

        Two thermometers

        A lab thermometer says 20°, a cheap one says 25°. Averaging them makes the good one worse.

      Part 3

      How similar

      Scores for how alike two things are: tastes and movies, searches and documents, fruit, words.

      0/10
      • 13

        Match score

        How much will you like a movie, given what you like and what’s in it?

      • 14

        Invent the score

        Rank documents for a search. Copy-paste spam and long rambling documents keep winning.

      • 15

        The shadow

        How far does an arrow reach in a given direction? Measure its shadow.

      • 16

        Do they move together?

        Hours studied and test scores: do they rise together? Adding up x × y says yes to everything.

      • 17

        Which fruit is it?

        Name a new fruit after the known fruit it’s closest to. Closest by size, by redness, or both?

      • 18

        Shared interests

        Match people by what they’re into. Someone who likes everything shouldn’t match everyone.

      • 19

        Colors into numbers

        A model only reads numbers. Calling the colors 0, 1 and 2 quietly tells it green sits between red and blue.

      • 20

        Which words matter?

        Which words say what a document is about? “the” shows up the most and means the least.

      • 21

        The tenth mention

        A page that says “python” 400 times isn’t 400 times more about Python. How much does the tenth mention add?

      • 22

        King − man + woman

        Words as points on a map: man is to king as woman is to what?

      Part 4

      Shapes in space

      What a transform does to area, the one direction in a cloud that matters most, where to put a shop, and how much room a boundary leaves.

      0/4
      • 23

        How much does it stretch?

        A 2×2 matrix moves every point of the plane. How many times bigger does a shape get?

      • 24

        The best single direction

        Squash a map of towns onto one straight road. Which way should it run so the towns stay as spread out as possible?

      • 25

        Two pizza shops

        Every home orders from its nearest pizza shop. Move each shop to serve its own customers best.

      • 26

        Leave room

        Two fences both keep the sheep from the goats. One brushes past a sheep. Which is safer, and by how much?

      Part 5

      Probabilities from scores

      Turning any scores, even negative or enormous ones, into chances that add up to 100%, then picking from them.

      0/6
      • 27

        Scores into chances

        A model scores each answer. Turn any scores, even negative ones, into chances that add up to 100%.

      • 28

        Yes or no chances

        A spam filter scores an email. Turn one score, any size, into the chance it’s spam.

      • 29

        Confident or cautious

        A model picks the next word. One knob decides whether it always takes its favourite or spreads its bets.

      • 30

        Too big for the computer

        Turn scores into chances when the scores are in the thousands. e¹⁰⁰⁰ doesn’t fit in a float.

      • 31

        Roll a loaded die

        A computer only rolls fair numbers from 0 to 1. Turn one into a roll of a loaded die.

      • 32

        Cut the long tail

        A model picks its next word by chance. Drop the junk words first, but keep the variety it really has.

      Part 6

      Chance and surprise

      Fair prices, rare diseases, combining clues, and one number for how surprised you should be.

      0/11
      • 33

        Is the bet worth it?

        A scratch card pays $100 one time in ten. What should a ticket cost?

      • 34

        The rare disease test

        A test that’s right 99% of the time says positive. How worried should you be?

      • 35

        Two clues

        Two clues each say 80% spam. Together they should say more, but how much more?

      • 36

        Two for two

        A rookie makes their first 2 free throws. Are they a 100% shooter?

      • 37

        How surprising?

        One number for how uncertain you are before a coin lands, a die rolls or a model picks the next word.

      • 38

        Best question to ask

        Splitting off one spam email leaves a perfectly pure side. Did that question really help?

      • 39

        Planning for the wrong world

        You set up your questions for a 99-to-1 world. It turned out to be 50/50.

      • 40

        Score a forecaster

        A forecaster said 20% rain, and it rained. How much should that cost them?

      • 41

        Too small to store

        Score a sentence by how likely it is. Multiply 2,000 word chances and the computer runs out of zeros.

      • 42

        How confused is the model?

        A language model guessed each next word. One number for how lost it was: “like choosing among k words”.

      • 43

        Never say never

        A model that has never seen a letter pair calls it impossible, then meets it in the very next sentence.

      Part 7

      Is it real?

      Telling luck from a real effect, and scoring a model honestly.

      0/6
      • 44

        Is it luck?

        A coin lands heads 15 times out of 20. Is it rigged, or could a fair coin do that?

      • 45

        Twenty jelly beans

        Test 20 jelly bean colours for a link to acne and one will look guilty by pure luck.

      • 46

        Better than guessing the average?

        A model predicts a lemonade stand’s sales. Is it any better than always saying the average?

      • 47

        Grade a spam filter

        Averaging precision and recall seems fair, until a filter that flags every email scores 50%.

      • 48

        Pick the sick one

        A test scores patients from low to high. How good is the ranking, before anyone picks a cutoff?

      • 49

        At least one right

        A model wrote 10 answers and 3 are right. Check 2 at random: how likely is at least one right?

      Part 8

      Learning from mistakes

      Measuring how wrong a model is, then walking that number down: steadier, faster, and without forgetting.

      0/9
      • 50

        How wrong is the forecast?

        Score a weather forecast. Why do models square their errors instead of just adding them up?

      • 51

        Walk downhill

        Lost on a foggy hill, you can only feel the slope under your feet. Which way, and how far, is the next step?

      • 52

        Through the cloud

        Draw the best line through a cloud of points. Every point has its own idea of the slope; who gets the final say?

      • 53

        Shrink toward zero

        Two noisy points and a confident slope. How do you build in a little doubt?

      • 54

        Smooth the noise

        A noisy sensor jumps around. Keep one smoothed value that follows it calmly, without storing the history.

      • 55

        The ball keeps rolling

        A careful walker stops the moment the ground goes flat. A rolling ball doesn’t. Give your downhill step some momentum.

      • 56

        One step size per direction

        In a long, narrow valley the walls are 100× steeper than the floor. One step size bounces off the walls or crawls along the floor.

      • 57

        Same step, smaller batches

        Your GPU fits 8 photos at a time, but you want the step a batch of 32 would take. Four small batches should add up to one big one.

      • 58

        Protect what matters

        A network learns a new task and forgets the old one. Charge it for moving the weights the old task needs.

      Part 9

      Inside a neural network

      Why stacked layers need a bend, who gets the blame, and how a deep net keeps its signal alive.

      0/9
      • 59

        Who’s to blame

        The output came out wrong. Nudge the input and follow the nudge through every stage to see how much it’s to blame.

      • 60

        Stacking straight lines

        Stack two layers of straight lines and you get… a straight line. Find the bend that lets a network draw a V.

      • 61

        Keep the signal alive

        A deep network starts with random weights. Pick their size wrong and the signal dies out or blows up in 20 layers.

      • 62

        Keep the original

        Stack 50 layers that barely know anything yet, and the signal fades to nothing before it reaches the end.

      • 63

        Don’t depend on the neighbours

        One loud example in a batch, and every other example’s numbers shift. Rescale so each example stands on its own.

      • 64

        Random no-shows

        In training, units of a network randomly skip work. The next layer shouldn’t be able to tell, on average.

      • 65

        Never be 100% sure

        A target of exactly 100% can only be reached with an infinite score. Teach a classifier to keep a little doubt.

      • 66

        Same rule everywhere

        Blur a row of pixels by mixing each one with its neighbours. A photo filter, and the first step of every image model.

      • 67

        How far can it see?

        Stack small windows on a row of pixels. How much of the picture can one output at the top see?

      Part 10

      Attention and language models

      How a model decides which words to listen to, and the tricks that make language models work.

      0/10
      • 68

        Merge the most common pair

        A tokenizer starts with single letters and invents new symbols by gluing neighbours. Which pair should it glue first?

      • 69

        Who should “it” listen to?

        In “the cat sat on the mat because it was tired”, which word does “it” mean?

      • 70

        Listen and collect

        Now “it” knows who to listen to. What does it actually hear?

      • 71

        Don’t peek

        A model writing word by word can’t listen to words it hasn’t written yet.

      • 72

        Word order matters

        Attention reads a sentence as a bag of words, so “dog bites man” and “man bites dog” look the same. Tag each word with where it is.

      • 73

        Distance, not place

        Tag each word with where it sits, so attention can tell how far apart two words are but not where they are.

      • 74

        Softmax on the go

        Scores arrive one at a time and you can’t keep them. Keep what softmax needs anyway, without overflowing.

      • 75

        The greedy trap

        Take the likeliest word, then the likeliest next one. The likeliest sentence can still slip past.

      • 76

        Find your twin

        Teach a model that two crops of the same photo belong together, using nothing but the rest of the batch as strangers.

      • 77

        A small change to a big matrix

        Fine-tuning nudged a huge grid of weights. Store the nudge in a tiny fraction of the numbers.

      Part 11

      Learning from rewards

      Rewards that arrive over time, trying the unknown, and learning from what people prefer.

      0/6
      • 78

        A reward now or later

        Rewards spread over the coming steps. One later is worth a bit less than one now. What is the whole list worth today?

      • 79

        Don’t wait for the end

        Learn what a position is worth from the very next step, instead of waiting for the game to end.

      • 80

        Try the unknown

        Machine A has paid 0.6 a play over 100 plays, B 0.5 over just 2. Which do you play next?

      • 81

        Ask the wrong crowd

        You surveyed the people who were easy to reach, but you want the average of a different crowd.

      • 82

        Which answer do people prefer?

        A reward model scores two answers −1 and −3. How often will people pick the first?

      • 83

        Grade on a curve

        A model answers one question 8 times and a grader scores each. Which answers should training push up?

      Part 12

      Graphs, noise and speed

      Learning on a network of friends, turning pictures into static, and making a big model fast to serve.

      0/5
      • 84

        Listen to your friends

        Everyone updates their opinion from their friends’. How much should their own count?

      • 85

        Fade to static

        Bury a picture in noise one step at a time, without it shrinking on the way.

      • 86

        Is it the math or the memory?

        A chip does math and fetches numbers at the same time. Which one decides how long a step takes?

      • 87

        One outlier ruins it

        Squeeze every weight into one byte. Works fine, until a single huge weight wipes out all the small ones.

      • 88

        Don’t redo the work

        A chatbot writes one word at a time. Does it have to reread everything it wrote before each new word?