FAR: Function-preserving Attention Replacement for IMC-friendly Inference
Not on the map. Why?
Abstract (arXiv)
While transformers dominate modern vision and language models, their attention mechanism remains poorly suited for in-memory computing (IMC) devices due to intensive activation-to-activation multiplications and non-local memory access, leading to substantial latency and bandwidth overhead on ReRAM-based accelerators. To address this mismatch, we propose FAR, a Function-preserving Attention Replacement framework that substitutes all attention in pretrained DeiTs with sequential modules inherently compatible with IMC dataflows. Specifically, FAR replaces self-attention with a multi-head bidirectional LSTM architecture via block-wise distillation to retain functional equivalence while enabling linear-time computation and localized weight reuse. We further incorporate structured pruning on FAR models, enabling flexible adaptation to resource-constrained IMC arrays while maintaining functional fidelity. Evaluations on the DeiT family demonstrate that FAR maintains comparable accuracy to the original attention-based models on ImageNet and multiple downstream tasks with reduced parameters and latency. Further analysis shows that FAR preserves the semantic token relationships learned by attention while improving computational efficiency, highlighting its potential for energy-efficient transformer inference on IMC-based edge accelerators.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 29 of its 44 references that are in the map. First posted on arXiv 24 May 2025.
Builds on
29 of 44 references.
References · 29
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2015Distilling the Knowledge in a Neural Networkcited by 10,324
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2020Reformer: The Efficient Transformercited by 1,668
- 2020Rethinking Attention with Performerscited by 1,601
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
17 more
- 2021MLP-Mixer: An all-MLP Architecture for Visioncited by 1,446
- 2019TinyBERT: Distilling BERT for Natural Language Understandingcited by 1,167
- 2020Efficient Transformers: A Surveycited by 790
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 613
- 2020MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devicescited by 482
- 2021AdaViT: Adaptive Tokens for Efficient Vision Transformercited by 362
- 2019On the Relationship between Self-Attention and Convolutional Layerscited by 300
- 2024The Mamba in the Llama: Distilling and Accelerating Hybrid Modelscited by 122
- 2024What Matters in Transformers? Not All Attention is Neededcited by 84
- 2021Global Vision Transformer Pruning with Hessian-Aware Saliencycited by 70
- 2019DeepHoyer: Learning Sparser Neural Network with Differentiable Scale-Invariant Sparsity Measurescited by 56
- 2021Softermax: Hardware/Software Co-Design of an Efficient Softmax for Transformerscited by 54
- 2021Leveraging redundancy in attention with Reuse Transformerscited by 33
- 2023X-Former: In-Memory Acceleration of Transformerscited by 25
- 2024Memory Is All You Need: An Overview of Compute-in-Memory Architectures for Accelerating Large Language Model Inferencecited by 15
- 2024STAR: An Efficient Softmax Engine for Attention Model with RRAM Crossbarcited by 2
- 2024Topkima-Former: Low-energy, Low-Latency Inference for Transformers using top-k In-memory ADCcited by 1
Built on by
Not cited yet.