매일 아침, 어제의 AI를 한 통으로 정리해 보내드립니다메일로 받아보기

METAL LAB

From Retrieved Context to Runtime Control: Adaptive Compression for Edge-based RAG

arXiv:2608.195352026-08-21

엣지 기기에서 RAG 돌릴 때, 검색된 문서를 얼마나 압축할지 '실시간으로' 정해야 에너지를 아낄 수 있다

RAG는 외부 문서를 참고해 답변을 만들지만, 검색된 문서가 길어질수록 엣지 기기에서 시간과 전력을 많이 잡아먹는다. 이 논문은 젯슨 AGX Thor라는 엣지 기기에서 문서를 얼마나 압축해야 하는지 실측했는데, 압축을 너무 적게 하면 오히려 손해고 너무 많이 하면 답변 품질이 떨어지는 '적정 구간'이 있음을 확인했다. 적당한 수준의 압축은 GPU 에너지를 최대 53.2%, 전체 기기 에너지를 최대 48.2% 줄이면서도 답변 품질은 거의 유지했다.

무엇을 했나

  1. 7B~8B 크기의 큰 언어모델을 쓸 때는 문서 검색이나 압축이 아니라 답변을 생성하는 단계가 전체 시간의 약 90%, GPU 에너지의 약 91%를 차지한다는 것을 실측으로 확인했다
  2. LLMLingua-2라는 압축 도구로 압축 비율(rate)을 0.15부터 1.0까지 바꿔가며 실험한 결과, 압축률 1.0~0.3 구간에서는 답변 품질(F1 점수)이 거의 그대로 유지되다가 0.15로 가면 품질이 4~10점 뚝 떨어진다
  3. 압축률 0.9처럼 살짝만 압축하면 압축 작업 자체에 드는 고정 비용(130~310밀리초) 때문에 오히려 전체 에너지가 늘어나고, 0.7 이하로 압축해야 에너지 절감 효과가 나타난다
  4. 압축률 0.3을 '안전하면서도 공격적인' 지점으로 제시했으며, 모델 크기와 검색 문서 개수(top-k)가 클수록 절감 효과가 30%에서 53%까지 커진다
  5. 고정된 압축률을 미리 정해두는 대신, 기기의 실시간 상태(지연시간, 에너지, 온도 등)를 보고 압축 여부와 강도를 그때그때 결정하는 '제어기'가 필요하다고 주장한다
Figure 1. Telemetry-informed adaptive compression for edge RAG. Retrieved passages are compressed before generation, but the compression ratio is selected at runtime by a controller that observes edge-SoC telemetry and optimizes for latency, energy, thermal, memory, and accuracy constraints.
Figure 1. Telemetry-informed adaptive compression for edge RAG. Retrieved passages are compressed before generation, but the compression ratio is selected at runtime by a controller that observes edge-SoC telemetry and optimizes for latency, energy, thermal, memory, and accuracy constraints.
Table 1. Experimental Setup
ItemConfiguration
PlatformJetson AGX Thor: Blackwell GPU, 128 GB LPDDR5x, 273 GB/s, 130 W.
Corpus / indexEnglish Wikipedia 2018, sentence-split via FlashRAG (∼9.4 M passages) (16); e5-base-v2 encoder (50); FAISS GPU IndexFlatL2 ( 28.2 GB).
QA DatasetsNatural Questions (20) and HotpotQA (54); 100 seed-paired queries per config.
ModelsLlama-3.2 1B/3B, Llama-3.1 8B (9); Qwen-2.5 1.5B/3B/7B (53). All fp16.
CompressionNone, or LLMLingua-2 (34)
SweepsExp. 1 uses k∈{1,5,10} with compression off. Exp. 2 uses HotpotQA, k∈{5,10}, and LLMLingua-2 rates 1.0, 0.9, 0.7, 0.5, 0.3, and 0.15.
ControlsSingle-query mode, reranker off, standard pipeline, randomized config order, first 3 queries dropped as warm-up.
Metrics/telemetryEM, token-level F1, retrieval recall; end-to-end and per-stage latency; GPU/SoC energy, power, memory, and temperature from tegrastats at 100 ms cadence.
Figure 2. Per-query share of latency (left) and GPU energy (right) by stage, on AGX Thor, fp16, no compression.
Figure 2. Per-query share of latency (left) and GPU energy (right) by stage, on AGX Thor, fp16, no compression.
Table 2. Net savings at rate=0.3 vs. the in-session uncompressed baseline (positive Δ = saving on the cost columns, improvement on the quality columns).
ModelkΔlat.Δ​EGPUΔ​ESoCΔEMΔF1
Llama-3B5+8.5%+30.2%+28.2%+0.000−0.005
Llama-3B10+15.6%+40.6%+35.1%+0.010+0.012
Llama-8B5+25.2%+44.9%+38.5%+0.052+0.016
Llama-8B10+32.6%+53.2%+48.2%+0.000−0.011
Figure 3. Answer F1 (left axis) and per-query GPU energy (right axis) vs. LLMLingua-2 rate on HotpotQA. Shaded band: adaptive operating room between the two dotted-line knees.
Figure 3. Answer F1 (left axis) and per-query GPU energy (right axis) vs. LLMLingua-2 rate on HotpotQA. Shaded band: adaptive operating room between the two dotted-line knees.

왜 중요한가

스마트폰, 로봇, AR 기기처럼 배터리와 발열 제약이 있는 엣지 기기에서 RAG를 쓰려는 개발자에게, 문서 압축을 무작정 세게 걸면 오히려 손해라는 사실과 안전한 압축 지점(0.3)을 알려준다. 압축을 정적인 전처리가 아니라 기기 상태에 따라 조절하는 실시간 자원 관리 문제로 봐야 한다는 방향을 제시한다.

Figure 4. Net GPU energy delta (top) and ΔF1 (bottom) at rate=0.9 (mild) and rate=0.3 (safe-aggressive), vs. the in-session uncompressed baseline.
Figure 4. Net GPU energy delta (top) and ΔF1 (bottom) at rate=0.9 (mild) and rate=0.3 (safe-aggressive), vs. the in-session uncompressed baseline.

이 논문의 용어

  • RAG(검색증강생성) · 질문에 답하기 전 외부 문서를 검색해 그 내용을 참고하여 답변을 만드는 방식
  • 컨텍스트 압축 · 검색된 문서에서 덜 중요한 부분을 잘라내거나 요약해 모델에 넣는 입력 길이를 줄이는 기법
  • 압축률(rate) · 압축 후에도 남겨두는 원문 토큰의 비율. rate=0.3이면 원문의 30%만 남긴다는 뜻
  • LLMLingua-2 · 중요하지 않은 토큰을 골라 제거하는 방식의 대표적인 텍스트 압축 도구
  • 엣지 SoC · 스마트폰이나 로봇 등에 들어가는, 배터리와 발열 제약이 있는 저전력 시스템온칩(예: 젯슨 AGX Thor)

논문 원문 초록 (영문)

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.

저자 · Zlatan Feric, Amir Taherin, Yanzhi Wang, David Kaeli

arXiv에서 원문 보기

최신 논문

논문 전체 보기 →

METAL LAB 최신 기사

그림 출처: Zlatan Feric et al., arXiv:2608.19535, arxiv-nonexclusive