Skip to main content
Back

Oak Ridge Researcher Finds Hidden 'Ghosts' That Crash AI Training Runs

A new geometric bound on cross-entropy training uses complex zeros of the softmax to predict when a single step will break your model.

Pro

  • Complex zeros of the softmax partition function set a hard Taylor-convergence limit on cross-entropy step sizes.
  • Closed-form bound rho_a = pi / Delta_a costs one JVP and uses the spread of directional logit derivatives.
  • Normalized step r = tau/rho_a predicts collapse: safe below 1, dangerous above 1, across 6 architectures.
  • Temperature normalization shrinks collapse-onset spread 6x, from std 0.992 to 0.164, validating the mechanism.
  • A rho_a controller survives 10,000x learning-rate spikes where gradient clipping still fails outright.
  • Code, experiments, and appendices at github.com/piyush314/ghosts-of-softmax.

A single-author paper from Oak Ridge National Laboratory offers an unusually clean explanation for one of deep learning's most annoying failure modes: training runs that look healthy for hours, then collapse in one step. The culprit, according to Piyush Sao, is not curvature or gradient magnitude. It is the location of imaginary numbers where the softmax denominator equals zero. Those zeros never touch the real line where training actually happens, but they still cap how far you can safely step.

The paper calls these zeros the ghosts of softmax, and it turns them into a computable, one-line stability bound that a controller can enforce with a single Jacobian-vector product per step.

The problem with smoothness

Standard optimization theory bounds the learning rate using L-smoothness: pick a step smaller than 2/L and the quadratic Taylor model of the loss still tracks the true loss. This is the machinery behind most descent guarantees. But for cross-entropy this bound hides a late-training failure mode, and it explains why LLM runs like PaLM and LLaMA report sudden loss spikes that get patched with checkpoints, warmup, and gradient clipping.

The reason is subtle. A Taylor expansion is only reliable inside its radius of convergence, and that radius is not set by how curvy the loss looks on the real line. It is set by the nearest singularity in the complex plane. For f(x) = 1/(x+a), the Hessian shrinks as x grows, suggesting large steps are safe, yet the Taylor series diverges past x = a because of a pole on the negative axis. The polynomial approximation lies, even though the function itself is perfectly smooth where you are stepping.

Where the ghosts live

Cross-entropy loss along a step direction reduces to -a_y*t + log F(t), where F(t) = sum_k w_k * exp(a_k * t) is the softmax partition function evaluated along the update. On the real line F is always positive. In the complex plane it has zeros, and each zero becomes a logarithmic branch point of the loss.

For binary classification the nearest zero has a closed form. Solving F(t) = 0 requires exp(Delta_a * t) = -w1/w2, and taking the complex logarithm gives t = (delta + i*pi*(2k+1))/Delta_a, with the nearest zeros at distance sqrt(delta^2 + pi^2)/Delta_a. The imaginary pi comes straight from Euler's identity: 1 + exp(i*pi) = 0. It is present even when the two classes are perfectly balanced.

For multiclass there is no closed form, but a geometric argument gives a tight lower bound. If the phases of the terms w_k*exp(a_k*t) lie in an open arc shorter than pi, they all sit in a common half-plane and no positive combination can cancel to zero. This yields the paper's headline formula:

rho_a = pi / Delta_a
where Delta_a = max_k a_k - min_k a_k
and a_k = grad(z_k) . v

Delta_a is the spread of directional logit derivatives along your update direction v. It costs one Jacobian-vector product to compute per sample, which is roughly 1.5x a forward pass.

One number that predicts collapse

Define r = tau / rho_a, where tau is the step norm. This dimensionless ratio partitions optimizer behavior into three regimes: safe below one, boundary at one, and unreliable above one. The empirical claim is remarkably sharp.

  • Across six architectures and multiple step directions, no tested model fails for r < 1, and collapse appears once r crosses 1.
  • Sweeping r along the gradient direction and 20 random directions produces the same transition near r = 1, so the bound is direction-independent.
  • Temperature scaling shifts logits by 1/T; normalizing by rho_a collapses the onset-threshold spread across temperatures from standard deviation 0.992 to 0.164, a 6x reduction.

