Dialogue for Prompting: a Policy-Gradient-Based Discrete Prompt Generation for Few-shot Learning

Chengzhengxu Li, Xiaoming Liu, Yichen Wang, Duyi Li, Yu Lan +1 more
8/14/2023
cs.LGcs.CL

Official code: czx-li/DP2O (17 stars, MIT, last commit 2024-03-28).

Abstract

Prompt-based pre-trained language models (PLMs) paradigm have succeeded substantially in few-shot natural language processing (NLP) tasks. However, prior discrete prompt optimization methods require expert knowledge to design the base prompt set and identify high-quality prompts, which is costly, inefficient, and subjective. Meanwhile, existing continuous prompt optimization methods improve the performance by learning the ideal prompts through the gradient information of PLMs, whose high computational cost, and low readability and generalizability are often concerning. To address the research gap, we propose a Dialogue-comprised Policy-gradient-based Discrete Prompt Optimization ($DP_2O$) method. We first design a multi-round dialogue alignment strategy for readability prompt set generation based on GPT-4. Furthermore, we propose an efficient prompt screening metric to identify high-quality prompts with linear complexity. Finally, we construct a reinforcement learning (RL) framework based on policy gradients to match the prompts to inputs optimally. By training a policy network with only 0.67% of the PLM parameter size on the tasks in the few-shot setting, $DP_2O$ outperforms the state-of-the-art (SOTA) method by 1.52% in accuracy on average on four open-source datasets. Moreover, subsequent experiments also demonstrate that $DP_2O$ has good universality, robustness, and generalization ability.

View on arXivView PDF

Code Implementations(1)

czx-li/DP2OOfficial100%
MIT

Accompanying repo for the DP2O paper accepted by AAAI 2024 main conference

170PythonJan 11, 20242 years agoMIT

Similar Papers

Cite this paper

@article{li2023dialogue,
  title  = {Dialogue for Prompting: a Policy-Gradient-Based Discrete Prompt Generation for Few-shot Learning},
  author = {Chengzhengxu Li and Xiaoming Liu and Yichen Wang and Duyi Li and Yu Lan and Chao Shen},
  year   = {2023},
  eprint = {2308.07272},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.07272v2}
}

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/2308.07272.svg)](https://codeofpaper.com/paper/2308.07272)

Discussion