The Flatness Problem Solved By Continuous Learning

When the shape of what an AI learns determines whether it can keep learning at all.

Machine Learning  ·  Loss Landscape Geometry
The Mountain Range Inside Every AI
2026  ·  Daice Labs

How the shape of a hidden mathematical landscape may determine whether artificial intelligence can truly keep learning.

For nearly three decades, a quiet but fierce debate has simmered among machine learning researchers. Does it matter which kind of valley an AI lands in? Are wide, flat valleys genuinely better? And if so, can we build systems that always find them? The answers have turned out to be far more complicated than anyone hoped.

I. Lost in the mountains

Imagine you are dropped, blindfolded, somewhere in a vast mountain range. Your only goal is to find the lowest valley you can. You can feel the ground beneath your feet, whether it slopes up or down, steeply or gently, but you cannot see the terrain ahead. So you take small steps, always moving downhill, inching your way toward what you hope is the bottom.

This is, in a rough but surprisingly accurate sense, what a neural network does every time it learns.

Every AI system is trained by navigating a landscape. Not a physical one, but a mathematical one of staggering complexity. The large language models behind chatbots, the image classifiers in your phone's camera, the recommendation engines shaping what you read: all of them learn by moving through this hidden terrain. Researchers call it the loss landscape, and it encodes something fundamental about how wrong the model is. Every combination of the model's internal settings, called weights or parameters, corresponds to a point somewhere in this space. The elevation at that point is the model's error. Training is the process of rolling downhill until you find a valley, a place where the error is low and the model performs well.

But not all valleys are the same. Some are narrow crevices: the model found a tight, precise solution that works perfectly on its training data but shatters the moment it sees something slightly new. Others are wide, open basins, gentle bowls where the terrain around the lowest point is relatively flat. A model settled in one of those broad valleys can be nudged, perturbed, even pushed a little, and still perform well.

For nearly three decades, a quiet but fierce debate has simmered among machine learning researchers. Does it matter which kind of valley an AI lands in? Are wide, flat valleys genuinely better? And if so, can we build systems that always find them?

The answers have turned out to be far more complicated than anyone hoped.

01 The loss landscape
Tightly packed contour rings signal a sharp minimum. Wide-spaced rings signal a flat one. The shape of the valley determines how an AI performs on data it has never seen.
Sharp minimum a narrow, steep valley nudge loss spikes steep Fails on unseen data Flat minimum a wide, gentle basin nudge still inside the basin gentle wide margin of safety Holds up on unseen data Same nudge. Two completely different outcomes. The shape of the valley the AI lands in determines how it performs on data it has never seen.
Sharp minimum — steep walls, fragile
Flat minimum — wide basin, resilient
Same nudge applied to both
II. The shape of intelligence

The mathematical landscape of a neural network is not two-dimensional like the terrain of a mountain range. It is not three-dimensional either. Modern AI models have billions of adjustable parameters, which means their loss landscapes exist in billions of dimensions simultaneously. The human mind cannot picture this. Researchers who study it can only examine slices and projections, the way an archaeologist tries to reconstruct a city from a handful of pottery shards.

Despite this difficulty, a remarkably productive question has emerged: what is the shape of the landscape near the final solution? Specifically, how sharply does the terrain rise around it?

That curvature is measured through a mathematical object called the Hessian, a matrix that captures how the loss function bends in every direction at once. High curvature means the landscape is sharply peaked around the solution. Low curvature means it is flat, like a broad plateau. When researchers talk about sharp versus flat minima, they are talking about this. A sharp minimum is a tightly confined valley. A flat minimum is a wide, gently sloping basin.

The hypothesis that flat minima lead to better AI has a surprisingly long history. Sepp Hochreiter and Jürgen Schmidhuber, the same researchers who later pioneered long short-term memory networks, published a paper in 1997 arguing that flat minima correspond to simpler, more compressible models. Their reasoning was borrowed from information theory: a model sitting in a flat region can be described with less precision. You do not need to specify the weights to many decimal places, because small errors in those values barely change how the model behaves. Simpler descriptions, by Occam's Razor logic, should generalize better.

