Keywords: genetic algorithms, evolutionary algorithms, prompt optimization, heuristics, large language models
TL;DR: We introduce GenDLN, an evolutionary framework that optimizes stacked LLM prompt pairs for text classification. It achieves strong performance on legal and paraphrase classification tasks using minimal data and no fine-tuning.
Abstract: With Large Language Model (LLM)-based applications becoming more common due to strong performance across many tasks, prompt optimization has emerged as a way to extract better solutions from frozen, often commercial LLMs that are not specifically adapted to a task. LLM-assisted prompt optimization methods provide a promising alternative to manual/human prompt engineering, where LLM “reasoning” can be used to make them optimizing agents. However, the cost of using LLMs for prompt optimization via commercial APIs remains high, especially for heuristic methods like evolutionary algorithms (EAs), which need many iterations to converge, and thus, tokens, API calls, and rate-limited network overhead. We propose GenDLN, an efficient genetic algorithm-based prompt pair optimization framework that leverages commercial API free tiers. Our approach allows teams with limited resources (NGOs, non-profits, academics…) to efficiently use commercial LLMs for EA-based prompt optimization. We conduct experiments on CLAUDETTE for legal terms of service classification and MRPC for paraphrase detection, performing in line with selected prompt optimization baselines, at no cost. Our code is available in <omitted>.
Archival Status: Archival
Paper Length: Long Paper (up to 8 pages of content)
Submission Number: 345
Loading