search
HomeTechnology peripheralsAINetizens 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.

Netizens praised: Transformer leads the simplified version of the annual paper is here

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":

Netizens praised: Transformer leads the simplified version of the annual paper is here

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?

Netizens praised: Transformer leads the simplified version of the annual paper is here

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. 

Netizens praised: Transformer leads the simplified version of the annual paper is here

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 (как показано ниже).

Netizens praised: Transformer leads the simplified version of the annual paper is here

В каждом разделе главы 4 статьи автор рассказывает, как удалять по одному компоненту блока за раз, не влияя на скорость обучения.

Во всех экспериментах в этой части используется 18-блочная модель GPT, подобная декодеру шириной 768 пикселей, в наборе данных CodeParrot. Этот набор данных достаточно велик, поэтому, когда автор Когда в В режиме одной эпохи обучения разрыв в обобщении очень мал (см. рисунок 2), что позволяет им сосредоточиться на скорости обучения.

Netizens praised: Transformer leads the simplified version of the annual paper is here

Удалить остаточное соединение

#Исследователь сначала рассмотрел возможность удаления остаточного соединения в подблоке внимания. В обозначениях уравнения (1) это эквивалентно фиксированию α_SA равным 0. Простое удаление остаточных связей внимания может привести к ухудшению сигнала, то есть коллапсу рангов, что приведет к плохой обучаемости. В разделе 4.1 статьи исследователи подробно объясняют свой метод. Netizens praised: Transformer leads the simplified version of the annual paper is here

Удалить параметры проекции/значения

Из рисунка 3 можно сделать вывод, что значение и параметры проекции W^ полностью удалены V, W^P возможны с минимальной потерей скорости обучения на каждое обновление. То есть, когда β_V = β_P = 0 и инициализирован идентификатор Netizens praised: Transformer leads the simplified version of the annual paper is here

, после того же количества шагов обучения, это исследование может в основном достичь производительности Pre-LN. блок.производительность. В этом случае W^V = W^P = I имеет W^V = W^P = I на протяжении всего процесса обучения, т.е. значения и параметры проекции согласованы. Авторы представляют подробные методы в разделе 4.2. Netizens praised: Transformer leads the simplified version of the annual paper is here

Удалить остаточное соединение субблока MLP

По сравнению с вышеуказанными модулями, удаление остаточного соединения субблока MLP требует Более сложной. Как и в предыдущем исследовании, авторы обнаружили, что при использовании Адама без остаточных связей MLP создание более линейных активаций за счет распространения сигнала все равно приводило к значительному снижению скорости обучения на каждое обновление, как показано на рисунке 22. Netizens praised: Transformer leads the simplified version of the annual paper is here

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

Авторы обращаются к концепции параллельных субблоков MHA и MLP, которая оказалась популярной в нескольких последних моделях крупных трансформаторов, таких как PALM и ВиТ-22Б. Блок параллельного трансформатора показан на рисунке ниже. Netizens praised: Transformer leads the simplified version of the annual paper is here

Автор подробно описывает конкретную операцию удаления остаточных соединений субблока MLP в разделе 4.3 статьи.

Удалить слой нормализации

Последнее, что нужно удалить, это слой нормализации, чтобы получился простейший блок в правом верхнем углу рисунка 1. С точки зрения инициализации распространения сигнала авторы могут удалить уровень нормализации на любом этапе упрощения в этом разделе. Их идея состоит в том, что нормализация в блоке Pre-LN неявно уменьшает вес остаточных ветвей, и этот полезный эффект можно воспроизвести без слоя нормализации с помощью другого механизма: либо в При использовании остаточных соединений явно уменьшить вес остаточной ветви или сместить матрицу внимания в сторону идентичности/преобразовать нелинейность MLP в «большую» линейность.

Поскольку автор учел эти механизмы в процессе модификации (например, уменьшение веса MLP β_FF и Shaped Attention), в нормализации нет необходимости. Более подробную информацию авторы представляют в разделе 4.4.

