TL;DR
FastE is a training-free, plug-and-play token compression method that significantly accelerates LLM embedding inference for long sequences. By identifying that prefix tokens become increasingly redundant in deeper layers, FastE dynamically drops unneeded tokens mid-forward pass, slashing computational costs (up to 59% FLOPs reduction) with virtually no loss in embedding quality.
What Problem Does This Paper Address?
Large Language Models (LLMs) have become state-of-the-art backbones for generating text and multimodal embeddings. Most of these models use a "final-readout" approach: the entire input sequence (the prefix) is processed via causal attention, and the hidden state of the very last token (e.g., the [EOS] token) is extracted as the final vector representation.
However, when dealing with long documents or massive user activity logs, propagating hundreds or thousands of prefix tokens through dozens of transformer layers becomes incredibly expensive. While token pruning methods exist for autoregressive generation (like KV-cache compression), they don't translate well to embedding generation, where the goal is to optimize a single readout state rather than predict the next token.
The authors ask a fundamental question: Are prefix states equally necessary in both shallow and deep layers of an embedding model?
Methods
The authors discovered an empirical pattern they call depth-dependent prefix redundancy: dropping tokens in early layers severely degrades embedding quality, but dropping them in deeper layers causes almost no performance loss (as seen in Figure 1a above).
To exploit this, they introduced FastE, which decomposes token compression into two dynamic decisions:
- When to compress (Trigger Layer): FastE tracks the cosine similarity between the evolving readout token and the average representation of the prefix tokens—a metric called readout-prefix alignment (Figure 1b). Once this batch-mean alignment crosses a predefined threshold ($\theta$), it triggers compression.
- Which tokens to retain: At the trigger layer, FastE ranks all prefix tokens based on the attention scores they receive from the readout position. It performs a one-shot eviction, keeping only the top-$K$ most important tokens for all subsequent layers while preserving their original causal order and rotary position IDs.
Datasets
FastE was evaluated across a diverse suite of tasks and modalities:
- Text Embedding Benchmarks: NarrativeQA (long-document retrieval), Core17, Supply Chain, IMDb (classification), and ArXiv P2P (clustering).
- Cross-Modal Retrieval: MSCOCO (text-to-image), DocVQA (visual document retrieval), and NIGHTS (image-to-image similarity).
- Industrial Workloads: A proprietary suite of 39 Alipay prediction tasks spanning user engagement, risk control, and anti-abuse scenarios.
Key Insights and Ideas
- The "Aha!" Moment: Prefix tokens are crucial early on to build context, but once that context is absorbed by the readout token, the individual prefix states become highly homogeneous and functionally redundant.
- Readout State as an Oracle: Instead of relying on complex, modality-specific heuristics or training a separate policy network, FastE uses the model's own readout token as a lightweight online signal to determine both when the network is ready to compress and what information matters most.
- Truly Plug-and-Play: Because it requires zero retraining or custom sparse-attention kernels, FastE can be dropped directly into existing production pipelines.
Key Results
FastE consistently outperformed established sequence reduction baselines (like ToMe and FastV) under matched token budgets:
- Efficiency Gains: On NarrativeQA using Qwen3-Embedding-0.6B, FastE achieved a 40.11% reduction in decoder FLOPs and a 1.363× end-to-end speedup while retaining 99.53% of the full model's retrieval performance (nDCG@10).
- Scalability: On the larger Qwen3-Embedding-4B model, a 70% token removal ratio yielded a 2.07× end-to-end speedup with minimal quality loss.
- Cross-Architecture & Modality Transfer: FastE successfully generalized to the Mistral architecture (E5-Mistral-7B-Instruct) and vision-language models (Qwen3-VL-Embedding-2B) without changing its core logic.
- Production Viability: In the Alipay industrial benchmark, FastE maintained a 99.28% macro-average AUC retention even when aggressively removing 70% of the prefix tokens.
Limitations and Future Work
- Architecture Constraints: FastE is strictly designed for final-readout embedding models. It cannot be directly applied to models that utilize mean-pooling or final-layer pooling architectures without modification.
- Controller Overhead: The online alignment checks and Top-K sorting introduce minor computational overhead, meaning FLOPs reductions do not perfectly translate to wall-clock speedups (though the gains remain substantial).
- Modality Scope: While initial cross-modal results on images and text are promising, broader evaluations on video processing and other complex multimodal backbones are left for future research.
Summary updated