Concepts / Evaluation Pipelines for Foundation Models

Evaluation Pipelines for Foundation Models

Large models need large amounts of training data, which is expensive and slow to collect, so providers often use whatever data is available, and that may leave gaps for specific tasks.

  • Programming

A Hospital Assistant and the Question of What the Model Has Seen

Imagine a hospital network that wants an assistant able to read and summarize clinical notes written in a regional language and in one specialized medical vocabulary. Before anyone thinks about which model design to pick, a more basic question appears: what has the model seen? A model can only become good at patterns that appear in the material it learned from. For foundation models, that material is the training data, and it is one of the most important factors in how a model performs.

This article follows the chain of decisions that starts with training data. Data feeds into design choices such as the size of the model, the way the model is refined after its first training phase, and the way it produces output. Each of these choices connects back to the data question, so keep the hospital scenario in mind as you read.

Why Training Data Quantity and Quality Matter

Large models need large amounts of training data. Collecting that data is expensive and slow, so providers often use whatever data is available. That choice can leave gaps for specific tasks. The data a model learned from sets the boundary of what it can reliably do, because the model's abilities come from patterns present in that material.

In the real world

Consider the hospital assistant again. If the training material contains plenty of general English text but very few clinical notes in the regional language, the model has seen few examples of the patterns it must handle. Curating data for that language and that vocabulary is the step that addresses the gap, even though it adds cost and time.

Measuring Scale With Parameters, Tokens, and Compute

Model scale is described with three numbers. Each one answers a different question, and they must be read together rather than one at a time.

Definition

Parameters are the adjustable values inside the model. The number of parameters describes the size of the model itself.

Definition

Training tokens are the pieces of text the model is trained on. The number of training tokens describes the size of the dataset.

Definition

FLOPs needed for training describe the training compute, meaning how much computational work the training run requires.

The three numbers are not independent. Two factors in particular shape how much compute training requires: the size of the model and the size of the dataset. A bigger model or a larger dataset generally means more training work. So a statement like this model is large tells you little until you also know how many tokens it was trained on and how much compute that took.

Trading Model Size Against Data Under a Fixed Budget

Suppose the total compute budget is fixed. Model size and data size both draw on that same budget, so increasing one leaves less room for the other. A scaling law is the rule that reads the budget and suggests a balanced allocation between parameters and tokens. It helps find the best balance of parameters and tokens for a given compute budget.

Fixed computebudgetsame total FLOPsMore parameterslarger modelFewer training tokensless data fits the budgetFewer parameterssmaller modelMore training tokensmore data fits the budgetspend on sizeleaves less for dataspend on sizeleaves more for data
With total compute fixed, a larger model leaves room for fewer training tokens, while a smaller model leaves room for more. A scaling law helps choose the balance.
Worked example

Reasoning About a Fixed Budget

A team has one fixed training compute budget and must decide whether to build a larger model or a smaller model trained on more data. How should they reason about it?

  1. 1
    Identify the fixed quantity

    The total compute budget does not change between the two options.

  2. 2
    Identify what competes for it

    Model size and dataset size both consume that budget, so they compete with each other.

  3. 3
    Apply the trade-off

    Choosing a larger model leaves fewer tokens within the same budget. Choosing more tokens leaves less room for parameters.

  4. 4
    Use the scaling law

    The scaling law is the rule that suggests a balanced split between parameters and tokens for this budget, instead of pushing all of it into one number.

Result

The team does not pick the biggest model by default. It uses the budget to find a balance between parameters and tokens.

Post-Training After Pretraining

Pretraining produces a model whose outputs may not match what users want. Post-training comes after pretraining to address this. It is made of two steps: supervised finetuning and preference finetuning. Post-training narrows the gap between what a pretrained model produces and what people want.

Pretrained basemodeloutput may not match userwantsSupervised finetuningpost-training step onePreference finetuningpost-training step twoRefined modelcloser to user wants, notperfectpost-training beginsthenresult
Post-training runs after pretraining in two steps, each addressing outputs that do not align with what users want.

