TechByteByByte

Prediction

What a trained model actually produces when it's put to work — a calculated guess with a confidence level, not a guaranteed fact.

#prediction#machine-learning#probability#core-ml-foundations

You now have a trained Model — the finished cake, tuned through Training on real data. This article is about what happens the moment you actually hand that model something new and ask it to do its job. What comes out is called a prediction.

The simple definition

A prediction is a model’s calculated guess about something it wasn’t explicitly told — based entirely on the patterns it learned during training. When a spam filter labels an email “spam,” that’s a prediction. When a weather model says “72% chance of rain tomorrow,” that’s a prediction. When a chatbot writes the next word of its response, that, too, is a prediction — a guess at what word should come next.

The word “guess” isn’t meant to sound dismissive. These guesses are often extremely accurate, calculated using the sophisticated, learned math covered throughout this glossary. But “guess” is the technically honest word, and holding onto that honesty is exactly what separates a careful user of AI from an overconfident one.

From features to a prediction

Suppose a spam model receives an email:

"Congratulations! Claim your free prize now."

The system converts the email into features or learned representations, runs them through the trained model, and produces scores.

Email

Numerical representation

Trained model

spam: 0.93, not spam: 0.07

Predicted class: spam

The prediction is the model’s calculated result. It is not a guaranteed fact.

Score, probability, class, and decision

These outputs are related but different:

  • A score expresses the strength of an output.
  • A probability estimate attempts to represent likelihood.
  • A predicted class is the category selected from scores.
  • A decision is what the application chooses to do with the prediction.
Model score: 0.93
        ↓ application threshold
Prediction: spam
        ↓ business rule
Decision: move email to spam folder

Changing the threshold can change the prediction or action without retraining the model.

Predictions are not always about the future

A model can predict:

  • Whether an existing image contains a dog
  • Which language a sentence uses
  • The price of a house
  • Which token should come next
  • Whether a future payment may be fraudulent

In Machine Learning, prediction means producing an unknown output from input. The unknown value may concern the present, past, or future.

A code example

spam_probability = 0.93
review_threshold = 0.80

if spam_probability >= review_threshold:
    prediction = "spam"
else:
    prediction = "not spam"

print(prediction)

The model would normally produce spam_probability. Ordinary rule-based code applies the chosen threshold. This shows how learned predictions and fixed rules cooperate in a production system.

Evaluating predictions

A useful evaluation compares predictions with trustworthy expected outcomes across many representative examples. The correct metric depends on the task and cost of mistakes.

For rare diseases, fraud, or dangerous defects, accuracy alone can hide failure. Teams may also inspect precision, recall, confusion matrices, calibration, group-level performance, and the real consequences of false positives and false negatives.

Prediction mistakes

  • Treating confidence as certainty
  • Displaying an unverified prediction as a fact
  • Using a threshold chosen on the test set
  • Ignoring how error costs differ
  • Assuming yesterday’s performance remains stable
  • Automatically executing high-impact actions from uncertain output

Why “prediction” is the right word, technically

Recall from the Pattern article that a model doesn’t possess understanding — it has learned parameters shaped by regularities in its training data. When you give it new input, it isn’t recalling a memorized fact; it’s running that input through its learned parameters and producing the output its training says is most likely correct. That’s a prediction in the strict statistical sense: an estimate based on past patterns, applied to a new, specific case — the same sense in which a doctor “predicts” a diagnosis from symptoms, or a meteorologist “predicts” tomorrow’s weather from today’s atmospheric data.

What a prediction actually looks like, under the hood

This is where it’s worth being precise, because the raw output a model computes and the friendly answer you’re shown are often two different things — a point first raised in the Output article.

For a classification model, the raw prediction is usually a probability for each possible category, not a flat label. A spam filter doesn’t compute “spam” — it computes something like “97% spam, 3% not-spam,” and a downstream rule converts that into the label you actually see.

For a large language model like GPT, Gemini, or Claude, prediction happens one token (roughly a word-piece) at a time. At each step, the model calculates a probability across its entire vocabulary — tens of thousands of possible next tokens — for what should come next, using a mathematical function called softmax that turns raw internal scores into a clean probability distribution that adds up to 100%.

