Q-Adapter: Customizing Pre-trained LLMs to New Preferences with Forgetting Mitigation

要約

大量のコーパスで学習された大規模言語モデル(LLM)は、驚くべき能力を発揮している。しかし、LlamaのようなオープンソースのLLMは、そのほとんどが一般的な目的で学習されたものであるため、実世界の特定のシナリオに直接適用するには不十分かもしれません。このように、一般に公開されているLLMをカスタマイズする要求が出てくるが、現在のところ研究されていない。本研究では、事前に訓練されたLLMを新たな人間の嗜好に合わせてカスタマイズすることを検討する。具体的には、LLMは新しい嗜好を満たすだけでなく、カスタマイズ後も元の能力を維持する必要がある。人間の嗜好は報酬モデルとして表現できるという観察からヒントを得て、我々はLLMのカスタマイズを2つの報酬関数の和の最適化とすることを提案する。ここで問題となるのは、両方の報酬関数が未知であり、最新の強化学習法を適用できないことである。残差Q学習フレームワークのおかげで、報酬関数$r_1$を用いずに、事前に学習したLLMと{残差Q関数}を用いてカスタマイズしたLLMを復元することができる。さらに、一定の事前学習済みLLMに対して、報酬関数$r_2$は残差Q関数から導出できることがわかり、Bradley-Terryモデルに新しい人間の嗜好データから残差Q関数を直接学習できることがわかった。我々はこの手法をQ-Adapterと命名する。これは、事前学習されたLLMを新しい嗜好に合わせてカスタマイズするために、残差Q関数を近似するアダプタモジュールを導入するためである。Llama-3.1モデルを用いたDSPデータセットとHH-RLHFデータセットの実験により、Q-Adapterが既存の知識の保持と新しい嗜好の学習の両方に優れていることを示す。コードはhttps://github.com/mansicer/Q-Adapter。

要約(オリジナル)

Large Language Models (LLMs), trained on a large amount of corpus, have demonstrated remarkable abilities. However, it may not be sufficient to directly apply open-source LLMs like Llama to certain real-world scenarios, since most of them are trained for \emph{general} purposes. Thus, the demands for customizing publicly available LLMs emerge, but are currently under-studied. In this work, we consider customizing pre-trained LLMs with new human preferences. Specifically, the LLM should not only meet the new preference but also preserve its original capabilities after customization. Drawing inspiration from the observation that human preference can be expressed as a reward model, we propose to cast LLM customization as optimizing the sum of two reward functions, one of which (denoted as $r_1$) was used to pre-train the LLM while the other (denoted as $r_2$) characterizes the new human preference. The obstacle here is that both reward functions are unknown, making the application of modern reinforcement learning methods infeasible. Thanks to the residual Q-learning framework, we can restore the customized LLM with the pre-trained LLM and the \emph{residual Q-function} without the reward function $r_1$. Moreover, we find that for a fixed pre-trained LLM, the reward function $r_2$ can be derived from the residual Q-function, enabling us to directly learn the residual Q-function from the new human preference data upon the Bradley-Terry model. We name our method Q-Adapter as it introduces an adapter module to approximate the residual Q-function for customizing the pre-trained LLM towards the new preference. Experiments based on the Llama-3.1 model on the DSP dataset and HH-RLHF dataset illustrate the superior effectiveness of Q-Adapter on both retaining existing knowledge and learning new preferences. Code is available at https://github.com/mansicer/Q-Adapter.

arxiv情報

著者 Yi-Chen Li,Fuxiang Zhang,Wenjie Qiu,Lei Yuan,Chengxing Jia,Zongzhang Zhang,Yang Yu,Bo An
発行日 2025-03-03 08:48:38+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.LG パーマリンク