LIVE · Thursday 3 December

How Much Training Data Does a Decision Model Need? Run a Learning Curve, Then Count the Rare Cases

No fixed number of training examples exists. A rule-based decision model needs none, and a learned one needs as many as a learning curve and your rarest important outcome show.

By Surya11 min read

A decision model needs no training data at all if it is built from business rules, and an unknown amount if it learns from examples. The way to find that amount is a learning curve: train on increasing samples, score each one on the same held-out validation data, and stop when the curve flattens. Total row count can mislead, because a 1% outcome gives only about 100 cases in 10,000 random records. Plan for enough of the decisions that matter, not just enough rows.

The kind of decision model that you build determines whether you need training data

"Decision model" covers three different things. Each one needs a different amount of data, but all three need task-specific examples that are held out for testing.

IBM's documentation describes the first kind. "Decision models allow you to capture business decisions in a decision diagram," it says. People then add the logic "by creating business rules and decision tables." Nothing is learned from examples. The last step in IBM's process is to create test data sets that "run your decision and make sure it works as expected."

The second kind is a pretrained model that is used without changes. Some models are now built to rank the next action from a list of allowed actions. You supply the state and the options, and the model returns a choice. No training data is needed to start, but you still need labeled examples to measure whether its choices are good enough for your task.

The third kind is a model that you train or adapt on your own decisions. This is the only kind for which the question "how much training data" has a real answer, and that answer depends on the task. Google's machine learning course puts the range plainly: "For some relatively simple problems, a few dozen examples might be sufficient. For other problems, a trillion examples might be insufficient." It adds that good results from a small dataset are possible "if you are adapting an existing model."

The table below sets out what each approach needs.

Approach What you supply Training data needed Evaluation data needed
Authored rules and decision tables Rules written by people None Test cases for every rule path
Pretrained model used without changes State, options and a prompt None Held-out labeled decisions
Model trained or adapted on your decisions Labeled past decisions Set by a learning curve Held-out, calibration and test sets

Custom training is not always necessary. Every approach should be scored on the same held-out examples from your own task, and the cheapest approach that meets the target should win.

One training example is one independent decision, not one row

A decision model chooses one option for one situation. A useful training example therefore has three parts: the state that the model sees, the options that were allowed, and the choice that was acceptable.

Many logs store this differently. A support log may hold one row for each candidate option, so a decision among eight options becomes eight rows. Counting those rows overstates the data by eight times. Count decisions instead.

Decisions are also often related to each other. Several turns in one conversation share a customer, a problem and a tone. If some turns go to training and others go to testing, the test score measures memory of that conversation rather than skill on new ones. The cross-validation guide for scikit-learn describes this problem: "The i.i.d. assumption is broken if the underlying generative process yields groups of dependent samples." Its fix is to make sure that validation samples come from groups that do not appear in training at all. Its GroupKFold splitter does this, and StratifiedGroupKFold also tries to keep the share of each class similar across splits.

Exact copies need the same treatment. Google's course says to "delete any examples in the validation set or test set that are duplicates of examples in the training set." Its reason is that "the only fair test of a model is against new examples, not duplicates."

Label quality should be recorded on its own. Google lists bad labels as a main cause of unreliable data and recommends "using automation to flag unreliable data." For decisions, a second problem appears: sometimes the policy itself allows two answers. Write down which cases are ambiguous under policy, have a sample labeled twice, and report how often the two labelers agree. More rows cannot fix a label that the policy does not settle.

A learning curve shows whether more data is still helping

scikit-learn's documentation gives the core definition. "A learning curve shows the validation and training score of an estimator for varying numbers of training samples," it says. "It is a tool to find out how much we benefit from adding more training data."

The shape of the two lines gives the answer. When the training score is much higher than the validation score at small sizes, scikit-learn says that "adding more training samples will most likely increase generalization." When both scores meet at a low value, "we will probably not benefit much from more training data." In that case the problem lies in the features, the labels or the model, not in the number of rows.

