OpticalRAG: Pixel-Space Compression for Token-Efficient Retrieval-Augmented Generation

Senhao Liu, Yuheng Zhang, Chunyu Wei, Yueguo Chen, Xinran Zhang
11/10/2026
cs.CL
rag

Official code: brighterr/OpticalRAG (0 stars, Python, last commit 2026-11-10).

Abstract

Retrieval-augmented generation (RAG) is bottlenecked by the token budget of large language models: feeding long documents into the context window is expensive, while aggressive textual compression discards fine-grained information that is irreversibly lost in a one-dimensional token sequence. We argue that this bottleneck is not fundamental to information density but to the choice of compression \emph{modality}.

Show full abstract

Modern visual encoders can pack the contents of a rendered text page into roughly a hundred visual tokens with little semantic loss, opening a new compression-fidelity tradeoff that purely textual methods cannot reach. We present \textbf{OpticalRAG}, a framework that renders documents as page images, encodes them with a frozen vision encoder, and distills the retrieved visual tokens into as few as $16$ injected tokens before passing them to the LLM. Two ingredients make this work without expensive cross-modal training: (i) \emph{Encoder-Bridged Retrieval}, which projects text-query states into the visual feature space of the frozen encoder, through a projection shared with the compressor, to retrieve visual tokens from a text query, with no contrastive training; and (ii) \emph{Query-Driven Distillation}, a lightweight cross-attention compressor that condenses the retrieved visual tokens into a small set of query-conditioned prefix tokens. On LongBench-v2, BAMBOO, and LooGLE-v2, OpticalRAG achieves the best compression-aware accuracy (CAP) on all three benchmarks while injecting only $16$ tokens, and improves the closed-book Qwen2.5-7B-Instruct backbone by $5.17$ points on LongBench-v2.Code is available at https://github.com/brighterr/OpticalRAG.

View on arXivView PDF

Code Implementations(1)

OpticalRAG: Pixel-Space Compression for Token-Efficient Retrieval-Augmented Generation

00PythonOct 21, 20263 weeks ago

Similar Papers

Cite this paper

@article{liu2026opticalrag,
  title  = {OpticalRAG: Pixel-Space Compression for Token-Efficient Retrieval-Augmented Generation},
  author = {Senhao Liu and Yuheng Zhang and Chunyu Wei and Yueguo Chen and Xinran Zhang},
  year   = {2026},
  eprint = {2611.13675},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.13675v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.13675.svg)](https://codeofpaper.com/paper/2611.13675)

Discussion