Het doorbreken van de aandachtknelpunt
Breaking the Attention Bottleneck
June 16, 2024
Auteurs: Kalle Hilsenbek
cs.AI
Samenvatting
Attention-based transformers zijn de standaardarchitectuur geworden in veel
deep learning-gebieden, voornamelijk vanwege hun vermogen om langeafstandsafhankelijkheden
te modelleren en invoerreeksen met variabele lengte te verwerken. Het aandachtmechanisme
met zijn kwadratische complexiteit vormt echter een belangrijk knelpunt in de
transformer-architectuur. Dit algoritme is slechts unidirectioneel in de decoder
en convergeert naar een statisch patroon in overgeparametriseerde decoder-only modellen.
Ik pak dit probleem aan door een generatieve functie te ontwikkelen als vervanging
voor aandacht of activatie. Het behoudt nog steeds het auto-regressieve karakter
door elk token te vergelijken met het vorige. In mijn testopstelling met nanoGPT
resulteert dit in een kleiner verlies terwijl het model kleiner is. Het verlies
daalt verder door het opnemen van een gemiddelde contextvector. Dit concept van
aandachtsvervanging is beschikbaar onder de GNU AGPL v3-licentie op
https://gitlab.com/Bachstelze/causal_generation.
English
Attention-based transformers have become the standard architecture in many
deep learning fields, primarily due to their ability to model long-range
dependencies and handle variable-length input sequences. However, the attention
mechanism with its quadratic complexity is a significant bottleneck in the
transformer architecture. This algorithm is only uni-directional in the decoder
and converges to a static pattern in over-parametrized decoder-only models. I
address this issue by developing a generative function as attention or
activation replacement. It still has the auto-regressive character by comparing
each token with the previous one. In my test setting with nanoGPT this yields a
smaller loss while having a smaller model. The loss further drops by
incorporating an average context vector. This concept of attention replacement
is distributed under the GNU AGPL v3 license at
https://gitlab.com/Bachstelze/causal_generation.