Abstract

In retrieval-augmented generation (RAG) pipelines for large language models (LLMs), documents are often selected by relevance alone. Near-duplicate documents are then frequently returned, the limited context budget is wasted, and complementary aspects of a prompt are left uncovered. Less relevant documents can be introduced when diversity is increased, and the preferred balance varies across queries and users. This disclosure describes a technique in which document subset selection is framed as a contextual bandit problem. The utility of a subset is modeled as a known relevance component plus an unknown, query-dependent diversity gain. The diversity gain is computed after document embeddings are mapped by a latent, user-specific transformation into a query-specific semantic space. The transformation parameters are learned online from numerical user feedback through an upper-confidence-bound procedure. The diversity-relevance trade-off is thereby adapted to each user, with sublinear regret and polynomial-time computation.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.

Share

COinS