Pith. sign in

REVIEW 1 cited by

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

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2404.09529 v1 pith:ZMYUZA75 submitted 2024-04-15 cs.LG cs.AIcs.CL

classification cs.LGcs.AIcs.CL
keywords lengthsprefillingcomputationpromptmultipleprepackingpromptssignificant
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

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.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 1 Pith paper

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Vortex: Overcoming Memory Capacity Limitations in GPU-Accelerated Large-Scale Data Analytics

    cs.DB 2025-02 conditional novelty 7.0 of 10

    By routing data through idle IO paths of neighboring GPUs, Vortex lets a single GPU run analytics on datasets exceeding its memory at 140GB/s aggregate transfer and beats CPU baselines.

Pith tools