paper-with-me

Papers

Prepacking: A Simple Method for Fast Prefilling and Increased Throughput in Large Language Models

2024-04-15 · Siyan Zhao, Daniel Israel, Guy Van Den Broeck, Aditya Grover

During inference for transformer-based large language models (LLM), prefilling is the computation of the key-value (KV) cache for input tokens in the prompt prior to autoregressive generation. For longer input prompt lengths, prefilling will incur a significant overhead on decoding time. In this work, we highlight the following pitfall of prefilling: for batches containing high-varying prompt lengths, significant computation is wasted by the standard practice of padding sequences to the maximum length. As LLMs increasingly support longer context lengths, potentially up to 10 million tokens, variations in prompt lengths within a batch become more pronounced. To address this, we propose Prepacking, a simple yet effective method to optimize prefilling computation. To avoid redundant computation on pad tokens, prepacking combines prompts of varying lengths into a sequence and packs multiple sequences into a compact batch using a bin-packing algorithm. It then modifies the attention mask and positional encoding to compute multiple prefilled KV-caches for multiple prompts within a single sequence. On standard curated dataset containing prompts with varying lengths, we obtain a significant speed and memory efficiency improvements as compared to the default padding-based prefilling computation within Huggingface across a range of base model configurations and inference serving scenarios.

📄 PDF Abstract BibTeX arXiv:2404.09529

Code (1)

siyan-zhao/prepacking 공식 구현 pytorch

Methods 이 논문이 사용한 방법론

SPEED The monocular depth estimation (MDE) is the task of estimating depth from a single frame. This information is an essential knowledge in many computer vision tasks such as scene…
BASE 설명 없음

Similar Papers 제목 키워드 기반

Mix-Quant: Quantized Prefilling, Precise Decoding for Agentic LLMs

2026-05-19 · Haiquan Lu, Zigeng Chen, Gongfan Fang, Xinyin Ma 외 arxiv

LLM agents have recently emerged as a powerful paradigm for solving complex tasks through planning, tool use, memory retrieval, and multi-step interaction. However, these agentic workflows often introduce substantial inp…

LightVLM: Acceleraing Large Multimodal Models with Pyramid Token Merging and KV Cache Compression

2025-08-30 · Lianyu Hu, Fanhua Shang, Wei Feng, Liang Wan arxiv

In this paper, we introduce LightVLM, a simple but effective method that can be seamlessly deployed upon existing Vision-Language Models (VLMs) to greatly accelerate the inference process in a training-free manner. We di…

Improving LLM First-Token Predictions in Multiple-Choice Question Answering via Prefilling Attack

2025-05-21 · Silvia Cappelletti, Tobia Poppi, Samuele Poppi, Zheng-Xin Yong 외

Large Language Models (LLMs) are increasingly evaluated on multiple-choice question answering (MCQA) tasks using *first-token probability* (FTP), which selects the answer option whose initial token has the highest likeli…

Multiple-choiceMultiple Choice Question Answering (MCQA)Question Answeringvalid

FlashPrefill: Instantaneous Pattern Discovery and Thresholding for Ultra-Fast Long-Context Prefilling

2026-03-06 · Qihang Fan, Huaibo Huang, Zhiying Wu, Juqiu Wang 외 arxiv

Long-context modeling is a pivotal capability for Large Language Models, yet the quadratic complexity of attention remains a critical bottleneck, particularly during the compute-intensive prefilling phase. While various …

Seesaw: High-throughput LLM Inference via Model Re-sharding

2025-03-09 · Qidong Su, Wei Zhao, Xin Li, Muralidhar Andoorveedu 외

To improve the efficiency of distributed large language model (LLM) inference, various parallelization strategies, such as tensor and pipeline parallelism, have been proposed. However, the distinct computational characte…

Computational EfficiencyLanguage ModelingLanguage ModellingLarge Language Model+1