Approximating Matrix Functions with Deep Neural Networks and Transformers
Rahul Padmanabhan, Simone Brugiapaglia

TL;DR
This paper explores how neural networks, including transformers, can approximate matrix functions like the exponential and sign functions, providing theoretical bounds and experimental evidence of effectiveness.
Contribution
It establishes bounds on neural network size for approximating matrix exponentials and demonstrates transformers' practical capability to approximate matrix functions with high accuracy.
Findings
ReLU networks can approximate matrix exponential with arbitrary precision.
Transformers can approximate certain matrix functions with about 5% relative error.
Encoding schemes significantly influence approximation performance.
Abstract
Transformers have revolutionized natural language processing, but their use for numerical computation has received less attention. We study the approximation of matrix functions, which map scalar functions to matrices, using neural networks including transformers. We focus on functions mapping square matrices to square matrices of the same dimension. These types of matrix functions appear throughout scientific computing, e.g., the matrix exponential in continuous-time Markov chains and the matrix sign function in stability analysis of dynamical systems. In this paper, we make two contributions. First, we prove bounds on the width and depth of ReLU networks needed to approximate the matrix exponential to an arbitrary precision. Second, we show experimentally that a transformer encoder-decoder with suitable numerical encodings can approximate certain matrix functions at a relative error…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsModel Reduction and Neural Networks · Tensor decomposition and applications · Quantum many-body systems
