Was ein guter Prompt wert ist: GEPA im Test auf 3 Aufgaben
Sachin Agrawal
Always building 5 projects, sometimes finishing them. Community builder.
Viele Teams kaufen Performance über ein größeres Modell ein. Der günstigere Hebel liegt näher: der Prompt. Ein starker Prompt lässt ein kleines Modell weit über seiner Preisklasse spielen und macht ein gutes Modell noch besser. GEPA sucht diesen Prompt automatisch: für Kostenersparnis, für Spitzenqualität, idealerweise beides.
Wir haben GEPA auf drei Aufgaben getestet, unserer Event-Extraktion plus den bekannten Benchmarks GSM8K und HotpotQA, gegen einen bewusst schwachen Prompt und einen handgeschriebenen Experten-Prompt, auf gpt-4o-mini und gpt-4o. Auf allen drei Aufgaben schlägt das kleine Modell mit GEPA-Prompt das große Modell mit schwachem Prompt. Bei der Event-Extraktion überholt es sogar gpt-4o mit Experten-Prompt (0.902 vs 0.897), bei rund 12x geringeren Kosten pro Request.
Das Problem: Harness-Optimierung
Das Modell ist nur ein Teil des Systems. Der Harness drumherum (Prompts, Tools, Retries, Output-Parsing) entscheidet, wie viel der Modellfähigkeit ankommt. Die Modellwahl bewegt dich auf der Kostenachse; der Prompt auf der Qualitätsachse. Daraus folgen zwei Spielzüge:
- Kosten: Qualität halten, Modell verkleinern. Ein kleines Modell mit optimiertem Prompt ersetzt ein großes mit durchschnittlichem.
- Performance: Modell behalten, Qualität steigern. Derselbe optimierte Prompt hebt auch ein starkes Modell weiter an.
Schwache Prompts sind ein Alignment-Problem
Ohne präzisen Prompt rät das Modell, was du willst. Output-Formate driften, Edge Cases fallen bei jedem Lauf anders aus, und zwei Modelle geben auf denselben Input zwei verschiedene Antworten. In unserer Extraktionsaufgabe lieferte der schwache Prompt Datumsangaben in drei Formaten und 'N/A', wo die Spezifikation einen leeren String verlangte. Ein präziser Prompt fixiert die Intention: Das Verhalten bleibt konsistent über Läufe und über Modelle hinweg.
Was ist GEPA?
GEPA (Genetic-Pareto) ist reflektive Prompt-Evolution, verfügbar als Optimizer in DSPy. Die Metrik liefert Score plus textuelles Feedback ('Datumsformat falsch, erwartet YYYY-MM-DD'). Ein Reflection-Modell liest das Feedback, schreibt den Prompt um, und Pareto-verbessernde Kandidaten überleben. Du startest mit einem schwachen Einzeiler und lässt den Optimizer die starke Instruction finden.
Wo GEPA sich über dieses Pilotprojekt hinaus lohnt:
- Modellmigration: Ein Provider-Wechsel oder Modell-Update optimiert den Prompt automatisch neu, statt einer Woche Hand-Tuning.
- Konsistenz über Modelle: Eine Metrik richtet mehrere Modelle auf denselben Output-Vertrag aus.
- Domänenwissen kodieren: Fachleute schreiben das Bewertungs-Rubrik; der Optimizer übersetzt es in Prompt-Formulierungen.
- Agenten-Pipelines: Die Instruction jedes Moduls wird gegen End-to-End-Feedback optimiert.
Das Setup: ein Experten-Prompt als Benchmark
Automatische Optimierung ist nur interessant, wenn sie mit sorgfältiger Handarbeit konkurriert. Jede Aufgabe bekommt deshalb drei Prompts auf gpt-4o-mini plus zwei Referenzen auf gpt-4o:
- Schwacher Prompt: ein dünner Einzeiler wie 'Löse die Matheaufgabe.' Das ist der GEPA-Startpunkt.
- Experten-Prompt: ein detailliertes handgeschriebenes Rubrik. Der menschliche Benchmark.
- GEPA-Prompt: aus dem schwachen Einzeiler evolviert (Medium-Budget für die Headline-Zahlen; zusätzlich Heavy). Reflection-Modell gpt-4o.
Aufgaben: Extraktion von sechs Feldern aus EN/DE-Event-Blurbs (unsere, 12 Test-Beispiele), GSM8K-Mathe (Exact Match, 24 Test) und HotpotQA Multi-Hop-QA mit Distractor-Absätzen (Token-F1, 24 Test). Die Holdouts sind klein; lies die Deltas als Richtungswerte, nicht als Leaderboard-Scores.
Ergebnisse über drei Aufgaben
Event-Extraktion (n=12): schwacher Prompt 0.72, Experten-Prompt 0.89, GEPA 0.90 (+0.01 gegenüber Experte, Compile ~31 Min).
GSM8K (n=24): schwacher Prompt 0.79, Experten-Prompt 0.96, GEPA 0.88 (−0.08 gegenüber Experte, Compile ~74 Min).
HotpotQA (n=24): schwacher Prompt 0.17, Experten-Prompt 0.75, GEPA 0.66 (−0.09 gegenüber Experte, Compile ~33 Min).

