ACL 2025long0 citations

Direct Prompt Optimization with Continuous Representations

Yangkun Wang, Zihan Wang, Jingbo Shang

Abstract

Prompt optimization for language models faces challenges due to the large discrete search space, the reliance on continuous gradient updates, and the need to round continuous representations into discrete prompts, which causes inflexibility and instability. Existing methods attempt to address these by constraining the search space and adopting greedy, incremental improvements, but they often fail to fully leverage historical gradient information. In this paper, we model the prompt optimization problem by the probability distribution of the prompt and present a novel approach that integrates greedy strategies into optimization with continuous representations. This approach can exploit historical gradient information to address the instability caused by rounding in existing methods. Our study indicates that using continuous representations can improve prompt optimization performance on both text classification and attack tasks, as well as models, including GPT-2, OPT, Vicuna, and LLaMA-2, and also be adaptable to models of different sizes.

BibTeX
@inproceedings{wang-etal-2025-direct,
    title = "Direct Prompt Optimization with Continuous Representations",
    author = "Wang, Yangkun  and
      Wang, Zihan  and
      Shang, Jingbo",
    editor = "Che, Wanxiang  and
      Nabende, Joyce  and
      Shutova, Ekaterina  and
      Pilehvar, Mohammad Taher",
    booktitle = "Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = jul,
    year = "2025",
    address = "Vienna, Austria",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.acl-long.133/",
    doi = "10.18653/v1/2025.acl-long.133",
    pages = "2642--2652",
    ISBN = "979-8-89176-251-0"
}