Enhancing Transformers Through Conditioned Embedded Tokens

Hemanth Saratchandran, Simon Lucey
5/19/2025
cs.CV
transformer-attention

No confident code implementation found for this paper.

Abstract

Transformers have transformed modern machine learning, driving breakthroughs in computer vision, natural language processing, and robotics. At the core of their success lies the attention mechanism, which enables the modeling of global dependencies among input tokens.

Show full abstract

However, we reveal that the attention block in transformers suffers from inherent ill-conditioning, which hampers gradient-based optimization and leads to inefficient training. To address this, we develop a theoretical framework that establishes a direct relationship between the conditioning of the attention block and that of the embedded tokenized data. Building on this insight, we introduce conditioned embedded tokens, a method that systematically modifies the embedded tokens to improve the conditioning of the attention mechanism. Our analysis demonstrates that this approach significantly mitigates ill-conditioning, leading to more stable and efficient training. We validate our methodology across various transformer architectures, achieving consistent improvements in image classification, object detection, instance segmentation, and natural language processing, highlighting its broad applicability and effectiveness.

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{saratchandran2025enhancing,
  title  = {Enhancing Transformers Through Conditioned Embedded Tokens},
  author = {Hemanth Saratchandran and Simon Lucey},
  year   = {2025},
  eprint = {2505.12789},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.12789v2},
  journal = {ICCV 2025 2025}
}

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

Discussion