ChatPaper.aiChatPaper

Dualità del Flusso Residuo nelle Architetture Moderne dei Trasformatori

Residual Stream Duality in Modern Transformer Architectures

March 17, 2026
Autori: Yifan Zhang
cs.AI

Abstract

Recenti lavori hanno chiarito che il percorso residuo non è una mera questione di ottimizzazione tecnica; esso è parte del meccanismo rappresentativo del modello. Siamo d'accordo, ma sosteniamo che il modo più chiaro per organizzare questo spazio di progetto sia attraverso una visione a due assi del Transformer. Un decoder evolve l'informazione lungo due dimensioni ordinate: la posizione nella sequenza e la profondità del layer. L'auto-attenzione fornisce già un mixing adattivo lungo l'asse della sequenza, mentre il flusso residuo (residual stream) esegue solitamente un'addizione fissa lungo l'asse della profondità. Se fissiamo una posizione di token e trattiamo l'indice del layer come variabile ordinata, allora una lettura di attenzione residuale depth-wise causale è esattamente lo stesso operatore locale dell'attenzione causale a finestra scorrevole corta (ShortSWA), eccetto che scritta sulla profondità anziché sulla sequenza. Questa è la dualità fondamentale del flusso residuo alla base del Transformer^2. Questa prospettiva chiarisce anche la letteratura recente. ELC-BERT e DenseFormer mostrano già che un'aggregazione appresa sulla profondità può superare l'accumulo residuo uniforme, mentre Vertical Attention, DeepCrossAttention (DCA), MUDDFormer e Attention Residuals si spingono ulteriormente verso un routing esplicito basato sull'attenzione sugli strati precedenti. Il punto cruciale, tuttavia, è che la dualità a livello di operatore non implica una simmetria a livello di sistema. Per modelli autoregressivi su larga scala, lo ShortSWA sull'asse della sequenza è di solito il posizionamento più compatibile con l'hardware perché riutilizza kernel a finestra scorrevole lato token, layout di KV-cache ed esecuzione chunked. Se l'obiettivo è invece modificare la scorciatoia stessa, il Deep Delta Learning (DDL) è l'intervento più pulito perché modifica direttamente l'operatore residuo anziché aggiungere un percorso di retrieval cross-layer separato. La nostra raccomandazione è quindi semplice: usare il DDL quando la scorciatoia è l'oggetto di interesse, e usare lo ShortSWA sull'asse della sequenza quando l'obiettivo è un mixing adattivo locale.
English
Recent work has made clear that the residual pathway is not mere optimization plumbing; it is part of the model's representational machinery. We agree, but argue that the cleanest way to organize this design space is through a two-axis view of the Transformer. A decoder evolves information along two ordered dimensions: sequence position and layer depth. Self-attention already provides adaptive mixing along the sequence axis, whereas the residual stream usually performs fixed addition along the depth axis. If we fix a token position and treat layer index as the ordered variable, then a causal depth-wise residual attention read is exactly the same local operator as causal short sliding-window attention (ShortSWA), except written over depth rather than over sequence. This is the core residual stream duality behind Transformer^2. This perspective also clarifies the recent literature. ELC-BERT and DenseFormer already show that learned aggregation over depth can outperform uniform residual accumulation, while Vertical Attention, DeepCrossAttention (DCA), MUDDFormer, and Attention Residuals move further toward explicit attention-based routing over earlier layers. The key point, however, is that operator-level duality does not imply systems-level symmetry. For large-scale autoregressive models, sequence-axis ShortSWA is usually the more hardware-friendly placement because it reuses token-side sliding-window kernels, KV-cache layouts, and chunked execution. If the goal is instead to change the shortcut itself, Deep Delta Learning (DDL) is the cleaner intervention because it modifies the residual operator directly rather than adding a separate cross-layer retrieval path. Our recommendation is therefore simple: use DDL when the shortcut is the object of interest, and use sequence-axis ShortSWA when the goal is local adaptive mixing.
PDF42March 31, 2026