LLM in a flash: Efficient Large Language Model Inference with Limited Memory
Keivan Alizadeh, Iman Mirzadeh, Dmitry Belenko, S. Khatamifard, Minsik Cho, Carlo C. del Mundo, Mohammad Rastegari, Mehrdad Farajtabar
摘要
Large language models (LLMs) are central to modern natural language processing, delivering exceptional performance in various tasks. However, their substantial computational and memory requirements present challenges, especially for devices with limited DRAM capacity. This paper tackles the challenge of efficiently running LLMs that exceed the available DRAM capacity by storing the model parameters in flash memory, but bringing them on demand to DRAM. Our method involves constructing an inference cost model that takes into account the characteristics of flash memory, guiding us to optimize in two critical areas: reducing the volume of data transferred from flash and reading data in larger, more contiguous chunks. Within this hardware-informed framework, we introduce two principal techniques. First, "windowing" strategically reduces data transfer by reusing previously activated neurons, and second, "row-column bundling", tailored to the sequential data access strengths of flash memory, increases the size of data chunks read from flash memory. These methods collectively enable running models up to twice the size of the available DRAM, with up to 4x and 20x increase in inference speed compared to naive loading approaches in CPU and GPU, respectively. Our integration of sparsity awareness, context-adaptive loading, and a hardware-oriented design paves the way for effective inference of LLMs on devices with limited memory.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 67 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- A Simple and Effective Pruning Approach for Large Language Models 引用了 Measuring Massive Multitask Language Understanding
- A Simple and Effective Pruning Approach for Large Language Models 引用了 Language Models are Few-Shot Learners
- Measuring Massive Multitask Language Understanding 引用了 Language Models are Few-Shot Learners
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments 引用了 Language Models are Few-Shot Learners
- Language Models are Few-Shot Learners 引用了 The Curious Case of Neural Text Degeneration
- SpecExec: Massively Parallel Speculative Decoding For Interactive LLM Inference on Consumer Devices 引用了 Fast Inference from Transformers via Speculative Decoding
- Cost-Efficient Large Language Model Serving for Multi-turn Conversations with CachedAttention 引用了 Measuring Massive Multitask Language Understanding
- Fast Inference from Transformers via Speculative Decoding 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper67
- Cost-Efficient Large Language Model Serving for Multi-turn Conversations with CachedAttentionBin Gao, Zhuomin He, Puru Sharma, Qingxuan Kang 等USENIX ATC 2024 · 273 次引用
- DynamoLLM: Designing LLM Inference Clusters for Performance and Energy EfficiencyJovan Stojkovic, Chaojie Zhang, Íñigo Goiri, Josep Torrellas 等HPCA 2025 · 106 次引用
- GPTCoach: Towards LLM-Based Physical Activity CoachingMatthew Jörke, Shardul Sapkota, Lyndsea Warkenthien, Niklas Vainio 等CHI 2025 · 89 次引用
- SpecExec: Massively Parallel Speculative Decoding For Interactive LLM Inference on Consumer DevicesRuslan Svirschevski, Avner May, Zhuoming Chen, Beidi Chen 等NeurIPS 2024 · 70 次引用
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained EnvironmentsJunyoung Park, Dalton Jones, Matthew J. Morse, Raghavv Goel 等NeurIPS 2025 · 47 次引用
它引用的 Paper18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes 等ICLR 2020 · 4,112 次引用
- Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 次引用
- A Simple and Effective Pruning Approach for Large Language ModelsMingjie Sun, Zhuang Liu, Anna Bair, J. Zico KolterICLR 2024 · 794 次引用
相关 Paper
- AiF: Accelerating On-Device LLM Inference Using In-Flash ProcessingJaeyong Lee, Hyeunjoo Kim, Sanghun Oh, Myoungjun Chun 等ISCA 2025 · 14 次引用
- FlashMem: Supporting Modern DNN Workloads on Mobile with GPU Memory Hierarchy OptimizationsZhihao Shu, Md. Musfiqur Rahman Sanim, Hangyu Zheng, Kunxiong Zhu 等ASPLOS 2026
- Neuralink: Fast on-Device LLM Inference with Neuron Co-Activation LinkingTuowei Wang, Ruwen Fan, Minxing Huang, Zixu Hao 等ASPLOS 2025 · 1 次引用
- InstAttention: In-Storage Attention Offloading for Cost-Effective Long-Context LLM InferenceXiurui Pan, Endian Li, Qiao Li, Shengwen Liang 等HPCA 2025 · 22 次引用
- VLM in a flash: I/O-Efficient Sparsification of Vision-Language Model via Neuron ChunkingKichang Yang, Seonjun Kim, Minjae Kim, Nairan Zhang 等NeurIPS 2025 · 1 次引用