A curve does not establish a guaranteed minimum. A review of the research by Tom Viering and Marco Loog found that learning curves "are surprisingly diverse and no universal model can be identified." Some even show worse results with more data. Their 2022 revision adds more doubt that power laws reliably describe the curves. Read a curve for the range that you measured, and do not extend it far past the largest sample.

The experiment needs nested samples, repeated seeds and four separate data sets

A learning curve can be trusted only when the data that measures it never changes and never leaks. The experiment below uses four separate sets, all split by conversation or other group:

  • A final test set of about 15% is set aside first and is not used until the very end.
  • A calibration set of about 10% is kept for checking and fitting confidence scores.
  • A fixed validation set of about 15% scores every point on the curve.
  • A training pool with the remaining 60% supplies the increasing samples.

The samples should be nested, so that each larger sample contains the smaller ones. Then a change in score comes from more data, not from a different mix of data. Repeating the whole curve with several random seeds shows how much the score moves by chance. The learning_curve function in scikit-learn takes prefixes of the training data, and it shuffles only if shuffle=True, so the order of the rows must be controlled.

The script below runs the experiment for a simple text classifier. It assumes a table df with one row per independent decision and the columns text, label and group_id.

import numpy as np
import pandas as pd
from sklearn.model_selection import GroupShuffleSplit
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import make_pipeline
from sklearn.metrics import accuracy_score, recall_score

def group_split(frame, share, seed=0):
    gss = GroupShuffleSplit(n_splits=1, test_size=share, random_state=seed)
    keep, out = next(gss.split(frame, groups=frame.group_id))
    return frame.iloc[keep], frame.iloc[out]

rest, test = group_split(df, 0.15)       # final test set: do not score until the end
rest, calib = group_split(rest, 0.12)    # calibration set
pool, val = group_split(rest, 0.20)      # fixed validation set and training pool

RARE = "escalate_to_fraud_team"          # replace with your rarest important outcome
groups = pool.group_id.unique()
sizes = [g for g in [100, 250, 500, 1000, 2000, 4000] if g <= len(groups)]
rows = []
for seed in range(5):
    order = np.random.default_rng(seed).permutation(groups)
    for n in sizes:                      # nested: each sample contains the smaller ones
        part = pool[pool.group_id.isin(order[:n])]
        model = make_pipeline(TfidfVectorizer(), LogisticRegression(max_iter=2000))
        model.fit(part.text, part.label)
        pred = model.predict(val.text)
        rows.append({
            "seed": seed, "groups": n, "decisions": len(part),
            "train_acc": accuracy_score(part.label, model.predict(part.text)),
            "val_acc": accuracy_score(val.label, pred),
            "rare_recall": recall_score(val.label, pred, labels=[RARE], average="macro"),
        })
curve = pd.DataFrame(rows).groupby("groups").agg(["mean", "std"])
print(curve)

Plot the mean training and validation scores against the number of groups, with a band for the spread across seeds. Run the same loop for every candidate that learns. Score authored rules and an unmodified pretrained model once on the same validation set, and draw them as flat lines. A DummyClassifier, which in scikit-learn's words "makes predictions that ignore the input features," gives the floor that every option must beat. A learned model justifies its training cost only where its curve rises clearly above those lines.

Rare outcomes need their own count before the total count matters

The rarest outcome that matters usually sets how much data you need. Google's course warns that "a severely class-imbalanced dataset might not contain enough minority class examples for proper training."

The arithmetic is simple. A 1% outcome gives an expected 100 cases in 10,000 random records. After the split above, about 60 of those land in the training pool, 15 in validation, 15 in the test set and 10 in calibration. Those are expected counts, and a random draw of 10,000 records will usually vary by about 10 cases either way.

An expected count is not the same as enough evidence. Suppose that the model handles all 15 rare test cases correctly. A 95% Wilson score interval, one of the methods in the statsmodels proportion_confint function, still puts the true rate as low as 79.6%. If the model gets 45 of 50 right, the interval runs from 78.6% to 95.7%. With an observed 90%, about 70 rare test cases are needed before the lower bound passes 80%. At a 1% rate, that means about 7,000 random records in the test set alone.

