English

OneGen: Efficient One-Pass Unified Generation and Retrieval for LLMs

Computation and Language 2024-10-03 v2 Artificial Intelligence Databases Information Retrieval Machine Learning

Abstract

Despite the recent advancements in Large Language Models (LLMs), which have significantly enhanced the generative capabilities for various NLP tasks, LLMs still face limitations in directly handling retrieval tasks. However, many practical applications demand the seamless integration of both retrieval and generation. This paper introduces a novel and efficient One-pass Generation and retrieval framework (OneGen), designed to improve LLMs' performance on tasks that require both generation and retrieval. The proposed framework bridges the traditionally separate training approaches for generation and retrieval by incorporating retrieval tokens generated autoregressively. This enables a single LLM to handle both tasks simultaneously in a unified forward pass. We conduct experiments on two distinct types of composite tasks, RAG and Entity Linking, to validate the pluggability, effectiveness, and efficiency of OneGen in training and inference. Furthermore, our results show that integrating generation and retrieval within the same context preserves the generative capabilities of LLMs while improving retrieval performance. To the best of our knowledge, OneGen is the first to enable LLMs to conduct vector retrieval during the generation.

Keywords

Cite

@article{arxiv.2409.05152,
  title  = {OneGen: Efficient One-Pass Unified Generation and Retrieval for LLMs},
  author = {Jintian Zhang and Cheng Peng and Mengshu Sun and Xiang Chen and Lei Liang and Zhiqiang Zhang and Jun Zhou and Huajun Chen and Ningyu Zhang},
  journal= {arXiv preprint arXiv:2409.05152},
  year   = {2024}
}

Comments

EMNLP 2024 Findings; code is available at https://github.com/zjunlp/OneGen

R2 v1 2026-06-28T18:37:49.231Z