Nanotech logoNanotech
StudioPricingBlogAboutGet Started
All articles

How Many Examples Does a Text Classifier Need?

2026-10-12 · 26 min read · The Nanotech Team

We trained the same tiny text classifier from scratch 51 times, on 10 to 420 examples per label, and scored every model on examples it had never seen.

With 10 examples per label, 20 text messages in all, a model of 408,000 parameters trained from nothing told spam from real messages with 87.5 percent accuracy. The same model, trained the same way on 10 examples per label of support tickets, sorted them into billing, bug and feature request with 46 percent accuracy, where guessing gets 33. Same model, same recipe, same amount of data: one task almost solved, the other barely started.

That gap is the real answer to "how many examples do I need?" The advice online ranges from 8 per label to 1,000, and almost all of it assumes a model that has already read millions or billions of words before it sees yours. We measured the case that advice skips: a small model that learns everything from your examples, the kind you can train in a browser tab. We ran it on three real tasks at six data sizes, three times each, next to a classic word-counting method and the dumbest one-line rule we could write, and we report every number, including the ones where the neural network lost.

The short answer

Your labels differ byExampleTiny model, 25 per labelTiny model, all dataWord counting, all data
A cue that almost always holds (digits)Spam91.0%94.3%95.8%
A cue with exceptions (Title Case)Clickbait80.7%95.4%95.8%
Meaning, carried by wordsSupport tickets52.5%77.8%95.8%

Held-out accuracy, mean of three runs per size. All data is 420 examples per label (197 for the tickets). Full curves below.

  • If one visible feature separates your labels almost perfectly, about 25 examples per label gets a from-scratch model close to its best, and more data adds only a few points.
  • If a visible feature explains most of the difference but not all, 25 per label gets you to that feature, and getting past it takes hundreds: our clickbait model passed the obvious rule only between 100 and 200 per label.
  • If the difference is in meaning, a from-scratch model needs hundreds per label and is still improving at 200. A method that already knows words (Naive Bayes, or any pretrained model) gets further with far fewer.
  • If you start from a pretrained model, published guidance and research put the number at a few dozen per label, sometimes fewer (section 1).
  • Whatever your case, measure it: set a quarter of your examples aside, score the dumbest rule first, and draw a learning curve (section 8).

Contents

  1. Why the usual answers disagree
  2. The experiment
  3. Spam: ten examples got most of the way, for a suspicious reason
  4. Clickbait: a cue with exceptions costs more data
  5. Support tickets: every example counted, and word counting still won
  6. Memorizing is not learning
  7. What sets your number
  8. How to find your own number
  9. Limits of this measurement
  10. The takeaway

1. Why the usual answers disagree

Ask how many labeled examples a text classifier needs and you get numbers that differ by a factor of a hundred. Every one of them is true; they are answers to different questions.

  • About 13 per label. Nyckel, which sells classification as a service, analyzed over 10,000 production classifiers and concluded that "you need only 13 training examples per class to train a solid image or text classifier," where "solid" means roughly 80 percent mean accuracy, 90 percent of the way to a plateau of 85 to 90 percent that arrives after about 100 examples. Its texts were first passed through a large pretrained sentence model, and only a simple classifier on top was trained on the customer's examples.
  • 8 per label. The authors of SetFit report that "with only 8 labeled examples in the Customer Reviews (CR) sentiment dataset, SetFit is competitive with fine-tuning on the full training set," a set their announcement puts at 3,000 examples, fed to a model three times larger. SetFit, too, starts from a pretrained sentence model.
  • 100 in total. ULMFiT, one of the 2018 papers that made transfer learning standard for text, found that "with only 100 labeled examples, it matches the performance of training from scratch on 100x more data." It starts from a language model pretrained on Wikipedia.
  • 10 to start, 50 to 100 to see results. OpenAI's fine-tuning guide sets a minimum of 10 examples and says "we see improvements from fine-tuning on 50–100 examples," recommending a start with 50 (the same page notes that OpenAI is winding down that platform). Google's AutoML Text, retired in June 2025 according to the Vertex AI deprecations page, asked for at least 10 documents per label, suggested starting with 50, and warned it "might require hundreds or even 1000 examples per label."

