cd /news/large-language-models/you-only-cache-once-decoder-decoder-… · home topics large-language-models article
[ARTICLE · art-126678] src=arxiv.org ↗ pub= topic=large-language-models verified=true sentiment=↑ positive

You Only Cache Once: Decoder-Decoder Architectures for Language Models (2024)

Microsoft researchers Li Dong and colleagues introduced YOCO, a decoder-decoder architecture for large language models that caches key-value pairs only once, in an arXiv paper submitted 8 May 2024 and revised 9 May 2024. YOCO stacks a cross-decoder on a self-decoder that encodes global KV caches reused via cross-attention, reducing GPU memory demands while retaining global attention, and its computation flow allows prefilling to early exit without changing the final output. The authors report YOCO improves inference memory, prefill latency, and throughput by orders of magnitude across context lengths and model sizes, and extends to 1M context length with near-perfect needle retrieval accuracy, with code available at aka.ms/YOCO.

read2 min views1 publishedSep 11, 2026
You Only Cache Once: Decoder-Decoder Architectures for Language Models (2024)
Image: source
  [Submitted on 8 May 2024 (

[v1](https://arxiv.org/abs/2405.05254v1)), last revised 9 May 2024 (this version, v2)]

[View PDF](/pdf/2405.05254)

[HTML (experimental)](https://arxiv.org/html/2405.05254v2)

Abstract:We introduce a decoder-decoder architecture, YOCO, for large language models, which only caches key-value pairs once. It consists of two components, i.e., a cross-decoder stacked upon a self-decoder. The self-decoder efficiently encodes global key-value (KV) caches that are reused by the cross-decoder via cross-attention. The overall model behaves like a decoder-only Transformer, although YOCO only caches once. The design substantially reduces GPU memory demands, yet retains global attention capability. Additionally, the computation flow enables prefilling to early exit without changing the final output, thereby significantly speeding up the prefill stage. Experimental results demonstrate that YOCO achieves favorable performance compared to Transformer in various settings of scaling up model size and number of training tokens. We also extend YOCO to 1M context length with near-perfect needle retrieval accuracy. The profiling results show that YOCO improves inference memory, prefill latency, and throughput by orders of magnitude across context lengths and model sizes. Code is available at this https URL.

Submission history #

From: Li Dong [
[view email](/show-email/d1dc91d7/2405.05254)]

**Wed, 8 May 2024 17:57:39 UTC (456 KB)**

[\[v1\]](/abs/2405.05254v1)
**[v2]** Thu, 9 May 2024 14:12:45 UTC (455 KB)

References & Citations

...

Bibliographic Explorer

(What is the Explorer?) Connected Papers

(What is Connected Papers?) Litmaps

(What is Litmaps?) scite Smart Citations

(What are Smart Citations?) alphaXiv

(What is alphaXiv?) CatalyzeX Code Finder for Papers

(What is CatalyzeX?) DagsHub

(What is DagsHub?) Gotit.pub

(What is GotitPub?) Hugging Face

(What is Huggingface?) ScienceCast

(What is ScienceCast?) Influence Flower

(What are Influence Flowers?) CORE Recommender

(What is CORE?) arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

── more in #large-language-models 4 stories · sorted by recency
── more on @yoco 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/you-only-cache-once-…] indexed:0 read:2min 2026-09-11 ·