ACL 2024findings20 citations

Automatic Engineering of Long Prompts

Cho-Jui Hsieh, Si Si, Felix Yu, Inderjit Dhillon

Abstract

Large language models (LLMs) have demonstrated remarkable capabilities in solving complex open-domain tasks, guided by comprehensive instructions and demonstrations provided in the form of prompts. However, these prompts can be lengthy, often comprising hundreds of lines and thousands of tokens, and their design often requires considerable human effort. Recent research has explored automatic prompt engineering for short prompts, typically consisting of one or a few sentences. However, the automatic design of long prompts remains a challenging problem due to its immense search space. In this paper, we propose an algorithm named Automated Prompt Engineering Xpert (APEX), a novel algorithm that automatically improves long prompts. Leveraging a greedy algorithm with beam-search for efficiency, APEX utilizes search history to significantly enhance the effectiveness of LLM-based mutation in its search process. Our results show that APEX achieves an average of 9.2% accuracy gain on eight tasks in Big Bench Hard and a consistent improvements on GSM8K with various models, highlighting the significance of automating prompt designs to fully harness the capabilities of LLMs.

BibTeX
@inproceedings{hsieh-etal-2024-automatic,
    title = "Automatic Engineering of Long Prompts",
    author = "Hsieh, Cho-Jui  and
      Si, Si  and
      Yu, Felix  and
      Dhillon, Inderjit",
    editor = "Ku, Lun-Wei  and
      Martins, Andre  and
      Srikumar, Vivek",
    booktitle = "Findings of the Association for Computational Linguistics: ACL 2024",
    month = aug,
    year = "2024",
    address = "Bangkok, Thailand",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.findings-acl.634/",
    doi = "10.18653/v1/2024.findings-acl.634",
    pages = "10672--10685"
}
Automatic Engineering of Long Prompts · ACL 2024