🤖 AI Summary
To address the challenges of prohibitively large global search spaces and insufficient guidance in large language model (LLM) prompt optimization, this paper proposes the Local Prompt Optimization (LPO) framework. LPO identifies and fine-tunes only the task-critical tokens—those most influential on downstream performance—thereby drastically reducing optimization dimensionality and computational overhead. Methodologically, it introduces, for the first time, an LLM-based dynamic token importance analysis coupled with a masking mechanism and a task-oriented gradient-guided update strategy, enabling efficient and interpretable local optimization. Crucially, LPO is fully compatible with existing automated prompt engineering techniques and requires no modifications to the underlying LLM. Extensive evaluation on GSM8K, MultiArith, and BBH benchmarks demonstrates that LPO achieves an average 2.1% absolute accuracy gain over global optimization methods while accelerating convergence by 3.4×, validating its effectiveness and generalizability.
📝 Abstract
In recent years, the use of prompts to guide the output of Large Language Models have increased dramatically. However, even the best of experts struggle to choose the correct words to stitch up a prompt for the desired task. To solve this, LLM driven prompt optimization emerged as an important problem. Existing prompt optimization methods optimize a prompt globally, where in all the prompt tokens have to be optimized over a large vocabulary while solving a complex task. The large optimization space (tokens) leads to insufficient guidance for a better prompt. In this work, we introduce Local Prompt Optimization (LPO) that integrates with any general automatic prompt engineering method. We identify the optimization tokens in a prompt and nudge the LLM to focus only on those tokens in its optimization step. We observe remarkable performance improvements on Math Reasoning (GSM8k and MultiArith) and BIG-bench Hard benchmarks across various automatic prompt engineering methods. Further, we show that LPO converges to the optimal prompt faster than global methods.