Entropy Gate: Entropy Quenching for Near-Lossless Token Compression in LLM Pipelines
Justice Owusu Agyemang, Jerry John Kponyo, Kwame Opuni-Boachie Obour Agyekum, Francisca Adoma Acheampong, Kwame Agyeman-Prempeh Agyekum, James Dzisi Gadze · 2026
Read Entropy Gate: Entropy Quenching for Near-Lossless Token Compression in LLM Pipelines by Justice Owusu Agyemang, Jerry John Kponyo, Kwame Opuni-Boachie Obour Agyekum, Francisca Adoma Acheampong, Kwame Agyeman-Prempeh Agyekum, James Dzisi Gadze (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-03739.txt.
Introduction
Agyemang and co-authors cut token waste in language model pipelines with Entropy Gate. Pipelines burn budget on repeated context, verbose replies, and boilerplate. Entropy Gate applies entropy quenching, a process borrowed from thermodynamics. Low-energy tokens freeze out step by step while meaning stays intact. Each token gets an information energy from statistical, structural, and positional factors.
A cooling schedule lowers the temperature over time. Tokens whose survival chance falls below a threshold are removed. A fidelity gate halts compression if weighted similarity drops too low. Theory shows the selection rule maximizes expected meaning preserved. Achievable compression nears the information-theoretic limit. A heuristic phase reaches 40 to 60 percent compression across five prompt types. Similarity stays above 0.80. Deduplication of repeated blocks saves far more. Combined with external memory, agentic workloads shrink by up to 96 percent. The tool is stateless and deploys as a proxy.
Catalog record
| CREATOR | Justice Owusu Agyemang, Jerry John Kponyo, Kwame Opuni-Boachie Obour Agyekum, Francisca Adoma Acheampong, Kwame Agyeman-Prempeh Agyekum, James Dzisi Gadze |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 75 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.03739
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Entropy Gate: Entropy Quenching for Near-Lossless Token Compression in LLM Pipelines Justice Owusu Agyemang, Jerry John Kponyo, Kwame Opuni-Boachie Obour Agyekum, Francisca Adoma Acheampong, Kwame Agyeman-Prempeh Agyekum, James Dzisi Gadze Abstract LLM pipelines waste substantial token budgets on low-information content: repeated context, verbose responses, and redundant boilerplate. We introduce Entropy Gate, a token compression framework applying entropy quenching—a thermodynamic process that progressively freezes out low-energy tokens while preserving semantic fidelity. Each token receives a multi-factor information energy E ( t ) E(t) combining statistical, structural, and positional components. An adaptive quenching schedule T ( τ ) = T 0 / ( 1 + α τ ) T(\tau)=T_{0}/(1+\alpha\tau) removes tokens whose Boltzmann survival probability p i = exp ( − E i / k T ) p_{i}=\exp(-E_{i}/kT) falls below threshold, with a fidelity gate halting compression when energy-weighted similarity drops below θ \theta . We prove token selection by descending E ( t ) E(t) maximizes expected semantic preservation, that quenching produces nested survival sets, and that achievable compression approaches the information-theoretic limit CR → 1 − I ( P ; T ) / H ( P ) \text{CR}\to 1-\MI(P;T)/H(P) . A Phase 1 heuristic achieves 40–60% compression across five prompt categories while maintaining S E > 0.80 S_{E}>0.80 , with energy-squared amplification E → E 2 E\to E^{2} adding 10–25 percentage points. Context deduplication adds 50–70% savings on repeated blocks. Output-side quenching, motivated by findings that brevity improves accuracy [ 5 ] , further reduces response overhead. Combined with external memory, reduction composes multiplicatively to 88–96% for agentic workloads. The framework is stateless, model-agnostic, and deploys as an OpenAI-compatible HTTP proxy. 1 Introduction LLM pipelines suffer from a three-component token tax: (1) context amnesia, where agents re-read the same codebase files across sessions [ 33 ] ; (2) output verbosity, where default model responses contain 75% fluff tokens [ 5 ] ; and (3) within-prompt redundancy from system instructions, boilerplate, and repeated structural patterns. Together these inflate token consumption by factors of 50–500 \times relative to the information-theoretic minimum. Existing approaches address individual components. The Caveman plugin constrains output style to reduce verbosity [ 6 ] . Graphify replaces repeated codebase reads with precomputed AST knowledge graphs [ 32 ] . Memory systems like MemPalace [ 29 ] externalize conversation history for retrieval across sessions. LLMLingua and Selective Context [ 21 , 27 ] apply information-theoretic pruning to prompts. Each is a point solution; none provides a unified, mathematically principled compression layer operating at the token level across both input and output. We propose Entropy Gate , a token compression framework inspired by entropy quenching in statistical mechanics. The core insight is that token importance can be modeled as an information energy E(t) , and compression can be modeled as a quenching process that progressively freezes out low-energy tokens. Unlike adiabatic cooling (which preserves system entropy while temperature changes), quenching reduces entropy by selectively removing low-information tokens, analogous to the rapid cooling that traps a system in a low-entropy ground state. The fidelity gate ensures the compressed prompt’s semantic vector remains within (1-\theta) of the original. The contributions are: (1) A multi-factor information energy E(t)=w_{1}E^{\text{stat}}(t)+w_{2}E^{\text{struct}}(t)+w_{3}E^{\text{pos}}(t) decomposing token importance into statistical, structural, and positional components (Section 3.1 ). (2) An entropy quenching schedule T(\tau)=T_{0}/(1+\alpha\tau) with Boltzmann survival p_{i}=\exp(-E_{i}/kT) and provable fidelity bounds (Section 3.6 ). (3) An energy-squared amplification lemma proving E\to E^{2} increases preservation efficiency by amplifying the signal-to-noise ratio in the energy distribution (Section 3.5 ). (4) An energy-weighted fidelity gate guaranteeing semantic preservation at each quenching step (Section 3.7 ). (5) Output-side quenching operating on upstream responses, operationalizing the finding that brevity constraints improve accuracy by 26% [ 5 ] (Section 3.9 ). (6) Provable bounds on optimal cooling rate, achievable compression ratio, and the relationship to the information-theoretic bound (Section 3.8 ). (7) A combined memory-compression bound (Theorem 11.1 ) proving that external memory and entropy quenching compose multiplicatively: R_{\text{total}}=1-(1-R_{\text{mem}})(1-R_{\text{quench}}) , achieving 88–96% total token reduction in agentic workflows. (8) Structural multi-turn compression (Theorem 11.3 ) with turn-decayed quenching: older turns receive more aggressive compression while tool calls, the live query, and system messages are protected verbatim. Achieves 57% CR on compressible spans in 7-turn agentic sessions without corrupting the observation-action loop. 2 Related Work Token Economics in Agentic Systems. Rosati [ 33 ] demonstrated 71.5 \times token savings by combining Obsidian-based session memory with Graphify’s tree-sitter AST graphs. Brussee [ 5 , 6 ] showed brevity constraints improve accuracy by 26% while reducing output tokens by 75%. Karpathy [ 25 ] popularized the “second brain” approach using structured note systems for agent context. These empirical findings motivate unified token compression but lack a general mathematical framework. Prompt Compression. LLMLingua [ 21 ] uses a small language model to compute token-level perplexity and selectively remove low-information tokens, achieving up to 20 \times compression. Selective Context [ 27 ] applies lexical and semantic redundancy detection. Gist tokens [ 30 ] train a model to compress prompts into a fixed number of “gist” embeddings. ICAE [ 14 ] uses an autoencoder architecture for in-context compression. Unlike these methods, Entropy Gate requires no training, operates as a stateless proxy, and provides provable fidelity guarantees. Model Compression. Knowledge distillation [ 18 ] transfers knowledge from large to small models. Network pruning [ 16 , 2 ] removes redundant parameters. Quantization [ 11 , 12 ] reduces numerical precision. KV-cache compression [ 13 , 37 ] reduces memory in transformer inference. These operate on model weights or activations; Entropy Gate operates on the token stream itself. Information Theory and Statistical Mechanics. Shannon’s source coding theorem [ 34 ] establishes the entropy rate as the fundamental compression limit. Rate-distortion theory [ 10 ] formalizes lossy compression with fidelity constraints. The Boltzmann distribution [ 3 ] and Jaynes’ maximum entropy principle [ 20 ] provide the thermodynamic framework underlying our quenching process. N-gram language models [ 23 ] establish the connection between token probability and information content. LLM Architectures and Benchmarks. The transformer architecture [ 35 ] and scaling laws [ 24 , 19 ] underpin modern LLMs. Retrieval-augmented generation [ 26 ] and agentic frameworks [ 36 , 22 ] define the pipeline contexts where compression is most impactful. Standard benchmarks include MMLU [ 17 ] , HumanEval [ 7 ] , GSM8K [ 9 ] , and LongMemEval [ 28 ] . Table 1 : Comparison of prompt compression methods. Entropy Gate is the only method providing provable fidelity guarantees without requiring model training. Method Model Fidelity CR Domain LLMLingua [ 21 ] 124M+ No 5–20 \times No Selective Context [ 27 ] No No 2–5 \times No Gist Tokens [ 30 ] Trained No 10–26 \times No ICAE [ 14 ] Trained No 4–10 \times No AutoCompressors [ 8 ] Trained No 5–20 \times No Caveman [ 6 ] No No 2–4 \times No EG (Phase 1) No Yes 2–3 \times Yes EG (Phase 2) 268M Yes 5–10 \times Yes Table 1 positions Entropy Gate within the prompt compression landscape. Four properties are unique: (1) provable fidelity guarantees ( S_{E}\geq\theta ); (2) no training required—Phase 1 works immediately, Phase 2 uses off-the-shelf models; (3) self-calibrating