One Model Is Enough: Native Retrieval Embeddings from LLM Agent Hidden States
Organizations: Temple University
Abstract
LLM agents that retrieve external knowledge typically generate a search query as text, then run a separate embedding model to encode it into a vector. This two-model pipeline adds infrastructure complexity and latency, yet is redundant: the LLM already encodes the full conversational context in its hidden states. We propose equipping LLM agents with native retrieval capability by adding a lightweight projection head that maps hidden states directly into the embedding space, eliminating the need for a separate embedding model. Trained with a combination of alignment, contrastive, and rank distillation losses, our method retains 97% of baseline retrieval quality while enabling the LLM agent to search with its own representations. Experiments on the QReCC conversational search benchmark show competitive Recall@10 and MRR@10 compared to the standard generate-then-encode pipeline, with systematic ablations confirming the contribution of each loss component.
Figures & tables
| Recall | MRR | nDCG | Latency | |
|---|---|---|---|---|
| @10 | @10 | @10 | (p50) | |
| Baseline | 0.637 | 0.329 | 0.402 | 43.5ms |
| Ours | 0.607 | 0.293 | 0.367 | 2.0ms |
| –3.0% | –3.6% | –3.5% | 21.8 | |
| 95% CI | [–4.7, –1.4] | [–4.7, –2.4] | [–4.5, –2.4] | — |
| Configuration | / / | R@10 | MRR |
|---|---|---|---|
| Align only | 1.0 / 0.0 / 0.0 | 0.567 | 0.273 |
| Contrastive only | 0.0 / 1.0 / 0.0 | 0.498 | 0.231 |
| Rank distill only | 0.0 / 0.0 / 1.0 | 0.001 | 0.000 |
| Align + Contra | 0.5 / 0.5 / 0.0 | 0.582 | 0.281 |
| Align + Rank | 0.5 / 0.0 / 0.5 | 0.579 | 0.272 |
| All three | 0.5 / 0.5 / 0.5 | 0.595 | 0.288 |
| Epochs / LR | R@10 | MRR | Status |
|---|---|---|---|
| 30 / | 0.595 | 0.288 | converged |
| 50 / | 0.552 | 0.261 | converged |
| 80 / | 0.607 | 0.293 | converged |
| 30 / | 0.001 | 0.000 | collapsed |
| Config | / | R@10 | MRR | |
|---|---|---|---|---|
| Align-heavy | 1.0 / 0.5 | 128 | 0.591 | 0.280 |
| RD-heavy | 0.5 / 1.0 | 128 | 0.516 | 0.236 |
| Top-256 | 0.5 / 0.5 | 256 | 0.584 | 0.284 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Group | Experiment | R@10 | R@10 | 95% CI | MRR | MRR | 95% CI |
|---|---|---|---|---|---|---|---|
| C | recipe_e80_lr2e4 | 0.607 | –0.030 | [–0.047, –0.014] | 0.293 | –0.036 | [–0.047, –0.024] |
| A | All three losses | 0.595 | –0.042 | [–0.058, –0.025] | 0.288 | –0.040 | [–0.052, –0.029] |
| B | Align-heavy RD | 0.591 | –0.046 | [–0.063, –0.029] | 0.280 | –0.049 | [–0.060, –0.037] |
| B | RD top-256 | 0.584 | –0.053 | [–0.070, –0.037] | 0.284 | –0.045 | [–0.057, –0.033] |
| A | Align + Contra | 0.582 | –0.055 | [–0.072, –0.038] | 0.281 | –0.047 | [–0.059, –0.036] |
| A | Align + Rank | 0.579 | –0.058 | [–0.075, –0.041] | 0.272 | –0.057 | [–0.069, –0.045] |
Agentic Retrieval
Agentic retrieval lets AI agents iteratively search, inspect, and verify evidence to answer complex information needs.
See all 93 papersLatent Abstraction for Retrieval-Augmented Generation
[PRED] token and uses them to match against encoded document representations from the same model. Furthermore, LAnR adaptively decides when sufficient evidence has been retrieved using a lightweight MLP control head over those same hidden states, eliminating both the separate retriever and explicit token-level stopping reasoning. This design is motivated by our empirical observation that answer token entropy reliably signals retrieval sufficiency. Extensive experiments on six QA benchmarks spanning single-hop and multi-hop settings demonstrate that LAnR outperforms existing RAG methods, while achieving improved inference efficiency through reduced number of retrieval calls and tighter model integration.