Understand and Accelerate Memory Processing Pipeline for Large Language Model Inference
Organizations: Department of Computer Science, University of California, Los Angeles · Microsoft Research Asia
Abstract
Modern large language models (LLMs) increasingly depends on efficient long-context processing and generation mechanisms, including sparse attention, retrieval-augmented generation (RAG), and compressed contextual memory, to support complex reasoning. We show that these optimizations can be unified into a four-step memory processing pipeline: Prepare Memory, Compute Relevancy, Retrieval, and Apply to Inference. Through systematic profiling, we identify a 22%-97% memory processing overhead in LLM inference and strong heterogeneity in its computational characteristics. Motivated by this insight, we argue that heterogeneous systems are well-suited to accelerate memory processing and thus end-to-end inference. We demonstrate this approach on a GPU-FPGA system by offloading sparse, irregular, and memory-bounded operations to FPGAs while retaining compute-intensive operations on GPUs. Evaluated on an AMD MI210 GPU and an Alveo U55C FPGA, our system is up to faster and achieves up to less energy across multiple LLM inference optimizations than the GPU baseline (similar results hold on NVIDIA A100). These results establish heterogeneous systems as a practical direction for efficient LLM memory processing and inform future heterogeneous hardware design.
Figures & tables
| LLM Opt. | Related Works | Prepare Memory | Compute Relevancy | Retrieval | Apply to Inference |
| Sparse Attention | DeepSeek Attention ( Liu et al., 2025 ) | Linear Projections + RoPE | Multi-headed Inner Product | Top- | Fine-grain Sparse Attention |
| SeerAttention-R ( Gao et al., 2026a ) | Linear Projections + Pooling | Inner Product | Top- / Threshold | Block Sparse Attention | |
| LServe ( Yang et al., 2025b ) | Page-wise Min/Max Pooling | Inner Product + Max Reduction | Top- | Block Sparse Attention | |
| Retrieval Augmented Generation (RAG) | Two-stage RAG ( Moreira et al., 2024 ) | Embedding Model / Tokenization | Inner Product / BM25 + Reranker | Top- | Append to query |
| Fixed-Sentence RAG ( Trivedi et al., 2023 ) | Tokenization | BM25 | Top- | Append to query | |
| Dynamic RAG ( Su et al., 2024 ; Jiang et al., 2023 ) | Tokenization | BM25 | Top- | Append to query |
| LLM Opt. | Prepare Memory | Compute Relevancy | Retrieval | Apply to Inference | Rest Ops in LLM | |
|---|---|---|---|---|---|---|
| Sparse Attention | Arith. Intensity | – | – | 1 | – | – |
| Access Pattern | Regular | Regular | Irregular | Regular | Regular | |
| Data Requirement | Local Memory | Local Memory | Across Memories | Local Memory | Local Memory | |
| RAG | Arith. Intensity | – | – | 1 | ||
| Access Pattern | Irregular (tokenizer) | Irregular | Irregular | Regular | Regular | |
| Regular (embeddings) |
| Category | Method | GPU-FPGA | Baseline | Max | Geomean |
| (J/req. or J/tok) | (J/req. or J/tok) | Improve | Improve | ||
| Sparse Attn. | DSA | 15.86 | 25.62 | ||
| SA-R (Thres.) | 0.30 | 0.34 | |||
| SA-R (Top- ) | 0.32 | 0.36 | |||
| LServe | 0.29 | 0.43 | |||
| RAG | DRAGIN | 328.16 | 362.57 |
| Category | Method | BS=1 | BS=2 | BS=4 | BS=8 | BS=32 |
|---|---|---|---|---|---|---|
| Sparse Attn. | SA-R (Thres.) | 1.12 | 1.21 | 1.33 | 1.47 | 1.60 |
| DSA | 1.02 | 1.05 | 1.09 | 1.14 | 1.15 | |
| SA-R (Top- ) | 1.07 | 1.15 | 1.24 | 1.30 | 1.32 | |
| LServe | 1.19 | 1.34 | 1.51 | 1.67 | 1.83 | |
| RAG | DRAGIN | 1.14 | 1.20 | 1.29 | 1.44 | 1.92 |
| FLARE | 1.19 | 1.26 | 1.38 | 1.55 | 2.11 |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Device | Model | Memory |
|---|---|---|
| CPU | AMD EPYC 7v13 @ 2.5GHz (7 nm) | 1 TB (51.2 GB/s) |
| GPU | AMD Instinct MI210 (6 nm) | 64 GB (1.6 TB/s) |
| FPGA | AMD Alveo U55C (16 nm) | 16 GB (460 GB/s) |
LLM Inference
Large language model inference studies how models generate outputs efficiently, reliably, and securely across hardware and workloads.
See all 268 papers