SuperCompress

Glossary · Updated 2026-10-19

Extractive vs abstractive context compression

By

Extractive compression shortens context by selecting original sentences or lines and dropping the rest, so kept text is exact. Abstractive compression rewrites context into a shorter summary, which can be denser but may lose or alter details. For code, logs and identifiers, extractive methods are usually safer; for narrative history, abstractive summaries can work.

How does extractive compression work?

A scorer rates each unit of text (token, sentence or line) and keeps the highest scoring units in their original form. Query-aware extractive compression scores units against the current question, so the same log yields different kept lines for different questions. SuperCompress works this way: the hosted Neural Keep model keeps the original lines that answer the question and drops the others.

How does abstractive compression work?

An LLM reads the context and writes a shorter version. Conversation compaction in coding agents, such as Claude Code's /compact, is abstractive. It can merge scattered facts into a tight recap, which extraction cannot do.

How does each one fail?

ExtractiveAbstractive
Typical failureDrops a relevant lineParaphrases a value wrongly, or invents a detail
Exact strings (paths, IDs, errors)Preserved when keptCan be altered
AuditabilityKept text is a subset of the inputMust compare summary to source
Cost to runA scoring modelAn extra LLM generation

Which should you use?

Use extractive compression for tool output, stack traces, diffs, config, JSON and retrieved documents where exact wording matters. Use abstractive summaries for long conversational history when the gist is enough. Many agents use both: extract at the tool boundary, summarize old history.

Where does token pruning fit?

Token-level pruning, as in Microsoft's LLMLingua, is extractive at the token level. It can leave text that is ungrammatical but readable to a model. Line-level extraction keeps whole lines, which tends to suit code and logs. See SuperCompress vs LLMLingua.

npm install -g supercompress-proxy && supercompress setup

Frequently asked questions

What is extractive compression?

It shortens text by keeping selected original units, such as lines or sentences, and dropping the rest, with no rewriting.

What is abstractive compression?

It shortens text by generating a new, shorter version, usually with an LLM, as in summarization.

Is SuperCompress extractive or abstractive?

Extractive. It keeps original lines chosen against your question and never rewrites or summarizes them.

Can extractive compression hallucinate?

It cannot add text that was not in the input, but it can drop a line that mattered, so evaluate it on your own tasks.

Get API key Coding agents guide All alternatives