A Constrained Optimization Perspective of Unrolled Transformers

Javier Porras-Valenzuela, Samar Hadou, Alejandro Ribeiro
1/24/2026
cs.LG

No confident code implementation found for this paper.

Abstract

We introduce a constrained optimization framework for training transformers that behave like optimization descent algorithms. Specifically, we enforce layerwise descent constraints on the objective function and replace standard empirical risk minimization (ERM) with a primal-dual training scheme. This approach yields models whose intermediate representations decrease the loss monotonically in expectation across layers. We apply our method to both unrolled transformer architectures and conventional pretrained transformers on tasks of video denoising and text classification. Across these settings, we observe constrained transformers achieve stronger robustness to perturbations and maintain higher out-of-distribution generalization, while preserving in-distribution performance.

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{porrasvalenzuela2026constrained,
  title  = {A Constrained Optimization Perspective of Unrolled Transformers},
  author = {Javier Porras-Valenzuela and Samar Hadou and Alejandro Ribeiro},
  year   = {2026},
  eprint = {2601.17257},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.17257v1}
}

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/2601.17257.svg)](https://codeofpaper.com/paper/2601.17257)

Discussion