A Transformer-Derived Iterative Preconditioner
Patrick Lutz, Themistoklis Haris, Aditya Gangrade, Venkatesh Saligrama
Abstract
Transformers trained on in-context prediction problems can learn known numerical algorithms, e.g., gradient descent. We go further, showing that their internal computations can reveal new algorithms with provable guarantees. A softmax-attention transformer trained to solve linear systems implicitly improves matrix conditioning. Tracing reveals an iterative preconditioning primitive, which we develop into RAPID, a standalone algorithm requiring no learned components. RAPID is an anytime preconditioner for symmetric positive definite (SPD) matrices, using randomized mixing and sparse local corrections to improve conditioning. Proof-of-concept experiments on synthetic and real-world problems consistently improve conditioning and reduce conjugate gradient iterations needed to reach a target accuracy. For a Haar-mixing idealization, we prove convergence to any fixed target condition number regardless of spectral distribution, with only logarithmic dependence on initial conditioning. Together, these results show how a transformer can discover a broadly applicable numerical algorithm.
Create a lesson
Metadata
- Comments
- Accepted at NeurIPS 2026
Related papers
Loop-Count Schedules in Looped Transformers: An Empirical Study
Shared title terminologycs.LGKonstantin Kolokolov
Cross-Site Transformers Are Robust Heart Rate Estimators
Shared title terminologycs.LGMason Kadem, Rong Zheng
SONATI: Spatio-temporal ocean neighbourhood asymmetric transformer for imputation of sparse, tabular data with uncertainty
Shared title terminologycs.LGYvonne Jenniges, Boris Peter Koch, Maike Sonnewald et al.
Failure Modes and Data-Efficient Remedies for Transformer-Based Prediction of Viscoplastic Flows
Shared title terminologycs.LGMaedeh Saberi, Hugo Franca, Maziyar Jalaal et al.
Feedback Shortcut: Speculative Decoding for Latent Feedback Transformers
Shared title terminologycs.LGBenhao Huang, Xuezhe Ma, Hector Liu
Model Carving: Training Transformers That Optimize Their Own Topology
Shared title terminologycs.LGKaden Zheng, Pratyusha Sharma