Notice what they share. Every one of these starts from a model that has already read millions or billions of words. That model arrives knowing that "refund" and "charged twice" are about money, and the few examples you give it only have to point at the distinction you care about. A model trained from scratch arrives knowing nothing, not even that a space separates words. Every pattern it ends up using has to come out of your examples.

So there are really two questions. How many examples does a pretrained model need to learn your labels? The sources above answer that one, and the answer is "a few dozen." How many does a model need that learns everything from your examples alone? We could not find a published measurement of that for a small model you can train yourself, so we made one.

2. The experiment

The model. A small GPT, the same kind of model as the ones behind chat assistants, with 2 layers and 408,064 parameters (the adjustable numbers a model learns; a large chat model has hundreds of billions). It reads text one character at a time and starts from random numbers, so at step zero it knows nothing. It is the classifier Nanotech trains in your browser, and every run here used the studio's own training code on a Mac's graphics chip, through the same WebGPU kernels a browser runs.

Training. Training is a guessing game. The model reads an example, guesses its label, is shown the right one, and every parameter is nudged slightly toward the answer that would have been right. Only the label is graded, never the text itself, so all of its learning goes into the one judgment you want. Every run took the studio's fixed budget of 1,500 steps of 32 examples, whatever the data size. Nothing was tuned per size, which is exactly what you get when you paste a small set into the studio: with 10 examples per label, the model sees each one about 2,400 times.

Three tasks, chosen because the difference between their labels is visible in different ways:

TaskLabelsDataHeld out
Spamspam, not spamReal text messages from the UCI SMS Spam Collection (2011, CC BY 4.0)240
Clickbaitclickbait, not clickbaitReal headlines from Stop Clickbait (2016): BuzzFeed, Upworthy and others against news sites240
Ticketsbilling, bug, feature request711 short support tickets written for the example in Train on your own labels120

Six sizes: 10, 25, 50, 100, 200 and 420 examples per label (the ticket set stops at 197, which is all it has once its scoring set is reserved). The smaller sets are nested inside the larger ones, as they would be if you kept labeling.

Three repeats of every size. Each repeat draws a different random subset and starts the model from different random numbers, so the spread between repeats is the honest run-to-run noise at that size.

The held-out score. Before anything trains, a fixed set of examples is put aside and never trained on: that is what "held out" means. Every model is scored on the same held-out set, so a score says how the model handles text it has never seen. A model can memorize the examples it practiced on; it cannot memorize ones it never saw. The held-out sets were also checked for near copies of training examples (texts that differ by a word or a number), so a reworded twin cannot slip in as a free point.

Two baselines, because a score means little until you know what a dumb method gets:

  • Naive Bayes, the classic spam filter. It counts how often each word appears under each label, then labels a new text by which label its words are most typical of. It was the method of an early, influential junk-mail filter ( Sahami and others, 1998) and of Paul Graham's essay A Plan for Spam, whose filter missed "less than 5 per 1000 spams, with 0 false positives" on his own mail. We fitted it on exactly the same examples as each model.
  • The best one-line rule we could find for each task, with its single setting chosen on the training data only and then scored once on the held-out set, the same way the model is.

3. Spam: ten examples got most of the way, for a suspicious reason

With 10 examples per label, 20 text messages in all, the model scored 87.5 percent on the 240 messages it had never seen (84 to 91 across the three repeats). With 25 per label it scored 91. After that the curve barely moves: 92.4 at 100 per label, 94.3 at 420. Going from 25 to 420 per label, nearly seventeen times the data, bought about three points.

How can 20 messages teach a model to catch spam? They mostly don't teach it what spam is. They teach it one cue. More than half of the collection's 747 scam texts were taken from Grumbletext, a UK website where people posted the spam they received, and those scams ask you to text a short code, call a premium number or claim a cash prize, so they are full of digits, and ordinary texts mostly are not. A rule of one line, "three or more digits means spam," with its threshold chosen on the training messages, gets 92.1 percent of the held-out messages right on its own: it catches 103 of the 120 spam messages and wrongly flags only 2 of the 120 real ones. The model reads characters, so every digit in every phone number looks like every other digit to it, and the cue jumps out of the first few examples. The first model trained on 10 per label disagreed with the digit rule on only 10 of the 240 messages.

