← BlogContact

The Topology Rule That Predicts Whether a Stuck System Escapes

Every other post on this blog comes from a real incident in a production system: something broke, I found the cause, a rule or a hook came out of it. This one is different. It comes from a research paper I just finished writing, on a subject with no direct connection to AI agents or software delivery: why some "stuck" states in a certain kind of neural network can get themselves out, and others never do.

I'm publishing the paper itself alongside this post, and this is the plain-language version of what it says.

Two nodes with outgoing arrows labelled escapes, and one isolated node labelled sink, illustrating that out-degree in the transition graph predicts escape.
The rule in one picture: a state with at least one way out on the map always finds it. A state with no way out on the map never does.

What "stuck" means here

Picture a landscape of valleys, where each valley is a stable pattern a system can settle into — this kind of network is called a Hopfield network, and each valley is called an attractor. Drop a ball anywhere and it rolls downhill into the nearest valley and stays there.

Sometimes the ball lands near the ridge between two valleys instead of deep inside one. It slows down dramatically and can sit there, barely moving, for 300 or more steps before finally rolling into a valley. I call these plateau states. The question the paper asks is simple: when a plateau state finally moves, which valley does it end up in — and can you tell in advance whether it will ever leave the valley it looks stuck in at all?

The map that predicts almost everything

The obvious guess is that the answer depends on local geometry: how steep the slope is, which direction the ball is nudged, how flat the ridge is right where the ball sits. That guess is only partly right, and it's the less important part.

What actually predicts escape is a separate exercise: for every valley, deliberately push a trajectory toward every other valley and record whether the push succeeds. That builds a map — a directed graph where each valley is a node, and an arrow from valley A to valley B means "a push from A can reach B." Call a valley's number of outgoing arrows its out-degree.

The finding: a plateau state near valley A escapes under its own, unforced dynamics if and only if valley A has an out-degree greater than zero on that map. If A has arrows leading out, the system eventually finds one of them on its own. If A has no arrows leading out — a dead end on the map — it never leaves, no matter how long you wait.

The transition graph — built by forcing, used to predict unforced escape A B C out-degree 2 → escapes D out-degree 0 → permanent sink
← swipe sideways to see the full diagram →

Across 400 plateau states tested over five independently built networks, this rule was right 99.75% of the time. The single miss was a false negative — a plateau that could escape even though the perturbation test happened to measure its out-degree as zero — which points at the sensitivity of the measurement, not a hole in the pattern.

Why this is the surprising part

I also tested the "obvious" local predictors directly: how steep the drop is, which direction the ball is pushed, whether the point sits at a genuine saddle. The best of them — the steepness of the drop — gets escape right about 0.75 of the time, on a scale that tops out at a perfect 1. That's better than a coin flip, but nowhere near the map's 99.75%.

Energy tells you how expensive a transition is. Topology tells you whether it's possible at all. Those turned out to be two different questions with two different answers.

That separation is the actual finding. The map is a global, structural fact about the whole network — not something you could read off by standing at one point and looking at the slope under your feet.

How far the rule holds

Before trusting a pattern like this, I tried hard to break it. The out-degree rule held at 100% across every combination of network size, forcing strength and sharpness I tested, and it held at zero errors across 540 plateau states as the network size grew from 50 all the way up to 50,000 dimensions. It also held under sustained random jostling of the trajectory (up to a noise level of 0.20) with no measurable drop in accuracy.

Where it breaks

The rule is not universal, and the paper says so plainly. It holds when the valleys are built deliberately, as combinations of shared building blocks — that shared structure is what creates the low, crossable ridges the map is measuring. When the valleys instead come from simplifying real, messy data (a common technique called PCA), the valleys are closer to isolated islands with high walls between them, and the map's accuracy drops to somewhere between 10% and 40% correspondence. That boundary — where the rule works and where it stops — is itself one of the paper's findings, not a failure to hide.

Testing it on real data anyway

The underlying idea is still useful outside that boundary, just for a different job: routing and interpretation rather than escape prediction. Built into a zero-configuration analysis tool, it was run against six real-world datasets — including hospital ICU records covering 9,105 patients — and passed every one of five independent validation checks on all but one. The exception is a workplace dataset where one outcome is 128 times rarer than the other; that's a data-imbalance problem, not a flaw in the tool.

What this paper does not claim

This is an empirical pattern, not a proven theorem — I want to be as direct about that here as the paper is. 99.75% is not 100%. A follow-on formula for predicting exactly how hard a specific transition will be reaches an LOO-CV R² of 0.676 across 262 tested transitions, which leaves a real chunk of the answer unexplained. And the paper only tests one kind of randomness (sustained jostling); truly probabilistic dynamics remain untested.

Code and data will be released on acceptance; for now, every number in this post and in the paper traces back to a stated seed and a reproducible setup, and the paper's own limitations section lists what's still open.

Topological Determinants of State Transitions in Compositional Attractor Networks

Read the full paper (PDF) · S. Singh, AdaptiveMind — Studio of Singh · ai.meharbansingh@gmail.com

The lesson: the question "can this system get out of where it is?" and the question "how hard would it be?" are not the same question, and in this setting they have different answers. Knowing the map beats reading the slope.

Meharban Singh

Meharban Singh

AI systems / delivery architect. I build software with AI agents governed by rules, hooks, gates and independent review — and watch it in production after go-live.