Summary (Overview)
- LatentPress introduces a novel context compression interface that writes conversational histories and long documents into continuous memory tokens that a frozen decoder reads directly through its input-embedding interface, with no text reconstruction at inference time.
- The system trains only a small reader-matched adapter (4.2M–26.2M parameters, ~0.1% of decoder parameters) while keeping the entire downstream decoder frozen.
- On LongMemEval, LatentPress achieves 0.504 accuracy at 7.70× compression versus 0.490 for uncompressed evidence, significantly outperforming text summaries (0.184) and OCR-based compression (0.426→0.312).
- On LongBench-QA, in-domain writers match or exceed raw-context reading at 4–8× compression, with writing taking 43 ms per conversation (roughly 10–22× faster than alternatives).
- Reading is 5–9× faster than raw context or cached OCR, validating soft tokens as a practical machine-facing context interface beyond text and vision.
Introduction and Theoretical Foundation
Background and Motivation
Long-running assistants and agents accumulate more history than they can afford to reread. A deployment trace may hold instructions, dialogue, plans, tool calls, observations, and environment feedback, yet a later decision often depends on only a small part of it. The paper argues that while text is convenient for people and interoperable across systems, a model need not require its stored or compressed context to be human-readable.
Theoretical Basis
The paper separates context use into two operations:
- WRITE: maps text to a compact state
- READ: supplies that state to a frozen decoder for downstream QA
This abstraction covers both conversational histories and long documents without attempting to replace retrieval, reflection, update policies, or conflict resolution in a complete memory system.
Positioning vs. Prior Work
The key distinction from prior compression methods (Gist, Auto-Compressor, ICAE, xRAG) is that LatentPress:
- Leaves the downstream decoder entirely frozen
- Trains only a small reader-matched adapter (~0.1% of decoder parameters)
- Consumes vectors directly at the decoder's input-embedding layer
- Supports variable-length, role-based compression rates
Methodology
Direct-Read Soft Context Interface
Let a context be a sequence of segments (dialogue turns or document chunks). A frozen decoder answers a question from a compact representation. A small trainable writer maps to a short sequence of continuous vectors :
For each position , the writer fuses the literal input embedding with a context-aware abstraction :
Compression Rate Scheduling
The rule determines how many neighboring token positions are pooled into each soft token:
- Uniform pooling: for every segment (used for documents)
- Role-based schedule: and , so user turns retain raw token embeddings while assistant turns are encoded and pooled
Training Objectives
For generic representation learning, the loss combines reconstruction and forward-KL distillation:
where for a target sequence :
Here and are the frozen decoder's teacher-forced next-token distributions given the full and compressed context, respectively. The forward-KL term distills full-context behavior into the writer (with ).
Writer Sizes by Backbone
| Backbone | Writer Parameters |
|---|---|
| Qwen2.5-7B | 12.849M |
| Qwen3-8B | 16.781M |
| Qwen3-1.7B | 4.196M |
| Qwen2.5-14B | 26.220M |
Empirical Validation / Results
LongMemEval: Conversational Memory
The writer is trained on 2,000 UltraChat conversations (text only, no QA labels) and evaluated zero-shot on 500 held-out LongMemEval oracle-evidence questions.
Table 2: Zero-shot LongMemEval results (Qwen2.5-7B reader)
| Method | Compression | Overall | user-fact |
|---|---|---|---|
| uncompressed evidence | 1.0× | 0.490 | 0.946 |
| LatentPress, | 4.62× | 0.476±0.014 | 0.938±0.007 |
| LatentPress, | 6.27× | 0.478±0.020 | 0.891±0.015 |
| LatentPress, | 7.70× | 0.504±0.024 | 0.938±0.010 |
| ICAE | 4.12× | 0.452±0.017 | 0.548±0.019 |
| ICAE | 8.96× | 0.318±0.022 | 0.381±0.023 |
| DeepSeek-OCR | 2.33× | 0.426 | 0.797 |
| DeepSeek-OCR | 9.34× | 0.312 | 0.594 |
| text summary | 12.06× | 0.184 | 0.297 |
Cross-backbone generalization (Table 3): LatentPress beats uniform pooling by +0.34 to +0.45 across all three readers (Qwen2.5-7B, Qwen3-8B, Qwen3-1.7B), and outperforms DeepSeek-OCR on Qwen2.5-7B (0.504 vs. 0.426) and Qwen3-1.7B (0.434 vs. 0.264).
LongBench-QA: Long-Document QA
Table 4: In-domain LatentPress on LongBench-QA English (official overall score in %)
| Reader | Setting | Overall |
|---|---|---|
| Qwen2.5-7B | raw context (1×) | 43.80 |
| Qwen2.5-7B | in-domain f4 | 49.06±2.30 |
| Qwen2.5-7B | in-domain f8 | 43.77±2.83 |
| Qwen2.5-7B | in-domain f16 | 37.78±3.46 |
| Qwen3-8B | raw context (1×) | 30.80 |
| Qwen3-8B | in-domain f4 | 39.62±2.31 |
| Qwen3-8B | in-domain f8 | 36.93±2.82 |
| Qwen3-8B | in-domain f16 | 26.12±3.33 |
| Qwen2.5-14B | raw context (1×) | 47.93 |
| Qwen2.5-14B | in-domain f4 | 57.99±2.35 |
| Qwen2.5-14B | in-domain f8 | 52.18±2.82 |
| Qwen2.5-14B | in-domain f16 | 40.30±3.51 |
Key findings:
- In-domain adaptation exceeds uncompressed baselines at 4× on all three readers (e.g., Qwen2.5-14B: 57.99 vs. 47.93)
- 16× compression degrades below raw baselines, exposing the cost of losing verbatim detail
- Cross-domain transfer (from LongMemEval-derived QA) partially succeeds, with 4× being the preferred rate
Efficiency Results
Write cost (Qwen3-8B, bfloat16, H100 GPU, batch of 8):
- LatentPress: 43 ms/conversation
- DeepSeek-OCR: 844–1056 ms (~22× longer)
- Text summarization: 407–645 ms (9–15× longer)
- ICAE: 350–700 ms (8–15× longer)
Read cost (Table 5, warm-loaded inference, 30 LongBench-QA examples):
| Reader | Raw context | LatentPress f8 | Cached OCR b640 |
|---|---|---|---|
| Qwen2.5-7B | 2.44s | 0.49s | 2.71s |
| Qwen2.5-14B | 4.14s | 0.49s | 4.34s |
| Qwen3-8B | 3.97s | 0.43s | 4.03s |
LatentPress is 5.0–9.2× faster than raw inference and 5.5–9.4× faster than the cached OCR route.
Theoretical and Practical Implications
Key Insights
-
More tokens are not automatically better: The uncompressed oracle evidence on LongMemEval reaches only 0.490, while LatentPress achieves 0.504 at 7.70× compression—demonstrating that aggressive compression can actually improve accuracy by filtering noise.
-
Role-based compression is effective: Keeping short user turns lossless while pooling assistant turns preserves answer-bearing facts, suggesting that input structure contains valuable information about information density.
-
The interface is reader-agnostic: LatentPress generalizes across three Qwen backbones spanning two model families and a 4.7× range in scale, with only a small adapter trained per reader.
-
Continuous vectors as a machine-facing interface: The results establish soft tokens as a practical alternative to text and vision for context storage, with significant implications for memory systems, agent architectures, and long-document processing.
Practical Applications
- Conversational memory systems: Complementary to systems like MemGPT, Memory-Bank, and Generative Agents—LatentPress provides the representation layer while those handle retrieval and reflection
- Long-document QA: Enables faster inference with comparable or better accuracy at mild compression rates
- Deployment efficiency: Near-real-time writing (43 ms) and 5–9× faster reading make it suitable for latency-sensitive applications
Conclusion
LatentPress demonstrates that compressed context need not be stored as text or reconstructed from images before a language model can use it. The system satisfies four practical criteria:
- Accuracy: Compressed readers preserve or improve accuracy on both benchmarks
- Write cost: Encoded tokens generated in near-real time (43 ms)
- Read cost: 5–9× faster than raw context or cached OCR
- Trainable footprint: Only a small adapter (~0.1% of decoder parameters)
Future Directions
- Dynamic compression: Learning a policy to choose compression rates per segment via reinforcement learning against downstream answer reward
- Learned token-wise fusion: Implementing a learned importance-weighted fusion of literal and contextual features
- Additional readers and modalities: Extending to non-text contexts such as tool, multimodal, or embodied traces
- Integration with retrieval: Pairing LatentPress with a retriever for full memory systems (the current LongMemEval setup uses oracle evidence sessions)
Related papers
- On the Fragility of Self-Improving Agents: Variance, Task Order, and Underspecification
Memory-based self-improving agents are fragile and unreliable, amplifying evaluation variance and degrading under shuffled task orders due to task and environment underspecification.
- Deriving Scaling Laws for OpenEuroLLM Models: Learning Rate, Batch Size and Loss
The Skaling law, with its N-D interaction exponent, predicts held-out LLM losses three times more accurately than Chinchilla, while optimal learning rate and batch size scale as N^-0.417 D^0.086 and N^0.145 D^0.460.
- Explore More, Drift Less: Outcome-Only Reinforcement Learning Can Suffice for Long-Horizon Interactive Agents
Outcome-only reinforcement learning with CANOPY, a protocol fixing signal starvation and policy drift, lets a single open 14B model top the AppWorld leaderboard.