← Blog

Statistical Inference vs AI Inference: Same Word, Different Worlds

Why "inference" means something different in statistics and in machine learning.

What is the difference between statistical inference and AI inference?

When talking about AI, inference is one of the words that comes up the most. The first time that I heard the word inference was in my “statistical inference” classes. Despite the common relation between statistics and AI, this word doesn’t mean the same thing in both of those fields. This article tries to clarify the difference between “statistical inference” and “inference” in machine learning.

AI Inference

In machine learning, the term inference is the act of predicting new output from a trained model. Basically, it consists of using a trained model on a given input to do what it’s meant for: generating predictions, supporting decisions, and so on. For instance, in the case of Large Language Models (LLMs), a response is generated given a user prompt. In the context of price prediction, a new price is inferred by the model given a set of features. AI inference is a compute-intensive process that requires specialized hardware and software, mostly GPUs, TPUs and NPUs, and often distributed compute. It consists of deploying the trained model for the sole purpose of predicting new data. AI inference can be categorized into two different types: online inference and batch inference. Online inference requires input data to be immediately processed. This kind of AI inference is mostly the one used by autonomous driving systems, online chatbots powered by LLMs, recommendation algorithms, and so on. The second kind of AI inference is batch inference, which doesn’t require an immediate output from the system.

Statistical Inference

On the other hand, statistical inference refers to using data from a sample to draw conclusions about a larger population, mostly because we can’t observe the entire population. Statistical inference is different from descriptive statistics, which mostly consists of the computation of summary statistics like the mean, the median, the quartiles, the variance, and so on. Inference is divided into many methods. The two most important are estimation and hypothesis testing. In estimation, the goal is to produce a value or an interval for an unknown aspect of the population. There are two kinds of estimations: point estimation and interval estimation. Roughly speaking, a point estimate is a single-value estimate of an unknown parameter made using a statistical estimator. Interval estimation, also known as set estimation, consists of giving an interval where the true value of the population parameter might be for a given measure. In statistical inference, a model is built upon specific assumptions regarding a population parameter. Statistical modeling then involves testing two competing hypotheses, the null hypothesis (H0), which is the default assumption and the alternative hypothesis (H1), under certain conditions to determine whether to reject or fail to reject that initial statement.

Conclusion

AI inference and statistical inference serve two different goals. AI inference consists of predicting new values or using an automated machine learning system to make a decision from a trained model. On the other hand, in statistics, inference is made under certain assumptions, relying on a set of statistical tests determining whether the model holds, ultimately allowing us to use a sample to draw conclusions about unobservable population parameters. In most cases, statistical inference doesn’t require the computational power that machine learning does.