Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Covariance-Aware Transformers for Quadratic Programming and Decision Making

About

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.~$A$ of the objective $\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) $\ell_1$-penalized QPs by emulating iterative soft-thresholding and (ii) $\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 $\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.

Kutay Tire, Yufan Zhang, Ege Onur Taga, Samet Oymak• 2026

Related benchmarks

TaskDatasetResultRank
Portfolio OptimizationNoisy Portfolio Return Series
MSE0.0232
35
Portfolio OptimizationMultivariate Return Series clean data (evaluation)
MSE0.0323
35
Quadratic Programming (QP) SolvingQP (n=5, m=3) (test)
R^20.9738
4
Quadratic Programming (QP) SolvingQP (n=7, m=3) (test)
R-squared0.96
4
Quadratic Programming (QP) SolvingQP (n=7, m=6) (test)
R^293.55
4
Quadratic Programming (QP) SolvingQP (n=10, m=3) (test)
R^20.9054
4
Quadratic Programming (QP) SolvingQP (n=10, m=6) (test)
R^20.8921
4
Quadratic Programming (QP) SolvingQP (n=10, m=9) (test)
R^290.62
4
Showing 8 of 8 rows

Other info

Follow for update