[Paper Review] Inference with Reference: Lossless Acceleration of Large Language Models
LLMA accelerates autoregressive LLM decoding by copying matched text spans from reference documents, enabling parallel verification and achieving about 2x–3x speedups without additional models.
We propose LLMA, an LLM accelerator to losslessly speed up Large Language Model (LLM) inference with references. LLMA is motivated by the observation that there are abundant identical text spans between the decoding result by an LLM and the reference that is available in many real world scenarios (e.g., retrieved documents). LLMA first selects a text span from the reference and copies its tokens to the decoder and then efficiently checks the tokens' appropriateness as the decoding result in parallel within one decoding step. The improved computational parallelism allows LLMA to achieve over 2x speed-up for LLMs with identical generation results as greedy decoding in many practical generation scenarios where significant overlap between in-context reference and outputs exists (e.g., search engines and multi-turn conversations).
Motivation & Objective
- Motivate reducing inference cost for autoregressive LLMs without changing model weights.
- Leverage overlaps between generated text and available reference documents to speed up decoding.
- Propose a reference-based decoding mechanism that preserves identical greedy outputs.
- Demonstrate practical speedups in retrieval-augmented generation, cached sessions, and multi-turn conversations.
Proposed method
- Introduce LLMA decoding that finds a matching text span in references and copies its tokens into the decoder input.
- Preemptively copy a run of k tokens when a match is found and verify each token for validity against the model’s next-token probabilities.
- Ensure outputs are identical to vanilla greedy decoding through token-by-token verification.
- Operate with two hyper-parameters: match length n and copy length k, controlling triggering and extent of copying.
- Support two deployment scenarios: retrieval-augmented generation and cache-assisted generation (and by extension multi-turn conversations).
- Implement using standard autoregressive decoding augmented with a copy-and-verify step, without training or extra drafting models.

Experimental results
Research questions
- RQ1How much speedup can LLMA achieve across model sizes (7B, 13B, 30B) and scenarios (RAG, CAG)?
- RQ2What are the optimal match length n and copy length k for different settings?
- RQ3How does LLMA compare to baseline greedy decoding in terms of tokens processed per second and total decoding time?
- RQ4Does LLMA preserve identical generation results to traditional greedy decoding while accelerating decoding?
Key findings
- LLMA achieves about 2x–3x speedups across 7B, 13B, and 30B models in RAG and CAG scenarios.
- Optimal match lengths and copy lengths vary by model and scenario, with n typically 1 and k around 14–18 in reported experiments.
- LLMA maintains identical outputs to greedy decoding by validating copied tokens before acceptance.
- Speedups arise from better parallelism and reduced decoding steps, especially for larger models and when k is large (up to 15+).
- Experiments on GPT-3.5/DaVinci-003-derived prompts show practical gains in realistic setups using retrieved or cached references.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.