


Netizens praised: Transformer leads the simplified version of the annual paper is here
Optimize from the root of the large model.
Transformer architecture can be said to be the main force behind many recent success stories in the field of deep learning. A simple way to build a deep Transformer architecture is to stack multiple identical Transformer "blocks" one after another, but each "block" is more complex and consists of many different components that require a specific arrangement and combination. achieve good performance.
Since the birth of the Transformer architecture in 2017, researchers have launched a large number of derivative studies based on it, but almost no changes have been made to the Transformer "block".
So the question is, can the standard Transformer block be simplified?
In a recent paper, researchers from ETH Zurich discuss how to simplify the standard Transformer block necessary for LLM without affecting convergence properties and downstream task performance. Based on signal propagation theory and empirical evidence, they found that some parts can be removed, such as residual connections, normalization layers (LayerNorm), projection and value parameters, and MLP serialization sub-blocks (favoring parallel layout ) to simplify GPT-like decoder architecture and encoder-style BERT models.
The researchers explored whether the components involved could be removed without affecting the training speed, and what architectural modifications should be made to the Transformer block.

Paper link: https://arxiv.org/pdf/2311.01906.pdf
Lightning AI Founder, Machine Learning Researcher Sebastian Raschka calls this study "one of his favorite papers of the year":
But some researchers question: "It's hard to comment unless I've seen the complete training process. Without a normalization layer and no residual connections, how can it be scaled in a network with >100 million parameters?』

Sebastian Raschka agreed: "Yes, the architecture they experimented with is relatively small. Can this be generalized to a Transformer with billions of parameters? That remains to be seen." But he still says the work is impressive and thinks the successful removal of residual connections is entirely reasonable (given its initialization scheme).
In this regard, Turing Award winner Yann LeCun commented: "We have only touched the surface of the field of deep learning architecture. This is a high-dimensional space, so the volume is almost completely contained in the surface. But we've only scratched the surface.
Why do we need to simplify the Transformer block?
The researchers said that simplifying the Transformer block without affecting the training speed is an interesting research problem. First of all, modern neural network architectures are complex in design and contain many components. The role that these different components play in the dynamics of neural network training and how they interact with each other is still unclear. This question relates to the gap between deep learning theory and practice, and is therefore very important. Signal propagation theory has proven influential in that it motivates practical design choices in deep neural network architectures. Signal propagation studies the evolution of geometric information in neural networks upon initialization, captured by the inner product of hierarchical representations across inputs, and has led to many impressive results in training deep neural networks. However, currently this theory only considers the model during initialization, and often only considers the initial forward pass, so it cannot reveal many complex issues in the training dynamics of deep neural networks, such as the contribution of residual connections to training speed. . While signal propagation is critical to modification motivation, the researchers say they couldn't derive a simplified Transformer module from theory alone and had to rely on empirical insights. In terms of practical applications, given the current high cost of training and deploying large Transformer models, any efficiency improvements in the Transformer architecture’s training and inference pipelines represent huge potential savings. If the Transformer module can be simplified by removing unnecessary components, it can both reduce the number of parameters and improve the throughput of the model. This paper also mentioned that after removing the residual connection, value parameters, projection parameters and serialization sub-blocks, it can be matched with the standard Transformer in terms of training speed and downstream task performance. Ultimately, the researchers reduced the number of parameters by 16% and observed a 16% increase in throughput in training and inference time.How to simplify the Transformer block?
Объединив теорию распространения сигналов и эмпирические наблюдения, исследователь представил, как создать простейший блок трансформатора, начиная с модуля Pre-LN (как показано ниже).
В каждом разделе главы 4 статьи автор рассказывает, как удалять по одному компоненту блока за раз, не влияя на скорость обучения.
Во всех экспериментах в этой части используется 18-блочная модель GPT, подобная декодеру шириной 768 пикселей, в наборе данных CodeParrot. Этот набор данных достаточно велик, поэтому, когда автор Когда в В режиме одной эпохи обучения разрыв в обобщении очень мал (см. рисунок 2), что позволяет им сосредоточиться на скорости обучения.
Удалить остаточное соединение
#Исследователь сначала рассмотрел возможность удаления остаточного соединения в подблоке внимания. В обозначениях уравнения (1) это эквивалентно фиксированию α_SA равным 0. Простое удаление остаточных связей внимания может привести к ухудшению сигнала, то есть коллапсу рангов, что приведет к плохой обучаемости. В разделе 4.1 статьи исследователи подробно объясняют свой метод.
Удалить параметры проекции/значения
Из рисунка 3 можно сделать вывод, что значение и параметры проекции W^ полностью удалены V, W^P возможны с минимальной потерей скорости обучения на каждое обновление. То есть, когда β_V = β_P = 0 и инициализирован идентификатор