The idea sat quietly in the literature for nearly two decades. Then, around 2016, the explosion of deep learning dragged it back into the spotlight.

Nitish Keskar and colleagues published a striking observation in 2017: when neural networks were trained using large batches of data simultaneously, a common technique for speeding up training, they consistently ended up in sharper minima than networks trained on smaller batches. And those sharper solutions generalized worse. The experiment was elegant. The implication was unsettling. If sharp minima are bad, and large-batch training reliably produces them, then one of the most common practices in AI development was quietly undermining performance.

The paper opened a floodgate. If the shape of the valley matters, what controls it? And could it be deliberately engineered?

02 Sharp vs. flat minimum
The same small perturbation produces a drastically different outcome depending on which shape the model landed in.
Sharp minimum small nudge → loss spikes sharply steep walls Works on training data only Flat minimum small nudge → loss barely changes gentle walls Holds up on data it has never seen ↑ error ↑ error
Sharp minimum
Flat minimum
Perturbation
III. Why randomness is your friend

The answer, it turned out, had been hiding in plain sight inside the training algorithm itself.

The standard method for training neural networks is called stochastic gradient descent, or SGD. It works roughly like the blindfolded hiker from before, but with a twist: the hiker's sense of the slope is noisy. Rather than computing the exact direction downhill using every piece of training data, SGD uses a random sample, a mini-batch, to estimate which way to step. This introduces randomness into every update.

For a long time, this noise was viewed as a computational compromise, a necessary imprecision imposed by the impossibility of processing all data at once. But researchers gradually realized the noise was doing something more interesting. It was acting as a compass toward flat terrain.

The physics intuition comes from thermodynamics. Imagine a ball rolling around on a bumpy surface while being randomly jostled. If the jostling is strong enough, the ball will eventually escape any narrow valley it finds itself in, because the walls are too steep and the random kicks can push it over. But when the ball rolls into a wide, flat basin, those kicks are not strong enough to dislodge it. The ball stays. Statistically speaking, the system will spend the most time in the flattest, widest basins.

SGD does something analogous. The stochastic noise in the gradient estimates is larger relative to the curvature of sharp valleys, so the optimization trajectory bounces out of them. In flat regions, the noise is small relative to the width of the basin, so training settles and stays. Feng and Tu demonstrated this rigorously in a 2021 paper in the Proceedings of the National Academy of Sciences, showing that SGD noise is systematically larger in sharp regions and smaller in flat ones, a self-reinforcing mechanism that steers training toward gentler terrain.

Even more remarkable is what Cohen and colleagues discovered in 2021, studying a phenomenon they called the edge of stability. In classical analysis, gradient descent should be stable only if the learning rate is small relative to the curvature of the loss. Yet in practice, deep networks are trained at learning rates that should, by the textbook, cause the optimization to diverge. What actually happens is that the network adapts: the curvature of the landscape near the solution self-adjusts to stay just at the threshold of stability. The landscape and the learning algorithm reach a kind of dynamic equilibrium, with sharpness capped at a level the learning rate can tolerate. The network does not just find a flat region. It sculpts one.

03 SGD as a flatness compass
Noise is largest where terrain is sharpest, a self-regulating mechanism that steers training toward gentler ground. The landscape effectively selects for itself.
noise: large kicks exceed wall height escapes — rolls toward flatter terrain noise: small too weak to escape → settles SGD noise magnitude SGD noise magnitude Noise is largest where terrain is sharpest — a self-regulating compass toward flat ground error
Sharp valley — ball escapes
Flat basin — ball settles
SGD noise
IV. The forgetting problem

All of this would be a tidy story if AI systems only ever had to learn one thing. But the challenge that motivates much of modern research is different: can a system keep learning new things without forgetting what it already knows?

This problem, called catastrophic forgetting, is one of the most persistent frustrations in AI. It shows up whenever a model trained on one task is then trained on another. The new training adjusts the weights to perform well on the new task, but those adjustments tend to overwrite exactly the weight configurations that supported the old task. The model forgets, rapidly and thoroughly, in a way that biological brains seem to avoid. We learn a new language without losing the ability to ride a bicycle. Neural networks, left to their own devices, are not so fortunate.

