DAK-UCB: Diversity-Aware Prompt Routing for LLMs and Generative Models
Donya Jafari, Farzan Farnia · 2026
Read DAK-UCB: Diversity-Aware Prompt Routing for LLMs and Generative Models by Donya Jafari, Farzan Farnia (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-23140.txt.
Introduction
Jafari and Farnia present DAK-UCB, a routing method that picks generative models for each prompt. Most routers chase fidelity scores alone and ignore output diversity. Their contextual bandit method scores both traits. Diversity is measured with prompt-aware scores built from past prompt-output pairs. Kernel distance and kernel entropy supply the joint measures. The router learns online as prompts arrive in sequence. Tests show more diverse model choice with fidelity kept high. Code is released in public.
Catalog record
| CREATOR | Donya Jafari, Farzan Farnia |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 80996 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.23140
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
DAK-UCB: Diversity-Aware Prompt Routing for LLMs and Generative Models Donya Jafari, Farzan Farnia Abstract The expansion of generative AI and LLM services underscores the growing need for adaptive mechanisms to select an appropriate available model to respond to a user’s prompts. Recent works have proposed offline and online learning formulations to identify the optimal generative AI model for an input prompt, based solely on maximizing prompt-based fidelity evaluation scores, e.g., CLIP-Score in text-to-image generation. However, such fidelity-based selection methods overlook the diversity of generated outputs, and hence, they can fail to address potential diversity shortcomings in the generated responses. In this paper, we introduce the Diversity-Aware Kernelized Upper Confidence Bound (DAK-UCB) method as a contextual bandit algorithm for the online selection of generative models with diversity considerations. The proposed DAK-UCB method incorporates both fidelity and diversity-related metrics into the selection process. We design this framework based on prompt-aware diversity score functions that decompose to a two-sample-based expectation over prompt-output pairs in the previous generation rounds. Specifically, we illustrate the application of our framework using joint kernel distance and kernel entropy measures. Our experimental results demonstrate the effectiveness of DAK-UCB in promoting diversity-aware model selection while maintaining fidelity in the generations for a sequence of prompts. The code is available at https://github.com/Donya-Jafari/DAK-UCB . 1 Introduction The past few years have witnessed a rapid surge in generative AI services capable of addressing a wide array of tasks, ranging from large language models (LLMs) answering arbitrary questions to text-to-image and video models generating visual content guided by user prompts. Given the growing number of available generative models, a key challenge is how to effectively select suitable generative models for a sequence of user-provided prompts. A conventional approach is to compute an overall evaluation score for each candidate generative AI model and subsequently select the model with the highest aggregate score to address all future prompts. However, this approach implicitly assumes that a single model consistently outperforms the other models across all possible prompts. This assumption has been demonstrated to be untrue in realistic scenarios where different models may excel on different topics or prompt categories ( 22 ; 18 ) . To address this limitation, recent literature has introduced prompt-aware model selection mechanisms. These methods include offline learning algorithms ( 44 ; 9 ; 18 ) , which train a selector model using a batch of pre-collected responses of models to prompts as training data. Also, 22 propose the online learning PAK-UCB method, formulating the selection task as a contextual multi-armed bandit problem to utilize the user’s observed model performances in the previous rounds. Figure 1: Comparison of baseline Kernelized-UCB model selection (CLIP-Score fidelity metric) ( 22 ) vs. our proposed diversity-aware DAK-UCB over T=500 rounds. While the baseline Kernelized-UCB does not favor model G_{2} with higher diversity over model G_{1} , DAK-UCB selected the more diverse G_{2} more frequently. Despite the development of several model selection approaches, the existing methods focus only on the fidelity scores in data generation, while overlooking the diversity of generated samples. For example, in text-to-image generation tasks, existing frameworks evaluate models based on the alignment of the input prompt and generated image, without considering diversity in the image outputs. Such a diversity-unaware selection can lead to output samples that, although individually aligned well with prompts, collectively lack diversity. In addition, overlooking the diversity of output data can potentially lead to a restricted representation of sensitive attributes, such as gender or ethnicity, in generated datasets. Figure 1 displays an example, where the diversity-unaware baseline kernelized UCB selection algorithm in ( 22 ) chooses the less and more diverse generative models (conditioned to ”young male” and none) with similar frequencies, ignoring the diversity factor in the selection process. This limitation arises because PAK-UCB, and standard contextual bandit methods more broadly, compute rewards using the mean of sample-level scores. Diversity, however, is a group-level property determined by the relative positioning of multiple samples, which cannot be expressed through a simple average of individual rewards. These limitations highlight the importance of diversity-aware selection methods, which explicitly incorporate considerations of output diversity into the model selection process. In this work, we specifically focus on the online selection task, proposing an algorithm designed to leverage previously generated data to select generative models that achieve an optimal balance between fidelity and diversity. Our proposed method, which we call Diversity-Aware Kernelized Upper Confidence Bound (DAK-UCB) , extends the kernelized UCB framework ( 56 ; 22 ) by integrating a diversity-oriented term, in the form of the expectation of a two-sample (prompt,output) random variable, into the contextual bandit objective. A key challenge in designing DAK-UCB is to determine which diversity scores are compatible with the contextual bandit selection framework. Specifically, we identify a family of joint kernel scores—including prompt-conditional extensions of kernel distance ( 6 ) , RKE ( 25 ) , and MMD ( 20 ) —that can be expressed as expectations of two-sample quadratic forms over prompts and outputs. This structure is central to DAK-UCB: it enables fast-converging estimation from streaming data via kernel ridge regression, yielding principled confidence bounds in the UCB process. Moreover, by combining joint kernel scores with task-specific fidelity metrics (e.g., CLIPScore in text-to-image generation), DAK-UCB can be extended to provide a unified approach to prompt-adaptive selection that balances the fidelity and diversity factors. Figure 1 shows an application of DAK-UCB for a diversity-ware generative model selection in response to T=500 prompts of MS-COCO dataset ( 34 ) on generating human-related scenes. The candidate model G_{1} represents the Stable Diffusion XL (SD-XL) ( 53 ) model conditioned to ”young male individual”, whereas candidate model G_{2} outputs the SD-XL outputs without any conditioning. While the baseline kernelized UCB fidelity-based selection did not favor the more diverse model G_{2} , generating samples from both models with equal probabilities, the DAK-UCB model selection with the joint RKE diversity score chose model G_{1} more often over the 500 online selection iterations. Beyond deterministic prompt-to-model assignment at every iteration of DAK-UCB, DAK-UCB can be adapted to assign the model to an input prompt based on a non-degenerate mixture of the models. As noted by 46 in the unconditional setting, the optimal diversity-aware selection strategy can itself be a non-degenerate mixture of models. Extending this insight to the conditional, prompt-aware setting, a mixture-based selector effectively rolls a biased m -sided die to determine which of the m models is queried for a given prompt. We introduce the Mixture-DAK-UCB method to realize this idea: an online algorithm that optimizes prompt-dependent mixture probabilities. Mixture-DAK-UCB generalizes the prompt-free Mixture-UCB framework of 46 to the conditional case, enabling diversity-enhancing mixtures tailored to incoming prompts and yielding further improvements in diversity metrics. We empirically evaluate different variants of the proposed DAK-UCB and Mixture-DAK-UCB algorithms on text-to-image and language model generation tasks. Our results demonstrate improvements in diversity and overall correctness metrics relative to existing contextual bandit algorithms, such as Kernelized UCB, PAK-UCB, and randomized selection strategies. We also validated the defined Joint-RKE and Joint-KD measures for capturing diversity and distributional matching characteristics of prompt-guided generative models. Here we summarize the work’s main contributions: • Studying the role of diversity in prompt-aware selection of generative AI models, • Introducing the Diversity-Aware Kernelized