atlas

Research map / Architectures and efficiency / Attention and transformers

You Only Cache Once: Decoder-Decoder Architectures for Language Models

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: KV cache eviction and compression · 4 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 YOCO, a decoder-decoder LLM architecture (self-decoder producing one global KV cache reused by a cross-decoder) that cuts KV-cache memory and prefill latency while matching Transformer quality.

Problem

Decoder-only Transformers store KV caches for every layer, making long-context inference memory-bound and prefilling very slow.

Approach

Stack a cross-decoder on a self-decoder so that only the self-decoder's final output produces one global KV cache, which all cross-decoder layers reuse via cross-attention; the self-decoder uses constant-memory efficient attention (gated retention or sliding-window attention), and prefill can exit after the self-decoder.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use YOCO instead of Transformer3B language modeling · Eval Harness, 1T tokensAvgHelped
Increase YOCO training from 1T to 1.6T tokensYOCO-3B · Eval HarnessAvg: 0.634 -> 0.636Helped
Extend context length to 1M tokensYOCO-3B · Eval HarnessAvg: 0.636 -> 0.645Helped
Use gated retention instead of sliding-window attentionYOCO · Language modeling, validation setperplexity: 3.553 -> 3.530Helped
Use gated retention instead of sliding-window attentionYOCO · Language modeling, AR-Hitperplexity: 1.202 -> 1.199Helped
Use gated retention instead of sliding-window attentionYOCO · Language modeling, First-Occurperplexity: 4.094 -> 4.067Helped
Use YOCO-3B-1M rather than LWM-1M-text128K multi-needle retrieval · N=2accuracy: 0.90 -> 0.98Helped
Use YOCO-3B-1M rather than LWM-1M-text128K multi-needle retrieval · N=4accuracy: 0.76 -> 0.84Helped
Use YOCO-3B-1M rather than LWM-1M-text128K multi-needle retrieval · N=8accuracy: 0.62 -> 0.56Hurt
Use YOCO-gRet rather than Transformerlanguage modeling · Validation setperplexity: 3.564 -> 3.530Helped
Use YOCO-gRet rather than Transformerlanguage modeling · AR-Hitperplexity: 1.219 -> 1.199Helped
Use YOCO rather than Transformerinference at 512K context · 512K input contextprefill latency: 180 seconds to less than 6 secondsHelped

Surprising findings

Limitations

Experimental setup

Datasets: curated pretraining corpus similar to StableLM-3B-4E1T book data repository-level code data

Benchmarks: ARC-C ARC-E BoolQ HellaSwag OBQA PIQA Winogrande SciQ Needle-in-a-Haystack multi-needle retrieval ZeroSCROLLS AR-Hit/First-Occur perplexity

Metrics: accuracy validation loss perplexity GPU memory prefilling latency throughput needle retrieval accuracy

Baselines: Llama Transformer OpenLLaMA-v2-3B StableLM-base-alpha-3B-v2 StableLM-3B-4E1T YaRN-Mistral-128K LWM-1M-text MiniCPM-128K ChatGLM3-128K Mamba RetNet Hybrid H3

Builds on: Transformer RetNet StableLM-3B-4E1T Flash-Decoding grouped-query attention

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