A Transformer-Derived Iterative Preconditioner

Patrick Lutz, Themistoklis Haris, Aditya Gangrade, Venkatesh Saligrama
11/17/2026
cs.LG
transformer-attention

No confident code implementation found for this paper.

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.

Show full abstract

A softmax-attention transformer trained to solve linear systems $Xw=y$ implicitly improves matrix conditioning. Tracing $XX^\top$ 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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lutz2026transformerderived,
  title  = {A Transformer-Derived Iterative Preconditioner},
  author = {Patrick Lutz and Themistoklis Haris and Aditya Gangrade and Venkatesh Saligrama},
  year   = {2026},
  eprint = {2611.22941},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.22941v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.22941.svg)](https://codeofpaper.com/paper/2611.22941)

Discussion