{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/q-probe-a-lightweight-approach-to-reward","title":"Q-Probe: A Lightweight Approach to Reward Maximization for Language Models","arxiv_id":"2402.14688","date":"2024-02-22","proceeding":null,"authors":["Kenneth Li","Samy Jelassi","Hugh Zhang","Sham Kakade","Martin Wattenberg","David Brandfonbrener"],"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 .","url_abs":"https://arxiv.org/abs/2402.14688v2","url_pdf":"https://arxiv.org/pdf/2402.14688v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"q-probe-a-lightweight-approach-to-reward","repo_url":"https://github.com/likenneth/q_probe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.14688","atlas_url":"https://app.syntology.ai/?focus=2402.14688","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.14688"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/likenneth/q_probe","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":3,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"c8740af760ce1a05","entry":"binomial_confidence_interval","repo":"likenneth/q_probe","repo_kind":"official","path":"preference_exp/utils.py","file_url":"https://github.com/likenneth/q_probe/blob/HEAD/preference_exp/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c8740af760ce1a05"}},{"code_sha256_prefix":"3962aa4c294057b5","entry":"sample_list_to_dict","repo":"likenneth/q_probe","repo_kind":"official","path":"code_exp/q_probe/sweep_utils.py","file_url":"https://github.com/likenneth/q_probe/blob/HEAD/code_exp/q_probe/sweep_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3962aa4c294057b5"}},{"code_sha256_prefix":"3d41c270b36fcb1f","entry":"shortcut_eval_probe","repo":"likenneth/q_probe","repo_kind":"official","path":"code_exp/q_probe/sweep_utils.py","file_url":"https://github.com/likenneth/q_probe/blob/HEAD/code_exp/q_probe/sweep_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3d41c270b36fcb1f"}},{"code_sha256_prefix":"e7ce4c19888c6df6","entry":"get_remote_file","repo":"likenneth/q_probe","repo_kind":"official","path":"preference_exp/utils.py","file_url":"https://github.com/likenneth/q_probe/blob/HEAD/preference_exp/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e7ce4c19888c6df6"}},{"code_sha256_prefix":"e5b14d12b64c08c2","entry":"slice_and_move_batch_for_device","repo":"likenneth/q_probe","repo_kind":"official","path":"preference_exp/utils.py","file_url":"https://github.com/likenneth/q_probe/blob/HEAD/preference_exp/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e5b14d12b64c08c2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}