What Is an AI Model?

What is an AI model? Follow one print job from training data to an 11-second prediction, and see how the model differs from its weights, algorithm, and app.

Three steps from training data to a trained model and its prediction.

An AI model is a representation that a computer uses to turn inputs into outputs. In machine learning, training fits that representation to examples. Consider a print shop: its model takes a page count and estimates how long a job will take. The estimate is the output; the model is the reusable relationship that produced it.

How does a model learn from data?

Suppose three completed print jobs give us these pairs: 1 page took 5 seconds, 3 pages took 9 seconds, and 5 pages took 13 seconds. The feature is page count, which the shop knows in advance. The target is the measured time, which it knows only after a job finishes. These are invented measurements, not a printer benchmark.

We choose a straight line: estimated seconds = weight × pages + intercept. That choice fixes the shape of the relationship but not its numbers. A least-squares fit chooses the two numbers that minimize the sum of squared differences between the measured and estimated times. Here, adding two pages always adds four seconds. A weight of 2 seconds per page and an intercept of 3 seconds fit all three jobs exactly. The 3 is a fitted offset, not proof that the printer spends exactly three seconds warming up.

Follow one prediction: a four-page job

Now a customer sends four pages. Using the fitted line gives 2 × 4 + 3 = 11 seconds. That calculation is inference: it needs the page count and the fitted parameters, not the recorded times or a fresh round of training. Suppose this job actually takes 12 seconds. Its absolute error is |12 − 11| = 1 second. We kept the four-page job out of training; using its measured time as an input would answer the question with information the shop did not yet have.

Try the fit and prediction in Python 3.10 or later. No packages or downloads are required beyond Python:

from statistics import linear_regression

pages = [1, 3, 5]
seconds = [5, 9, 13]
weight, intercept = linear_regression(pages, seconds)
estimate = weight * 4 + intercept
actual = 12  # observed after the prediction
print(f"{weight=}, {intercept=}")
print(f"Estimate: {estimate:.0f} s; absolute error: {abs(actual - estimate):.0f} s")

The first line prints weight=2.0, intercept=3.0; the second prints Estimate: 11 s; absolute error: 1 s.

Algorithm, architecture, weights, model, or app?

The training algorithm is the procedure that fits a line; the trained model is the particular line you can use afterward. Fit the same kind of line to a slower printer and you can get different numbers without changing the algorithm. Other machine learning algorithms can instead fit a tree with splits and leaf values: not every trained model is a list of neural-network weights.

The line is our choice of model form. In a neural network, the corresponding design is its architecture: how layers and units connect. Its weights scale signals, and its biases add offsets. The architecture tells you how to use those parameters, but it does not tell you their learned values. See how neural networks work for a worked comparison.

The app might count the pages in a PDF, call the model, add an estimate of the current queue delay, and display a pickup time. The line predicts only the run time. An empty queue and a ten-job queue produce the same model output for four pages, but the app should not promise the same pickup time.

When should you trust the estimate?

One held-out job checks the arithmetic, not reliability. On many later jobs, compare the absolute errors against a simple alternative, such as always predicting the median training time (9 seconds here). Track performance separately for color and black-and-white jobs. If color is slower, a page count alone cannot distinguish those cases. A 400-page run is also far outside the training range; the same neat formula may give a poor estimate.

Predicting one quantity is an example of narrow AI, not evidence that a system understands printers or can troubleshoot a paper jam. For the distinction between performing a task and understanding it, see how strong AI relates to AGI. AI also includes systems built from explicit rules rather than fitted from examples. To see parameters change one update at a time, train a one-neuron model in Python and watch what happens when the learning rate is too high.

Sources and further reading

For the equation and the roles of weight and bias, see Google’s introduction to linear regression. The Python statistics documentation specifies what the least-squares function returns.

As an Amazon Associate I earn from qualifying purchases. For a broader treatment of models and learning, see Stuart Russell and Peter Norvig’s Artificial Intelligence: A Modern Approach (Pearson, fourth edition, hardcover).