Das Muster: Ausgehend von einem Wegwerf-Einzeiler schlägt GEPA unseren Experten-Prompt bei der Event-Extraktion und schließt 50% (GSM8K) bzw. 84% (HotpotQA) der Lücke zwischen schwachem und Experten-Prompt auf den bekannten Benchmarks, ohne eine Minute Prompt-Schreibarbeit. Der größte Sprung kommt dort, wo der schwache Prompt am härtesten scheitert: HotpotQA springt von 0.17 auf 0.66, weil der evolvierte Prompt gelernt hat, mit der exakten kurzen Span zu antworten statt mit einem hilfreichen Satz.
Kleines Modell + evolvierter Prompt vs großes Modell

Das ist der Kosten-Spielzug in einem Bild: Auf allen drei Aufgaben schlägt gpt-4o-mini mit GEPA-Prompt das große gpt-4o mit schwachem Prompt. Ein besserer Prompt schlägt ein größeres Modell. Bei der Event-Extraktion überholt das kleine Modell mit evolviertem Prompt (0.902) sogar gpt-4o mit Experten-Prompt (0.897), bei ~12x geringerem Preis pro Request. HotpotQA ist der ehrliche Kontrapunkt: Das große Modell mit Experten-Prompt bleibt vorn (0.80 vs 0.66); wenn Multi-Hop-Reasoning der Engpass ist, schließt Prompt-Qualität allein die Lücke nicht.
Echte Prompts, wie GEPA sie umschreibt
Das sind keine Paraphrasen. Jeder Block ist ein realer Instruktions-Kandidat aus unseren Heavy-GEPA-Läufen — der Seed am Start, ein Zwischenstand mitten in der Suche und der finale Best-on-Validation-Prompt. Längere Prompts sind mit Auslassungspunkten gekürzt; Volltext in scripts/experiments/gepa/results/<task>/heavy/prompt_evolution.json.
Event-Extraktion: Seed → Zwischenstand → Final
GEPA hat auf diesem Task 63 Kandidaten vorgeschlagen. Seed = Kandidat #0 (Val 0.74); Zwischenstand = Kandidat #31 (Val 0.94); Final = Kandidat #54 (Val 0.95).
Extract event fields from the blurb.Task: Extract structured data from an event description blurb to standardize event details for improved data management and retrieval.
Instructions:
1. **Title**:
- Extract the main title of the event, incorporating any unique identifiers like event numbers or themes (e.g., "Builder Friday #42").
- Avoid including excessive organizational descriptions unless they add essential context.
- Refine the title based on implied suggestions in the blurb, ensuring it closely aligns with feedback expectations. Keep titles concise and relevant.
2. **Date (ISO format)**:
- Convert the date mentioned in the blurb into ISO format (YYYY-MM-DD).
- Check for various date formats including DD.MM.YYYY, MM-DD-YYYY, or verbal forms like 'Tue May 20 2025.'
- If only the date is mentioned without explicit hints on time, assume the event will occur at a standardized time (e.g., 00:00 hours).
3. **City**:
- Extract the city mentioned in the event blurb.
- If the event is entirely online or the location is unspecified, use 'online'.
- In a hybrid setup, use the main physical location provided in the blurb.
4. **Format**:
- Classify the event as 'in-person', 'online', or 'hybrid'.
- If there are both physical and online attendance options, mark it as 'hybrid'.
5. **Topics**:
- Identify the main themes of the event from the blurb and form concise, generalized kebab-case topic tags.
- Convert descriptive phrases into short, standardized tags—aligning with common feedback suggestions, such as converting both "artificial-intelligence" and "ai solutions" into 'ai'.
- Ensure tags encapsulate all primary themes indicated in the feedback, merging related concepts when necessary, e.g., 'genai' becomes 'generative-ai', 'research-spinouts' should instead be broken into 'research, spinouts' unless specified otherwise.
- Strive to cover both direct and implied subjects in the event to prevent topic mismatches, ensuring the tags are holistic and meet expected terminologies in the feedback, like 'ai, research, mobility, design'.
6. **Registration URL**:
- Extract the URL for event registration.
- If the registration URL isn't provided, deno
…Task: Extract and refine structured data from an event description blurb to standardize event details for improved data management and retrieval, emphasizing alignment with feedback suggestions.
Instructions:
1. **Title**:
- Extract the main title of the event, incorporating any unique identifiers like event numbers, themes, or edition types (e.g., "Builder Friday #42", "remote edition").
- Avoid including excessive organizational descriptions unless they provide essential context or clarity.
- Refine the title based on feedback expectations, ensuring it captures the essence and brand of the event as implied in the blurb.
2. **Date (ISO format)**:
- Convert the date mentioned into ISO format (YYYY-MM-DD).
- Look for varying formats such as DD.MM.YYYY, MM-DD-YYYY, or verbal forms like 'Tue May 20 2025'.
- If the time isn't specified, assume a standard start time (e.g., 00:00 hours).
3. **City**:
- Extract the city if mentioned in the blurb.
- For online events or if the location is not specified, use 'online'.
- In hybrid scenarios, specify the main physical location mentioned.
4. **Format**:
- Classify the event as 'in-person', 'online', or 'hybrid'.
- If both physical and online attendance options are available, mark it as 'hybrid'.
5. **Topics**:
- Identify and form concise kebab-case topic tags reflecting the main themes.
- Prioritize broader feedback-aligned terms over detailed phrases to encapsulate primary themes accurately.
- Transform terms using established mappings:
- "artificial-intelligence" and "ai solutions" to 'ai',
- "automotive startups pitch" to 'automotive, startups, demo-day',
- "ai agents" as 'ai-agents',
- Include specific terms found within the event context like 'claude', 'cheatsheet', or 'live-coding'.
- Ensure topic tags reflect the coherent main themes and intended context, avoiding mismatches with expected themes.
6. **Registration URL**:
- Extract the event registration URL.
- If the URL is not provided, denote it as an empty string ('').
Ensure outputs are consistent, accurate, and aligned with feedback-guided guidelines, enhancing future task accur
…GSM8K-Mathe: Seed → Zwischenstand → Final
GEPA hat auf diesem Task 13 Kandidaten vorgeschlagen. Seed = Kandidat #0 (Val 0.88); Zwischenstand = Kandidat #7 (Val 1.00); Final = Kandidat #1 (Val 1.00).
Solve the math problem.Task: Solve word problems that require basic arithmetic calculations.
Instructions:
1. Comprehend the Problem:
- Thoroughly read the entire problem statement to understand the context, information given, and what is being asked.
- Identify and note all numerical values, units, and relationships pertinent to the problem.
- Pay attention to keywords and phrases such as "total," "difference," "per," "left," "twice as much," or "half," which signal specific arithmetic operations.
- Pinpoint the specific question that needs an answer.
2. Organize and Analyze:
- Clearly list and define all known quantities and variables. If possible, outline them in a table to aid visualization.
- Establish a plan or sequence of arithmetic operations that will lead to a solution, which might involve setting up equations or performing direct calculations.
- Take into account any contextual peculiarities like time conversions, recurring events, or changing conditions like scaled increases (as seen with ships doubling in size).
3. Calculation Execution:
- Methodically carry out calculations, ensuring each step is clearly tracked.
- Ensure uniform use of units across calculations and consistently apply the correct order of operations (PEMDAS/BODMAS: Parentheses/Brackets, Exponents/Orders, Multiplication and Division, Addition and Subtraction).
- For monotonically increasing or decreasing sequences, recognize patterns or multipliers consistent with compounding growth or decay principles.
4. Verify the Solution:
- Review calculations at each step to affirm correctness and logical consistency.
- Confirm the final answer precisely addresses the posed question and falls within expected values or contexts.
- Adapt for special conditions and edge cases like rounding errors, integer restrictions, or event periodicity, especially in incremental or decremental problems.
5. Present the Answer Clearly:
- Provide the final answer in a clear, direct manner.
- Format the solution logically, employing complete sentences when necessary to maintain clarity.
- Relate the answer back to the problem context, including necessary units or explicit indication
…Task: Solve word problems that require basic arithmetic calculations.
Instructions:
1. Understand the problem:
- Read the question carefully to identify key information, such as quantities, relationships, and operations needed.
- Pay close attention to details about who, what, when, and how much.
2. Break down the problem into steps:
- Identify all known quantities and what needs to be calculated.
- Consider any mathematical operations required (e.g., addition, subtraction, multiplication, division).
3. Execute the calculations:
- Perform each arithmetic operation step by step, and keep track of intermediate results.
- For problems that involve multiple calculations, ensure that you follow the correct order of operations.
4. Verify the solution:
- Double-check your calculations for accuracy.
- Ensure the final result answers the specific question asked in the problem.
5. Present the answer:
- Provide the final answer succinctly, in complete sentences where appropriate.
- Ensure the answer directly corresponds to the question, including the correct units or context if applicable.HotpotQA Multi-Hop: Seed → Zwischenstand → Final
GEPA hat auf diesem Task 19 Kandidaten vorgeschlagen. Seed = Kandidat #0 (Val 0.19); Zwischenstand = Kandidat #9 (Val 0.66); Final = Kandidat #10 (Val 0.70).
Answer the question using the context.Your task is to answer questions based on the provided context by extracting a concise segment or providing a simple 'yes'/'no' response when appropriate. Each context consists of multiple paragraphs, each potentially covering different topics or events. Some paragraphs may include distractors irrelevant to the specific question. Implement the following guidelines to ensure clarity, accuracy, and relevance in your responses:
1. **Exact Match**: Prioritize the use of specific names, entities, or numerical data mentioned in the context. Your responses should directly reflect an exact match from the context, ensuring they are concise and precise.
2. **Relevance**: Focus on details that directly answer the question. Ignore any information that does not contribute to addressing the specific query, including potential distractors.
3. **Verification**: Verify numerical, factual data and names within the context to ensure your response's accuracy.
4. **Directness**: Provide the most direct answers possible. Avoid adding extra context or unnecessary explanations unless it is essential for standalone understanding. If applicable, reply with a simple 'yes' or 'no'.
5. **Synthesis Across Paragraphs**: If a question involves information that spans multiple paragraphs, identify and integrate these interrelated details to form a coherent response. Use systematic identification to ensure all relevant data are combined appropriately.
6. **Answer Simplicity**: Always provide the simplest possible form of your answer. This includes avoiding restatement of questions and excluding additional information beyond the exact answer.
7. **Feedback Reception**: Learn from given feedback to better identify exact matches, ignore irrelevant data, and improve extraction accuracy through insight into expected responses.
8. **Specific Instruction**: Based on prior feedback:
- When asked for item comparisons (e.g., "Which was started first?"), respond with just the exact name of the older entity.
- Where multiple names or identifiers exist, utilize any additional context provided to resolve potential ambiguities, ensuring the most complete factual identification.
- Extract nam
…Your task is to answer questions by extracting precise information from a provided context. The context will be made up of multiple paragraphs, each addressing different topics or events. Some parts may contain irrelevant information or distractors. Your goal is to sift through these sections to provide a relevant and exact answer to the question based on the given guidelines:
1. **Exact Match**: For names, entities, or numerical data related directly to the question, ensure your answer is an exact match of the wording in the context. Respond with the precise short span of text or phrase as it appears in the context.
2. **Relevance**: Focus solely on information that allows you to directly answer the question. Disregard any distractors or unrelated details.
3. **Verification**: Double-check numerical and factual data (e.g., names, dates, coordinates) within the context to confirm the accuracy of the information being used in your response.
4. **Brevity & Precision**: Avoid providing extended context unless absolutely necessary. If the context supports it, and unless stated otherwise, answer with a succinct, 'yes' or 'no'.
5. **Synthesis Across Paragraphs**: If pertinent information is spread over multiple paragraphs, discern and integrate these elements to formulate a coherent answer. Ensure information is logically combined to maintain accuracy.
6. **Feedback Adherence**: Past feedback indicates responses should stick strictly to the precise requested information without additional restatements or explanations unless they ensure standalone clarity. Provide only the necessary excerpt to satisfy the query.
By consistently applying these principles, you will ensure clarity, accuracy, and relevance in your responses.Das Muster über Tasks hinweg: Der Seed ist ein Einzeiler; der Zwischenstand ergänzt bereits Failure-Mode-Checklisten; der Final ist ein dichtes Betriebshandbuch. Achte darauf, was der Optimizer erfindet, ohne es gesagt zu bekommen — Datums-Normalisierung bei Events, Schritt-für-Schritt-Rechenchecks bei GSM8K und 'antworte mit der exakten kurzen Span' bei HotpotQA.
Höherer Aufwand: Heavy-GEPA-Budget auf allen drei Aufgaben
Medium war das Headline-Setup. Zusätzlich haben wir ein Heavy-GEPA-Budget auf denselben drei Aufgaben und denselben Holdouts gefahren. Heavy verbraucht mehr Reflection-Calls und mehr Compile-Zeit (Events ~49 Min, GSM8K ~80 Min, HotpotQA ~47 Min).

