PIC: Unlocking Long-Form Text Generation Capabilities of Large Language Models via Position ID Compression

Haoran Que, Wenge RongACL 2025

Abstract

Modern Large Language Models (LLMs) excel at processing long contexts but often struggle with long-form generation, typically hitting a "generation wall" around 4,000 tokens. This paper introduces Position ID Compression (PIC), a plug-and-play method that extends generation length by strategically shrinking perceived position indices. By compressing the middle context while preserving initial and recent tokens, the Dynamic PIC variant enables models to maintain coherence for much longer sequences. Combined with supervised fine-tuning (PIC-SFT), this approach extends generation length by up to 5x while maintaining high output quality.

Introduction: The "Output-Long" Challenge

While techniques like RoPE scaling have enabled LLMs to "read" millions of tokens, their "writing" capacity remains limited. Models often exhibit a sharp decline in quality—marked by repetition or incoherence—once they exceed the positional limits encountered during training. This "generation wall" suggests that the issue is not a lack of knowledge, but a failure in positional perception as IDs grow beyond the model's trained horizon.

Methodology: Position ID Compression

The core idea of PIC is to trick the model into staying within its trained positional comfort zone by compressing position IDs. The authors explore three strategies:

  1. Naive PIC: Applies a uniform compression ratio to all position IDs. This often fails as it disrupts local token relationships essential for coherence.
  2. NTK-aware PIC: Modifies the base of the Rotary Position Embedding (RoPE) to scale positional information smoothly across dimensions, avoiding the pitfalls of direct linear compression.
  3. Dynamic PIC: The most effective variant, which partitions the context into three segments: Initial Context (uncompressed anchors), Middle Context (compressed to save positional budget), and Recent Context (uncompressed for local coherence).
Overview of PIC variants (Naive, NTK-aware, and Dynamic) alongside their respective zero-shot performance on generation length and quality.

Experimental Results

The researchers evaluated PIC using benchmarks like HelloBench and LongBench-Write, alongside general reasoning tasks (MMLU, GSM8K).

Zero-Shot Capabilities

Both NTK-aware and Dynamic PIC demonstrate significant zero-shot potential, extending generation length by approximately 1.5x without any fine-tuning. As shown in the performance curves, Dynamic PIC maintains higher generation quality even as the compression ratio increases compared to naive methods.

Performance of Dynamic PIC across various compression ratios, illustrating the trade-off between generated length and quality maintenance.

PIC-SFT and Length Extension

By combining Dynamic PIC with supervised fine-tuning on the LongWriter-6k dataset, the authors achieved a 5x extension in generation length for models like LLaMA-3.1-8B and Qwen-2.5-7B. Notably, on GLM-4-9B, PIC-SFT reduced the "corrupted ratio" (failures or endless repetitions) to 0% while nearly quadrupling output length.

Key Insights

  • The "Middle" Matters: The success of Dynamic PIC highlights that LLMs are most sensitive to the positions of the beginning (anchors) and the immediate end (local context). Compressing the middle allows for length extension without sacrificing the model's "train of thought."
  • Decoupling Capabilities: Interestingly, using PIC during inference can help recover some short-form reasoning performance that is often lost during long-form fine-tuning, suggesting these capabilities can be partially decoupled through positional manipulation.

Conclusion and Future Work

PIC offers a robust, plug-and-play solution for the "generation wall" in LLMs. While it significantly boosts long-form writing, a performance "tax" on short-form tasks remains a challenge. Future research will focus on perfectly balancing these capabilities and further investigating the underlying mechanisms of positional decoupling.

Summary updated

BibTeX
@inproceedings{que2025pic,
  author = {Haoran Que and Wenge Rong},
  title = {{PIC: Unlocking Long-Form Text Generation Capabilities of Large Language Models via Position ID Compression}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure