| name | acon-context-compression-agents |
| title | ACON: Optimizing Context Compression for Long-Horizon LLM Agents |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2510.00615 |
| keywords | ["context-compression","agent-efficiency","long-horizon-reasoning","memory-reduction","LLM-agents"] |
| description | Reduce memory overhead of long-horizon LLM agents by learning task-specific context compression strategies. A learnable compressor adapts by analyzing failure cases, achieving 26-54% memory reduction while preserving 95%+ accuracy, enabling smaller models to act as efficient long-context agents. |
ACON: Adaptive Context Compression for Agent Efficiency
Long-horizon agents accumulate vast context—environment observations, interaction history, tool outputs—that grow linearly with task length. A 100-step task means 100x screenshot observations plus tool responses. This explodes memory and latency, limiting agent deployment to resource-rich settings. ACON solves this by learning task-specific compression rules that preserve critical information while discarding noise.
The key insight is that compression rules are learnable and task-dependent. Instead of generic compression (truncate old history, remove timestamps), ACON analyzes why compressed contexts fail, then refines the compression strategy iteratively. This produces adapters that work across different agents and tasks.
Core Concept
ACON operates in three phases:
- Baseline compression: Apply initial heuristic (e.g., keep recent K steps, summarize old steps)
- Failure analysis: When compressed context causes task failure, diagnose why (what info was lost?)
- Refinement: Update compression strategy in natural language (e.g., "always preserve error messages")
The compressor is a learned function that maps (observation, history, task) to (compressed_observation, compressed_history). It learns from failure traces, not from paired data.
Architecture Overview
- Compressor module: Maps observations and history to compressed versions
- Failure detector: Identifies task failures caused by missing context
- Analyzer: LLM reasoning over failure traces to identify patterns
- Guideline updater: Refines compression rules in natural language
- Distiller: Optionally compresses the compressor itself into a small model
Implementation Steps
Start with a baseline compressor that uses heuristic rules:
import json
from typing import Dict, List, Tuple
class ContextCompressor:
"""
Learn task-specific context compression via failure analysis.
"""
def __init__(self, task_name, model_name=):
.task = task_name
.model = model_name
.guidelines = [
,
,
,
]
() -> :
compressed = {}
observation:
max_screenshots =
compressed[] = observation[][-max_screenshots:]
observation:
seen = ()
unique_responses = []
resp observation[]:
resp_hash = (resp)
resp_hash seen:
unique_responses.append(resp)
seen.add(resp_hash)
compressed[] = unique_responses
observation:
compressed[] = observation[]
compressed
() -> []:
(history) <= max_recent:
history
recent = history[-max_recent:]
old_history = history[:-max_recent]
summary = {
: ,
: (old_history),
: ((a.get() a old_history)),
: [a a old_history a.get() == ]
}
[summary] + recent