Why The Best AI Systems Learn to Wobble

Neural networks find robust solutions by being slightly wrong on purpose.

Optimization · Machine Learning · Neurosymbolic AI · Software Engineering
The Hidden Compass Inside Every AI: How Noise Teaches Machines to Survive Surprise
For a quarter century, computer scientists have known that the workhorse algorithm behind every neural network does something it was never designed to do. Now they are learning to copy that trick everywhere else.
2026

Imagine a hiker dropped into a vast mountain range with no map. The fog is so thick she can see only a meter of ground in any direction. Her job is to find a low valley and settle there. She has one rule: at every step, walk slightly downhill. If she walks carefully, she will find the nearest pit and stop. It might be a narrow gorge between two cliffs, the kind of place where a single gust of wind would tip her over the edge. She has technically succeeded. But it is the wrong kind of low point.

Now imagine she walks with a slight wobble. Her steps are not perfectly accurate. She drifts a few centimeters left, a few centimeters right, sometimes overshooting, sometimes undershooting. The wobble keeps her from settling into the gorge. She slides off its walls every time she tries. Eventually she comes to rest in a broad, gentle valley, the kind of place where small missteps no longer matter. The wobble has saved her.

This is, in cartoon form, the most important accidental discovery in modern artificial intelligence. The hiker is an algorithm called stochastic gradient descent, or SGD. The wobble is noise. And the broad valleys she keeps finding are what researchers now call flat minima, regions of mathematical space where a neural network has settled into a robust, generalizable solution. The fact that SGD's noise reliably steers networks toward these valleys is not a happy accident anymore. It has become a design principle, one that is reshaping how AI systems are built, how distributed software stays online, and how engineers think about resilience itself.

01 Sharp vs. flat minima
A sharp minimum is a narrow gorge in the loss landscape. A tiny change in weights and the model falls apart. A flat minimum is a broad valley: small perturbations barely move the loss. SGD's noise keeps sliding the model off sharp walls until it finds flat ground.
Sharp minimum narrow gorge high loss high loss small weight change → large error Flat minimum broad valley low loss low loss small weight change → small error
Sharp minimum (poor generalization)
Flat minimum (robust generalization)
I. The Geometry No One Was Looking For

To see why this matters, you have to picture what it means to train a neural network. A network with a few billion parameters lives in a space with a few billion dimensions. Every possible configuration of its weights is a single point in that space. Above this space floats a surface called the loss landscape, which measures how badly the network performs at any given point. Training means finding a low spot on that landscape.

The trouble is that the landscape is fantastically jagged. Some pits are narrow and steep. A model that lands in one of these has memorized the training data so precisely that any small change to its inputs throws it off. Other pits are broad and shallow. A model that lands in one of these has learned something more general. Show it a slightly different example and it still gets the answer roughly right.

In the late 1990s, a pair of European researchers writing in the journal Neural Computation proposed that the breadth of a pit, what they called the flatness of a minimum, ought to predict how well the network generalizes to data it has never seen. Their reasoning leaned on information theory. A flat minimum can be specified with fewer bits of precision, since you can wiggle the parameters and still get a working network. Fewer bits means a simpler model. Simpler models generalize better. The idea was elegant. It also lay mostly ignored for two decades.

Then, in 2016, a collaboration between Northwestern University and Intel turned the conjecture into a measurable engineering reality. They were investigating why training with very large batches of data, which would be much faster on modern hardware, produced models that performed worse on test data. Train with small batches, you get good accuracy. Train with batches sixteen times larger, accuracy collapses. The training loss looks identical in both cases. What they found was geometry. Small-batch training reliably landed networks in flat valleys. Large-batch training landed them in sharp pits.

Why was SGD doing this? At each step, the algorithm asks the network to make predictions on a small random sample of training data, called a mini-batch, computes how wrong those predictions are, and adjusts the weights in the direction that would have made them less wrong. The crucial word is random. If the algorithm used the entire dataset at every step, the direction would be exact and the hiker would walk without wobbling. By using only a sample, the direction wobbles around the true downhill direction. The smaller the sample, the bigger the wobble.

