atlas

Research map / Architectures and efficiency / Attention and transformers

Cached Transformers: Improving Transformers with Differentiable Memory Cachde

AAAI 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head and block redesign · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces Cached Transformer with Gated Recurrent Cache (GRC) attention, a differentiable, gated memory of compressed past token embeddings that is attended alongside current tokens, evaluated on language, translation, LRA, ImageNet classification and COCO detection.

Problem

Standard self-attention is quadratic in sequence length and cannot cheaply capture long-range dependencies; existing memory/cache methods are FIFO-limited or require costly KNN search over large token caches.

Approach

A fixed-size Gated Recurrent Cache updated via reset and update gates compresses the history of token embeddings into vectors; attention output is an learned interpolation of cached attention and self-attention, so the cache cost is independent of the number of cached tokens.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add GRC-Attention to ViT-SViT-S · ImageNet-1kTop-1 accuracy (%): 79.9 -> 81.3Helped
Add GRC-Attention to PVT-TinyPVT-Tiny · ImageNet-1kTop-1 accuracy (%): 75.1 -> 78.4 (+ 3.3)Helped
Add GRC-Attention to PVT-SmallPVT-Small · ImageNet-1kTop-1 accuracy (%): 79.9 -> 81.8Helped
Add GRC-Attention to PVT-MediumPVT-Medium · COCO val2017 (Mask R-CNN 1×)Box AP: 42.0 -> 46.6Helped
Add GRC-Attention to PVT-MediumPVT-Medium · COCO val2017 (Mask R-CNN 1×)Mask AP: 39.0 -> 42.3Helped
Add GRC-Attention to the Pre-Norm TransformerPre-Norm Transformer · IWSLT14 De-EnBLEU: 35.5 -> 36.0(+ 0.5)Helped
Replace the Transformer-XL cache with GRCTransformer-XL base · WikiText-103Test perplexity: 24.0 -> 22.9Helped
Add GRC-Attention while retaining BigBird attentionBigBird · Long ListOps (LRA)Accuracy: 36.06 -> 37.45 (+ 1.39)Helped
Replace GRC with an attention-based cache (ablation)ViT-S · ImageNet-1kTop-1 accuracy (%): 81.3 -> 80.0Hurt
Replace GRC with an attention-based cache (ablation)PVT-Tiny · ImageNet-1kTop-1 accuracy (%): 78.4 -> 74.8Hurt
Replace GRC with an attention-based cache (ablation)PVT-Small · ImageNet-1kTop-1 accuracy (%): 81.8 -> 79.6Hurt
Increase PVT-Tiny caching ratio from 0.000 to 0.125 (ablation)PVT-Tiny with GRC · ImageNet-1kAccuracy: 75.1 -> 75.7Helped

Surprising findings

Limitations

Experimental setup

Datasets: ImageNet-1k ImageNet-22k COCO train2017 COCO val2017 WikiText-103 IWSLT14 IWSLT15 Long ListOps (LRA)

Benchmarks: ImageNet-1k ImageNet-22k COCO val2017 WikiText-103 IWSLT14 IWSLT15 Long ListOps (LRA)

Metrics: top-1 accuracy top-5 accuracy box AP mask AP test perplexity BLEU accuracy

Baselines: Transformer-XL Memory Transformer (MT) Recurrent Memory Transformer (RMT) ViT PVT PVTv2 Swin Reformer BigBird Mask R-CNN

Builds on: Transformer-XL Reformer BigBird PVT Mask R-CNN

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy