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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Tian, Zhengyu, Kumar, Anantha Padmanaban Krishna, Krishnakumar, Hemant, Rawassizadeh, Reza
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915380620951552
author Tian, Zhengyu
Kumar, Anantha Padmanaban Krishna
Krishnakumar, Hemant
Rawassizadeh, Reza
author_facet Tian, Zhengyu
Kumar, Anantha Padmanaban Krishna
Krishnakumar, Hemant
Rawassizadeh, Reza
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2507_07247
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Attentions Under the Microscope: A Comparative Study of Resource Utilization for Variants of Self-Attention
Tian, Zhengyu
Kumar, Anantha Padmanaban Krishna
Krishnakumar, Hemant
Rawassizadeh, Reza
Machine Learning
Artificial Intelligence
Neural and Evolutionary Computing
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.
title Attentions Under the Microscope: A Comparative Study of Resource Utilization for Variants of Self-Attention
topic Machine Learning
Artificial Intelligence
Neural and Evolutionary Computing
url https://arxiv.org/abs/2507.07247