🤖 AI Hot

PIPO: Compressing LLM Inputs by Packing Two Tokens into One

A
Alex Chen

Every LLM user knows the pain: you paste a long prompt, and the time-to-first-token stretches into seconds. The transformer reads every token sequentially before it can produce anything. Xiaohongshu’s new PIPO architecture attacks this bottleneck directly by compressing two input tokens into one latent representation, then expanding hidden states into extra tokens on the output side. The headline numbers are 1.23× faster time-to-first-token and 1.86× faster time-per-output-token on Qwen backbones, with up to a 7.15-point lift in pass@4 on AIME 2025.

Token compression is not a new idea. The challenge has always been keeping accuracy stable when you throw away information. Most approaches either lose too much signal in the compression step or require expensive architectural changes that break compatibility with existing training pipelines. PIPO’s contribution is a two-stage training recipe that keeps the model accurate after aggressive compression, plus a design that works as a drop-in modification on standard transformer architectures.

How PIPO Compresses

The architecture has two asymmetric sides. On the input, a latent compressor maps every two consecutive tokens into a single latent vector. The model processes fewer tokens through the attention and feedforward layers, which is where the speedup comes from — attention complexity scales quadratically with sequence length, so halving the input length cuts attention cost by roughly 4×.

On the output, the compressed latent is expanded back into extra tokens through a multi-token prediction head. The model predicts multiple output tokens from each compressed representation, recovering the information density that the compressor removed. This is not a lossless round-trip — information is discarded in compression — but the two-stage training ensures the model learns which information is safe to discard and which must be preserved.

The design choices are pragmatic. The compressor and expander are lightweight modules bolted onto a standard transformer backbone. No custom attention mechanism. No exotic tokenization. The model architecture underneath stays the same, which means PIPO can be applied to existing model families without rewiring the entire training stack.

The Two-Stage Training Recipe

This is where PIPO differs from earlier approaches that tried to compress tokens and failed to maintain quality. Most length-reduction methods train in one shot, jointly optimizing the compressor, the backbone, and the output head. Joint training is convenient but creates a coupling problem: the compressor learns shortcuts that work for the training distribution but break on harder examples, because the backbone never sees the full, uncompressed information.

PIPO splits training into two clean stages. Stage one is standard supervised fine-tuning. The model learns basic response patterns from the full, uncompressed token sequence — no compression involved. This establishes a quality baseline.

Stage two is on-policy distillation. A stronger verifier model evaluates the student model’s outputs and assigns quality labels. A lightweight confidence head, trained alongside the backbone, learns to predict those labels. The student model generates its own outputs, the verifier scores them, and the confidence head learns to predict when the student is likely to be right. This separation prevents the compressor from learning incorrect shortcuts — it can only compress tokens in ways that preserve the verifier’s assessment of output quality.

The confidence head also serves a second purpose at inference time. It controls how aggressively the model accepts early stopping during the expansion phase. Set the confidence threshold high, and the model produces fewer output tokens but risks dropping accuracy on hard problems. Set it low, and you get the full output but lose some of the speedup. The hyperparameter is exposed, which means deployment teams can tune it for their specific latency-accuracy tradeoff.

Benchmark Results

The tested backbones were Qwen3.5-4B and Qwen3.5-9B. Both showed speed improvements, but the pattern differed by model size.

The 4B model saw the largest relative speedups — 1.23× TTFT and 1.86× TPOT — because smaller models spend proportionally more time in attention, and attention is where token compression pays off. The 9B model preserved more accuracy under the same compression ratio but showed slightly smaller speed gains, because larger models have more headroom in the feedforward layers where compression does not help.

The AIME 2025 result is the strongest signal. A 7.15-point lift in pass@4 means the compressed model did not just maintain accuracy — it improved on one of the hardest math benchmarks available. This is surprising. Compression usually trades accuracy for speed. PIPO’s result suggests the training recipe is doing something more than just preserving information — it may be acting as a regularizer that helps the model focus on what matters.

The controlled GPU measurements give confidence that the speedups are real and not cherry-picked. Same prompt sets, same hardware, same serving frameworks. The only variable was whether PIPO compression was enabled.

Where the Tradeoffs Land

Not everything is positive. Peak memory during training increases because the latent compressor and multi-token prediction head run in parallel with the backbone. If you are fine-tuning from scratch rather than applying PIPO to an already-trained model, you need to budget extra GPU memory. The exact overhead depends on the compressor architecture, but the paper notes it as a real constraint for teams with tight memory budgets.

