Two LLMs working together crack the long context problem through smart compression
π https://arxiv.org/abs/2410.19318
π― Original Problem:
While continual pre-training on long-context data works, it demands substantial computational resources and data acquisition costs.
-----
π§ Solution in this Paper:
β SharedLLM uses two short-context LLMs - an upper model (decoder) and lower model (compressor)
β Lower model breaks input into chunks, compresses each into multi-grained representations using a tree structure
β Information transfer happens only at lowest layers to avoid redundant processing
β Uses specialized tree-style data structure for efficient encoding and retrieval of contextual information
β Implements query-aware dynamic tree construction that expands only relevant nodes
β Employs position-aware cross-attention for integrating compressed information
-----
π‘ Key Insights:
β Two LLMs sharing same architecture can effectively handle long contexts without extra alignment steps
β Tree-based compression with varying granularity better captures relevant information
β Query-dependent dynamic tree construction significantly improves efficiency
β Layer-wise information transfer at bottom layers is sufficient for good performance
-----
π Results:
β Achieves 2x faster speed than streaming approaches, 3x faster than encoder-decoder architectures
β Outperforms baselines by 3-10% on language modeling tasks
β Successfully processes sequences up to 128K tokens while trained only on 8K tokens
β Demonstrates superior performance on long-context tasks like Math.Find (13.58 vs 11.14) and En MC (33.65 vs 31.44)