What did the other 410 examples per label buy? We can answer that message by message. The digit rule gets 19 of the 240 messages wrong: 17 scams with fewer than three digits, and 2 real messages that happen to contain a number. With all 420 examples per label, the three models got 9 to 11 of those 19 right, while getting 4 to 6 wrong that the rule gets right. Net, that is 4 to 7 messages out of 240, about two to three points. In practice the full model catches more spam than the rule (110 to 113 of 120, against 103) and wrongly flags slightly more real messages (5 of 120, against 2). That is real learning beyond the shortcut, and it is small.

And then word counting caught up. Naive Bayes started far behind (74.6 percent at 10 per label) because it reads whole words, so every phone number is a different word it has seen once. By 50 per label it had seen the spam vocabulary often enough to tie the model (92.4 against 91.1), and from 100 per label it stayed ahead, finishing at 95.8 against 94.3, a gap inside the margin of error of a 240-message test. On this task, a counting method first applied to spam in 1998, which fits in milliseconds, matches a neural network trained on a graphics chip.

The lesson from spam: when one visible cue separates your labels, the first 25 examples per label do most of the work, the rest add a few points, and a simple method may do just as well. A high score from a tiny dataset is worth checking against the dumbest rule you can write, because the model may have found the same rule.

4. Clickbait: a cue with exceptions costs more data

Viral headlines have a visual tell too: Title Case, with nearly Every Word Capitalized, the house style of the BuzzFeed era. The best one-line rule we found builds on it: call a headline clickbait when at least 95 percent of its words of three or more letters start with a capital. Tuned on the training headlines, it gets 87.9 percent of the held-out headlines right. But this cue has exceptions. The rule catches 119 of the 120 clickbait headlines and also flags 28 of the 120 real ones, because some of the real news headlines in the collection are written in Title Case as well.

With 10 examples per label the model scored 62 percent, and the three repeats ranged from 51 to 70: with so few examples, which ten you happen to pick matters a great deal. By 25 per label it reached 81. Then, unlike spam, it kept climbing: 84 at 50, 87 at 100, 91 at 200 and 95.4 at 420. It passed the capital-letters rule somewhere between 100 and 200 examples per label, and every doubling after that still paid.

What did it learn that the rule could not? The rule gets 29 of the 240 headlines wrong. Trained on all 420 per label, the three models got 24 to 26 of those 29 right, while getting 5 to 9 wrong that the rule got right. What they picked up beyond capital letters is the rest of the house style, which the paper behind the data measured: its clickbait headlines averaged 10 words against 7 for news, used shortened forms such as "you'll" far more often, and, in the authors' words, "stop words are used more frequently (e.g. 45% compared to 18% in non-clickbaits)." Each of those habits shows up in only some headlines, so each takes many examples to learn.

Word counting kept pace the whole way. From 25 per label on, Naive Bayes stayed within about three points of the model and finished at 95.8 against 95.4, a tie.

The lesson from clickbait: when a visible cue explains most of the difference but not all of it, a few dozen examples get a model to the cue, and getting past it takes hundreds.

5. Support tickets: every example counted, and word counting still won

The support tickets tell the opposite story. Billing, bug and feature request differ in what the ticket is about, not in how it looks. "I was charged twice this month," "the login page shows an error" and "would love a dark mode" are about as long as each other, punctuated alike and free of telltale numbers. We tried the obvious one-feature rules on the training tickets (length, digits, capitals, symbols, a question mark), and the best of them, sorting by whether the ticket asks a question, got 45 percent of the held-out tickets right, against 33 for guessing.

Here the tiny model needed everything it got. With 10 examples per label it scored 46 percent, barely better than the question-mark rule. Then it climbed steadily, by six to nine points with each step up in data: 53 at 25 per label, 62 at 50, 70 at 100 and 78 at 197, the most the set allows. The curve had not flattened when the data ran out, which means more tickets would still have helped.

Naive Bayes beat it at every size, by a wide margin. Fitted on the same tickets, it scored 74 percent with only 10 per label, 92 with 50, and 95.8 with 197, a lead of 18 to 34 points. The reason is in how each one reads. These labels are separated by vocabulary. Counted across the training tickets, "card," "refund," "charged" and "invoice" appear only in billing tickets; "error" and "won't" almost only in bugs; "would," "wish" and "love" almost only in feature requests. Naive Bayes reads whole words, so each of those is one feature it can count from the first example. The tiny model reads characters, so before it can use the word "refund" it has to discover from your examples that those six letters belong together, and with a few hundred examples it only partly does.

