In-Context Former: Lightning-fast Compressing Context for Large Language Model
Xiangfeng Wang, Zaiyi Chen, Zheyong Xie, Tong Xu, Yongyi He, Enhong, Chen

TL;DR
In-Context Former (IC-Former) is a novel method that compresses large language model contexts efficiently by leveraging cross-attention and digest tokens, significantly reducing inference costs and enabling real-time applications.
Contribution
IC-Former introduces a cross-attention based compression method that operates independently of target LLMs, achieving linear time complexity and substantial speedups over existing quadratic methods.
Findings
Requires only 1/32 of the baseline FLOPs during compression
Achieves 68 to 112 times faster processing speed
Maintains over 90% of baseline performance on evaluation metrics
Abstract
With the rising popularity of Transformer-based large language models (LLMs), reducing their high inference costs has become a significant research focus. One effective approach is to compress the long input contexts. Existing methods typically leverage the self-attention mechanism of the LLM itself for context compression. While these methods have achieved notable results, the compression process still involves quadratic time complexity, which limits their applicability. To mitigate this limitation, we propose the In-Context Former (IC-Former). Unlike previous methods, IC-Former does not depend on the target LLMs. Instead, it leverages the cross-attention mechanism and a small number of learnable digest tokens to directly condense information from the contextual word embeddings. This approach significantly reduces inference time, which achieves linear growth in time complexity within…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Machine Learning in Healthcare
MethodsSPEED: Separable Pyramidal Pooling EncodEr-Decoder for Real-Time Monocular Depth Estimation on Low-Resource Settings
