AWS Introduces Query-Aware Compression to Reduce RAG Costs

AWS ML Blog · rss · 2026-08-22

Input tokens often represent a significant cost factor for Retrieval Augmented Generation (RAG) at scale. This AWS ML Blog post introduces a "query-aware compression" pattern on Amazon Bedrock that reduces these costs by filtering retrieved chunks before they reach the primary model.

Architecture Overview:

Economic Logic:

Savings are achieved because the expensive primary model processes significantly fewer input tokens ($R/c$ instead of $R$). The approach is cost-effective when retrieved context is large, the price ratio between the large and small models is high, and irrelevant content can be trimmed without affecting answer quality. The article provides a detailed cost formula comparing baseline vs. compressed workflows.

Implementation Details:

Original post →

More from Infra

Infra channel →