Attention Flows for General Transformers
- URL: http://arxiv.org/abs/2205.15389v1
- Date: Mon, 30 May 2022 19:12:49 GMT
- Title: Attention Flows for General Transformers
- Abstract summary: We formalize a method to construct a flow network out of the attention values of encoder-only Transformer models.
We show that running a maxflow algorithm on the flow network construction yields Shapley values.
We provide a library that computes and visualizes the attention flow of arbitrary Transformer models.
- Score: 3.4123736336071864
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: In this paper, we study the computation of how much an input token in a
Transformer model influences its prediction. We formalize a method to construct
a flow network out of the attention values of encoder-only Transformer models
and extend it to general Transformer architectures including an auto-regressive
decoder. We show that running a maxflow algorithm on the flow network
construction yields Shapley values, which determine the impact of a player in
cooperative game theory. By interpreting the input tokens in the flow network
as players, we can compute their influence on the total attention flow leading
to the decoder's decision. Additionally, we provide a library that computes and
visualizes the attention flow of arbitrary Transformer models. We show the
usefulness of our implementation on various models trained on natural language
processing and reasoning tasks.
Related papers
- Cross-Attention and Encoder-Decoder Transformers: A Logical Characterization [2.446672595462589]
We study such transformers over text in the practical setting of floating-point numbers and soft-attention.<n>We also give an additional characterization of such transformers via a type of distributed automata.
arXiv Detail & Related papers (2026-05-08T13:14:04Z) - A Transformer Inspired AI-based MIMO receiver [0.5039813366558306]
The AttDet design combines model-based interpretability with data-driven flexibility.<n>We demonstrate through link-level simulations under 5G channel models and high-order, mixed QAM modulation and coding schemes.<n>AttDet can approach near-optimal BER/BLER performance while maintaining predictable, realistic complexity.
arXiv Detail & Related papers (2025-10-23T09:05:10Z) - On-Chip Learning via Transformer In-Context Learning [0.9353041869660692]
Self-attention mechanism requires transferring prior token projections from the main memory at each time step.
We present a neuromorphic decoder-only transformer model that utilizes an on-chip plasticity processor to compute self-attention.
arXiv Detail & Related papers (2024-10-11T10:54:09Z) - Algorithmic Capabilities of Random Transformers [49.73113518329544]
We investigate what functions can be learned by randomly transformers in which only the embedding layers are optimized.
We find that these random transformers can perform a wide range of meaningful algorithmic tasks.
Our results indicate that some algorithmic capabilities are present in transformers even before these models are trained.
arXiv Detail & Related papers (2024-10-06T06:04:23Z) - Transformers need glasses! Information over-squashing in language tasks [18.81066657470662]
We study how information propagates in decoder-only Transformers.
We show that certain sequences of inputs to the Transformer can yield arbitrarily close representations in the final token.
We also show that decoder-only Transformer language models can lose sensitivity to specific tokens in the input.
arXiv Detail & Related papers (2024-06-06T17:14:44Z) - Quantum linear algebra is all you need for Transformer architectures [1.660288273261283]
We investigate transformer architectures under the lens of fault-tolerant quantum computing.
We show how to prepare a block encoding of the self-attention matrix, with a new subroutine for the row-wise application of the softmax function.
Our subroutines prepare an amplitude encoding of the transformer output, which can be measured to obtain a prediction.
arXiv Detail & Related papers (2024-02-26T16:31:28Z) - On the Convergence of Encoder-only Shallow Transformers [62.639819460956176]
We build the global convergence theory of encoder-only shallow Transformers under a realistic setting.
Our results can pave the way for a better understanding of modern Transformers, particularly on training dynamics.
arXiv Detail & Related papers (2023-11-02T20:03:05Z) - iTransformer: Inverted Transformers Are Effective for Time Series Forecasting [62.40166958002558]
We propose iTransformer, which simply applies the attention and feed-forward network on the inverted dimensions.
The iTransformer model achieves state-of-the-art on challenging real-world datasets.
arXiv Detail & Related papers (2023-10-10T13:44:09Z) - Error Correction Code Transformer [92.10654749898927]
We propose to extend for the first time the Transformer architecture to the soft decoding of linear codes at arbitrary block lengths.
We encode each channel's output dimension to high dimension for better representation of the bits information to be processed separately.
The proposed approach demonstrates the extreme power and flexibility of Transformers and outperforms existing state-of-the-art neural decoders by large margins at a fraction of their time complexity.
arXiv Detail & Related papers (2022-03-27T15:25:58Z) - Predicting Attention Sparsity in Transformers [0.9786690381850356]
We propose Sparsefinder, a model trained to identify the sparsity pattern of entmax attention before computing it.
Our work provides a new angle to study model efficiency by doing extensive analysis of the tradeoff between the sparsity and recall of the predicted attention graph.
arXiv Detail & Related papers (2021-09-24T20:51:21Z) - Thinking Like Transformers [64.96770952820691]
We propose a computational model for the transformer-encoder in the form of a programming language.
We show how RASP can be used to program solutions to tasks that could conceivably be learned by a Transformer.
We provide RASP programs for histograms, sorting, and Dyck-languages.
arXiv Detail & Related papers (2021-06-13T13:04:46Z) - Transformers Solve the Limited Receptive Field for Monocular Depth
Prediction [82.90445525977904]
We propose TransDepth, an architecture which benefits from both convolutional neural networks and transformers.
This is the first paper which applies transformers into pixel-wise prediction problems involving continuous labels.
arXiv Detail & Related papers (2021-03-22T18:00:13Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.