Skip to content
  • enzuazua
  • Events Calendar
  • Jobs
cmc.deusto.eus
  • Home
  • About DeustoCCM
    • About DeustoCCM
    • Head of DeustoCCM
    • Team
    • Contact
    • Past Members
  • Research
    • Publications DeustoCCM
    • Projects
    • ERC CoDeFeL
      • CoDeFeL • WP1
      • CoDeFeL • WP2
      • CoDeFeL • WP3
      • CoDeFeL • WP4
      • CoDeFeL • GitHub
      • CoDeFeL • Blog
      • Industrial & Social Transference
    • DyCMaMod
    • Computational Mathematics Research Group
  • Activities
    • Events calendar
    • Seminars
    • Highlights
    • Our Latest
    • Courses
    • enzuazua
    • Past Events
    • Gallery
  • Partners
    • COST
    • FAU MoD
    • FAU MoD Members
    • FAU DCN-AVH
    • FAU DCN-AvH Team
    • Projects at FAU
    • FAU MoD Lectures
    • FAU MoD Courses / Workshops
    • Teaching
    • Academy
    • FAU Math and Research posts
    • FAU Initiatives
    • Contributors
    • FAU Past members
  • Jobs

Exact Sequence Classification with Hardmax Transformers

A. Alcalde Zafra, G. Fantuzzi, E. Zuazua (2025) Exact Sequence Classification with Hardmax Transformers, arxiv: 2502.02270

Abstract. We prove that hardmax attention transformers perfectly classify datasets of $N$ labeled sequences in \mathbb{R}^d, d\geq 2. Specifically, given N sequences with an arbitrary but finite length in \mathbb{R}^d, we construct a transformer with \mathcal{O}(N) blocks and \mathcal{O}(Nd) parameters perfectly classifying this dataset. Our construction achieves the best complexity estimate to date, independent of the length of the sequences, by innovatively alternating feed-forward and self-attention layers and by capitalizing on the clustering effect inherent to the latter. Our novel constructive method also uses low-rank parameter matrices within the attention mechanism, a common practice in real-life transformer implementations. Consequently, our analysis holds twofold significance: it substantially advances the mathematical theory of transformers and it rigorously justifies their exceptional real-world performance in sequence classification tasks.

arxiv: 2502.02270

  • Hidden Routes: What Nonlinear Control Teaches Us About AI Safety
  • When Averaging Is Not Enough: Coordinating Distributed Learning Systems
  • IKTrace Seminar: If mathematics is the answer, what was the question?Teaching Mathematics Beyond Mathematics
  • Machine Learning from an Applied Mathematician’s Perspective
Copyright 2016 - 2026 DeustoCCM — cmc.deusto.eus. All rights reserved. Chair of Computational Mathematics, University of Deusto
Scroll to Top
  • Aviso Legal
  • Política de Privacidad
  • Política de Cookies
  • Configuración de Cookies
WE USE COOKIES ON THIS SITE TO ENHANCE USER EXPERIENCE. We also use analytics. By navigating any page you are giving your consent for us to set cookies.    more information
Privacidad