cs.LGFeb 16, 2026

Covariance-Aware Transformers for Quadratic Programming and Decision Making

Authors: Kutay Tire, Yufan Zhang, Ege Onur Taga, Samet Oymak

Organizations: The University of Texas at Austin · University of Michigan

Abstract

We explore the use of transformers for solving quadratic programs and how this capability benefits decision-making problems that involve covariance matrices. We first show that the linear attention mechanism can provably solve unconstrained QPs by tokenizing the matrix variables (e.g.~AA of the objective 12x⊤Ax+b⊤x\frac{1}{2}x^\top Ax+b^\top x) row-by-row and emulating gradient descent iterations. Furthermore, by incorporating MLPs, a transformer block can solve (i) ℓ1\ell_1-penalized QPs by emulating iterative soft-thresholding and (ii) ℓ1\ell_1-constrained QPs when equipped with an additional feedback loop. Our theory motivates us to introduce Time2Decide: a generic method that enhances a time series foundation model (TSFM) by explicitly feeding the covariance matrix between the variates. We empirically find that Time2Decide uniformly outperforms the base TSFM model for the classical portfolio optimization problem that admits an ℓ1\ell_1-constrained QP formulation. Remarkably, Time2Decide also outperforms the classical "Predict-then-Optimize (PtO)" procedure, where we first forecast the returns and then explicitly solve a constrained QP, in suitable settings. Our results demonstrate that transformers benefit from explicit use of second-order statistics, and this can enable them to effectively solve complex decision-making problems, like portfolio construction, in one forward pass.

Figures & tables

Appendix figures & tables49 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. An Optimal Control Approach To Transformer Training

    Mar 10, 2026Kağan Akman, Naci Saldi, Serdar YükselTransformerTransformer Training Dynamics

  2. Breaking Feedback-Blindness: Utility-Augmented Transformer for Sequential Decision Making

    Jul 21, 2026Yuyang Shen, Shan Dai, Daimin ChenNon-Stationary RLSequential Decision Making

  3. Decision-focused Sparse Tangent Portfolio Optimization

    Jul 1, 2026Haeun Jeon, Seunghoon Choi, Hyunglip Bae +2Decision-Focused LearningPortfolio Optimization