The lesson from support tickets: when the difference between labels is in the words people use, a model that has to learn words from scratch needs many more examples than you would think, and a method that already reads words (Naive Bayes, or any model pretrained on language) gets there with a fraction of them. It is the other side of what ULMFiT and SetFit show: start from a model that already knows the language, and most of those examples are no longer needed. One caution: these tickets were written for the studio, so their wording is cleaner and more consistent than a real help desk's, which flatters word counting. Real tickets would be harder for both methods.

6. Memorizing is not learning

One number never moved in all 51 runs: every model scored 100 percent on the examples it trained on, at every size, on every task. Ten tickets per label or 197, two labels or three, the model always learned its own training set perfectly.

That is what makes a training score useless as a measure of quality. A model this size has hundreds of thousands of adjustable numbers and, with a small set, sees each example thousands of times, so it can simply store the answers, the way a student who memorized last year's answer key can ace last year's exam. The 46 percent ticket model and the 94 percent spam model looked identical from the inside: flawless on what they had practiced, and only the held-out set told them apart.

So the one rule that holds at every data size is: never judge a classifier by the examples it trained on. Set examples aside before you train, never let the model see them, and believe only the score on those. If your tool reports a single accuracy number and cannot tell you which examples it was measured on, assume it is the training score.

7. What sets your number

Put the three curves side by side and one thing explains them: how visible the difference between your labels is to the model you are training.

A model learns whatever separates the labels most cheaply. If one feature it can see splits the examples almost perfectly, as digits do for these text scams, a handful of examples is enough to find it, because every example points at the same feature, and the curve is nearly flat from there. If that feature has exceptions, as Title Case does for clickbait, the model reaches the feature quickly and then has to learn the exceptions one example at a time, so the curve keeps climbing. If the difference lives in meaning, every example teaches one more way of saying the same thing ("I was charged twice," "the invoice is wrong," "where is my refund"), and none of them carries over to the next phrasing until the model has seen enough variety to find what they share. That is the curve that starts low and is still rising when the data runs out.

What a model can see depends on how it reads. Nanotech's model reads characters, so the digit 8 in one phone number is the same symbol as the 8 in another, and "any long run of digits" is something it can learn from ten examples. Naive Bayes, as we ran it, reads whole words, so 81010 and 87121 are two unrelated words, each seen once. That is why word counting started far behind on spam and then caught up: it needed enough examples for the spam words themselves (free, txt, claim, prize, call) to pile up. Change how a model reads and you change which differences are cheap.

Simple methods often win with little data and lose with a lot. This is an old result, and our curves repeat it. Andrew Ng and Michael Jordan showed in 2001 that a generative classifier such as Naive Bayes "may also approach its (higher) asymptotic error much faster" than a discriminative one, getting there after a number of examples that grows with the logarithm of the number of features rather than with the number of features itself ( Ng and Jordan, 2001). Michele Banko and Eric Brill's often-cited 2001 study showed the ranking of learners flipping as data grew from a million words to a billion: the method that led at the smallest size finished last. The method that wins at your data size is an empirical question, which is the case for measuring rather than assuming.

More data helps less and less, at a predictable rate. Across translation, language modeling, images and speech, Hestness and others (2017) found "power-law generalization error scaling": each doubling of the data removes a roughly constant fraction of the remaining error. On a curve that has flattened, that fraction is small, which is why the last doubling in our spam runs bought one point, the last doubling on clickbait four and the last doubling on the support tickets eight.

8. How to find your own number

No table can tell you how many examples your labels need, because it depends on how visible the difference between them is, and you cannot know that before you look. You can measure it in an afternoon. The tool is called a learning curve: in the words of the scikit-learn documentation, it "shows the validation and training score of an estimator for varying numbers of training samples," and it is "a tool to find out how much we benefit from adding more training data."

  1. Label a first batch. Aim for about 50 per label, as evenly spread across labels as you can manage.
  2. Set a quarter aside before you train anything, and never train on it. Check it for near copies of the rest (the same canned reply with a different order number counts as a copy).
  3. Write the dumbest rule you can think of and score it on the set-aside quarter. If one obvious cue (a number, a word, the length, the capitals) already gets most of the way, you now know what your model has to beat, and you know that a high score from a few examples may only mean the model found the same cue.
  4. Train on half of your remaining examples, then on all of them, and score both on the set-aside quarter.
  5. Read the gap. If doubling the data added several points, you are still on the steep part of the curve and labeling more will pay. If it added nothing beyond the noise between repeats, more of the same examples will not help: change what you are labeling instead (harder cases, the ones it gets wrong, a clearer definition of each label).

