MOM: Memory-Efficient Offloaded Mini-Sequence Inference for Long Context Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Junyang, Zhu, Tianyi, Luo, Cheng, Anandkumar, Anima
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917988449386496
author Zhang, Junyang
Zhu, Tianyi
Luo, Cheng
Anandkumar, Anima
author_facet Zhang, Junyang
Zhu, Tianyi
Luo, Cheng
Anandkumar, Anima
contents Long-context language models exhibit impressive performance but remain challenging to deploy due to high GPU memory demands during inference. We propose Memory-efficient Offloaded Mini-sequence Inference (MOM), a method that partitions critical layers into smaller "mini-sequences" and integrates seamlessly with KV cache offloading. Experiments on various Llama, Qwen, and Mistral models demonstrate that MOM reduces peak memory usage by over 50\% on average. On Meta-Llama-3.2-8B, MOM extends the maximum context length from 155k to 455k tokens on a single A100 80GB GPU, while keeping outputs identical and not compromising accuracy. MOM also maintains highly competitive throughput due to minimal computational overhead and efficient last-layer processing. Compared to traditional chunked prefill methods, MOM achieves a 35\% greater context length extension. More importantly, our method drastically reduces prefill memory consumption, eliminating it as the longstanding dominant memory bottleneck during inference. This breakthrough fundamentally changes research priorities, redirecting future efforts from prefill-stage optimizations to improving decode-stage residual KV cache efficiency.
format Preprint
id arxiv_https___arxiv_org_abs_2504_12526
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle MOM: Memory-Efficient Offloaded Mini-Sequence Inference for Long Context Language Models
Zhang, Junyang
Zhu, Tianyi
Luo, Cheng
Anandkumar, Anima
Machine Learning
Artificial Intelligence
Computation and Language
Long-context language models exhibit impressive performance but remain challenging to deploy due to high GPU memory demands during inference. We propose Memory-efficient Offloaded Mini-sequence Inference (MOM), a method that partitions critical layers into smaller "mini-sequences" and integrates seamlessly with KV cache offloading. Experiments on various Llama, Qwen, and Mistral models demonstrate that MOM reduces peak memory usage by over 50\% on average. On Meta-Llama-3.2-8B, MOM extends the maximum context length from 155k to 455k tokens on a single A100 80GB GPU, while keeping outputs identical and not compromising accuracy. MOM also maintains highly competitive throughput due to minimal computational overhead and efficient last-layer processing. Compared to traditional chunked prefill methods, MOM achieves a 35\% greater context length extension. More importantly, our method drastically reduces prefill memory consumption, eliminating it as the longstanding dominant memory bottleneck during inference. This breakthrough fundamentally changes research priorities, redirecting future efforts from prefill-stage optimizations to improving decode-stage residual KV cache efficiency.
title MOM: Memory-Efficient Offloaded Mini-Sequence Inference for Long Context Language Models
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2504.12526