A 2017 analysis from UCLA showed this wobble can be modeled as a kind of temperature. Smaller batches mean hotter temperatures, which means more wobble. And the wobble is not random in any uniform way. The noise from a mini-batch tends to be much larger in some directions than others, depending on the curvature of the landscape at that point. SGD does not just shake. It shakes in a structured way, and that structure is what biases it toward broad valleys. Follow-up papers from groups at Stanford, Princeton, and DeepMind made the mechanism precise: the noise structure of SGD acts like a hidden regularizer. Without anyone programming it in, the algorithm penalizes solutions in sharp regions and rewards solutions in flat ones. The strength of this effect can be tuned with a single ratio: how big the steps are, divided by how big the batches are.

By the early 2020s, the field had a working theory of why a sixty-year-old optimization technique kept finding good answers. It was the noise. Then, almost immediately, the picture got complicated. A group at Carnegie Mellon University reported that when you remove the noise entirely, running gradient descent with the full dataset at every step, classical theory says it should converge smoothly. It does not. Instead, it climbs to the very edge of mathematical stability and stays there, bouncing back and forth across valley walls, yet trending downward on average. They named this the edge of stability. Separately, a paper from researchers affiliated with Google Brain and CIFAR showed that for certain common network types, you can mathematically rewrite the weights so the same model occupies a minimum that looks arbitrarily sharp or flat depending only on the coordinate system. Flatness, measured naively, was an artifact of description. Most researchers now think the compass is still real, but it points at something deeper than curvature: noise resilience. A network whose outputs barely change when its weights are slightly perturbed is also a network that tends to handle data it has never seen.

02 The noise structure of SGD
Mini-batch gradient noise is not uniform. It is anisotropic: large in high-curvature directions, small in low-curvature ones. This structured noise acts as a hidden regularizer, automatically penalizing sharp regions without any explicit instruction to do so.
Sharp region of landscape High curvature → large noise components true gradient Wide spread of noisy gradients Model wobbles off sharp walls and cannot settle here Flat region of landscape Low curvature → small noise components true gradient Tight cluster of noisy gradients Model stabilizes in the valley and generalizes well
Sharp region: wide noisy spread, model escapes
Flat region: tight spread, model settles
II. Building Optimizers That Hunt for Flat Ground

While theorists argued about foundations, engineers got to work. If SGD's noise was finding flat valleys by accident, why not build an algorithm that hunts for them on purpose?

The most prominent answer arrived in late 2020 from a Google Research team. They called it Sharpness-Aware Minimization, or SAM. The idea is almost brutally simple. At every step, instead of asking how to reduce the loss at the current point, ask how to reduce the worst possible loss within a small ball around it. The algorithm is no longer trying to find a low point. It is trying to find a region where the entire neighborhood is low.

The results were striking. On vision transformers, a class of image-recognition models that had been underperforming compared to older convolutional networks, SAM pushed accuracy on the standard ImageNet benchmark from below 75 percent to nearly 80 percent. On larger transformer variants, the gains were even bigger. Suddenly, an architecture that had seemed second-rate was state of the art, simply because someone had pointed the optimizer at flatness directly.

A wave of variants followed. One version normalized the size of the perturbation to handle the coordinate-system problem the Google Brain paper had raised. Another added a term that tracked the actual sharpness of the landscape more carefully. A third reduced the doubled computational cost of running the algorithm by only perturbing a random subset of weights at each step. Older techniques were rediscovered in the same light. A method called Stochastic Weight Averaging, published in 2018 by a Cornell and Samsung team, simply averages all the weight configurations the optimizer passes through during the second half of training. It costs almost nothing computationally and reliably produces flatter, better-generalizing models.

At the scale of the largest language models, the story has gotten messier. A DeepMind team reported in early 2025 that plain SAM, applied to a billion-parameter transformer, actually destabilizes training and produces worse results than the standard approach. The algorithm was regularizing the wrong thing, optimizing for a statistical property of the model's output rather than the geometry of the landscape itself. A modified version, tailored to the math of transformers, recovered the benefits. Other recent papers have reported speedups of around two times during pretraining of GPT-style models by carefully tuning flatness-seeking behavior layer by layer.

A more skeptical paper from researchers at Borealis AI, presented in 2024, argued that SAM's benefits do not come from flatness at all. They proposed an alternative method that explicitly forgets certain biased patterns in the model's outputs, and found it outperformed SAM while sometimes settling in sharper regions of the landscape. The pursuit of flat minima, they suggested, might be a red herring. What actually matters is the act of perturbing a model and discarding whatever does not survive the perturbation. The debate is unresolved. But the underlying intuition has only grown stronger.