The annotation tool Prodigy builds the same check into a command, train-curve, which trains on growing portions of your data (for example a quarter, a half, three quarters and all of it) and prints the score at each step, with a sensible rule of thumb: "if accuracy improves within the last 25%, training with more examples will likely result in better accuracy." When your labels need a professional's judgment, as with medical, legal or financial text, the expert data service on AITraining.jobs, built by the people behind Nanotech, has verified professionals write and grade training and evaluation data.

In Nanotech the first two steps happen for you. Paste your examples as text | label lines into Train on your own labels: it balances the labels, sets aside a quarter (up to 40 per label), keeps near copies on the same side of that split, and scores the model on the set-aside examples while it trains, so the number you watch is a held-out score from the first minute. To draw your own curve, train once on half of your lines and once on all of them.

9. Limits of this measurement

  • One small model. Every number here comes from a 408,064-parameter model that reads characters. A model that reads whole words, or a much larger one, would trace a different curve. The direction of the findings (surface cues are cheap, meaning is expensive) is what you would expect of any model that learns from scratch, but the exact counts belong to this model.
  • Three tasks, short texts. All three use texts of at most about 150 characters. Long documents give a model more to read per example and may change the counts.
  • A fixed training budget. Every run used 1,500 steps. A small set might do a little better with fewer steps, or worse with more; we kept the budget fixed because that is what the studio does.
  • Clean, balanced labels. Real data is often lopsided (one label far more common than the others) and sometimes mislabeled. Both raise the number of examples you need.
  • Written tickets. The support tickets were written for the studio's example rather than collected from a real help desk, so they are cleaner than a real inbox.
  • Scoring sets of 240 and 120. A score from 240 examples carries a margin of error of about 3 to 4 points either way at these accuracies, and a score from 120 examples about 4 to 8. Differences smaller than that are noise, which is why every size was run three times.

10. The takeaway

There is no universal number of examples per label, but there is a reliable way to find yours, and these measurements show what decides it.

  • Visibility decides the count. When one feature the model can see separates your labels, it finds that feature from a couple of dozen examples, and the rest of your data buys a few points. When that feature has exceptions, getting past it takes hundreds. When the difference lives in meaning, a model that learns from scratch spends most of its examples learning the language itself, and needs hundreds per label.
  • A high score from a small set deserves suspicion. Check it against the dumbest rule you can write. On spam, our 20-message model and a one-line digit rule agreed on all but 10 of 240 messages.
  • Simple methods often win, early and sometimes for good. Word counting tied the neural model on spam and clickbait and beat it by 18 to 34 points on support tickets. If what you need is the most accurate sorter from a few hundred examples, try Naive Bayes or a pretrained model first.
  • Only the held-out score counts. Every model here was perfect on its own training data.

Training a model from scratch is still the best way to understand what a classifier actually learns, because you can watch it happen. In Nanotech you can paste your own text | label lines into Train on your own labels, or start with the spam filter or the clickbait detector, and see the held-out score climb live, in your browser, with nothing to install. For how the model itself works, see how Nanotech trains a real GPT in your browser, and for why small specialist models matter, small models won the week AI got bigger.

Measured in October 2026 on Nanotech's own training engine (2-layer, 408,064-parameter character-level GPT, 1,500 steps of 32 examples, WebGPU on Apple silicon). Each figure is the mean of three runs with different random subsets and starting weights. Vendor guidance quoted in section 1 was checked on the date of publication and changes often.

Nanotech logoNanotech

A hands-on lab for building and training real GPT language models from scratch, live in your browser. No server, no black box.

Product

  • Studio
  • Pricing
  • Blog
  • About

Train a model

  • Text classifier
  • Spam filter
  • Clickbait detector
  • Language router
  • Clickbait lesson
  • Clickbait activity
  • Language lesson
  • Language activity
  • Unplugged lesson

Legal

  • Privacy Policy
  • Terms of Service

Contact

  • hello@gonano.tech
© 2026 Nanotech. All rights reserved.