Datasets:
Simplify prompts for thinking models
Browse filesRemove verbose persona framing, CoT instructions, and filler text.
Thinking models handle reasoning internally, so prompts only need
to specify the answer format and tag requirements.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- src/prompts.py +28 -36
src/prompts.py
CHANGED
|
@@ -3,64 +3,56 @@
|
|
| 3 |
# --- Initial Prompt Components ---
|
| 4 |
|
| 5 |
ANSWER_FORMAT_INSTRUCTIONS = {
|
| 6 |
-
"MCQ_SINGLE_CORRECT": "
|
| 7 |
-
"INTEGER": "
|
| 8 |
-
"MCQ_MULTIPLE_CORRECT": "
|
| 9 |
-
"DEFAULT": "
|
| 10 |
}
|
| 11 |
|
| 12 |
EXAMPLE_INSTRUCTIONS = {
|
| 13 |
-
"MCQ_SINGLE_CORRECT": "-
|
| 14 |
-
"INTEGER": "-
|
| 15 |
-
"MCQ_MULTIPLE_CORRECT": "-
|
| 16 |
-
"DEFAULT": "-
|
| 17 |
}
|
| 18 |
|
| 19 |
-
INITIAL_PROMPT_TEMPLATE = """
|
| 20 |
-
This exam uses specific marking schemes, so accuracy and correct formatting are crucial.
|
| 21 |
|
| 22 |
-
|
| 23 |
-
Examine the provided image of the question carefully.
|
| 24 |
-
1. Analyze the question and the provided options (if any).
|
| 25 |
-
2. Reason through the problem to {answer_format_instruction}
|
| 26 |
-
3. Format your final answer by enclosing ONLY the determined identifier(s) or numerical value(s) within <answer> tags.
|
| 27 |
|
| 28 |
-
|
| 29 |
-
{example_instruction}
|
| 30 |
-
- If you are unsure or cannot determine the answer: <answer>SKIP</answer>
|
| 31 |
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
# --- Reprompt Components ---
|
| 36 |
|
| 37 |
SPECIFIC_INSTRUCTIONS_REPROMPT = {
|
| 38 |
-
"MCQ_SINGLE_CORRECT": "provide
|
| 39 |
-
"INTEGER": "provide
|
| 40 |
-
"MCQ_MULTIPLE_CORRECT": "provide
|
| 41 |
-
"DEFAULT": "provide the answer
|
| 42 |
}
|
| 43 |
|
| 44 |
REPROMPT_EXAMPLE_INSTRUCTIONS = {
|
| 45 |
-
"MCQ_SINGLE_CORRECT": "
|
| 46 |
-
"MCQ_MULTIPLE_CORRECT": "
|
| 47 |
-
"INTEGER": "
|
| 48 |
-
"DEFAULT": "
|
| 49 |
}
|
| 50 |
|
| 51 |
-
REPROMPT_PROMPT_TEMPLATE = """
|
| 52 |
-
--- PREVIOUS RESPONSE START ---
|
| 53 |
-
{previous_raw_response}
|
| 54 |
-
--- PREVIOUS RESPONSE END ---
|
| 55 |
|
| 56 |
-
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
{reprompt_example_instruction}
|
| 61 |
-
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
# --- Helper functions to get instructions ---
|
| 66 |
|
|
|
|
| 3 |
# --- Initial Prompt Components ---
|
| 4 |
|
| 5 |
ANSWER_FORMAT_INSTRUCTIONS = {
|
| 6 |
+
"MCQ_SINGLE_CORRECT": "Pick the single correct option (e.g., A, B, 1, 2).",
|
| 7 |
+
"INTEGER": "Find the numerical answer (integer or decimal).",
|
| 8 |
+
"MCQ_MULTIPLE_CORRECT": "Pick all correct options (e.g., A,C or 1,3), comma-separated.",
|
| 9 |
+
"DEFAULT": "Answer based on the question's format."
|
| 10 |
}
|
| 11 |
|
| 12 |
EXAMPLE_INSTRUCTIONS = {
|
| 13 |
+
"MCQ_SINGLE_CORRECT": "- <answer>A</answer>\n- <answer>2</answer>",
|
| 14 |
+
"INTEGER": "- <answer>5</answer>\n- <answer>12.75</answer>",
|
| 15 |
+
"MCQ_MULTIPLE_CORRECT": "- <answer>A,C</answer>\n- <answer>1,3</answer>\n- <answer>B</answer>",
|
| 16 |
+
"DEFAULT": "- <answer>Your Answer</answer>"
|
| 17 |
}
|
| 18 |
|
| 19 |
+
INITIAL_PROMPT_TEMPLATE = """Look at this {exam_name} {exam_year} exam question ({question_type}).
|
|
|
|
| 20 |
|
| 21 |
+
{answer_format_instruction}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
Respond with ONLY an <answer> tag. No other text.
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
{example_instruction}
|
| 26 |
+
- Unsure: <answer>SKIP</answer>"""
|
| 27 |
|
| 28 |
|
| 29 |
# --- Reprompt Components ---
|
| 30 |
|
| 31 |
SPECIFIC_INSTRUCTIONS_REPROMPT = {
|
| 32 |
+
"MCQ_SINGLE_CORRECT": "provide the correct option (e.g., A or 2)",
|
| 33 |
+
"INTEGER": "provide the numerical answer",
|
| 34 |
+
"MCQ_MULTIPLE_CORRECT": "provide all correct options comma-separated (e.g., A,C)",
|
| 35 |
+
"DEFAULT": "provide the answer"
|
| 36 |
}
|
| 37 |
|
| 38 |
REPROMPT_EXAMPLE_INSTRUCTIONS = {
|
| 39 |
+
"MCQ_SINGLE_CORRECT": "<answer>A</answer>",
|
| 40 |
+
"MCQ_MULTIPLE_CORRECT": "<answer>A,C</answer>",
|
| 41 |
+
"INTEGER": "<answer>42</answer>",
|
| 42 |
+
"DEFAULT": "<answer>Your Answer</answer>",
|
| 43 |
}
|
| 44 |
|
| 45 |
+
REPROMPT_PROMPT_TEMPLATE = """Your previous response was not in the correct format.
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
Previous response:
|
| 48 |
+
{previous_raw_response}
|
| 49 |
|
| 50 |
+
This is a '{question_type}' question. Please {specific_instructions} in an <answer> tag.
|
| 51 |
|
| 52 |
+
Example: {reprompt_example_instruction}
|
| 53 |
+
Unsure: <answer>SKIP</answer>
|
| 54 |
|
| 55 |
+
Respond with ONLY the <answer> tag. No other text."""
|
| 56 |
|
| 57 |
# --- Helper functions to get instructions ---
|
| 58 |
|