03 SAM: hunting flat ground on purpose
Standard gradient descent minimizes the loss at the current point. SAM asks: what is the worst-case loss within a small ball around me? It then minimizes that. The result is a solution where the entire neighborhood is low, not just the center.
STANDARD SGD Minimize loss here at the current point step down may land in sharp minimum SAM Minimize worst-case loss within the ball around current point finds flat neighborhood, not just a point
SAM current point
Worst-case loss within perturbation ball
III. When the Network Has to Talk to a Logic Engine

The flatness story takes on new urgency in a corner of AI research that has been quietly resurgent: neurosymbolic systems. These are hybrid architectures, in which a neural network passes its outputs to a piece of traditional symbolic software. The symbolic software might be a logic solver, a theorem prover, a database, or a planner. The neural network is the intuitive component. The symbolic system is the deductive one.

The most famous recent example is AlphaGeometry, a system from Google DeepMind that, in January 2024, solved 25 out of 30 problems from the International Mathematical Olympiad geometry section, roughly the performance of a gold-medal human contestant. AlphaGeometry pairs a language model, which proposes auxiliary geometric constructions, with a symbolic deduction engine, which verifies the resulting proofs. Neither component could solve the problems alone. Together, they produce mathematical reasoning at olympiad level. A follow-up system called AlphaProof, released later in 2024, extended the approach to broader mathematical problems and earned silver-medal performance at the actual Olympiad.

In a purely neural system, a tiny weight change produces a tiny output change. The world is continuous. In a neurosymbolic system, this is not true. A tiny change to a neural weight can shift a probability by a fraction of a percent, which can flip a discrete decision, which can route a logical proof down an entirely different branch of the search. Small parameter changes produce binary outcomes. The downstream symbolic component will not gracefully smooth over a tiny error. It will either accept the input or reject it.

This is exactly the regime where flat minima should matter most. A neural network whose predictions are robust to weight perturbations is one that the symbolic component can trust. A network occupying a sharp minimum, by contrast, is one whose discrete decisions are constantly on the edge of flipping. The handoff between the two components is only as reliable as the flatness of the neural side.

Researchers have begun building this insight into their systems. A team at the University of Texas at Austin proposed a technique that samples possible paths through a neurosymbolic program and trains the network against the worst-case outcomes along those paths. It is conceptually identical to SAM, applied to discrete program execution rather than continuous loss surfaces. A 2025 study explicitly proved that data augmentation techniques, long used to improve robustness, are mathematically equivalent to flattening the loss landscape in parameter space. Despite these connections, as of mid 2026, no major published evaluation has applied SAM or its variants inside the most prominent neurosymbolic frameworks. The combination is sitting there, waiting for someone to push the button.

04 The neural-to-symbolic handoff
In a neurosymbolic system, a tiny weight change can flip a discrete decision and reroute an entire logical proof. Flat minima protect the boundary: robust neural outputs mean reliable symbolic inputs. Sharp minima make the handoff fragile.
Neural Network continuous probabilities small weight change Sharp minimum probability flips: 0.48 → 0.52 Flat minimum probability stable: 0.91 → 0.90 Symbolic engine takes wrong proof branch → FAIL Symbolic engine same branch, stable decision → OK The handoff is only as reliable as the flatness of the neural side Flat minima protect discrete downstream decisions from small continuous perturbations
Sharp minimum: fragile handoff
Flat minimum: stable handoff
SGD noise and loss landscape visualization

The loss landscape of a deep neural network stretches across billions of dimensions. SGD's structured noise acts as a compass, steering the model away from sharp, fragile minima and toward broad, robust valleys where small perturbations no longer matter.

IV. What the Loss Landscape Taught the Rest of Software

The deepest legacy of the flatness compass may not be in AI at all. The same instinct, that solutions which tolerate perturbation are better than solutions which do not, has spread through the broader practice of computational system design.

The clearest example is chaos engineering, a discipline pioneered at Netflix in the early 2010s. The company built a tool called Chaos Monkey, which deliberately kills production servers during business hours. Then it built a more ambitious version called Chaos Kong, which simulates the failure of an entire geographic region of Amazon's cloud. The point is not destruction for its own sake. The point is to ensure that the production system has converged to a flat region of its operational landscape, a region where small disruptions do not cause cascading failures. A system that requires every server to be healthy is operating at a sharp minimum. A system that gracefully degrades when an entire data center disappears is operating in a broad valley. Read as an algorithm, chaos engineering is essentially SAM applied to a distributed system: perturb the parameters within a bounded radius and optimize for the worst case.

