Reja1 Claude Opus 4.6 commited on
Commit
fbb8468
·
1 Parent(s): b5a5090

Simplify prompts for thinking models

Browse files

Remove 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>

Files changed (1) hide show
  1. 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": "determine the single correct option identifier (e.g., 1, 2, A, B) as it appears in the question.",
7
- "INTEGER": "determine the single numerical answer. This can be an integer or a decimal value. Provide the number as accurately as possible.",
8
- "MCQ_MULTIPLE_CORRECT": "determine all correct option identifier(s) (e.g., 1, 2, A, B) as they appear in the question. If multiple options are correct, list their identifiers separated by commas.",
9
- "DEFAULT": "determine the correct answer based on the question's format."
10
  }
11
 
12
  EXAMPLE_INSTRUCTIONS = {
13
- "MCQ_SINGLE_CORRECT": "- If the correct option is labeled '2' in the question: <answer>2</answer>\n- If the correct option is labeled 'A' in the question: <answer>A</answer>",
14
- "INTEGER": "- If the answer is 5: <answer>5</answer>\n- If the answer is 12.75: <answer>12.75</answer>\n- If the answer is 0.5: <answer>0.5</answer>",
15
- "MCQ_MULTIPLE_CORRECT": "- If options labeled 'A' and 'C' are correct: <answer>A,C</answer>\n- If options labeled '1' and '3' are correct: <answer>1,3</answer>\n- If only option 'B' is correct: <answer>B</answer>\n- If only option '2' is correct: <answer>2</answer>",
16
- "DEFAULT": "- Example: <answer>Your Answer</answer>"
17
  }
18
 
19
- INITIAL_PROMPT_TEMPLATE = """You are an expert at analyzing exam questions from the {exam_name} {exam_year} exam ({question_type}) and extracting the correct answer option(s)/value.
20
- This exam uses specific marking schemes, so accuracy and correct formatting are crucial.
21
 
22
- Please think step-by-step to solve the problem.
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
- Examples:
29
- {example_instruction}
30
- - If you are unsure or cannot determine the answer: <answer>SKIP</answer>
31
 
32
- It is crucial that your response contains ONLY the <answer> tag with the correct option identifier(s), numerical value(s) OR the word SKIP inside. Do not include any other text, explanation, or formatting."""
 
33
 
34
 
35
  # --- Reprompt Components ---
36
 
37
  SPECIFIC_INSTRUCTIONS_REPROMPT = {
38
- "MCQ_SINGLE_CORRECT": "provide ONLY the single correct option identifier (e.g., 1, A) as it appears in the question",
39
- "INTEGER": "provide ONLY the single numerical answer (integer or decimal)",
40
- "MCQ_MULTIPLE_CORRECT": "provide ALL correct option identifier(s) (e.g., A,C or 1,3) as they appear in the question, separated by commas if multiple. If only one is correct, provide just that one (e.g., <answer>B</answer> or <answer>2</answer>)",
41
- "DEFAULT": "provide the answer according to the question format"
42
  }
43
 
44
  REPROMPT_EXAMPLE_INSTRUCTIONS = {
45
- "MCQ_SINGLE_CORRECT": "Example for single correct MCQ option 'A': <answer>A</answer>\nExample for single correct MCQ option '2': <answer>2</answer>",
46
- "MCQ_MULTIPLE_CORRECT": "Example for multiple correct MCQ options 'A' and 'C': <answer>A,C</answer>\nExample for single correct option 'B': <answer>B</answer>",
47
- "INTEGER": "Example for integer answer: <answer>42</answer>\nExample for decimal answer: <answer>12.75</answer>",
48
- "DEFAULT": "Example: <answer>Your Answer</answer>",
49
  }
50
 
51
- REPROMPT_PROMPT_TEMPLATE = """You previously provided the following response to an exam question:
52
- --- PREVIOUS RESPONSE START ---
53
- {previous_raw_response}
54
- --- PREVIOUS RESPONSE END ---
55
 
56
- Your previous response did not correctly format the final answer within <answer> tags, or it did not match the expected format for a '{question_type}' question.
 
57
 
58
- Please re-examine your previous reasoning and {specific_instructions}, enclosed in <answer> tags.
59
 
60
- {reprompt_example_instruction}
61
- If you are unsure or cannot determine the answer: <answer>SKIP</answer>
62
 
63
- It is crucial that your response contains ONLY the <answer> tag with the correct option identifier(s), numerical value(s) OR the word SKIP inside. Do not include any other text, explanation, or formatting."""
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