Researchers working on continual learning, sometimes called lifelong learning, have tried dozens of strategies to combat this. The connection to loss landscape geometry arrived as a geometric insight: if you want a model to be robust to changes in its weights, you want it to occupy a region of the landscape where small perturbations do not matter much. You want it in a flat minimum.

If the model's solution for task A is perched in a narrow, steep valley, then the moderate adjustments needed to learn task B will likely shift the weights far enough to cause the loss on task A to spike. The valley is too narrow to permit any movement.
04 The forgetting problem
The width of the valley is a direct predictor of how much a model forgets when it learns something new.
vs. Sharp minimum where Task A landed Task A solution Task B update loss spikes — walls too steep Task A forgotten Flat minimum where Task A landed Task A solution Task B update still within basin margin of safety Task A remembered The width of the valley determines how much a model forgets when it learns something new
Sharp — task A overwritten
Flat — task A survives
Task B update

Seyed Issa Mirzadeh and collaborators confirmed this experimentally in a 2020 paper at NeurIPS, the field's most prestigious conference. They showed that training regimes producing flatter minima consistently reduced forgetting. The width of the valley, it turned out, is a direct predictor of how well a model weathers the disruption of ongoing learning.

This was a unifying insight. Suddenly, the loss landscape geometry community and the continual learning community were speaking to each other in the same language.

V. Teaching the network to seek flatness

If flat minima are beneficial, the natural engineering question is: can we make a training algorithm that actively seeks them out, rather than just hoping the noise of SGD happens to find them?

The answer arrived in 2021, from Pierre Foret, Behnam Neyshabur, and colleagues at Google. Their algorithm, called SAM, for Sharpness-Aware Minimization, adds a deliberate twist to the usual training procedure. Instead of simply finding weights that minimize the loss, SAM looks for weights where the worst-case loss in a small neighborhood around the solution is also low. It does not just ask whether this is a good solution. It asks whether it is a robust one: if the weights are perturbed slightly in the worst possible direction, does the model still hold up?

The result is that SAM explicitly pushes training toward wide, flat basins rather than narrow valleys. Across dozens of benchmarks, it outperformed standard training in generalization and became one of the most widely cited papers in the field almost immediately.

SAM also turned out to be a natural fit for the continual learning problem. If you want a model that can learn task B without forgetting task A, you want the task A solution to be in a region so flat that the task B updates cannot dislodge it. Training with flatness-seeking algorithms from the start is, in a sense, pre-adapting the network's landscape geometry for the demands of ongoing learning.

Several research groups have pushed this idea further. A 2021 paper from Hong Kong Polytechnic University introduced F2M, for Finding Flat Minima, specifically designed for scenarios where a model must later learn new tasks with only a handful of examples. A 2024 paper introduced C-Flat, a flexible flatness optimizer that can be layered on top of essentially any continual learning algorithm. AlterSGD, from Huang and colleagues, achieves flatness by alternating between descending the gradient and ascending it, a push-pull that prevents the optimizer from getting trapped in any narrow crevice.

Together, these methods represent something genuinely new: training algorithms that treat the geometry of the loss landscape not as an accident of optimization, but as a design target.

05 SAM vs. standard training
Standard training asks whether the current point is good. SAM asks whether the entire neighborhood is good. A different question, a fundamentally different landing spot.
Standard training finds lowest point, stops sharp valley fragile solution asks: is the loss low here? Yes → done SAM checks the whole neighborhood first neighborhood probed flat basin robust solution asks: is the whole neighborhood low? Yes → settle in flat basin SAM does not just find a low point — it finds one that stays low in every direction around it
Standard — lands in sharp valley
SAM — finds flat basin
Neighborhood search radius
VI. The flaw in the picture

At this point the story might seem to be converging on a satisfying conclusion: flat minima are better, continual learning benefits from them, and researchers now know how to find them. But the picture has a serious flaw, and it was spotted almost as soon as the flatness hypothesis became popular.

