ChatPaper.aiChatPaper

Преодоление узкого места внимания

Breaking the Attention Bottleneck

June 16, 2024
Авторы: Kalle Hilsenbek
cs.AI

Аннотация

Трансформеры с механизмом внимания стали стандартной архитектурой во многих областях глубокого обучения, в основном благодаря их способности моделировать дальние зависимости и обрабатывать входные последовательности переменной длины. Однако механизм внимания с квадратичной сложностью является значительным узким местом в архитектуре трансформера. Этот алгоритм однонаправлен только в декодере и сходится к статическому образцу в переопределенных моделях только декодера. Я решаю эту проблему, разрабатывая генеративную функцию в качестве замены внимания или активации. Он все еще обладает авторегрессивным характером, сравнивая каждый токен с предыдущим. В моем тестовом сценарии с использованием nanoGPT это приводит к меньшим потерям при более компактной модели. Потери дополнительно снижаются при включении среднего вектора контекста. Этот концепт замены внимания распространяется под лицензией GNU AGPL v3 по адресу 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.

Summary

AI-Generated Summary

PDF44December 6, 2024