atlas

Research map / Large language models / Language, safety and interpretability

In-context Autoencoder for Context Compression in a Large Language Model

ICLR 2024 · Large language models › Language, safety and interpretability · approach: Pruning and circuits in LLMs · 7 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 the In-context Autoencoder (ICAE), a LoRA-adapted Llama encoder that compresses long contexts into 128 memory slots read by the frozen Llama decoder, pretrained with autoencoding and continuation then fine-tuned on the GPT-4-generated PwC dataset.

Problem

Long context handling in LLMs is costly in compute and memory; prior architectural fixes degrade on long contexts, and prompt/context compression methods are either lossy, short-prompt only, or require tuning the target LLM.

Approach

Use the LLM itself, with a lightweight LoRA adapter and learnable memory tokens, as an encoder that compresses a context into a few continuous memory slots that the untouched target LLM can condition on; pretrain with autoencoding plus text continuation, then instruction fine-tune on context-prompt-response data.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Compress a 512-token context to 128 memory slotsLlama-7B text continuation · 512→128 (4×)PPL: 9.01 -> 9.50; +0.49Hurt
Use 64 or 32 memory slots instead of k=128 (ablation)ICAE autoencoding · Long contexts, including length 500BLEUHurt
Compress 512-token content to 128 slotsICAE restoration · Normal text versus random textBLEU: 99.3; 3.5; 0.2Mixed
Increase memory length from k=64 to k=128 (ablation)Llama-2-7B-chat ICAE · PwC test setwin rate in pairwise comparison: 57.6% win; 19.5% lose; 22.9% tieHelped
Use pretrained k=64 rather than non-pretrained k=128 (ablation)Llama-2-7B-chat ICAE · PwC test setwin rate in pairwise comparison: 33.1% win; 28.0% lose; 38.9% tieHelped
Add pretraining (ablation)Llama-2-7B-chat ICAE, k=128 · PwC test setwin rate in pairwise comparison: 60.4% win; 9.5% lose; 30.1% tieHelped
Combine AE and LM pretraining objectives instead of using AE alone (ablation)Llama-2-7B-chat ICAE, k=128 · PwC test setwin rate in pairwise comparison: 36.4% win; 28.5% lose; 35.1% tieHelped
Combine AE and LM pretraining objectives instead of using LM alone (ablation)Llama-2-7B-chat ICAE, k=128 · PwC test setwin rate in pairwise comparison: 35.1% win; 24.9% lose; 40.0% tieHelped
Use ICAE memory slots instead of a GPT-4 summary of the same 128-token length (ablation)Llama-2-7B-chat ICAE · PwC test setwin rate in pairwise comparison: 34.1% win; 17.6% lose; 48.3% tieHelped
Increase target model size from Llama-7B to Llama-2-13BPretrained ICAE, 512→128 · AutoencodingBLEU: 99.1 -> 99.8Helped
Compress the context before generationLlama-7B inference · 8×2048 inputspeedup: 3.3×Helped
Increase memory length from k=128 to k=256 (ablation)Llama-2-7B-chat ICAE · PwC test set, comparison against GPT-4win+tie rate: 74.2 -> 79.5Helped

Surprising findings

Limitations

Experimental setup

Datasets: The Pile PwC (Prompt-with-Context, GPT-4 generated)

Benchmarks: PwC test set The Pile (autoencoding and text continuation)

Metrics: BLEU exact match cross entropy loss perplexity win/tie rate latency

Baselines: Alpaca-7b StableLM-tuned-alpha-7b Llama-2-7b-chat Llama-2-13b-chat GPT-4 summary (128 tokens) non-pretrained ICAE

Builds on: Gisting AutoCompressor LoRA

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