The order matters because each step builds on the model produced before it. Supervised finetuning is the first post-training step, and preference finetuning is the second. Both exist because the pretrained model alone does not reliably produce outputs aligned with user expectations.

Sampling Turns Scores Into a Chosen Token

A model that produces text does not simply output one fixed answer. Its outputs are probabilistic. Generation can be pictured as a sequence of decisions: for each position, the model produces probability scores over candidate next tokens, and a sampling step picks one token from that distribution. The chosen token is then part of what comes next.

Promptinput textModelcomputes next-token scoresProbabilitydistributionone probability percandidate tokenSampling steppick one token from thedistributionChosen tokenmay differ on another runfed inproducessampledselects
The same prompt yields a probability distribution over candidate next tokens, and sampling selects one token from it, so different runs can choose different tokens.

Predicting Whether Repeated Prompts Match

What do you think happens?

If you send the exact same prompt to a model twice, will you always receive the identical output?

  • Yes, the output is fixed by the prompt

  • Not necessarily, because the output is sampled from a probability distribution

Reveal answer
Answer:

Not necessarily. Because outputs are sampled from a probability distribution, the same prompt can produce different outputs.

Sampling picks a token from the distribution rather than always taking the single most likely one, so repeated runs can diverge.

Benefits and Risks of Probabilistic Output

Because sampling makes outputs probabilistic, the model can produce varied wording for the same request. That variety can be useful when a user wants alternatives. The same property creates risk. Output that is not fixed can be harder to predict and harder to reproduce, so a reviewer who checks one response cannot assume the next response will match it.

In the real world

In the hospital setting, varied phrasing may be harmless when the assistant rewrites a sentence for readability. But if a summary of a clinical note changes meaning between runs, the same flexibility becomes a serious risk. This is why the evaluation of outputs matters as much as the training that produced them.

Mistakes Beginners Make About Scale and Output

  • Common mistake

    Judging a model by its parameter count alone

    What it looks like

    Calling a model strong because it is large, without asking how many tokens it was trained on.

    Why it fails

    The three scale numbers are not independent. Model size and dataset size both draw on the same training compute.

    Do this instead

    Read parameters, training tokens, and training compute together.

  • Common mistake

    Assuming more data always solves the task

    What it looks like

    Believing a general collection will cover a regional language or a specialized medical vocabulary.

    Why it fails

    Providers often use whatever data is available, and that may leave gaps for specific tasks.

    Do this instead

    Check coverage for the target language or domain, and curate data where gaps exist.

  • Common mistake

    Believing post-training makes outputs perfect

    What it looks like

    Assuming that after supervised and preference finetuning, the model always matches what users want.

    Why it fails

    Human preference is diverse and cannot be fully captured, so post-training does not guarantee a perfect match.

    Do this instead

    Treat post-training as narrowing the gap, and keep evaluating outputs.

  • Common mistake

    Expecting identical output for identical prompts

Checking the Hospital Assistant Design

MEDIUM

The hospital team has a fixed training compute budget. Its training data has very few clinical notes in the regional language. Describe, in order, the data problem to address first, how the scale numbers and the scaling law should inform the model size decision, what post-training should address, and why the team should still check outputs after sampling.

Hints
  • Start with what the model has seen, since data sets the boundary of what it can do.
  • Model size and dataset size compete for the same compute budget.
  • Post-training narrows the gap with user wants but does not guarantee a match.
  • Sampling can produce different outputs for the same prompt.

Key Takeaways

  • The quantity and quality of training data set the boundary of what a foundation model can reliably do, and gaps in coverage often appear for low-resource languages and specialized domains.
  • Model scale is described by parameters, training tokens, and training compute measured in FLOPs, and these three numbers must be read together.
  • With a fixed compute budget, model size and data size compete, and a scaling law suggests a balanced allocation between parameters and tokens.
  • Post-training follows pretraining in two steps, supervised finetuning and preference finetuning, which narrow the gap between model output and what users want without guaranteeing a perfect match.
  • Sampling picks tokens from a probability distribution, so outputs can vary across runs, which brings both useful variety and reproducibility risk.

Related concepts

More concepts starting with E