[Paper Review] SPRIG: Improving Large Language Model Performance by System Prompt Optimization
This paper introduces Sprig, a genetic algorithm that optimizes system prompts to improve large language model performance across diverse tasks. By iteratively combining predefined prompt components, Sprig achieves performance on par with task-specific prompt optimization and enables complementary gains when combined with task-level tuning, demonstrating strong generalization across models, languages, and tasks.
Large Language Models (LLMs) have shown impressive capabilities in many scenarios, but their performance depends, in part, on the choice of prompt. Past research has focused on optimizing prompts specific to a task. However, much less attention has been given to optimizing the general instructions included in a prompt, known as a system prompt. To address this gap, we propose SPRIG, an edit-based genetic algorithm that iteratively constructs prompts from prespecified components to maximize the model's performance in general scenarios. We evaluate the performance of system prompts on a collection of 47 different types of tasks to ensure generalizability. Our study finds that a single optimized system prompt performs on par with task prompts optimized for each individual task. Moreover, combining system and task-level optimizations leads to further improvement, which showcases their complementary nature. Experiments also reveal that the optimized system prompts generalize effectively across model families, parameter sizes, and languages. This study provides insights into the role of system-level instructions in maximizing LLM potential.
Motivation & Objective
- To address the underexplored challenge of optimizing general system prompts rather than task-specific prompts in LLMs.
- To develop a systematic method for constructing high-performing, task-agnostic system prompts that enhance model behavior across diverse scenarios.
- To evaluate whether system prompt optimization provides complementary benefits when combined with task prompt optimization.
- To assess the generalization of optimized system prompts across model families, sizes, and languages.
- To identify which components (e.g., reasoning, personas, formatting) contribute most to performance gains.
Proposed method
- Sprig employs an edit-based genetic algorithm that evolves system prompts by combining predefined prompt components from a curated corpus of strategies.
- The algorithm uses fitness evaluation on a benchmark of 47 diverse tasks to guide selection, crossover, and mutation of prompt components.
- Components include reasoning strategies (e.g., Chain-of-Thought), personas, formatting rules, and meta-instructions.
- Optimization is performed iteratively, with performance measured on a held-out set of tasks to ensure generalization.
- The method evaluates both standalone system prompt optimization and its combination with task prompt optimization.
- Hidden state activations are analyzed via PCA to visualize how system prompt optimization shifts model behavior in latent space.

Experimental results
Research questions
- RQ1Can a single optimized system prompt achieve performance comparable to task-specific prompt optimization?
- RQ2Do system prompt and task prompt optimizations learn complementary strategies, leading to further performance gains when combined?
- RQ3How well do optimized system prompts generalize across different model families, parameter sizes, and languages?
- RQ4Which types of system prompt components (e.g., CoT, personas, formatting) contribute most to performance improvements?
- RQ5How does system prompt optimization affect the underlying representation space of the model, as measured by hidden state distributions?
Key findings
- A single optimized system prompt via Sprig achieves performance on par with task-specific prompt optimization across 47 diverse tasks.
- Combining Sprig-optimized system prompts with task-specific prompt optimization yields further performance gains, demonstrating their complementary nature.
- Sprig outperforms Chain-of-Thought (CoT) across all task types except knowledge-based questions, and surpasses ProTeGi in language understanding tasks.
- The combination of Sprig and ProTeGi exceeds state-of-the-art performance across most task types, with CoT-style components being a key contributor.
- Optimized system prompts generalize effectively across model families and languages, outperforming task-optimized prompts in cross-lingual settings.
- System prompt optimization significantly shifts the distribution of hidden states in the model’s latent space, while task prompt optimization has only minor local effects.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.