In 2017, Laurent Dinh and Razvan Pascanu, working with Samy and Yoshua Bengio, published a paper with a provocative title: "Sharp Minima Can Generalize for Deep Nets." Their argument was mathematical and uncomfortable. They showed that for the kinds of neural networks typically used in practice, those with ReLU activation functions, you can take any solution in the parameter space and reparameterize it to make it appear arbitrarily sharp or arbitrarily flat, without changing a single prediction the network makes. Simply multiply the weights in one layer by a large number and divide the corresponding weights in the next layer by the same number. The network behaves identically. But its loss landscape geometry, as measured by standard metrics, looks completely different.

The implication was devastating for naive versions of the flatness hypothesis. If sharpness is just an artifact of how you choose to measure it, and different parameterizations of the same function can look sharp or flat depending on an arbitrary scaling choice, then finding flat minima might be a meaningless goal.

The research community has spent years wrestling with this objection. Some responses have been partial victories. Geometric measures invariant to rescaling, drawing on tools from information geometry and statistics, have been developed and do appear to correlate better with generalization. PAC-Bayes bounds, which measure something like how much weight perturbation a model can tolerate, are inherently reparameterization-invariant and remain the most theoretically principled support for flatness as a predictor of generalization.

In late 2025, a team of researchers published results that deepened the concern. Even in mathematically clean settings, smooth convex optimization problems far simpler than deep learning, they showed that finding a flat empirical minimum offers no guarantee of good generalization. Flat solutions in those settings can perform arbitrarily badly on new data. Sharp solutions can generalize perfectly. The flatness hypothesis, the authors argued, is not universally valid even in principle.

The field, in other words, is caught between two things it knows to be true: flatness seems to work in practice, and flatness is not a reliable theoretical explanation for why.

Fragility versus stability

Fragility versus stability: the same solution, two different landscapes. In the sharp crevice, any perturbation is catastrophic. In the wide basin, the model rests.

VII. The wrong kind of flat

There is a further twist that makes the story even stranger. Recent work on large language models has uncovered a phenomenon that cuts against the optimistic story of flatness and continual learning.

When a large language model is fine-tuned on a sequence of tasks, something counterintuitive happens to the loss landscape of the earlier tasks. It gets flatter. Dramatically flatter. The curvature of the landscape for the first task, as measured by the largest eigenvalue of the Hessian, can drop by more than half over the course of subsequent training.

This sounds, at first, like good news. More flatness, less forgetting, right? But the reality is the opposite. The flattening precedes performance collapse. The loss landscape for the earlier task loses its informative structure before the model loses its ability to perform that task. The geography that was guiding the model toward good solutions simply dissolves.

Imagine the flat basin representing task A as a plateau with a helpful, subtle slope that still points toward good solutions. As the model learns more tasks, that subtle slope is erased. The plateau becomes featureless.
06 Beneficial vs. destructive flattening
Both landscapes become flat. Only one preserves the structure that makes flatness useful. The difference is whether the guiding slope survives.
Beneficial flattening flatness found deliberately, structure preserved Destructive flattening flatness caused by overwriting, structure erased After Task A Learning Task B Result subtle guiding slope Task B lands inside basin Task A retained After Task A Sequential training Result structured slope slope being erased featureless — no guidance Task A degraded Both landscapes look flat. Only one preserves the structure that makes flatness useful.
Beneficial — guiding slope preserved
Destructive — slope erased, featureless
Task B update

Researchers call this destructive flattening, and it is distinct from the beneficial flattening that SAM and similar algorithms seek. Beneficial flatness means the model occupies a region where good performance is robust to perturbation. Destructive flattening means the landscape has been so overwritten that it no longer guides the model toward good performance at all.

A related finding made the problem more precise. Even when earlier task solutions appear to sit in wide, flat regions, those regions are not entirely featureless. They contain a small number of directions of high curvature, narrow ridges in an otherwise flat terrain. And the gradients produced by learning new tasks tend to point precisely in those directions, as if the optimization is drawn toward the remaining sensitive spots by some hidden force. The model's memory of earlier tasks is more vulnerable than the landscape's overall flatness suggests, because the vulnerability is concentrated in exactly the places subsequent learning will probe.

Flatness, the research is making clear, is not a simple property that you either have or lack. It is a complex geometric structure, and what matters is not just whether the landscape is flat, but how it is flat, and where.