A setting called temperature then controls how the model uses those probabilities: a low temperature makes it almost always pick the single most probable token (safe, predictable, sometimes repetitive text), while a higher temperature lets it more often pick less-likely tokens (more varied, creative, but occasionally stranger output). This is a real, adjustable setting available in most AI developer tools — not a hidden implementation detail.

flowchart LR
    A[New Input] --> B[Trained Model]
    B --> C[Raw probabilities across possible outputs]
    C --> D[Decision rule / sampling method]
    D --> E[Final Prediction shown to the user]

ANALOGY vs. TECHNICAL REALITY

Analogy: Think of an experienced doctor looking at a set of symptoms and saying, “I’d estimate an 80% chance this is condition A, and a 20% chance it’s condition B.” They’re not certain — they’re offering a calibrated, experience-based estimate, and a good doctor will tell you plainly when they’re not sure.

Where this breaks down: A doctor’s confidence is grounded in genuine medical reasoning and can be explained and questioned. A model’s confidence score is a mathematical output of its training, not a reasoned judgment — and, importantly, it isn’t always well-calibrated to real-world accuracy. A model can report 95% confidence and still be wrong more often than that number would suggest, particularly on inputs quite different from what it saw during training. Confidence, in a model, describes how strongly its internal math leans toward an answer — not a guarantee about how often that answer is actually correct.

A concrete example, layered

A simple credit-scoring model predicts a single number: the probability a loan applicant will default, say 0.12 (12%). A bank’s policy might turn any prediction above 0.15 into an automatic decline — the raw prediction and the final business decision are related but distinct things, echoing the fraud-detection example from the Output article.

At a much larger scale, a system like ChatGPT or Claude predicts, one token at a time, the most statistically fitting continuation of a conversation, repeating that single-token prediction process potentially hundreds of times to assemble a full paragraph — every fluent sentence you read from one of these systems is really a long chain of individual next-token predictions, strung together.

Key terms

  • Prediction: A model-generated estimate, category, value, or sequence.
  • Score: A numerical output used to rank or compare possibilities.
  • Threshold: A boundary that converts a score into a class or action.
  • Confidence: A system’s numerical strength for an output, not a guarantee.
  • Calibration: How well predicted probabilities match observed frequencies.

Check your understanding

Is every prediction a forecast about the future? No. It can estimate any unknown output.

If a model says 90% confidence, is it correct 90% of the time? Not necessarily. That interpretation requires appropriate calibration and evaluation.

Common misconception

The most important misconception to correct here, because it comes up constantly: a confident-sounding prediction is not the same as a correct one. This is precisely the mechanism behind AI “hallucinations,” first mentioned in the Artificial Intelligence article — a language model can predict a wrong fact with exactly the same fluent confidence as a correct one, because fluency and correctness are two different things the model was never explicitly forced to keep separate.

Treating every prediction as a verified fact, rather than as a calculated estimate, is one of the most common and consequential mistakes people make when relying on AI output for anything important.

Follow one prediction all the way to a decision

A model may produce an internal score of 1.39, which becomes a default probability of 0.80. A chosen threshold turns that probability into the class “high risk,” while bank policy may turn the class into the action “request additional review.”

Changing the threshold can change decisions even when the model does not change. For an LLM, GPT, Gemini, or Claude produces scores for possible next tokens, converts them into a distribution, selects a token according to decoding settings, and repeats.

Where this fits in what comes next

Prediction is the result; the next article, Inference, covers the broader process of actually running a trained model to produce that result in a live, real-world system — including the practical concerns, like speed and cost, that come with doing this at scale.

In one sentence

A prediction is a model’s calculated, probability-based estimate — not a guaranteed fact — and understanding that distinction is the single most practical piece of judgment you can carry forward into every future interaction with an AI system.

Author
TechByteByByte Editorial Team
Reviewed by
TechByteByByte Admin
Published
Last reviewed