Ripensare l'Attenzione: Esplorare Reti Neurali Feed-Forward Superficiali come Alternativa ai Livelli di Attenzione nei Trasformatori
Rethinking Attention: Exploring Shallow Feed-Forward Neural Networks as an Alternative to Attention Layers in Transformers
November 17, 2023
Autori: Vukasin Bozic, Danilo Dordervic, Daniele Coppola, Joseph Thommes
cs.AI
Abstract
Questo lavoro presenta un'analisi dell'efficacia dell'utilizzo di reti feed-forward standard e poco profonde per emulare il comportamento del meccanismo di attenzione nel modello Transformer originale, un'architettura all'avanguardia per compiti di sequenza-a-sequenza. Sostituiamo elementi chiave del meccanismo di attenzione nel Transformer con semplici reti feed-forward, addestrate utilizzando i componenti originali tramite distillazione della conoscenza. I nostri esperimenti, condotti sul dataset IWSLT2017, rivelano la capacità di questi "Transformer senza attenzione" di competere con le prestazioni dell'architettura originale. Attraverso rigorosi studi di ablazione e sperimentando con vari tipi e dimensioni di reti sostitutive, offriamo approfondimenti che supportano la fattibilità del nostro approccio. Ciò non solo getta luce sull'adattabilità delle reti feed-forward poco profonde nell'emulare i meccanismi di attenzione, ma sottolinea anche il loro potenziale nel semplificare architetture complesse per compiti di sequenza-a-sequenza.
English
This work presents an analysis of the effectiveness of using standard shallow
feed-forward networks to mimic the behavior of the attention mechanism in the
original Transformer model, a state-of-the-art architecture for
sequence-to-sequence tasks. We substitute key elements of the attention
mechanism in the Transformer with simple feed-forward networks, trained using
the original components via knowledge distillation. Our experiments, conducted
on the IWSLT2017 dataset, reveal the capacity of these "attentionless
Transformers" to rival the performance of the original architecture. Through
rigorous ablation studies, and experimenting with various replacement network
types and sizes, we offer insights that support the viability of our approach.
This not only sheds light on the adaptability of shallow feed-forward networks
in emulating attention mechanisms but also underscores their potential to
streamline complex architectures for sequence-to-sequence tasks.