TL;DR
The GRC (Generation, Retrieval, and Compression) framework unifies three critical LLM capabilities—reasoning-driven text generation, text embedding, and context compression—into a single model using a uniform causal attention mask. By introducing non-intrusive "meta latent tokens" that act like architectural registers, GRC achieves $O(1)$ constant-sized KV cache storage for long documents and delivers up to a $10\times$ inference speedup via a novel Hybrid Paged Attention engine.
What Problem Does This Paper Address?
Modern Large Language Model (LLM) applications, such as Retrieval-Augmented Generation (RAG) and autonomous agents, rely on three distinct capabilities:
- Generation: Producing text or reasoning chains.
- Retrieval: Embedding queries and documents into vector spaces.
- Compression: Condensing long histories or documents to save memory.
Currently, these tasks are handled by fragmented pipelines using separate models or modules. This separation introduces massive training costs, deployment complexity, and computational inefficiencies, as internal representations cannot be shared or reused across stages. While some recent architectures attempt to unify generation and embedding, they still rely on heterogeneous attention mechanisms (e.g., bidirectional attention for embeddings and causal attention for generation), and they completely neglect context compression.
Methods
The authors propose GRC, a unified training and inference framework that handles all three tasks in a single forward pass using a standard causal attention mask.
Meta Latent Tokens
At the core of GRC are trainable meta latent tokens ($\{r_i\}$). Unlike prior prompt-gisting methods, these tokens are non-intrusive—they are not added to the model's vocabulary. Instead, they act like hidden registers that sit between text segments to capture and store compressed semantic information.
GRC Training Framework
As illustrated in the training architecture, a single sequence is divided into three segments:
- Segment ❶ (Generation): The input instruction/query and the model's reasoning-enhanced response.
- Segment ❷ (Meta Latent Tokens): The register tokens that absorb context.
- Segment ❸ (Recovery): A reconstruction prompt and the target context to be recovered.
During training, a joint loss function optimizes three objectives simultaneously: $$\mathcal{L} = \alpha \mathcal{L}_{Gen} + \beta \mathcal{L}_{Recons} + \gamma \mathcal{L}_{Rep}$$
- $\mathcal{L}_{Gen}$ (Cross-Entropy): Trains the model to generate next tokens and reasoning steps.
- $\mathcal{L}_{Recons}$ (Reconstruction Loss): Forces the meta latent tokens to compress Segment ❶ by requiring Segment ❸ to reconstruct the original context only by attending to the meta tokens.
- $\mathcal{L}_{Rep}$ (Contrastive InfoNCE Loss): Pools the hidden states of the meta latent tokens through an adapter layer to create high-quality text embeddings.
Hybrid Paged Attention (HPA)
To make deployment practical, the authors developed Hybrid Paged Attention (HPA). This inference engine extends standard paged attention to concurrently manage regular prefix/dynamic KV caches alongside the fixed-size compressed KV caches generated by the meta latent tokens.
Datasets
The model was trained and evaluated on a diverse suite of benchmarks:
- Training Data: General reasoning traces (GeneralThought and 0.9M DeepSeek-R1 traces), mathematical datasets (OpenMathReasoning), retrieval data (ReasonEmbed), and agentic data (DR-Tulu-SFT, ADP Dataset V1).
- Retrieval Evaluation: The BRIGHT benchmark, which focuses on heavy, reasoning-intensive retrieval tasks.
- Generation Evaluation: GSM8K (math) and BBH (general reasoning).
- Compression Evaluation: The PwC dataset and a newly curated dataset of Wikipedia markdown documents spanning early 2026.
Key Insights and Ideas
- Causal Attention is All You Need for Embeddings: GRC proves that you do not need bidirectional attention masks to generate competitive text embeddings. Routing information through causal meta-tokens preserves representation quality.
- Reasoning Boosts Retrieval: Querying the model to "think step-by-step" before extracting the embedding significantly improves retrieval performance on complex tasks. However, this effect plateaus; overthinking beyond a certain token length yields diminishing returns.
- True $O(1)$ Document Caching: Instead of storing an $O(N)$ KV cache that grows linearly with document length, GRC compresses documents into a fixed number of latent token states. This turns document caching into a constant-space operation.
Key Results
Memory and Storage Efficiency
GRC reduces document KV cache storage requirements to a constant size. For an 8K token document, GRC's cache is $64\times$ smaller than traditional models like GritLM, requiring a constant 14.0 MB compared to GritLM's 896 MB.
Retrieval Performance
On the reasoning-intensive BRIGHT benchmark, the small GRC-1.7B model achieved an average nDCG@10 of 25.7, outperforming the much larger, specialized ReasonIR-8B model (24.4). The GRC-4B variant pushed this further to 27.2.
Inference Speedups
When paired with the proposed Hybrid Paged Attention (HPA) engine, GRC achieves up to a $10\times$ speedup in inference latency compared to a naive Hugging Face implementation on an NVIDIA A100 GPU, making multi-task forward passes highly viable for production.
Limitations and Future Work
The authors point out a subtle architectural conflict in the current implementation: the final hidden states of the meta latent tokens are simultaneously used for two competing objectives—mean pooling to generate text embeddings, and predicting the subsequent token (typically a BOS token). This dual-role can introduce optimization instability. Future work will explore better ways to decouple these representation spaces without sacrificing the single-forward-pass efficiency.
Summary updated