Результаты экспериментов

Расширение по глубине

Учитывая, что теория распространения сигнала обычно фокусируется на больших глубинах, в данном случае ухудшение сигнала обычно происходит. Поэтому возникает естественный вопрос: может ли улучшенная скорость обучения, достигнутая с помощью нашего упрощенного трансформаторного блока, масштабироваться и на большую глубину?

###Из рисунка 6 видно, что после увеличения глубины с 18 блоков до 72 блоков производительность как модели, так и преобразователя Pre-LN в этом исследовании улучшается, что указывает на упрощение в этом исследовании. Модели не только тренируются быстрее, но и используют дополнительную мощность, обеспечиваемую большей глубиной. Фактически, когда используется нормализация, траектории упрощенного блока и Pre-LN за каждое обновление в этом исследовании почти неразличимы на разных глубинах. ###
Netizens praised: Transformer leads the simplified version of the annual paper is here

BERT

Далее авторы показывают, что их упрощенная производительность блоков применима к различным наборам данных и архитектурам, а также к последующим задачам. Они выбрали популярную настройку модели BERT только для двунаправленного кодировщика для моделирования языка в масках и использовали нисходящий тест GLUE.

Как показано на рисунке 7, в течение 24 часов выполнения упрощенные блоки этого исследования сопоставимы со скоростью предварительного обучения задачи моделирования языка в масках по сравнению с базовым уровнем (набором) Pre-LN. С другой стороны, удаление остаточных связей без изменения значений и проекций снова приводит к значительному снижению скорости обучения. На рисунке 24 авторы представляют эквивалентную схему микросерийного этапа.

Netizens praised: Transformer leads the simplified version of the annual paper is here

Netizens praised: Transformer leads the simplified version of the annual paper is here

##Кроме того, в Таблице 1 исследователи обнаружили, что их метод после точной настройки на тесте GLUE показал хорошие результаты. тест Crammed BERT вполне.

Netizens praised: Transformer leads the simplified version of the annual paper is here
Последующие задачи разбиты на Таблицу 2. Для справедливого сравнения они использовали тот же протокол тонкой настройки, что и Geiping & Goldstein (2023) (5 эпох, постоянные гиперпараметры для каждой задачи, регуляризация отсева).

Netizens praised: Transformer leads the simplified version of the annual paper is here

Повышение эффективности

#В Таблице 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.

Netizens praised: Transformer leads the simplified version of the annual paper is here

Более подробную информацию об исследовании можно найти в оригинальной статье.

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!

Statement
This article is reproduced at:机器之心. If there is any infringement, please contact admin@php.cn delete
Are You At Risk Of AI Agency Decay? Take The Test To Find OutAre You At Risk Of AI Agency Decay? Take The Test To Find OutApr 21, 2025 am 11:31 AM

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

How to Build an AI Agent from Scratch? - Analytics VidhyaHow to Build an AI Agent from Scratch? - Analytics VidhyaApr 21, 2025 am 11:30 AM

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

Revisiting The Humanities In The Age Of AIRevisiting The Humanities In The Age Of AIApr 21, 2025 am 11:28 AM

"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

Understanding LangChain Agent FrameworkUnderstanding LangChain Agent FrameworkApr 21, 2025 am 11:25 AM

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

What are the Radial Basis Functions Neural Networks?What are the Radial Basis Functions Neural Networks?Apr 21, 2025 am 11:13 AM

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

The Meshing Of Minds And Machines Has ArrivedThe Meshing Of Minds And Machines Has ArrivedApr 21, 2025 am 11:11 AM

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

Insights on spaCy, Prodigy and Generative AI from Ines MontaniInsights on spaCy, Prodigy and Generative AI from Ines MontaniApr 21, 2025 am 11:01 AM

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

A Guide to Building Agentic RAG Systems with LangGraphA Guide to Building Agentic RAG Systems with LangGraphApr 21, 2025 am 11:00 AM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SecLists

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

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

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