NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pipelined Decoder for Efficient Context-Aware Text Generation

Zixian Huang, Chenxu Niu, Yu Gu, Gengyang Xiao, Xinwei Huang, Gong ChengarXiv 2025 · OpenReview

Abstract

As the basis of generative AI, an autoregressive model requires the generation of a new token depending on all the previously generated tokens, which brings high quality but also restricts the model to generate tokens one by one, forming a bottleneck limiting the generation speed. In this paper, we propose a new decoder architecture that efficiently generates text in parallel for context-aware generation tasks. Our proposed pipelined decoder initiates the generation of multiple subsequences simultaneously, and, at each time-step, it generates a new token for each subsequence to realize parallelism. Experiments on multiple text generation tasks, including question answering, text summarization, and keyphrase generation, show that our pipelined decoder significantly improves the generation speed without a significant loss of generation quality or additional memory consumption.

Introduction

Most modern AI text generation relies on autoregressive decoding, where the model must finish generating token $A$ before it can begin token $B$. This creates a massive computational bottleneck. While this strict dependency ensures high quality, it is incredibly slow, especially for "context-aware" tasks like Retrieval-Augmented Generation (RAG) or long-form summarization, where the model processes a large amount of input text for every new word produced.

Comparison between Sequential and Pipelined Decoding for context-aware tasks.

The authors argue that this strict dependency is often unnecessary. When humans write, we don't need to re-read every single word of a previous sentence to start the next one; we just need the general gist. The Pipelined Decoder introduces parallelism into decoding without losing the coherence that autoregression provides by generating multiple text subsequences (like sentences or phrases) in parallel.

Methodology

The core innovation is the Pipelined Decoder. Instead of waiting for a full sentence to finish, the model initiates the next subsequence after a fixed delay time ($\Delta t$).

The Pipelined Decoder mechanism showing parallel token generation with a delay time.

Key technical features include:

  • Parallel Generation: At each time step, the decoder generates one new token for every active subsequence simultaneously.
  • Partial Dependency: A token in a subsequent pipe doesn't attend to the entire preceding subsequence. Instead, it only attends to the tokens that have been generated so far, exploiting the "lookahead" property inherent in Transformer hidden states.
  • Boundary Tokens: The model utilizes special [bos] (beginning of sequence) and [eos] (end of sequence) tokens for each subsequence, allowing it to learn when to start and stop new "pipes" dynamically.
  • Architecture: Built on a standard Transformer backbone (specifically T5), the model modifies the attention mechanism to handle overlapping, parallel subsequences.

Key Insights

  • The "Outline" Hypothesis: Initial tokens of a subsequence often contain enough information to seed the start of the next one. Once a sentence's direction is established, the next can begin.
  • Efficiency via Context: In context-aware tasks, a large portion of the attention is directed at the static input context rather than previously generated tokens. Since the input context is available from the start, the model can afford less strict dependencies between generated tokens.
  • Memory Efficiency: The pipelined approach often uses less GPU memory than sequential decoding because partial token dependencies reduce the overhead of the KV cache in certain configurations.

Experimental Results

The researchers evaluated the model across phrase-level tasks (MSQA, KP20K) and sentence-level tasks (WikiHowQA, CNN/DMail, PubMed). The Pipelined Decoder demonstrated impressive performance gains:

  • Massive Speedups: The model achieved a 5.8x speedup on WikiHowQA and a 7.0x speedup on the PubMed summarization task compared to standard sequential T5 models.
  • Quality Preservation: Quality loss (measured by ROUGE and F1) was negligible—often less than 1%. In keyphrase generation on the KP20K dataset, the pipelined model actually outperformed the sequential baseline.
  • Scalability: The speedup ratio increases linearly with the number of subsequences, making it particularly effective for long documents.

Conclusion and Future Work

The Pipelined Decoder breaks the "one-token-at-a-time" bottleneck, achieving up to a 7x speedup in context-aware tasks without sacrificing quality. Future work includes testing this architecture on larger decoder-only models (like Llama or GPT) and developing adaptive delay times based on text complexity rather than fixed hyperparameters.

Summary updated

BibTeX
@misc{huang2025pipelined,
  author = {Zixian Huang and Chenxu Niu and Yu Gu and Gengyang Xiao and Xinwei Huang and Gong Cheng},
  title = {{Pipelined Decoder for Efficient Context-Aware Text Generation}},
  year = {2025},
  eprint = {2506.23431},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.23431},
}
Figure