AdmTree: Compressing Lengthy Context with Adaptive Semantic Trees

Yangning Li, Shaoshen Chen, Yinghui Li, Yankai Chen, Hai-Tao Zheng, Hui Wang, Wenhao Jiang, Philip S. Yu

Abstract

Large Language Models (LLMs) face significant computational challenges when processing long sequences due to the quadratic complexity of self-attention. While context compression techniques have emerged as a solution, they often struggle with a trade-off between semantic breadth and depth. This paper introduces AdmTree, a hierarchical context compression framework that organizes long documents into an adaptive, binary semantic tree of "gist tokens." By dynamically allocating compression budgets based on information density and utilizing a tree structure to capture both local details and global themes, AdmTree achieves state-of-the-art performance, outperforming existing methods by up to 10% while providing a 3.4x inference speedup.

1. Introduction

The expansion of LLM context windows has unlocked new capabilities in document analysis and multi-turn dialogue. However, the "quadratic bottleneck"—where computational costs grow exponentially with input length—remains a primary barrier to efficiency. Current context compression strategies generally fall into two categories: explicit methods, which prune tokens based on importance, and implicit methods, which compress text into latent "gist tokens."

Explicit methods often sacrifice local coherence, while flat implicit methods frequently suffer from positional bias (the "lost in the middle" phenomenon) and information degradation over extended sequences. AdmTree addresses these limitations by mimicking human cognitive processes: building hierarchical mental summaries that preserve both granular details and high-level abstractions.

2. Methodology

AdmTree employs a three-stage hierarchical approach to transform raw text into a structured, compressed representation.

2.1 Adaptive Leaf Gist Token Construction

Unlike traditional methods that apply a uniform compression ratio, AdmTree utilizes an "entropy-adjusted perplexity score" to evaluate the information density of different text segments. This allows the model to allocate more gist tokens to complex, information-dense passages while more aggressively compressing redundant or "fluff" segments. These dynamically allocated tokens form the leaves of the semantic tree.

2.2 Semantic Tree Construction

The leaf gist tokens are organized into a binary tree structure. A lightweight, single-layer self-attention aggregator builds the tree from the bottom up. A critical innovation here is the use of bidirectional aggregation; unlike standard causal LLMs that only look backward, AdmTree’s aggregator allows later parts of a document to inform the representations of earlier segments. This bidirectional flow ensures that the global context is reflected throughout the tree hierarchy.

2.3 Tree-based Compression and Inference

During the inference phase, the backbone LLM (which remains frozen) attends to the nodes of the semantic tree rather than the raw input text. This structure provides "shortcuts" for the model, allowing it to access any part of the context with fewer computational steps, effectively mitigating the positional bias inherent in linear sequences.

3. Experimental Evaluation

3.1 Datasets and Benchmarks

AdmTree was evaluated across a diverse suite of long-context benchmarks:

  • LongBench: A multi-task benchmark covering QA and summarization.
  • Needle-in-the-Haystack: A test of retrieval accuracy for specific facts buried in massive contexts.
  • ShareGPT & MSC: Evaluations for dynamic, multi-turn dialogue.
  • BookSum: A test for multi-granularity summarization across paragraph, chapter, and book levels.
  • Reasoning Tasks: GSM8K (mathematics) and Big-Bench Hard (BBH).

3.2 Performance Results

Experimental results demonstrate that AdmTree sets a new standard for implicit context compression. On Llama-2-7B, AdmTree outperformed the previous state-of-the-art (Activation Beacon) by an average of 10% across LongBench. On Qwen-2-7B, it achieved a 5% improvement. In specific Question Answering tasks, the gains were even more pronounced, with improvements exceeding 20 points over baselines and, in some instances, a 327% increase in accuracy compared to weaker implicit methods.

3.3 Efficiency and Robustness

AdmTree achieves a 3.3x to 3.4x speedup in inference latency compared to full-context models. In the "Needle-in-the-Haystack" test, while many baseline models collapsed under high compression ratios (dropping below a ROUGE score of 10), AdmTree maintained near-perfect retrieval performance regardless of the document length or the position of the target information.

4. Discussion and Future Work

The success of AdmTree highlights the importance of information density and hierarchical structure in context management. By moving away from flat, fixed-ratio compression, the model preserves critical data that would otherwise be lost.

Future research directions include:

  • Model Scaling: Testing AdmTree on larger-scale models and specialized architectures.
  • Mixture-of-Experts (MoE) Integration: Developing specialized compression experts for different data types, such as code or narrative prose.
  • Inference Optimization: Further refining tree-node retrieval strategies to optimize the trade-off between accuracy and floating-point operations (FLOPs).

5. Conclusion

AdmTree provides a robust solution to the long-context problem by combining adaptive token allocation with a hierarchical semantic tree. Its ability to maintain high accuracy while significantly reducing inference latency makes it a viable framework for the next generation of long-context LLM applications.

Summary updated

BibTeX
@inproceedings{li2025admtree,
  author = {Yangning Li and Shaoshen Chen and Yinghui Li and Yankai Chen and Hai-Tao Zheng and Hui Wang and Wenhao Jiang and Philip S. Yu},
  title = {{AdmTree: Compressing Lengthy Context with Adaptive Semantic Trees}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=l3Qq5MU5VX},
}
Figure