Exponential backoff with jitter, the standard pattern by which networked systems handle retries, follows the same logic. When many clients fail at the same time, retrying at the same interval creates synchronized waves of demand that prevent recovery. Adding a random delay smears the retries across time and breaks the synchrony. An engineer at AWS who helped design the pattern has written that jitter spreads the retries around in time, and that the technique generalizes far beyond retries to any periodic work that needs to be desynchronized. It is, in effect, gradient descent at the system level, with jitter playing the role of SGD's mini-batch noise. Simulated annealing, invented in the early 1980s to mimic the cooling of molten metal, fits the same template: a stochastic acceptance rule that allows the search to escape local pits and find broader basins. Compilers have used variants for decades to tune optimization flags.

The flatness story is now mature enough to have failure modes worth respecting. The coordinate-system critique remains unresolved. Most popular sharpness measurements still depend on how you choose to write the model's weights, and a sufficiently clever reparametrization can make them say almost anything. At the scale of frontier language models, the question of whether explicit flatness-seeking still helps is being actively litigated. Newer theoretical frameworks suggest that the loss landscape picture from the late 2010s is incomplete in ways the field has not fully digested.

What survives all this skepticism is the deeper principle. Noise, when introduced deliberately and shaped with care, is a tool for finding solutions that tolerate perturbation. Whether the solution lives in the weights of a neural network, the topology of a distributed system, or the branches of a logical proof search, the same instinct applies. Perturb the system. Trust what survives.

That is, in the end, what SGD's noise has been doing all along, quietly, since long before anyone understood it. It has been pointing toward solutions that are robust, that degrade gracefully, that can be handed off to whatever comes next in the pipeline without breaking. The compass is not perfect. It points slightly off, in ways theorists are still cataloging. But three decades after a pair of researchers first sketched the idea, it remains the best compass the field has. The interesting work now is figuring out where else it points, what new optimizers and what new architectures might be built in its direction, and what the next generation of theory will say when it finally explains why a slightly noisy hiker, fumbling through a fog-bound landscape, keeps finding the valleys worth living in.

05 One principle, three implementations
SGD noise, chaos engineering, and exponential backoff with jitter all express the same instinct at different scales. Perturb the system. Discard what breaks. Trust what survives. Randomness is the feature, not the bug.
SGD noise neural network training Chaos engineering distributed systems Jitter / backoff network retry logic Perturb mini-batch noise Perturb kill random servers Perturb random retry delays Discard sharp minima escape Discard fragile dependencies exposed Discard synchronized retry storms Survive flat, generalizing weights Survive resilient service topology Survive desynchronized retry patterns Same principle · different substrate · same outcome: robustness from deliberate noise
Discard (what breaks under perturbation)
Survive (what tolerates perturbation)
Distributed systems implementation

Key references: Hochreiter, S. and Schmidhuber, J., "Flat Minima," Neural Computation 9(1), 1997. Keskar, N. et al., "On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima," arXiv:1609.04836, 2016. Chaudhari, P. et al., "Stochastic Gradient Descent Performs Variational Inference, Converges to Limit Cycles for Deep Networks," ICLR 2018. Foret, P. et al., "Sharpness-Aware Minimization for Efficiently Improving Generalization," ICLR 2021 (Google Research). Cohen, J. et al., "Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability," ICLR 2021 (CMU). Dinh, L. et al., "Sharp Minima Can Generalize For Deep Nets," ICML 2017 (Google Brain / CIFAR). Izmailov, P. et al., "Averaging Weights Leads to Wider Optima and Better Generalization," UAI 2018. Bahri, Y. et al., "Sharpness-Aware Training for Free," NeurIPS 2022. "Avoiding spurious sharpness minimization broadens applicability of SAM," Google DeepMind / ETH Zürich, arXiv:2502.02407, 2025. "Forget Sharpness: Perturbed Forgetting of Model Biases Within SAM Dynamics," Borealis AI, ICML 2024. "AlphaGeometry: An Olympiad-Level AI System for Geometry," Google DeepMind, Nature, 2024. Haddouche, M. and Guedj, B., "A PAC-Bayesian Link Between Generalisation and Flat Minima," PMLR 2025. AWS Builders' Library, "Timeouts, retries and backoff with jitter," amazon.com/builders-library.