The last point is what elevates this from correlation to mechanism. Temperature is a controlled perturbation that the theory predicts should scale rho_a linearly, and it does.

Why late training is fragile

As a network sharpens its predictions, the logits spread apart, Delta_a grows, and rho_a shrinks. A learning rate that satisfied r < 1 at step 1000 can violate it at step 10000 with no change in the optimizer or data. Concretely, rho_a is about 3.14 when Delta_a = 1, drops to 0.31 when Delta_a = 10, and to 0.10 when Delta_a = 30.

This also resolves an apparent paradox from training practice. The Hessian of scalar logistic loss decays like exp(-delta) with margin, so curvature-based analysis says confident examples get safer. The convergence radius decays only like delta, so the true reliability window tightens. The mismatch between the two views grows exponentially with confidence; at delta = 10 it exceeds 4000x. Adam and other adaptive optimizers scale by inverse curvature, which is exactly the wrong direction late in training.

A controller with no learning rate

The proof of concept is a controller that clips the tentative optimizer update p so that its norm never exceeds rho_a, computed with one JVP along p/||p||. No new hyperparameters. Under a 10,000x learning rate spike injection, the results separate cleanly:

ArchitecturePlain AdamGradient Cliprho_a controller
Transformer31.8%38.7%95.3%
MLP + LayerNorm44.6%51.5%93.9%
CNN + BatchNorm13.4%10.3%71.6%

Gradient clipping applies a uniform norm threshold. The rho_a controller scales the update against the local radius, which contracts unevenly across samples and directions, so a fixed threshold still permits r > 1 in the wrong place.

On ResNet-18/CIFAR-10 with SGD and momentum, no injected spike, a controller that sets eta = r * rho_a / ||v|| from local geometry alone reaches 85.3% accuracy without a hand-designed learning-rate schedule, beating the best fixed rate of 82.6%. Setting r = 2 still hits 84.4%, consistent with the confidence-margin slack in the exact binary formula. Setting r = 4 degrades to 72.1% with high variance.

What the bound is not

Several honest limitations are worth flagging before you reach for this in production.

  • The bound governs one-step reliability. Multi-step dynamics, momentum feedback, and stochastic gradient noise can still amplify or damp violations in ways rho_a does not model.
  • Validation is small-scale: up to ResNet-18 and a two-layer transformer with d=32. All experiments use small models up to 128 dimensions and 10 classes; whether large-vocabulary language models operate perpetually at r much greater than 1 through favorable cancellation is unknown.
  • Overhead is real. Exact JVP on ResNet-18 adds roughly 129% to a step; a finite-difference estimate adds 66%.
  • The theory targets softmax singularities on logits and attention scores. Activation functions add their own singularities. The appendix ranks them: exact GELU and other entire activations have no finite ghosts, SiLU and softplus inherit the sigmoid lattice at imaginary distance pi, tanh sits at pi/2, and ReLU has kinks directly on the real axis.

What is actually new

The idea that complex singularities cap Taylor convergence is textbook complex analysis. The novelty is identifying the softmax partition function's zeros as the operative singularities for cross-entropy, deriving a bound that costs one JVP, and showing that a single dimensionless number r separates safe from dangerous updates across architectures and directions.

The practical takeaways are three-fold: use r as a diagnostic when a run diverges, monitor rho_a as an early warning that a fixed learning rate is about to become unsafe, and cap tau <= rho_a if you want a controller that survives adversarial learning-rate schedules. Code is available at github.com/piyush314/ghosts-of-softmax for anyone who wants to reproduce the temperature fingerprint or plug the controller into their own training loop.