Heavy vs Medium GEPA-Scores: Events 0.91 vs 0.90, GSM8K 0.83 vs 0.88, HotpotQA 0.73 vs 0.66. Heavy schlägt Medium auf 2 von 3 Aufgaben.
Vor der Festlegung auf Medium haben wir die GEPA-Budgets auf der Extraktionsaufgabe durchgetestet. Light (~2 Min Compile) lag fast gleichauf mit dem Experten-Prompt (0.881 vs 0.885). Medium (~28 Min) schlug ihn (0.916 vs 0.890). Heavy (~43 Min) schlug den Experten ebenfalls, landete aber unter Medium. Auf einem 12-Beispiel-Holdout ist mehr Budget nicht automatisch besser.

Was das für Builder heißt
- Behandle den Prompt als tunbaren Parameter deines Harness, nicht als einmalige Schreibaufgabe. Schwacher Prompt plus GEPA schlug unseren Experten-Prompt auf einer Aufgabe und schloss auf den anderen beiden 50–84% der Lücke.
- Prüfe die Kombination kleines Modell plus optimierter Prompt, bevor du für das große Modell zahlst. Sie schlug das große Modell mit schwachem Prompt auf allen drei Aufgaben, bei rund einem Zehntel des Preises.
- Schreib die Metrik, nicht den Prompt. Das textuelle Feedback in deiner Metrik ist das, was GEPA in Instructions übersetzt; dorthin gehört das Domänenwissen.
- Publiziere die Budget-Kurve. Medium ist oft der Sweet Spot; Heavy hilft manchmal und overfittet manchmal einen kleinen Holdout.
Für Enterprise-Teams
Bei unseren Enterprise-Kunden hat GEPA dort Wunder bewirkt, wo der Harness als Produkt behandelt wird: ein echtes Benchmark, ein bewertetes Experiment und ein Rollout, der sowohl auf dem Benchmark als auch außerhalb geprüft wird. Der Weg sieht meist so aus:
- Ein gutes Benchmark bauen. Die Fälle erfassen, die zählen: Edge-Formate, zweisprachige Texte, die Fehler, die dein Team schon kennt.
- Das Experiment aufsetzen. Eine Metrik mit textuellem Feedback verdrahten, einen schwachen Seed und eine Experten-Kontrolle wählen, GEPA suchen lassen.
- Auf dem Benchmark und außerhalb testen. Holdout-Scores zeigen die Kurve; Produktions-Traces zeigen, ob der Prompt hält, wenn sich die Verteilung verschiebt.
Wenn du das in deinen Stack bringen willst, starte hier: Creators for Enterprises oder schreib uns.
Dieser Artikel ist auch auf Englisch verfügbar: English







