Salvato in:
Dettagli Bibliografici
Autori principali: Nguyen, Tan M., Nguyen, Tam, Ho, Nhat, Bertozzi, Andrea L., Baraniuk, Richard G., Osher, Stanley J.
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:https://arxiv.org/abs/2406.13781
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866913398293266432
author Nguyen, Tan M.
Nguyen, Tam
Ho, Nhat
Bertozzi, Andrea L.
Baraniuk, Richard G.
Osher, Stanley J.
author_facet Nguyen, Tan M.
Nguyen, Tam
Ho, Nhat
Bertozzi, Andrea L.
Baraniuk, Richard G.
Osher, Stanley J.
contents Self-attention is key to the remarkable success of transformers in sequence modeling tasks including many applications in natural language processing and computer vision. Like neural network layers, these attention mechanisms are often developed by heuristics and experience. To provide a principled framework for constructing attention layers in transformers, we show that the self-attention corresponds to the support vector expansion derived from a support vector regression problem, whose primal formulation has the form of a neural network layer. Using our framework, we derive popular attention layers used in practice and propose two new attentions: 1) the Batch Normalized Attention (Attention-BN) derived from the batch normalization layer and 2) the Attention with Scaled Head (Attention-SH) derived from using less training data to fit the SVR model. We empirically demonstrate the advantages of the Attention-BN and Attention-SH in reducing head redundancy, increasing the model's accuracy, and improving the model's efficiency in a variety of practical applications including image and time-series classification.
format Preprint
id arxiv_https___arxiv_org_abs_2406_13781
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle A Primal-Dual Framework for Transformers and Neural Networks
Nguyen, Tan M.
Nguyen, Tam
Ho, Nhat
Bertozzi, Andrea L.
Baraniuk, Richard G.
Osher, Stanley J.
Machine Learning
Artificial Intelligence
Computation and Language
Computer Vision and Pattern Recognition
Self-attention is key to the remarkable success of transformers in sequence modeling tasks including many applications in natural language processing and computer vision. Like neural network layers, these attention mechanisms are often developed by heuristics and experience. To provide a principled framework for constructing attention layers in transformers, we show that the self-attention corresponds to the support vector expansion derived from a support vector regression problem, whose primal formulation has the form of a neural network layer. Using our framework, we derive popular attention layers used in practice and propose two new attentions: 1) the Batch Normalized Attention (Attention-BN) derived from the batch normalization layer and 2) the Attention with Scaled Head (Attention-SH) derived from using less training data to fit the SVR model. We empirically demonstrate the advantages of the Attention-BN and Attention-SH in reducing head redundancy, increasing the model's accuracy, and improving the model's efficiency in a variety of practical applications including image and time-series classification.
title A Primal-Dual Framework for Transformers and Neural Networks
topic Machine Learning
Artificial Intelligence
Computation and Language
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2406.13781