Удалить остаточное соединение субблока MLP
По сравнению с вышеуказанными модулями, удаление остаточного соединения субблока MLP требует Более сложной. Как и в предыдущем исследовании, авторы обнаружили, что при использовании Адама без остаточных связей MLP создание более линейных активаций за счет распространения сигнала все равно приводило к значительному снижению скорости обучения на каждое обновление, как показано на рисунке 22.
Они также пробовали различные варианты инициализации Looks Linear, включая гауссовы веса, ортогональные веса или тождественные веса, но безрезультатно. Поэтому они используют стандартные активации (например, ReLU) на протяжении всей своей работы и инициализации в подблоках MLP.

Автор подробно описывает конкретную операцию удаления остаточных соединений субблока MLP в разделе 4.3 статьи.
Удалить слой нормализацииПоследнее, что нужно удалить, это слой нормализации, чтобы получился простейший блок в правом верхнем углу рисунка 1. С точки зрения инициализации распространения сигнала авторы могут удалить уровень нормализации на любом этапе упрощения в этом разделе. Их идея состоит в том, что нормализация в блоке Pre-LN неявно уменьшает вес остаточных ветвей, и этот полезный эффект можно воспроизвести без слоя нормализации с помощью другого механизма: либо в При использовании остаточных соединений явно уменьшить вес остаточной ветви или сместить матрицу внимания в сторону идентичности/преобразовать нелинейность MLP в «большую» линейность.
Поскольку автор учел эти механизмы в процессе модификации (например, уменьшение веса MLP β_FF и Shaped Attention), в нормализации нет необходимости. Более подробную информацию авторы представляют в разделе 4.4.
Результаты экспериментовРасширение по глубине
Учитывая, что теория распространения сигнала обычно фокусируется на больших глубинах, в данном случае ухудшение сигнала обычно происходит. Поэтому возникает естественный вопрос: может ли улучшенная скорость обучения, достигнутая с помощью нашего упрощенного трансформаторного блока, масштабироваться и на большую глубину?
###Из рисунка 6 видно, что после увеличения глубины с 18 блоков до 72 блоков производительность как модели, так и преобразователя Pre-LN в этом исследовании улучшается, что указывает на упрощение в этом исследовании. Модели не только тренируются быстрее, но и используют дополнительную мощность, обеспечиваемую большей глубиной. Фактически, когда используется нормализация, траектории упрощенного блока и Pre-LN за каждое обновление в этом исследовании почти неразличимы на разных глубинах. ###
BERT
Далее авторы показывают, что их упрощенная производительность блоков применима к различным наборам данных и архитектурам, а также к последующим задачам. Они выбрали популярную настройку модели BERT только для двунаправленного кодировщика для моделирования языка в масках и использовали нисходящий тест GLUE.
Как показано на рисунке 7, в течение 24 часов выполнения упрощенные блоки этого исследования сопоставимы со скоростью предварительного обучения задачи моделирования языка в масках по сравнению с базовым уровнем (набором) Pre-LN. С другой стороны, удаление остаточных связей без изменения значений и проекций снова приводит к значительному снижению скорости обучения. На рисунке 24 авторы представляют эквивалентную схему микросерийного этапа.



