Negation disappears
Detect: The compressed text reverses a status or condition.
Recover: Protect logical operators and compare critical statements.
Remove low-value prompt content under a measured quality constraint while preserving negation, identifiers, evidence, and instructions.
Token pruning reduces the text sent to a model by selecting or compressing information that contributes to the task. It can operate at document, sentence, or token level. Learned compressors estimate importance differently from simple truncation, but all pruning methods risk removing a condition or relationship the final answer needs.
Prompt-token pruning is distinct from pruning model weights or evicting attention-cache entries. Its success criterion is end-to-end task quality at a lower total cost, including the compressor itself. Exact quotations, code, structured records, numbers, and contractual language often require protected spans rather than aggressive token deletion.
A prototype compares sentence selection, simple truncation, and a learned compressor on the same tasks.
Production marks protected spans, retains source alignment, and evaluates factual and structural preservation at several compression ratios.
Enterprise scale routes only suitable workloads through compression and monitors quality drift, compressor latency, and total inference savings rather than token reduction alone.
Sets a target based on available context and the task’s tolerated information loss.
Ranks passages or tokens using a documented selection method.
Preserves instructions, identifiers, negation, units, and exact-evidence requirements.
Produces reduced context with links to original source ranges.
Checks required facts and compares downstream performance with an uncompressed baseline.
flowchart LR
C["Candidate context"] --> P["Protected-span marking"]
P --> S["Importance scoring"]
S --> R["Budgeted pruning"]
R --> V["Fact and structure checks"]
V --> M["Reduced model request"]
V --> F["Fallback to original or smaller source set"]Determine whether the task permits lossy context or requires exact source wording.
Identify mandatory instructions, numbers, entity names, and evidence-critical conditions.
Choose an evaluated ratio that meets the latency and quality budget.
Remove low-value content while retaining source mapping and protected spans.
Check required fields, negation, and structure before sending the compressed prompt.
Include compression overhead, generation cost, and error rates in the acceptance decision.
Customer service analytics · Illustrative enterprise scenario, not a reported customer outcome.
A service-quality agent reviews long contact logs containing repeated greetings, routing text, and issue updates.
Boilerplate consumes most of the prompt while a few resolution facts matter.
Reduce context cost without losing the customer’s issue, promised action, or unresolved status.
A compressor removes repetitive low-value spans and protects commitments, dates, and final disposition.
If pruning removes a negation that changes whether an issue was resolved, validation rejects the compressed version.
Measure commitment-retention accuracy and total processing cost; a smaller prompt is not an improvement when it changes the operational meaning.
| Decision | Benefit | Cost |
|---|---|---|
| Token-level compression | Can achieve substantial input reduction. | May produce difficult-to-audit text and semantic loss. |
| Sentence selection | Preserves readable units. | May retain more redundant tokens. |
| Protected spans | Preserve high-value exact information. | Limit achievable compression. |
Detect: The compressed text reverses a status or condition.
Recover: Protect logical operators and compare critical statements.
Detect: Added model work exceeds avoided prefill cost.
Recover: Bypass short or low-redundancy requests.
Measure task quality and total latency.
Reserve protected policy and output-contract segments.
Retain original ranges so citations remain verifiable.