Cached Transformers: Improving Transformers with Differentiable Memory Cache

Zhaoyang Zhang, Wenqi Shao, Yixiao Ge, Xiaogang Wang, Jinwei Gu +1 more
12/20/2023
cs.CV

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

This work introduces a new Transformer model called Cached Transformer, which uses Gated Recurrent Cached (GRC) attention to extend the self-attention mechanism with a differentiable memory cache of tokens. GRC attention enables attending to both past and current tokens, increasing the receptive field of attention and allowing for exploring long-range dependencies. By utilizing a recurrent gating unit to continuously update the cache, our model achieves significant advancements in \textbf{six} language and vision tasks, including language modeling, machine translation, ListOPs, image classification, object detection, and instance segmentation. Furthermore, our approach surpasses previous memory-based techniques in tasks such as language modeling and displays the ability to be applied to a broader range of situations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2023cached,
  title  = {Cached Transformers: Improving Transformers with Differentiable Memory Cache},
  author = {Zhaoyang Zhang and Wenqi Shao and Yixiao Ge and Xiaogang Wang and Jinwei Gu and Ping Luo},
  year   = {2023},
  eprint = {2312.12742},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.12742v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.12742.svg)](https://codeofpaper.com/paper/2312.12742)

Discussion