There is also a subtle quality dynamic that the benchmark numbers do not fully capture. The two-stage training recipe separates SFT from distillation, which prevents the compressor from learning shortcuts during the SFT phase. But the distillation phase introduces its own risk: the verifier model’s quality assessments become the training signal for the confidence head. If the verifier has blind spots — it consistently overestimates quality on certain output patterns or underestimates on others — those blind spots become encoded in the confidence head’s predictions. The model learns to be confident when the verifier says it should be, not necessarily when it is actually right.

This is not a PIPO-specific problem. It is a general challenge with any distillation-based training approach. But it matters more for PIPO because the confidence head directly controls the compression-accuracy tradeoff. A miscalibrated confidence head can cause the model to either expand too aggressively, wasting the speedup, or compress too aggressively, dropping accuracy on examples the verifier was not good at evaluating.

The memory overhead in training also creates an adoption friction that is easy to miss. Teams that want to apply PIPO to an existing model need to run the full two-stage recipe — SFT then distillation — which requires more GPU hours than standard fine-tuning. The inference speedup is real, but the upfront training cost means PIPO makes the most sense for models that will serve high volumes of long-prompt requests. For a model that mostly handles short prompts or low query volumes, the training cost may not amortize.

The confidence head threshold is the other practical concern. It is a new hyperparameter that controls the latency-accuracy tradeoff, and tuning it requires running evaluations on your specific task distribution. A threshold that works well for math problems may be wrong for code generation or long-form writing. Deployment teams will need to invest in task-specific calibration, which adds operational complexity.

The training data question is unaddressed. The two-stage recipe relies on a verifier model strong enough to provide meaningful quality signals during distillation. If your domain does not have a strong verifier — or if verifier quality degrades on your specific task — the distillation signal becomes noise, and the confidence head cannot learn useful predictions. The AIME result shows this works for math, where verifiers are well-studied. Code, creative writing, and open-ended reasoning are less certain.

Token Compression as a Growing Priority

Context windows are getting longer. Claude and Gemini now support 1-2 million token contexts. GPUs are getting faster. But attention is still quadratic, and the gap between context length and inference latency is not closing — it is widening. A model that takes 10 seconds to process a 100K-token prompt will take 40 seconds at 200K tokens, even if the hardware is twice as fast, because attention cost grows with the square of sequence length.

Token compression attacks the problem at the architectural level rather than the hardware level. It says: instead of making attention faster for long sequences, make the sequences shorter before attention sees them. PIPO is one point in a growing design space that includes token merging, token pruning, and recurrent compression.

The question is whether the community converges on a standard compression approach. PIPO, token merging in models like LLaMA-3, and recurrent state models like Mamba each take different routes to the same destination. None has won yet, which means teams adopting compression today are making a bet on a specific approach rather than picking up an industry standard.

Xiaohongshu’s dots-note-3.0 model — which achieved a perfect score at IMO 2026, the first Chinese LLM to receive official IMO gold certification — may or may not use PIPO internally. The team has not disclosed the full architecture. But the timing is suggestive: a model from the same organization posts historically strong math reasoning results shortly after the lab publishes a token compression method that shows particular strength on math benchmarks. Whether PIPO contributed to the IMO result is unconfirmed, but the overlap in capability focus is hard to ignore.

What to Watch

The immediate signal to track is whether later Qwen releases adopt the PIPO compressor design. Xiaohongshu tested on Qwen backbones, and if the approach becomes part of Qwen’s standard architecture, it moves from “interesting paper” to “default setting.”

Open-source replications on other model families — LLaMA, Mistral, DeepSeek — will reveal whether the 1.23× and 1.86× speedups generalize or are specific to the Qwen architecture and training data. Any public release of the confidence-head weights would also allow independent verification of the distillation claims.

For practitioners, the practical takeaway is that token compression is maturing from a research curiosity into a deployable optimization. PIPO shows that a two-stage training regime — SFT then on-policy distillation — can produce compressed models that do not just survive the information loss but sometimes improve from it. If your LLM serving pipeline is latency-bound on long prompts, the gap between what you are getting and what is possible just got narrower.

The open question is whether PIPO becomes a standard module or remains one of several competing approaches. The two-stage recipe is the real contribution — the compressor architecture itself is straightforward. If other labs adopt the SFT-then-distillation pattern for their own compression methods, PIPO’s influence may outlast its specific design. Either way, that gap just got narrower.

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen