Q-Probe: A Lightweight Approach to Reward Maximization for Language Models

Kenneth Li, Samy Jelassi, Hugh Zhang, Sham Kakade, Martin Wattenberg +1 more
2/22/2024
cs.LG

Official code: likenneth/q_probe (40 stars, Apache-2.0, last commit 2024-06-10).

Abstract

We present an approach called Q-probing to adapt a pre-trained language model to maximize a task-specific reward function. At a high level, Q-probing sits between heavier approaches such as finetuning and lighter approaches such as few shot prompting, but can also be combined with either. The idea is to learn a simple linear function on a model's embedding space that can be used to reweight candidate completions. We theoretically show that this sampling procedure is equivalent to a KL-constrained maximization of the Q-probe as the number of samples increases. To train the Q-probes we consider either reward modeling or a class of novel direct policy learning objectives based on importance weighted policy gradients. With this technique, we see gains in domains with ground-truth rewards (code generation) as well as implicit rewards defined by preference data, even outperforming finetuning in data-limited regimes. Moreover, a Q-probe can be trained on top of an API since it only assumes access to sampling and embeddings. Code: https://github.com/likenneth/q_probe .

View on arXivView PDF

Code Implementations(1)

likenneth/q_probeOfficial100%
Apache-2.0

Q-Probe: A Lightweight Approach to Reward Maximization for Language Models

401Shell, PythonFeb 20, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{li2024qprobe,
  title  = {Q-Probe: A Lightweight Approach to Reward Maximization for Language Models},
  author = {Kenneth Li and Samy Jelassi and Hugh Zhang and Sham Kakade and Martin Wattenberg and David Brandfonbrener},
  year   = {2024},
  eprint = {2402.14688},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.14688v2},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.14688.svg)](https://codeofpaper.com/paper/2402.14688)

Discussion