atlas

Research map / Architectures and efficiency / Attention and transformers

MemoryFormer : Minimize Transformer Computation by Removing Fully-Connected Layers

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head and block redesign · 1 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.

Proposes MemoryFormer, a transformer that replaces all fully-connected layers with LSH-based in-memory lookup tables (Memory Layers), trained from scratch on the Pile to cut FLOPs while keeping zero-shot accuracy.

Problem

Transformer FC layers dominate compute in typical sequence lengths, and existing efficiency work mostly targets attention; the paper seeks a cheaper replacement for linear projections.

Approach

Replace each linear projection with Memory Layers: sign-based LSH hashes split sub-vectors into indices into learnable lookup tables, whose retrieved entries are weighted by a differentiable sign-similarity probability so gradients reach both tables and inputs.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace fully-connected layers with Memory LayersPythia-410M (MemoryFormer-base) · PIQAaccuracy: 0.675 -> 0.698Helped
Replace fully-connected layers with Memory LayersPythia-410M (MemoryFormer-base) · WinoGrandeaccuracy: 0.534 -> 0.546Helped
Replace fully-connected layers with Memory LayersPythia-410M (MemoryFormer-base) · WSCaccuracy: 0.471 -> 0.385Hurt
Replace fully-connected layers with Memory LayersPythia-410M (MemoryFormer-base) · ARC-E, ARC-C, and LogiQAaccuracyHelped
Use wider hash chunks (τ=10, K=51 rather than τ=4, K=128) (ablation)MemoryFormer-tiny · Validation setperplexity: 19.01 -> 18.67Helped
Increase learning rate from 1e-3 to 3e-3 (ablation)MemoryFormer-tiny · Validation set at 8000 training stepsperplexity: 19.86 -> 18.82Helped
Increase learning rate from 3e-3 to 4e-3 (ablation)MemoryFormer-tiny · Validation set at 8000 training stepsperplexity: 18.82 -> 18.84Hurt
Add expanding bits to the Memory Block (0 to 3) (ablation)MemoryFormer-tiny · Validation set at 8000 training stepsperplexity: 19.89 -> 18.54Helped
Add GeLU between the two Memory Layers (ablation)MemoryFormer-tiny · PIQAaccuracy: 0.602 -> 0.595Hurt
Add GeLU between the two Memory Layers (ablation)MemoryFormer-tiny · WinoGrande and WSCaccuracy: 0.522 -> 0.522; 0.375 -> 0.375No clear effect
Add GeLU between the two Memory Layers (ablation)MemoryFormer-tiny · ARC-Eaccuracy: 0.437 -> 0.441Helped
Add GeLU between the two Memory Layers (ablation)MemoryFormer-tiny · ARC-Caccuracy: 0.228 -> 0.211Hurt

Surprising findings

Limitations

Experimental setup

Datasets: The Pile

Benchmarks: PIQA WinoGrande WSC ARC-E ARC-C LogiQA

Metrics: zero-shot accuracy average accuracy inference FLOPs validation perplexity

Baselines: Pythia-70M Pythia-160M Pythia-410M Linformer cosFormer Performer

Builds on: Pythia Reformer LookupFFN Linformer Performer

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