Self-Supervised Prompt Optimization (2025)

Abstract: Well-designed prompts are crucial for enhancing Large language models’ (LLMs) reasoning capabilities while aligning their outputs with task requirements across diverse domains. However, manually designed prompts require expertise and iterative experimentation. While existing prompt optimization methods aim to automate this process, they rely heavily on external references such as ground truth or by humans, limiting their applicability in real-world scenarios where such data is unavailable or costly to obtain. To address this, we propose Self-Supervised Prompt Optimization (SPO), a cost-efficient framework that discovers effective prompts for both closed and open-ended tasks without requiring external reference. Motivated by the observations that prompt quality manifests directly in LLM outputs and LLMs can effectively assess adherence to task requirements, we derive evaluation and optimization signals purely from output comparisons. Specifically, SPO selects superior prompts through pairwise output comparisons evaluated by an LLM evaluator, followed by an LLM optimizer that aligns outputs with task requirements. Extensive experiments demonstrate that SPO outperforms state-of-the-art prompt optimization methods, achieving comparable or superior results with significantly lower costs (e.g., 1.1% to 5.6% of existing methods) and fewer samples (e.g., three samples).

## introduction as large language models (llms) continue to advance, well-designed prompts have become critical for maximizing their reasoning capabilities @xcite @xcite * these authors contributed equally to this work. outputs evaluate external reference feedback question llm execute llm optimize candidate prompt revised prompt new feedback& prompt (b) self-supervised prompt optimization (ours) outputs candidate prompt question llm execute llm optimize revised prompt candidate outputs candidate outputs better outputs& prompt and ensuring alignment with diverse task requirements. however, creating effective prompts often requires substantial trial-and-error experimentation and deep task-specific knowledge. to address this challenge, researchers have explored prompt optimization (po) methods that use llms' own capabilities to automatically improve prompts. po advances beyond traditional prompt engineering, by providing a more systematic and efficient approach to prompt design. as shown in figure 1 (a), these methods typically involve an iterative process of prompt optimization, execution, and evaluation. the design choices for these components significantly influence optimization effectiveness and efficiency. existing approaches have demonstrated success with both numerical evaluation mechanisms @xcite @xcite and textual "gradient" optimization strategies @xcite , 2024). through these innovations, po methods have shown promise in reducing manual effort while enhancing task performance @xcite @xcite . despite their potential, existing po methods face significant challenges in real-world scenarios, as discussed below. first, current methods often depend heavily on external references for evaluation. methods using ground truth for evaluation @xcite @xcite require large amounts of annotated data to assess prompt quality, yet such standard answers are often unavailable in many practical applications, especially for open-ended tasks. similarly, methods relying on human @xcite require manual evaluations or human-designed rules to generate feedback, which is time-consuming and contradicts the goal of automation. second, existing methods typically require evaluating prompts on numerous samples to obtain reliable feedback, leading to substantial computational overhead @xcite . at the core of these challenges lies the absence of reliable and efficient reference-free methods for assessing prompt quality. analysis of llm behavior reveals two key insights that inform our approach. first, prompt quality inherently manifests in model outputs, as evidenced by how different prompting strategies significantly influence both reasoning paths @xcite and response features @xcite . second, extensive studies on llm-as-a-judge have demonstrated their effectiveness in evaluating output adherence to task requirements @xcite . these observations suggest that by leveraging llms' inherent ability to assess outputs that naturally reflect prompt quality, reference-free prompt optimization becomes feasible. motivated by these insights, we propose a costefficient framework that generates evaluation and optimization signals purely from llm outputs, similar to how self-supervised learning derives training signals from data. we term this approach self-supervised prompt optimization (spo). as shown in figure 1 , spo builds upon the fundamental optimize-execute-evaluate loop while introducing several innovative mechanisms: ## self-supervised prompt optimization in this section, we first overview our method (section 3.1) and then analyze its effectiveness (section 3.2). ## conclusion this paper addresses a key challenge in prompt optimization: dependency on external references. we introduce self-supervised prompt optimization (spo), a framework that overcomes this dependency while achieving remarkable cost-efficiency at only $0.15 per dataset. drawing inspiration from self-supervised learning, spo innovatively constructs evaluation and optimization signals through pairwise comparisons of model outputs, enabling reference-free optimization without compromising effectiveness. our evaluation shows spo achieves state-of-the-art performance across diverse tasks while requiring only 1.1%-5.6% of existing methods' costs. success on both benchmarks and realworld applications validates spo's effectiveness and generalization capabilities, making prompt optimization more accessible and practical across various domains.