HYDRA: Model Factorization Framework for Black-Box LLM Personalization

📄 arXiv: 2406.02888v3 📥 PDF

作者: Yuchen Zhuang, Haotian Sun, Yue Yu, Rushi Qiang, Qifan Wang, Chao Zhang, Bo Dai

分类: cs.CL, cs.AI, cs.LG

发布日期: 2024-06-05 (更新: 2024-10-25)

备注: Accepted in NeurIPS'24

🔗 代码/项目: GITHUB


💡 一句话要点

HYDRA:一种用于黑盒LLM个性化的模型分解框架

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 个性化 大型语言模型 模型分解 黑盒模型 用户行为建模

📋 核心要点

  1. 现有黑盒LLM个性化方法依赖提示工程,难以泛化用户间的共享知识,导致个性化效果不佳。
  2. HYDRA框架通过模型分解,分离用户特定行为模式和用户间共享知识,实现更有效的个性化。
  3. 实验表明,HYDRA在多个个性化任务上显著优于现有基于提示的方法,平均相对提升9.01%。

📝 摘要(中文)

个性化已成为现代智能系统中的一个关键研究领域,它侧重于挖掘用户的行为历史并适应他们的偏好,以提供定制化的体验。尽管黑盒大型语言模型(LLM)展现出了卓越的少样本能力,但其模型参数的固有不透明性给使生成输出与个人期望对齐带来了重大挑战。现有的解决方案主要集中于提示设计,以结合用户特定的配置文件和行为;然而,由于无法捕获所有用户之间的共享知识,这些方法通常难以有效地泛化。为了应对这些挑战,我们提出了HYDRA,一种模型分解框架,它捕获来自历史数据的用户特定行为模式以及所有用户之间的共享通用知识,以提供个性化生成。为了捕获用户特定的行为模式,我们首先训练一个重排序器,以优先考虑从检索到的相关历史记录中最有用的信息。通过将优先排序的历史记录与相应的查询相结合,我们训练一个适配器,使输出与个人用户特定的偏好对齐,从而消除了对黑盒LLM固有模型参数的依赖。重排序器和适配器都可以分解为具有多个用户特定头的基本模型,类似于九头蛇。基本模型维护用户之间的共享知识,而多个个人头捕获用户特定的偏好。实验结果表明,在LaMP基准测试中的五个不同的个性化任务中,HYDRA的性能优于现有的最先进的基于提示的方法,平均相对提高了9.01%。我们的实现可在https://github.com/night-chen/HYDRA获得。

🔬 方法详解

问题定义:论文旨在解决黑盒大型语言模型(LLM)的个性化问题。现有方法主要依赖于提示工程,将用户特定的信息融入到提示中,但这种方法无法有效地捕捉用户之间的共享知识,导致个性化效果不佳,难以泛化到新的用户或场景。此外,由于黑盒LLM的参数不可访问,直接修改模型参数以适应用户偏好是不可行的。

核心思路:HYDRA的核心思路是将模型分解为两部分:一个共享的基础模型和一个或多个用户特定的头部。基础模型负责捕捉用户之间的共享知识,而用户特定的头部则负责捕捉用户的个性化偏好。通过这种方式,HYDRA可以同时利用共享知识和个性化信息,从而实现更有效的个性化。这种分解类似于神话中的九头蛇,因此得名HYDRA。

技术框架:HYDRA框架包含两个主要模块:重排序器(Reranker)和适配器(Adapter)。首先,对于给定的查询,从用户的历史记录中检索相关的信息。然后,重排序器对检索到的历史记录进行排序,选择最相关的部分。接下来,适配器将排序后的历史记录与查询结合,生成个性化的输出。重排序器和适配器都由一个共享的基础模型和多个用户特定的头部组成。

关键创新:HYDRA的关键创新在于其模型分解框架,它将模型分解为共享的基础模型和用户特定的头部。这种分解方式使得HYDRA可以同时利用共享知识和个性化信息,从而实现更有效的个性化。此外,HYDRA不需要访问黑盒LLM的参数,因此可以应用于各种不同的LLM。

关键设计:重排序器和适配器都使用Transformer架构。基础模型是一个预训练的Transformer模型,例如BERT或RoBERTa。用户特定的头部是一个小的神经网络,它将基础模型的输出映射到用户特定的偏好。损失函数包括交叉熵损失和对比损失,用于训练重排序器和适配器。具体的参数设置和网络结构在论文中有详细描述。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,HYDRA在LaMP基准测试的五个不同的个性化任务中,显著优于现有的最先进的基于提示的方法,平均相对提高了9.01%。这表明HYDRA能够有效地捕捉用户特定的行为模式和用户之间的共享知识,从而实现更有效的个性化。具体任务包括个性化文本生成、个性化对话等。

🎯 应用场景

HYDRA框架可广泛应用于各种需要个性化服务的场景,例如个性化推荐、个性化搜索、个性化对话系统等。通过学习用户的历史行为和偏好,HYDRA可以为用户提供更加定制化的体验,提高用户满意度和参与度。该研究的成果有助于推动个性化智能系统的发展,并为未来的研究提供新的思路。

📄 摘要(原文)

Personalization has emerged as a critical research area in modern intelligent systems, focusing on mining users' behavioral history and adapting to their preferences for delivering tailored experiences. Despite the remarkable few-shot capabilities exhibited by black-box large language models (LLMs), the inherent opacity of their model parameters presents significant challenges in aligning the generated output with individual expectations. Existing solutions have primarily focused on prompt design to incorporate user-specific profiles and behaviors; however, such approaches often struggle to generalize effectively due to their inability to capture shared knowledge among all users. To address these challenges, we propose HYDRA, a model factorization framework that captures both user-specific behavior patterns from historical data and shared general knowledge among all users to deliver personalized generation. In order to capture user-specific behavior patterns, we first train a reranker to prioritize the most useful information from top-retrieved relevant historical records. By combining the prioritized history with the corresponding query, we train an adapter to align the output with individual user-specific preferences, eliminating the reliance on access to inherent model parameters of black-box LLMs. Both the reranker and the adapter can be decomposed into a base model with multiple user-specific heads, resembling a hydra. The base model maintains shared knowledge across users, while the multiple personal heads capture user-specific preferences. Experimental results demonstrate that HYDRA outperforms existing state-of-the-art prompt-based methods by an average relative improvement of 9.01% across five diverse personalization tasks in the LaMP benchmark. Our implementation is available at https://github.com/night-chen/HYDRA.