Composing Policy Gradients and Prompt Optimization for Language Model Programs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Ziems, Noah, Soylu, Dilara, Agrawal, Lakshya A, Miller, Isaac, Lai, Liheng, Qian, Chen, Song, Kaiqiang, Jiang, Meng, Klein, Dan, Zaharia, Matei, D'Oosterlinck, Karel, Potts, Christopher, Khattab, Omar
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910208375128064
author Ziems, Noah
Soylu, Dilara
Agrawal, Lakshya A
Miller, Isaac
Lai, Liheng
Qian, Chen
Song, Kaiqiang
Jiang, Meng
Klein, Dan
Zaharia, Matei
D'Oosterlinck, Karel
Potts, Christopher
Khattab, Omar
author_facet Ziems, Noah
Soylu, Dilara
Agrawal, Lakshya A
Miller, Isaac
Lai, Liheng
Qian, Chen
Song, Kaiqiang
Jiang, Meng
Klein, Dan
Zaharia, Matei
D'Oosterlinck, Karel
Potts, Christopher
Khattab, Omar
contents Group Relative Policy Optimization (GRPO) has proven to be an effective tool for post-training language models (LMs). However, AI systems are increasingly expressed as modular programs that mix together multiple LM calls with distinct prompt templates and other tools, and it is not clear how practitioners can best leverage online RL algorithms like GRPO to improve these systems. We begin to address this challenge by investigating whether it is possible to effectively instantiate GRPO for arbitrary multi-prompt programs and whether it can work robustly as an off-the-shelf optimizer for LM programs using the same abstractions and constraints typically involved for prompt optimization. Our main variant of multi-module GRPO constructs groups from module-level invocations, and we also consider trajectory-level grouping as another natural instantiation. We find for the first time that GRPO (and its multi-module counterpart) empirically composes well with automatic prompt optimization, and together they improve accuracy by 11% on average across classification, many-hop search, and privacy-preserving delegation tasks against the post-trained LM - with 5% gains against prompt optimization on its own. We open-source multi-module GRPO in the DSPy library at https://dspy.ai .
format Preprint
id arxiv_https___arxiv_org_abs_2508_04660
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Composing Policy Gradients and Prompt Optimization for Language Model Programs
Ziems, Noah
Soylu, Dilara
Agrawal, Lakshya A
Miller, Isaac
Lai, Liheng
Qian, Chen
Song, Kaiqiang
Jiang, Meng
Klein, Dan
Zaharia, Matei
D'Oosterlinck, Karel
Potts, Christopher
Khattab, Omar
Computation and Language
Group Relative Policy Optimization (GRPO) has proven to be an effective tool for post-training language models (LMs). However, AI systems are increasingly expressed as modular programs that mix together multiple LM calls with distinct prompt templates and other tools, and it is not clear how practitioners can best leverage online RL algorithms like GRPO to improve these systems. We begin to address this challenge by investigating whether it is possible to effectively instantiate GRPO for arbitrary multi-prompt programs and whether it can work robustly as an off-the-shelf optimizer for LM programs using the same abstractions and constraints typically involved for prompt optimization. Our main variant of multi-module GRPO constructs groups from module-level invocations, and we also consider trajectory-level grouping as another natural instantiation. We find for the first time that GRPO (and its multi-module counterpart) empirically composes well with automatic prompt optimization, and together they improve accuracy by 11% on average across classification, many-hop search, and privacy-preserving delegation tasks against the post-trained LM - with 5% gains against prompt optimization on its own. We open-source multi-module GRPO in the DSPy library at https://dspy.ai .
title Composing Policy Gradients and Prompt Optimization for Language Model Programs
topic Computation and Language
url https://arxiv.org/abs/2508.04660