PAK-UCB Contextual Bandit: An Online Learning Approach to Prompt-Aware Selection of Generative Models and LLMs
Xiaoyan Hu, Ho-fung Leung, Farzan Farnia
Abstract
Selecting a sample generation scheme from multiple prompt-based generative models, including large language models (LLMs) and prompt-guided image and video generation models, is typically addressed by choosing the model that maximizes an averaged evaluation score. However, this score-based selection overlooks the possibility that different models achieve the best generation performance for different types of text prompts. An online identification of the best generation model for various input prompts can reduce the costs associated with querying sub-optimal models. In this work, we explore the possibility of varying rankings of text-based generative models for different text prompts and propose an online learning framework to predict the best data generation model for a given input prompt. The proposed PAK-UCB algorithm addresses a contextual bandit (CB) setting with shared context variables across the arms, utilizing the generated data to update kernel-based functions that predict the score of each model available for unseen text prompts. Additionally, we leverage random Fourier features (RFF) to accelerate the online learning process of PAK-UCB. Our numerical experiments on real and simulated text-to-image and image-to-text generative models show that RFF-UCB performs successfully in identifying the best generation model across different sample types. The code is available at: github.com/yannxiaoyanhu/dgm-online-select.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers8
- SPARKE: Scalable Prompt-Aware Diversity and Novelty Guidance in Diffusion Models via RKE ScoreMohammad Jalali, Haoyu Lei, Amin Gohari, Farzan FarniaNeurIPS 2025 · 15 citations
- When Kernels Multiply, Clusters Unify: Fusing Embeddings with the Kronecker ProductYouqi Wu, Jingwei Zhang, Farzan FarniaNeurIPS 2025 · 7 citations
- DAK-UCB: Diversity-Aware Prompt Routing for LLMs and Generative ModelsDonya Jafari, Farzan FarniaICLR 2026 · 5 citations
- MMD Guidance: Training-Free Distribution Adaptation for Diffusion Models via Maximum Mean Discrepancy GuidanceMatina Mahdizadeh Sani, Nima Jamali, Mohammad Jalali, Farzan FarniaICML 2026 · 4 citations
- KODA: Contrastive Representation Comparison and Alignment for Vision-Language Foundation ModelsYouqi WU, Mohammad Jalali, Farzan FarniaICML 2026 · 2 citations
Builds on18
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- SDXL: Improving Latent Diffusion Models for High-Resolution Image SynthesisDustin Podell, Zion English, Kyle Lacey, Andreas Blattmann et al.ICLR 2024 · 4,569 citations
- ImageReward: Learning and Evaluating Human Preferences for Text-to-Image GenerationJiazheng Xu, Xiao Liu, Yuchen Wu, Yuxuan Tong et al.NeurIPS 2023 · 1,310 citations
- Pick-a-Pic: An Open Dataset of User Preferences for Text-to-Image GenerationYuval Kirstain, Adam Polyak, Uriel Singer, Shahbuland Matiana et al.NeurIPS 2023 · 1,192 citations
Related papers
- Be More Diverse than the Most Diverse: Optimal Mixtures of Generative Models via Mixture-UCB Bandit AlgorithmsParham Rezaei, Farzan Farnia, Cheuk Ting LiICLR 2025
- Online Multi-LLM Selection via Contextual Bandits Under Unstructured Context EvolutionManhin Poon, Xiangxiang Dai, Xutong Liu, Fang Kong et al.AAAI 2026 · 11 citations
- Efficient Multi-objective Prompt Optimization via Pure-exploration BanditsDonghao Li, Chengshuai Shi, Weijuan Ou, Cong Shen et al.ICLR 2026 · 2 citations
- BanditSpec: Adaptive Speculative Decoding via Bandit AlgorithmsYunlong Hou, Fengzhuo Zhang, Cunxiao Du, Xuan Zhang et al.ICML 2025
- Efficient Prompt Optimization Through the Lens of Best Arm IdentificationChengshuai Shi, Kun Yang, Zihan Chen, Jundong Li et al.NeurIPS 2024 · 44 citations
