ChatPaper.aiChatPaper

Um Único Feedforward Amplo é Tudo que Você Precisa

One Wide Feedforward is All You Need

September 4, 2023
Autores: Telmo Pessoa Pires, António V. Lopes, Yannick Assogba, Hendra Setiawan
cs.AI

Resumo

A arquitetura Transformer possui dois principais componentes não relacionados a embeddings: o Mecanismo de Atenção e a Rede Feed Forward (FFN). O Mecanismo de Atenção captura interdependências entre as palavras, independentemente de suas posições, enquanto a FFN transforma de forma não linear cada token de entrada de maneira independente. Neste trabalho, exploramos o papel da FFN e descobrimos que, apesar de ocupar uma fração significativa dos parâmetros do modelo, ela é altamente redundante. Concretamente, conseguimos reduzir substancialmente o número de parâmetros com apenas uma modesta queda na precisão, removendo a FFN das camadas do decodificador e compartilhando uma única FFN no codificador. Por fim, escalamos essa arquitetura de volta ao seu tamanho original, aumentando a dimensão oculta da FFN compartilhada, alcançando ganhos substanciais tanto em precisão quanto em latência em relação ao Transformer Big original.
English
The Transformer architecture has two main non-embedding components: Attention and the Feed Forward Network (FFN). Attention captures interdependencies between words regardless of their position, while the FFN non-linearly transforms each input token independently. In this work we explore the role of the FFN, and find that despite taking up a significant fraction of the model's parameters, it is highly redundant. Concretely, we are able to substantially reduce the number of parameters with only a modest drop in accuracy by removing the FFN on the decoder layers and sharing a single FFN across the encoder. Finally we scale this architecture back to its original size by increasing the hidden dimension of the shared FFN, achieving substantial gains in both accuracy and latency with respect to the original Transformer Big.
PDF331February 8, 2026