VIII. The frontier

Despite the unresolved debates, the practical fruits of this research program are real and growing. Understanding that loss landscape geometry matters has given researchers new tools, and those tools are increasingly being applied to the most pressing problems in AI.

The challenge of fine-tuning large language models is essentially a continual learning problem in disguise. When a model trained on the entire internet is adapted to a specific domain, whether medical records, legal documents, or customer service transcripts, the risk of destructive forgetting is real. Flatness-aware fine-tuning methods, including variants of SAM adapted for low-rank parameter updates, are showing consistent benefits. A 2025 paper introduced Bi-LoRA, which modifies the popular LoRA fine-tuning technique to explicitly seek flatness not just within the restricted parameter subspace but across the full landscape.

The question of why larger models seem to train more stably is acquiring a geometric answer. Preliminary evidence suggests that as language models scale up in size, they tend to occupy flatter regions of the loss landscape. Larger models, in this view, are not just more powerful because they have more parameters. They may be settling into more geometrically favorable terrain that makes them more robust to the disruptions of additional training.

In federated learning, where AI models are trained across many separate devices, hospitals, phones, research institutions, without sharing raw data, the heterogeneity of data across those devices drives models toward sharp minima. Different devices see different distributions of data, so the gradient directions they estimate point in conflicting ways, collectively steering toward narrow, fragile solutions. A new generation of federated learning algorithms applies sharpness-aware optimization at both the local and global levels, recognizing that local flatness and global flatness are not the same thing.

Perhaps the most unexpected connection has emerged from neuromorphic computing, hardware designed to mimic the structure of biological brains using circuits that fire in discrete spikes rather than transmitting continuous values. Neural networks running on such hardware are trained in ways that introduce inherent noise into every computation. That noise, researchers found in 2025, reliably biases learning toward flatter regions of the loss landscape. The brain-inspired hardware is, in effect, automatically running a version of SAM without being designed to do so. Whether this is a coincidence or a clue about how biological neural systems avoid forgetting is a question that nobody has yet answered.

IX. What it all means

Step back from the technical detail and a larger picture comes into focus.

The question of whether AI can keep learning, accumulating new knowledge without losing old knowledge, adapting to new conditions without being destabilized by them, is not just a technical question. It is the difference between AI systems that are useful over time and AI systems that need to be periodically discarded and retrained from scratch. It is, in some ways, the difference between intelligence that is static and intelligence that is genuinely alive to experience.

The loss landscape geometry research suggests that this capacity for ongoing learning is deeply connected to a geometric property of the solution a model finds. Wide, flat basins are not just pleasant places to be. They are, in a precise mathematical sense, robust places to be. They can absorb perturbation. They can tolerate change. They are, in the language of the physicists who brought this insight from thermodynamics into machine learning, thermodynamically stable.

That is a beautiful idea. But it comes with a hard-won caveat: flatness is not a simple blessing. The field has learned that measuring it is difficult, achieving it deliberately is possible but costly, and even genuine flatness can be eroded or misdirected by the wrong kind of subsequent training. The connection between flatness and the ability to generalize to new situations is real but fragile, and the theoretical foundations for why it holds are still being built.

What researchers are doing, beneath the surface of all the algorithms and papers, is trying to understand a fundamental tension at the heart of learning itself. Learning requires change. Remembering requires stability. Any system that learns over time must find a way to be both, plastic enough to absorb new information, stable enough to hold onto what it has already acquired.

The loss landscape, with its mountains and valleys and flat, wide plateaus, is the geometry of that tension. Finding the right kind of flatness is not just an optimization trick. It may be a precondition for any intelligence, artificial or otherwise, that aspires to keep learning without losing itself.

The flatness problem is not solved. It is, at last, being asked in the right way.

This article draws on published research from NeurIPS, ICLR, ICML, PNAS, and arXiv preprints spanning 2017 through early 2026. Key contributions include Hochreiter and Schmidhuber (1997), Keskar et al. (2017), Kirkpatrick et al. (2017), Foret et al. (2021), Cohen et al. (2021), Feng and Tu (2021), Mirzadeh et al. (2020), and Imanov (2026).