Cache the Encoder Within:Compact, Reusable Memory across LLM Queries
cs.CL
Submitted: 2026-10-07
Updated: 2026-10-07
Comments: 17 pages, 3 figures, 7 tables
Code: https://github.com/harbor-framework/terminal-bench-2-1
License: http://creativecommons.org/licenses/by/4.0/
The gist: Repeated queries over shared documents incur redundant encoding, while caching model states introduces persistent storage costs.
Abstract
Repeated queries over shared documents incur redundant encoding, while caching model states introduces persistent storage costs. Building on CoMem's intermediate-state interface, EncBank treats a pretrained LLM's lower layers as a reusable document encoder and compactly stores their outputs for an adapted upper-layer reader. A self-distilled suffix adapter is shared across storage precisions within each backbone, without quantization-specific retraining. Across five benchmark suites on three Qwen backbones spanning different sizes and full-attention and hybrid architectures, 4-bit storage keeps each reported benchmark aggregate within one score point of native-precision EncBank. In a fixed Qwen3-8B workload, it retains 28.1% of the native-precision persistent GPU store. Separate native-precision controls yield a 1.40x selected-pack prefill speedup over same-evidence, same-adapter text replay, at a 3.12-point RULER accuracy cost. A native-precision Qwen3.8-27B configuration also passes 70 of 89 Terminal-Bench 2.1 tasks. EncBank thus combines reusable computation with compact memory, while task fidelity and end-to-end benefits remain dependent on the workload, preparation costs, and reuse frequency.
Sources
- KV Packet: Recomputation-Free Context-Independent KV Caching for LLMs
- Fast State Restoration in LLM Serving with HCache
- Distilling the Knowledge in a Neural Network
- RULER: What's the Real Context Size of Your Long-Context Language Models?
- ILRe: Intermediate Layer Retrieval for Context Compression in Causal Language Models
- CoMem: Reusing Transformer Depth across Queries with Persistent Intermediate Residuals
- CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving
- The Residual Stream Is All You Need: On the Redundancy of the KV Cache in Transformer Inference
- Compressive Transformers for Long-Range Sequence Modelling
- SemPIC: Learning Semantic Position-Independent KV Caches
- Qwen3 Technical Report
- CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering