From Retrieved Context to Runtime Control: Adaptive Compression for Edge-based RAG
Organizations: Northeastern University Boston, Massachusetts USA
Abstract
Retrieval-augmented generation (RAG) improves language-model responses by grounding generation in external passages, which comes with overhead: retrieved context lengthens the prompt, increasing prefill work, KV-cache footprint, memory traffic, latency, and energy. Context compression offers a natural remedy by pruning retrieved text before generation. However, state-of-the-art context-compression methods are typically used with a fixed compression budget, or with the rate selected offline and then applied at inference time. This static view ignores both workload variation and the live state of the edge device. On an edge SoC, compression is not free: the compressor itself runs on the same SoC and consumes latency and energy that can offset any generation savings. This paper proposes a vision for telemetry-informed adaptive compression in edge RAG, grounded in experimental evidence. We characterize the compression tradeoff on the NVIDIA Jetson AGX Thor using Llama and Qwen generators, Natural Questions and HotpotQA datasets, and LLMLingua-2 compression. Our measurements show that generation dominates the RAG budget for larger models, reaching roughly 90% of per-query latency and 91% of GPU energy for 7B-8B generators. Exploring the impact of the compression rate reveals an adaptive operating region: mild compression can miss energy opportunities, and overly aggressive compression can hurt inference quality. Intermediate compression can reduce GPU energy by up to 53.2%, and SoC energy by up to 48.2%, with negligible quality loss. We argue for runtime policies that dynamically manage compression, guided by workload features and edge telemetry.
Figures & tables
| Item | Configuration |
|---|---|
| Platform | Jetson AGX Thor: Blackwell GPU, 128 GB LPDDR5x, 273 GB/s, 130 W. |
| Corpus / index | English Wikipedia 2018, sentence-split via FlashRAG ( 9.4 M passages) ( Jin et al., 2024 ) ; e5-base-v2 encoder ( Wang, 2023 ) ; FAISS GPU IndexFlatL2 ( 28.2 GB). |
| QA Datasets | Natural Questions ( Kwiatkowski et al., 2019 ) and HotpotQA ( Yang et al., 2018 ) ; 100 seed-paired queries per config. |
| Models | Llama-3.2 1B/3B, Llama-3.1 8B ( Grattafiori and others, 2024 ) ; Qwen-2.5 1.5B/3B/7B ( Yang and others, 2024 ) . All fp16. |
| Compression | None, or LLMLingua-2 ( Pan et al., 2024 ) |
| Sweeps | Exp. 1 uses with compression off. Exp. 2 uses HotpotQA, , and LLMLingua-2 rates 1.0, 0.9, 0.7, 0.5, 0.3, and 0.15. |
| Model | lat. | EM | F1 | |||
|---|---|---|---|---|---|---|
| Llama-3B | 5 | 8.5% | 30.2% | 28.2% | 0.000 | 0.005 |
| Llama-3B | 10 | 15.6% | 40.6% | 35.1% | 0.010 | 0.012 |
| Llama-8B | 5 | 25.2% | 44.9% | 38.5% | 0.052 | 0.016 |
| Llama-8B | 10 | +32.6% | +53.2% | +48.2% | +0.000 | 0.011 |