
The attention mechanism in large language models (LLMs) scales quadratically with input length. This means that if a document’s length doubles, the computational and memory costs can increase fourfold. Such scaling issues not only slow down inference but also inflate the size of the key-value (KV) cache, rendering large-context applications impractical in production systems. In retrieval-augmented generation (RAG) settings, most retrieved passages contribute minimally to the final answer, yet the model incurs the full quadratic cost to process them. How Does REFRAG Compress and Shorten Context? How is Acceleration Achieved? How Does REFRAG Preserve Accuracy? What Do the Experiments Reveal? How Does REFRAG Compress and Shorten Context? REFRAG introduces a lightweight encoder that divides retrieved passages into fixed-size chunks, such...







