An 1838 paper about Belgian population growth is still the world's most common way to make a machine state a probability. Logistic regression sits underneath spam filters, credit scores, medical risk models, the final layer of most AI classifiers, and the calibration tricks that labs apply to large language models. It is the oldest workhorse in machine learning, and it explains more about how modern AI produces confidence numbers than almost any newer method.
The idea in one paragraph
A model takes its inputs, multiplies them by learned weights, and sums the results. That sum is a score that can range from negative infinity to positive infinity, which is an awkward thing to hand to anyone who asked for a probability. Logistic regression's move is to push the score through the logistic function, an S-shaped curve that squashes the entire number line into the interval between 0 and 1. A large positive score becomes a probability near 1, a large negative score near 0, and a score of exactly 0 maps to a coin flip. The model's job is then just to learn the weights that place genuine positives on the high end and genuine negatives on the low end (Wikipedia: logistic regression).

From Verhulst's Belgians to Cox's binary outcomes
The curve predates machine learning by about 140 years. In 1838, the Belgian mathematician Pierre François Verhulst published a short note arguing that Thomas Malthus had it wrong: populations do not grow exponentially forever, because growth is limited by available resources. Verhulst's equation makes the growth rate proportional to both the current population and the remaining capacity, producing an S-shaped curve that saturates at a "carrying capacity" (Wikipedia: logistic function, Verhulst's logistic curve, arXiv). He named the curve "logistique" in a later paper, and the etymology of even that word is contested; one hypothesis is that it is a misheard form of "logarithmic" (Springer: Verhulst and the logistic equation).
The idea went dormant until it was rediscovered twice in the early 20th century: by A. G. McKendrick in 1911, modeling bacterial growth in broth, and by Raymond Pearl and Lowell Reed at Johns Hopkins in 1920, fitting yeast cultures and US census data. Their work is why the curve is sometimes called the Verhulst-Pearl equation (Wikipedia: logistic function).
Statisticians then needed exactly this S-shape for a different problem: predicting binary outcomes like dead or alive from a drug dose. Chester Bliss proposed the probit curve in 1934; Joseph Berkson argued for the logistic alternative in 1944. The modern, multivariable form arrived with David Cox's 1958 paper "The Regression Analysis of Binary Sequences," which turned the bioassay curve into a general statistical model that fits any set of features to any yes-or-no outcome (Wikipedia: logistic regression).
Why the S-curve, and why the coefficients are odds
Clipping a linear score at 0 and 1 would also produce something probability-shaped, but it breaks the math: millions of observations pile up exactly at the boundary and the model gets no gradient telling it which way to improve. The logistic function is smooth everywhere and strictly increasing, so every score change moves the prediction a little. It is also invertible: the inverse takes a probability back to the log of its odds, which means the model is really saying "the log-odds of the outcome are a linear function of the inputs." That gives every coefficient a direct reading. A coefficient of 0.7 means the feature multiplies the odds of the outcome by e^0.7, about 2 times. This is why the odds ratio is the reported number in so many medical studies: it falls out of logistic regression almost for free (Wikipedia: logistic regression).
Fitting it: no algebra, just iteration
Ordinary linear regression has a closed-form solution, one matrix formula that returns the best weights. Logistic regression does not, because the sigmoid enters the likelihood nonlinearly and setting the derivative to zero cannot be solved directly. Instead, every statistics package fits it iteratively, classically with the Newton-Raphson method, which for this problem becomes a procedure called iteratively reweighted least squares (STA 211 lecture notes, Duke University, Iteratively Reweighted Least Squares for Maximum Likelihood, J. R. Stat. Soc.).
The payoff for that inconvenience is unusual in machine learning: the logistic likelihood is convex, so there is exactly one best answer. Gradient descent cannot get stuck in a bad local optimum, and convergence takes a handful of iterations even on millions of rows. Most neural networks offer no such guarantee. When a practitioner says a model "always finds the optimum," logistic regression is usually the model they mean.
What it has to do with large language models
Three things, all load-bearing.
Softmax is logistic regression with more classes. The layer at the end of every language model that turns hidden states into a distribution over the vocabulary is multinomial logistic regression, also called softmax regression. In the two-class case it reduces exactly to binary logistic regression, the same sigmoid and the same S-curve (Stanford UFLDL: Softmax Regression). A language model differs from a statistics textbook in that the inputs to the logistic layer are learned features rather than hand-specified columns; the probability machinery on top is identical.
Probes are logistic regressors pointed at a model's interior. The standard way to ask "does this layer encode grammar, or language, or truthfulness?" comes from a 2016 paper by Guillaume Alain and Yoshua Bengio: freeze a trained network, then fit an independent linear classifier on each intermediate layer and see how well it predicts the property of interest from that layer's activations alone. Their finding, that linear separability of class information increases with depth, came from exactly this technique (Understanding intermediate layers using linear classifier probes, arXiv). Interpretability work on transformers runs on the same plumbing; a 2022 survey by Yonatan Belinkov catalogs the promises and the known failure modes of the probing method (Belinkov, Probing Classifiers: Promises, Shortcomings, and Advances, Computational Linguistics).
Calibration is logistic regression used as a seatbelt. In 1999, John Platt proposed fitting a small logistic regression on a classifier's raw scores, on held-out data, to convert them into well-calibrated probabilities. This became the default fix for support vector machines and is still known as Platt scaling (Platt, Probabilistic Outputs for Support Vector Machines, 1999, Train in Data: The Complete Guide to Platt Scaling). When Chuan Guo and colleagues benchmarked calibration for modern neural networks in 2017, they found trained networks are systematically overconfident, and that the most effective fix was a one-parameter simplification of Platt scaling they renamed temperature scaling, which beat strictly more expressive variants (On Calibration of Modern Neural Networks, arXiv). The temperature parameter exposed on every frontier LLM API is a direct descendant of that 1999 logistic regression.

