Attentions Under the Microscope: A Comparative Study of Resource Utilization for Variants of Self-Attention

Zhengyu Tian, Anantha Padmanaban Krishna Kumar, Hemant Krishnakumar, Reza Rawassizadeh
7/9/2025
cs.LGcs.AIcs.NE

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

As large language models (LLMs) and visual language models (VLMs) grow in scale and application, attention mechanisms have become a central computational bottleneck due to their high memory and time complexity. While many efficient attention variants have been proposed, there remains a lack of rigorous evaluation on their actual energy usage and hardware resource demands during training. In this work, we benchmark eight attention mechanisms in training GPT-2 architecture, measuring key metrics including training time, GPU memory usage, FLOPS, CPU usage, and power consumption. Our results reveal that attention mechanisms with optimized kernel implementations, including Flash Attention, Locality-Sensitive Hashing (LSH) Attention, and Multi-Head Latent Attention (MLA), achieve the best energy efficiency. We further show that lower GPU power alone does not guarantee reduced energy use, as training time plays an equally important role. Our study highlights the importance of energy-aware benchmarking in attention design and provides a practical insight for selecting resource-efficient mechanisms. All our codes are available at GitHub.

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. 2 weaker matches are hidden by default — 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{tian2025attentions,
  title  = {Attentions Under the Microscope: A Comparative Study of Resource Utilization for Variants of Self-Attention},
  author = {Zhengyu Tian and Anantha Padmanaban Krishna Kumar and Hemant Krishnakumar and Reza Rawassizadeh},
  year   = {2025},
  eprint = {2507.07247},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.07247v1}
}

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

Discussion