# Poster 28098

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/28098

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hi, I'm Jerry, and today I'll be sharing some recent work on learning high-precision least squares algorithms with sequence models. So foundation models have been a remarkable new technology within the vision and language spaces. What's most remarkable is that it's a surprisingly simple recipe. By dumping raw data into a large model, they're able to achieve emergent capabilities and solve unseen tasks.
This is an exciting prospect to apply to science and engineering tasks, but one unique to Zitterata for science is numerical precision, which has so far gone underexplored. Specifically, for nonlinear problems and problems requiring long time horizon forecasting, small errors can quickly accumulate into catastrophic issues, so high precision is crucial. The main motivating question behind this work is whether our current training recipes, so architectures and optimizers, are sufficient to achieve high precision.
So as a quick roadmap, I'll first talk about some background info on transformers, least squares, and in-context learning. Next, we'll find perhaps surprisingly that transformers actually fail to solve least squares precisely. Towards identifying the issues with high precision, we find issues within standard architectures and optimization. And finally, to address the issues, we find alternative architectures and we propose an improved training recipe.
We look at least squares as a test bed for one because it's very simple and well understood with decades of theory and two because it's a useful primitive for differential equations specifically connections to spectral methods. Previous work finds that transformers seem to solve least squares in context by performing gradient descent on the least squares objective.
However, we add some nuance to this claim by finding that in fact transformers fail to learn a proper numerical algorithm for these squares. Specifically that means it exhibits poor precision when we scale these transformers to deeper and deeper networks and furthermore the algorithms transformers learn exhibit brittle generalization on out of distribution inputs. So our main research question is whether we can identify the sources of poor precision and hopefully alleviate the issues.
We identify three linear algebra primitives, read, linear, and multiply, which we show comprise two basic algorithms for least squares, gradient descent and Newton's shells. Our argument is that models need to be able to solve all three to high precision before they can ever hope to solve least squares precisely.
We find perhaps surprisingly that attention-based models actually struggle to implement all three primitives. Specifically, softmax attention struggles the most with this simple floating-point, element-wise multiplication task. In response, we look at alternative architectures towards getting to high precision, specifically base conf from this prior work. We find that simply replacing softmax attention with base conf within our models allows them to precisely learn the primitives.
Furthermore, we show by construction that baseconv is indeed able to use the primitives and implement gradient descent on these squares. However, we find that simply replacing softmax tension for baseconv and training end-to-end on these squares is still insufficient to achieve high precision. This indicates that we're still dealing with additional optimization challenges. To dig in deeper, we look at a simpler task, which is learning only one step of gradient descent on these squares.
We identify a key metric which is the cosine similarity on successive gradient updates and we find this is actually predictive of precision saturation specifically when the cosine similarity on successive gradients is close to zero this means that successive parameter updates are almost random noise and if that's the case this means the model is not making progress in response we propose a simple adaptive learning rate scheduler that uses the gradient metric as a controller
So when the gradient metric is close to zero, that means it looks like random noise and we actually increase the learning rate. When the gradient metric is close to one, we're able to decrease the learning rate. And we find that this is sufficient to achieve high precision for training. Finally, as an application, we look at in-context operator learning for the following distribution of 1D ODEs. So the problem is we're given a bunch of input-output pairs. The inputs are forcing functions, the outputs are the solution at time t.
And the model has to use that info to infer the parameter's alpha and then give a new forcing functions that needs to actually find the solution. We train using base conf and using our proposed training recipe and we find that the model actually learns a precise and general numerical algorithm that is competitive with least squares and gradient descent.
So in conclusion, we identify fundamental shortcomings within standard ML training recipes, both in the architecture and within the optimizer, and we propose a couple alternatives that fix the poor precision issue, specifically polynomial architectures and adaptive learning rate scheduler. Thanks so much for listening.