Повышение эффективности
#В Таблице 1 исследователь также подробно описывает использование различных блоков Transformer в языке маскировки Количество параметров и скорость обучения в задаче моделирования. Они рассчитали скорость как отношение количества микропакетных шагов, выполненных в течение 24 часов предварительной тренировки, к базовому уровню BERT Pre-LN Crammed. Вывод таков: модель использует на 16 % меньше параметров, а SAS-P и SAS работают на итерацию на 16 % и 9 % быстрее, чем блок Pre-LN соответственно. Можно отметить, что в данной реализации параллельный блок всего на 5% быстрее, чем блок Pre-LN, тогда как скорость обучения, наблюдаемая Чоудхери и др. (2022), на 15% быстрее, что указывает на то, что благодаря реализации оптимизации общая скорость обучения может быть дополнительно улучшена. Как и Geiping & Goldstein (2023), в этой реализации также используется технология автоматического объединения операторов в PyTorch (Sarofeen et al., 2022).Длительное обучение
Наконец, учитывая текущую тенденцию обучения меньших моделей на большем количестве данных в течение более длительных периодов времени, исследователи обсудили упрощение блоков в течение более длительных периодов времени. Можно ли достичь скорости обучения блока Pre-LN после тренировки. Для этого они используют модель на рисунке 5 на CodeParrot и тренируются с токенами 3x. Если быть точным, обучение занимает около 120 тыс. шагов (вместо 40 тыс. шагов) с размером пакета 128 и длиной последовательности 128, в результате чего получается около 2 млрд токенов. Как видно на рисунке 8, когда для обучения используется больше токенов, скорость обучения упрощенных кодовых блоков SAS и SAS-P по-прежнему сравнима или даже лучше, чем у кодовых блоков PreLN.The above is the detailed content of Netizens praised: Transformer leads the simplified version of the annual paper is here. For more information, please follow other related articles on the PHP Chinese website!

This article explores the growing concern of "AI agency decay"—the gradual decline in our ability to think and decide independently. This is especially crucial for business leaders navigating the increasingly automated world while retainin

Ever wondered how AI agents like Siri and Alexa work? These intelligent systems are becoming more important in our daily lives. This article introduces the ReAct pattern, a method that enhances AI agents by combining reasoning an

"I think AI tools are changing the learning opportunities for college students. We believe in developing students in core courses, but more and more people also want to get a perspective of computational and statistical thinking," said University of Chicago President Paul Alivisatos in an interview with Deloitte Nitin Mittal at the Davos Forum in January. He believes that people will have to become creators and co-creators of AI, which means that learning and other aspects need to adapt to some major changes. Digital intelligence and critical thinking Professor Alexa Joubin of George Washington University described artificial intelligence as a “heuristic tool” in the humanities and explores how it changes

LangChain is a powerful toolkit for building sophisticated AI applications. Its agent architecture is particularly noteworthy, allowing developers to create intelligent systems capable of independent reasoning, decision-making, and action. This expl

Radial Basis Function Neural Networks (RBFNNs): A Comprehensive Guide Radial Basis Function Neural Networks (RBFNNs) are a powerful type of neural network architecture that leverages radial basis functions for activation. Their unique structure make

Brain-computer interfaces (BCIs) directly link the brain to external devices, translating brain impulses into actions without physical movement. This technology utilizes implanted sensors to capture brain signals, converting them into digital comman

This "Leading with Data" episode features Ines Montani, co-founder and CEO of Explosion AI, and co-developer of spaCy and Prodigy. Ines offers expert insights into the evolution of these tools, Explosion's unique business model, and the tr

This article explores Retrieval Augmented Generation (RAG) systems and how AI agents can enhance their capabilities. Traditional RAG systems, while useful for leveraging custom enterprise data, suffer from limitations such as a lack of real-time dat


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software