Coverage planning should therefore list every option, every rare outcome, every language and every customer segment that matters. Set a minimum count for each one in the validation and test sets. When random sampling cannot reach those counts, collect the rare cases on purpose and report results for each group separately. Google suggests treating downsampling and upweighting "just as you would experiment with other hyperparameters" when you train on imbalanced data.

Confidence scores need a separate calibration check

A decision model often acts only when it is confident and passes other cases to a person or a larger model. That design works only if the confidence scores are calibrated. The scikit-learn guide gives a binary example. Among the cases that a well-calibrated classifier scores near 0.8, about 80% actually belong to the positive class.

Calibration must be checked on data that the model did not train on. The same guide says that the calibrator should be fit "on a dataset independent of the training data," because training data produces "a biased calibrator." This is why the experiment keeps a separate calibration set. Use a reliability diagram to see where scores are too high or too low. The guide also notes that a lower Brier loss "does not necessarily mean a better calibrated model," so do not use it as the only calibration measure.

A stopping worksheet turns the curve into a decision

Write the targets down before the first model is trained. Then the decision to stop is a check against agreed numbers, not a judgment made after seeing the results. Stop labeling when every line below is met on validation data, then confirm once on the final test set:

  1. The model meets the agreed held-out decision quality for your main metric, and the last doubling of data raised it by less than the agreed step.
  2. Each rare outcome meets its rare-case target, judged by the lower bound of its interval rather than the observed rate.
  3. The model is well calibrated in the score range where it acts on its own.
  4. The model covers enough cases at the agreed error rate, measured as the share of decisions that it handles above its confidence threshold.
  5. The cost of the next batch of labels and training is lower than the value of the expected gain.

Report latency and whole-task success on their own lines if you measure them. A faster model or a higher score on single decisions does not prove that whole tasks succeed more often.

The worksheet also shows when more rows are the wrong fix. If training and validation scores have met at a low value, better features or a different model will help more than more data. If two labelers often disagree, a clearer policy will help more than more labels. If one segment lags while the others pass, targeted collection for that segment is cheaper than labeling more of everything.

The worked cost example shows that labeling time costs more than training

Assume that a team's curve stands at 2,000 conversations and it is deciding whether to label 2,000 more. Assume that each decision takes a reviewer 45 seconds to label and that 10% are labeled twice to check agreement. That is 2,200 labels and 27.5 reviewer-hours.

Training is cheap by comparison. Together's pricing page lists supervised fine-tuning for Llama 3.1 8B at $0.34 per million tokens in its first fine-tuning table and $0.38 in a second one, with a $4.00 minimum per job in both. Assume 600 tokens per decision and three passes over 4,000 decisions. That is 7.2 million tokens, or $2.45 to $2.74, so the $4.00 minimum applies. A full tuned curve with five sizes and five seeds is 25 jobs, or about $100.

Scoring an unmodified model can cost even less. Parsec, a small language model lab, sells TOD, which it calls a "universal decision model" that ranks the next action from a supplied list of allowed actions. Its TOD page lists a price of $0.30 per 1,000 decisions, so scoring 3,000 validation and test decisions costs $0.90. TOD is a fit for the "pretrained model used without changes" row of the table. Parsec's own page also shows why the flat baseline matters. On the public JevBench set, TOD scored 84.4% against 86.2% for the untrained base model, a regression that Parsec says it will fix in the next release. Parsec publishes no price for custom tuning.

On these assumptions, the 27.5 reviewer-hours are the main cost of the next step. The stopping rule should be judged against that time.

No published learning curve yet compares all four approaches on one licensed routing dataset

The comparison that would settle most of this question has not been published. No public learning curve compares authored rules, a simple classifier, an unmodified named decision-model checkpoint and a tuned variant on one disclosed, licensed routing dataset, so that result has not been measured.

The PolyAI banking77 dataset is one suitable place to run it. Its card lists 13,083 online-banking queries labeled with 77 intents, split into 10,003 training and 3,080 test examples, under a CC BY 4.0 licence. The card does not mention duplicates or label quality, so those checks would come first. A useful release would record each model's architecture and checkpoint, the dataset version, the number of decisions at each point, the seeds, and every improvement that failed or was inconclusive.

Sources

More in Research

All Research →