Beyond Classical Attention: Quantum Attention for Scalable Computation

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Guo, Xuyang, Song, Zhao, Yang, Xin, Zhang, Ruizhe
Natura: Preprint
Pubblicazione: 2023
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914281718546432
author Guo, Xuyang
Song, Zhao
Yang, Xin
Zhang, Ruizhe
author_facet Guo, Xuyang
Song, Zhao
Yang, Xin
Zhang, Ruizhe
contents As large language models (LLMs) demonstrate outstanding performance across various tasks, attention-driven models have profoundly transformed the field of machine learning. Since attention computations account for the primary computational overhead in both model inference and training, efficiently computing attention matrices has become one of the core challenges in accelerating large language models. It is well-known that quantum machines possess computational advantages over classical machines, and the role of quantum computing in LLMs remains largely unexplored. In this work, we focus on leveraging the Grover search algorithm to efficiently compute a sparse attention matrix. Through comparisons with classical algorithms, we demonstrate that our method achieves quantum acceleration in polynomial time. Additionally, we observe that the generated quantum attention matrices naturally exhibit low-rank structures, providing further theoretical support for efficient modeling. Moreover, within the specific context of attention matrix computation, we conduct a systematic and detailed analysis of the error and time complexity of the proposed algorithm.
format Preprint
id arxiv_https___arxiv_org_abs_2307_08045
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Beyond Classical Attention: Quantum Attention for Scalable Computation
Guo, Xuyang
Song, Zhao
Yang, Xin
Zhang, Ruizhe
Quantum Physics
Machine Learning
As large language models (LLMs) demonstrate outstanding performance across various tasks, attention-driven models have profoundly transformed the field of machine learning. Since attention computations account for the primary computational overhead in both model inference and training, efficiently computing attention matrices has become one of the core challenges in accelerating large language models. It is well-known that quantum machines possess computational advantages over classical machines, and the role of quantum computing in LLMs remains largely unexplored. In this work, we focus on leveraging the Grover search algorithm to efficiently compute a sparse attention matrix. Through comparisons with classical algorithms, we demonstrate that our method achieves quantum acceleration in polynomial time. Additionally, we observe that the generated quantum attention matrices naturally exhibit low-rank structures, providing further theoretical support for efficient modeling. Moreover, within the specific context of attention matrix computation, we conduct a systematic and detailed analysis of the error and time complexity of the proposed algorithm.
title Beyond Classical Attention: Quantum Attention for Scalable Computation
topic Quantum Physics
Machine Learning
url https://arxiv.org/abs/2307.08045