arXiv:2602.14506cs.LG2026-02

Transformer通过显式利用协方差矩阵,一次前向传播解决投资组合优化等决策问题。

Covariance-Aware Transformers for Quadratic Programming and Decision Making

  • 将矩阵变量按行切片,用线性注意力模拟梯度下降求解无约束二次规划
  • 结合MLP与反馈环,可处理带L1惩罚或约束的QP问题,性能优于传统方法
  • 适用于需要协方差信息的决策场景,如金融投资组合构建,尤其适合时间序列模型增强

本文探索了Transformer求解二次规划(QP)的能力及其在涉及协方差矩阵的决策问题中的应用。研究发现,线性注意力机制可通过逐行令牌化矩阵变量(如目标函数中的$A$),并模拟梯度下降迭代,精确求解无约束QP。进一步地,引入MLP的Transformer模块可实现:(i) 通过模拟迭代软阈值法求解$\\\\ ext{L}_1$-惩罚的QP;(ii) 在增加反馈回路后求解$\\text{L}_1$-约束的QP。基于该理论,我们提出Time2Decide:一种通用方法,通过显式输入变量化之间的协方差矩阵来增强时间序列基础模型(TSFM)。实验表明,Time2Decide在经典投资组合优化问题(具有$\\text{L}_1$-约束的QP形式)中始终优于基线TSFM模型,且在合适条件下超越传统的“预测-再优化”(PtO)流程。结果表明,显式使用二阶统计量能显著提升Transformer在复杂决策任务中的表现。

原文摘要 · Abstract (English)

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.

二次规划决策建模Transformer投资组合优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。