atlas

Research map / Architectures and efficiency / Attention and transformers

Hierarchical Context Merging: Better Long Context Understanding for Pre-trained LLMs

ICLR 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes HOMER, a training-free hierarchical context-merging scheme that splits long inputs into chunks, merges them across transformer layers with attention-based token pruning, and uses DFS ordering for logarithmic memory, extending Llama-2 context to 64k.

Problem

LLMs are limited by a fixed context window and the quadratic cost of self-attention; existing extension methods either need costly training or only modify positional encodings without reducing computation.

Approach

Divide long input into chunks that are processed independently in early layers, then progressively merge adjacent chunks across layers after attention-based token pruning with position-bias calibration, and propagate pruning decisions to lower layers so the cache has fixed length; a DFS computation order makes peak memory logarithmic in input length. No finetuning is required.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply HOMER to plain Llama-2-7b-chatLlama-2-7b-chat · Passkey retrieval, 32Kaccuracy: 0.026 -> 0.776Helped
Apply HOMER on top of YaRNLlama-2-13b-chat · Passkey retrieval, 32Kaccuracy: 0.224 -> 0.860Helped
Apply HOMER to plain Llama-2Llama-2-7b-chat · QuALITY validationaccuracy: 0.327 -> 0.358Helped
Apply HOMER on top of NTKLlama-2-7b-chat · QuALITY validationaccuracy: 0.379 -> 0.388Helped
Apply HOMER on top of YaRNLlama-2-7b · PG-19, 64Kperplexity: $>10^{\phantom{1}}$ -> 8.83Helped
Use HOMER instead of the baseline setupLlama-2 · Peak GPU memory, 64k inputmemory (GB): $>80$ -> 21.3 (at least -73.4%)Helped
Use HOMER instead of the baseline setupLlama-2 · Inference, 100 tokens from 32k contextrun time (seconds): 18.828 -> 7.169 (162.6% speedup)Helped
Use calibrated attention-based top-K pruning instead of random token pruning (ablation)HOMER · Passkey retrieval, 16kaccuracy: 0.006 -> 0.890Helped
Add calibration to attention-based top-K pruning (ablation)HOMER · Passkey retrieval, 16kaccuracy: 0.056 -> 0.890Helped
Add propagative refinement of lower-layer embeddings (ablation)HOMER · Passkey retrieval, 16kaccuracy: 0.002 -> 0.890Helped
Use propagative refinement instead of random token gathering (ablation)HOMER · Passkey retrieval, 16kaccuracy: 0.116 -> 0.890Helped
Use propagative refinement instead of layer-wise top-K token gathering (ablation)HOMER · Passkey retrieval, 16kaccuracy: 0.040 -> 0.890Helped

Surprising findings

Limitations

Experimental setup

Datasets: WikiText-103 (calibration segments)

Benchmarks: passkey retrieval QuALITY PG-19

Metrics: retrieval accuracy accuracy perplexity peak GPU memory (GB) inference time (s)

Baselines: Plain Llama-2 Position Interpolation NTK-aware scaling YaRN

Builds on: Position Interpolation NTK-aware scaling YaRN Flash Attention 2

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy