atlas

Research map / Architectures and efficiency / Attention and transformers

MELODI: Exploring Memory Compression for Long Contexts

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: State space and recurrent sequence models · 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 MELODI, a hierarchical compression memory that pairs multi-layer recurrent short-term memory with a single-layer compressed long-term KV memory, matching or beating Memorizing Transformer perplexity with about 8x less memory.

Problem

Efficiently processing long documents with short context windows requires memory that bridges windows over long contexts without the memory cost of storing full KV caches.

Approach

Represent short-term memory as recurrent compression of context windows across multiple layers (via summary tokens and linear token mixers) and long-term memory as further compressed KV pairs from a single middle layer stored in a FIFO queue, arranged in a sandwich architecture.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use MELODI S192+L96 instead of Memorizing Transformerlong-context language modeling · PG19 (T5)perplexity: 10.62 -> 10.29Helped
use MELODI S192+L96 instead of Memorizing Transformerlong-context language modeling · arXiv Math (Meena)perplexity: 2.14 -> 2.09Helped
use MELODI S192+L96 instead of Memorizing Transformerlong-context language modeling · C4(4K+) (Custom)perplexity: 17.37 -> 17.25Helped
add summary branching (ablation)MELODI with short- and long-term memory · PG19 (T5)perplexity: 11.24 -> 10.95Helped
add summary branching (ablation)MELODI with short-term memory only · PG19 (T5)perplexity: 11.68 -> 11.39Helped
generate distinct long-term tokens instead of copying short-term tokens (ablation)MELODI S96+L96 · PG19 (T5)perplexity: 11.00 -> 10.92Helped
generate distinct long-term tokens instead of copying short-term tokens (ablation)MELODI S64+L64 · PG19 (T5)perplexity: 11.36 -> 11.08Helped
generate distinct long-term tokens instead of copying short-term tokens (ablation)MELODI S32+L32 · PG19 (T5)perplexity: 11.42 -> 11.25Helped
increase short-term or long-term memory capacity (ablation)MELODI · PG19 (T5)perplexityHelped
increase long-term memory coverage up to 32 windows (ablation)MELODI S128+L64 · PG19 (T5)perplexityHelped
increase long-term memory coverage beyond 32 windows (ablation)MELODI S128+L64 · PG19 (T5)perplexityNo clear effect
increase the number of short-term layers from 1 to 4 (ablation)MELODI · PG19 (T5)perplexityHelped

Surprising findings

Limitations

Experimental setup

Datasets: PG-19 arXiv Math C4

Benchmarks: PG-19 arXiv Math C4(4K+)

Metrics: token-level perplexity memory size (floats)

Baselines: Transformer XL Block Recurrent Transformer Memorizing Transformer

Builds on: Memorizing Transformer Block Recurrent Transformer Transformer-XL Recurrent Memory Transformer AutoCompressors

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