Skip to content

Commit 0ff356c

Browse files
committed
as
1 parent 2c7dc5c commit 0ff356c

File tree

3 files changed

+54
-4
lines changed

3 files changed

+54
-4
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Evaluate the following prompt designed for large language models on a scale of 0.0 to 1.0 for these metrics:
2+
3+
1. **Clarity** (0.0-1.0): How clear and unambiguous are the instructions? Are there any confusing or contradictory elements?
4+
5+
2. **Specificity** (0.0-1.0): Does the prompt provide appropriate detail and constraints without being overly restrictive? Does it guide the model effectively?
6+
7+
3. **Robustness** (0.0-1.0): Will this prompt handle edge cases and varied inputs well? Is it resilient to different phrasings or unexpected scenarios?
8+
9+
4. **Format_specification** (0.0-1.0): Is the expected output format clearly defined? Will the model know exactly how to structure its response?
10+
11+
Prompt to evaluate:
12+
```
13+
{current_program}
14+
```
15+
16+
Consider that this prompt is designed for a task involving mathematical problem-solving, classification, or similar structured tasks where accuracy and consistency are important.
17+
18+
Evaluation guidelines:
19+
- A score of 1.0 means excellent/optimal for that dimension
20+
- A score of 0.5 means adequate but with room for improvement
21+
- A score of 0.0 means severely lacking in that dimension
22+
- Consider how well the prompt would work across different models and contexts
23+
24+
Return your evaluation as a JSON object with the following format:
25+
{{
26+
"clarity": [score],
27+
"specificity": [score],
28+
"robustness": [score],
29+
"format_specification": [score],
30+
"reasoning": "[brief explanation of scores, highlighting strengths and areas for improvement]"
31+
}}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
You are an expert prompt engineer specializing in creating effective prompts for language models.
2+
3+
Your task is to evolve and improve prompts to maximize their performance on specific tasks. When rewriting prompts:
4+
5+
1. **Maintain the exact placeholder format**: Always use the same placeholder name as in the original prompt (e.g., {instruction}, {claim}, {context}, {question})
6+
2. **Keep it simple**: Avoid overly complex or verbose instructions unless necessary
7+
3. **Be specific**: Provide clear, actionable guidance to the model
8+
4. **Test-oriented**: Focus on what will improve accuracy on the given evaluation metrics
9+
5. **Format-aware**: Ensure the prompt works well with the expected input/output format
10+
11+
**CRITICAL**: Your rewritten prompt must use EXACTLY the same placeholder names as the original. Do not change {instruction} to {input_text} or any other variation.
12+
13+
Generate only the improved prompt text, nothing else.

examples/llm_prompt_optimization/templates/full_rewrite_user.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212

1313
# Task
1414
Rewrite the prompt to improve its performance on the specified metrics.
15-
Provide the complete new prompt text.
15+
Focus on clarity, specificity, and effectiveness for the target task.
1616

17-
IMPORTANT: Make sure your rewritten prompt maintains the same input placeholder ({{input_text}})
18-
but with improved instructions for better LLM performance.
17+
CRITICAL REQUIREMENTS:
18+
1. Keep the EXACT same placeholder from the original prompt (e.g., {{instruction}}, {{claim}}, etc.)
19+
2. Do not add any new placeholders or change existing ones
20+
3. Make the instructions clearer and more specific
21+
4. Focus on what will improve accuracy and task performance
22+
5. Keep the prompt concise but effective
1923

20-
Your improved prompt:
24+
Provide ONLY the complete new prompt text, with no additional commentary:
25+
26+
NEW PROMPT:

0 commit comments

Comments
 (0)