NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Closed-Form Last Layer Optimization

Alexandre Galashov, Nathaël Da Costa, Liyuan Xu, Philipp Hennig, Arthur Gretton

NeurIPS page · Open on the map

Category: Causality, Privacy & Learning Theory › Neural Network Robustness Verification · Type: new method · Keywords: closed-form optimization, last layer, neural networks, squared loss, neural operators

Areas: Optimization & Algorithms › Optimization Dynamics › Optimization methods

Summary

Closed-Form Last Layer Optimization leverages the closed-form solution for the last layer weights under squared loss, optimizing only the backbone parameters via alternating gradient steps and closed-form updates.

Explained to a 5-year-old

We have a big computer brain that learns things. Usually it changes all parts little by little. But for some problems, we know exactly how to set the last part of the brain if we know the rest. So we can keep the rest learning while the last part is set perfectly. This helps the brain learn faster and better.

Explained to a 5-year-old, longer

A computer program can learn to predict numbers or values by adjusting many small numbers inside it. Usually it changes all those numbers a little at a time using a method called gradient descent. For some problems where the final step is just a multiplication of the previous values, we can figure out the exact numbers for that step if we already know the earlier values. This means we can keep the earlier part of the program learning while the final step is set perfectly every time. In practice, we alternate between updating the earlier part with small steps and instantly fixing the final step using the exact formula. When we have only a few examples at a time, we also remember what we learned before to help the current step. The authors show that this alternating process will eventually reach the best possible solution. They also prove that, under certain conditions, the method works as well as the most advanced theory predicts. Experiments on problems like predicting physical systems and estimating cause-and-effect relationships demonstrate that the new way works better than the usual training methods. The improvement is especially noticeable when the amount of data is limited. By using the exact formula for the last layer, the program needs fewer updates and can finish learning more quickly.

For a technical reader

When training a neural network with a squared loss, the optimal weights of the final linear layer can be computed analytically given the preceding layers' outputs. The authors exploit this by updating only the backbone parameters via gradient descent while applying closed-form updates to the last layer. In a stochastic setting, they balance the loss on the current mini-batch with information accumulated from previous batches. Theoretical analysis shows convergence in the neural tangent kernel regime and quantifies a one-step advantage over SGD/Adam. Experiments on regression problems such as neural operators and causal inference confirm the improved performance.

Problem

Optimizing neural networks usually relies on stochastic gradient descent, which updates all parameters including the last layer. However, under a squared loss, the optimal last layer weights can be expressed in closed-form, suggesting a potential inefficiency in standard training.

Method

The approach treats the last layer weights as a function of the backbone parameters and updates them using closed-form expressions while performing gradient descent on the backbone. It alternates between gradient steps on the backbone and closed-form updates of the last layer, and for stochastic settings it balances the current batch loss with accumulated information from previous batches.

Results

The approach shows improved performance over SGD and Adam on regression tasks such as neural operators and causal inference.

Contributions

It provides a theoretical analysis showing convergence in the neural tangent kernel regime and quantifies gains over standard SGD in a one-step analysis, along with empirical validation on regression tasks.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction