Describing processes or systems that incorporate randomness and probabilistic outcomes.
In mathematics and computer science, stochastic refers to any system, process, or model that is inherently random — where outcomes are determined by probability distributions rather than fixed, deterministic rules. The term derives from the Greek stokhazesthai, meaning "to guess" or "to aim at." In machine learning, stochasticity is not merely a nuisance to be minimized but a deliberate and powerful tool embedded throughout the discipline's core methods.
The most prominent example of stochasticity in ML is stochastic gradient descent (SGD), the optimization workhorse behind training deep neural networks. Rather than computing gradients over the entire dataset — which would be computationally prohibitive — SGD estimates gradients from randomly sampled mini-batches. This randomness introduces noise into the optimization process, but that noise turns out to be beneficial: it helps models escape sharp local minima and often leads to better generalization on unseen data. The stochastic nature of the update rule is thus a feature, not a bug.
Beyond optimization, stochasticity appears throughout ML in forms such as dropout regularization (randomly deactivating neurons during training), stochastic data augmentation (applying random transformations to training examples), and probabilistic generative models like Variational Autoencoders (VAEs) and diffusion models, which explicitly learn and sample from probability distributions. Reinforcement learning also relies heavily on stochastic policies, where agents select actions according to probability distributions rather than rigid rules, enabling exploration of the environment.
Understanding stochasticity is essential for interpreting model behavior, designing robust training pipelines, and reasoning about uncertainty in predictions. Deterministic models produce the same output for a given input every time; stochastic models may produce different outputs, which can be critical for applications requiring calibrated confidence estimates or diverse sample generation. As ML systems are deployed in high-stakes domains — medicine, finance, autonomous systems — the ability to model and communicate uncertainty through stochastic frameworks has become increasingly important.