Where it breaks
Logistic regression draws straight-line decision boundaries. If the true boundary between classes is curved, the model cannot represent it no matter how much data you feed it; that limitation is the entire motivation for deep learning, and the famous XOR problem the standard classroom demonstration of it (Wikipedia: logistic regression). Two failure modes matter in practice. When classes are perfectly separable, the maximum-likelihood solution runs off to infinity, coefficients growing without bound; regularization exists partly to stop that. And the coefficients describe association, not causation: an odds ratio says what co-occurs with the outcome in the data, not what would change the outcome if you intervened, a distinction that has caused real trouble in medicine and criminal justice alike.
The takeaway
Logistic regression survives because of what it is not: not non-convex, not a black box, not miscalibrated by default, and cheap enough to fit while you wait. Two centuries after Verhulst used it to argue with Malthus about Belgian birth rates, it remains the shortest path from a number to a probability, and it is quietly the last thing every language model does before answering you.
Sources
- Wikipedia: Logistic function (Verhulst 1838, naming 1844/1845, McKendrick 1911, Pearl and Reed 1920)
- Wikipedia: Logistic regression (Cox 1958, Berkson 1944, Bliss 1934, applications and limits)
- Verhulst's Logistic Curve, arXiv 0706.3163 (derivation from exponential growth, carrying capacity)
- Springer: Verhulst and the logistic equation (1838) (primary references, rediscovery in the 1920s)
- Cox, D. R. 1958, The Regression Analysis of Binary Sequences (JRSS-B 20(2):215-242)
- Duke STA 211 lecture notes and Green, Iteratively Reweighted Least Squares for Maximum Likelihood (no closed form, Newton-Raphson/IRLS fitting)
- Stanford UFLDL: Softmax Regression (two-class softmax reduces to logistic regression)
- Alain & Bengio 2016: Understanding intermediate layers using linear classifier probes
- Belinkov 2022: Probing Classifiers: Promises, Shortcomings, and Advances (Computational Linguistics survey of linear probes)
- Platt 1999: Probabilistic Outputs for Support Vector Machines; Train in Data: The Complete Guide to Platt Scaling
- Guo et al. 2017: On Calibration of Modern Neural Networks
