FishLeg (Fisher-Legendre) is a novel second-order optimizer that leverages Legendre-Fenchel duality to directly "learn" the inverse Fisher Information Matrix (FIM) during training. By bypassing the need for complex, layer-specific analytical approximations—such as those used in Kronecker-Factored Approximate Curvature (KFAC)—FishLeg provides a general, robust framework for natural gradient descent that excels even with small batch sizes and non-convex landscapes.
The Challenge of Second-Order Optimization
Most deep learning models are trained using first-order methods like Stochastic Gradient Descent (SGD) or Adam. While computationally simple, these methods ignore the "curvature" of the loss landscape, often leading to slow convergence in pathological regions like long, narrow valleys. Second-order methods, specifically Natural Gradient Descent (NGD), use the Fisher Information Matrix (FIM) to navigate these landscapes more efficiently.
However, NGD faces two massive hurdles in deep learning:
- Intractable Inversion: For a model with millions of parameters, the FIM is too large to store, let alone invert. Existing solutions like KFAC use clever Kronecker-product approximations, but these are mathematically dense, require manual derivation for every new type of neural network layer, and rely on assumptions that do not always hold.
- Noise and Bias: Curvature estimates from small mini-batches are inherently noisy. When an optimizer estimates a matrix and then inverts it, that noise translates into a significant bias that can easily derail training.
The FishLeg Approach
The authors introduce FishLeg to shift the paradigm from approximating-then-inverting the FIM to directly learning the inverse FIM.
- Legendre-Fenchel Duality: The core mathematical insight comes from duality theory. The authors demonstrate that the inverse of the (damped) FIM is actually the Hessian of the Legendre-Fenchel conjugate of the model's cross-entropy.
- Online Meta-Learning: Instead of solving this complex dual problem exactly at every step, FishLeg parameterizes the inverse FIM as a linear model $Q(\lambda)$. It then "meta-learns" the parameters $\lambda$ online using an auxiliary loss function.
- The Update Rule: In each iteration, the optimizer performs two tasks:
- Update the auxiliary parameters $\lambda$ to better estimate the local curvature.
- Update the model parameters $\theta$ using the natural gradient estimate provided by $Q(\lambda)$.
- Efficiency: To maintain computational speed, the method uses a Taylor expansion of the auxiliary loss, allowing updates to be computed using standard automatic differentiation tools without explicit Hessian-vector products.
Key Insights and Results
The researchers evaluated FishLeg on deep linear networks (a synthetic teacher-student setup used to test convergence in highly curved, non-convex spaces) and standard auto-encoder benchmarks (FACES, CURVES, and MNIST), which are notoriously difficult for first-order methods to solve quickly.
- Rapid Convergence: On deep linear networks, FishLeg reached the noise floor significantly faster than Adam or SGD with momentum, both in terms of epochs and wall-clock time.
- Robustness to Small Batches: One of the most striking findings is FishLeg's stability. It is much more stable than other second-order methods (like KFAC or KBFGS) when using small batch sizes, converging reliably in scenarios where other methods frequently produced NaNs and failed. In a reliability test across 10 different random seeds, FishLeg maintained a 100% success rate.
- Architectural Generality: Unlike KFAC, which requires a custom implementation for convolutional versus fully-connected layers, FishLeg’s learning-based approach is theoretically "plug-and-play" for any architecture.
- Wall-Clock Efficiency: FishLeg can be viewed as "amortizing" the cost of finding the natural gradient. By updating the auxiliary parameters $\lambda$ only every 10 iterations, the authors achieved a significant wall-clock speedup—reducing overhead to just ~2x slower than SGDm per step—with almost no loss in optimization performance. Total training time remained highly competitive with state-of-the-art second-order methods.
Limitations and Future Work
While FishLeg presents a major step forward for generalized second-order optimization, there are areas for future exploration:
- Parameterization: The current version uses a Kronecker-factored block-diagonal structure for $Q(\lambda)$. More flexible parameterizations, such as sums of Kronecker products, could yield even better curvature estimates.
- Scaling: The method has been proven on standard benchmarks but has not yet been scaled to massive architectures like Large Language Models (LLMs).
- Hyperparameters and Damping: FishLeg introduces its own set of hyperparameters (like the auxiliary learning rate $\alpha$). Furthermore, the current implementation uses static damping; moving to an adaptive damping scheme could further improve stability and speed.
Summary updated