You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module holds the prompt template and the LLM call.
@@ -8,44 +9,12 @@
8
9
fromopenaiimportOpenAI
9
10
10
11
client=OpenAI() # API key must be in OPENAI_API_KEY
12
+
# MODEL constant removed from here
11
13
12
-
PROMPT_TEMPLATE="""You are an expert competition mathematician specializing in AIME problems. Your goal is to solve the following AIME problem accurately and present the final answer as a three-digit integer (000-999) enclosed in \\boxed{{}}. The evaluation script relies *absolutely* on this specific format \\boxed{{XXX}}. Meticulous accuracy is paramount.
13
-
14
-
Please structure your detailed thinking process as follows:
15
-
16
-
1. **Understand the Problem:**
17
-
* Carefully read the problem statement multiple times.
18
-
* Identify exactly what is being asked (the final quantity to find).
19
-
* List all given conditions, constraints, variables, and specific definitions or terminology.
20
-
* Identify the type of math problem (e.g., algebra, geometry, number theory, combinatorics).
21
-
* Ensure you fully grasp all aspects of the problem before proceeding.
22
-
23
-
2. **Plan the Solution:**
24
-
* Outline the mathematical approach you will take. What are the key steps?
25
-
* Identify relevant mathematical concepts, theorems, formulas, or techniques (e.g., casework, symmetry, invariants, specific algebraic/geometric manipulations, modular arithmetic, pigeonhole principle).
26
-
* Consider if the problem can be simplified, reframed, or approached using a specific known AIME strategy.
27
-
* Consider different strategies and choose the most promising one, explaining why.
28
-
* Break down the problem into smaller, manageable parts if necessary.
29
-
30
-
3. **Execute the Plan:**
31
-
* Work through the problem step-by-step according to your plan.
32
-
* Show ALL calculations and logical derivations explicitly. Do not skip steps. Ensure every step logically follows from the previous one.
33
-
* Clearly state your reasoning at each stage. Define any variables used.
34
-
* Perform calculations accurately. Pay close attention to details. Double-check arithmetic.
35
-
* Keep track of your intermediate results and units (if any).
36
-
37
-
4. **Verify the Solution:**
38
-
* Review your entire solution process from beginning to end.
39
-
* Re-read the original problem statement. Did you answer the specific question asked?
40
-
* Double-check your calculations, especially critical ones and the final arithmetic.
41
-
* Does the answer satisfy all the conditions and constraints given in the problem statement?
42
-
* Does the answer make sense in the context of the problem? (e.g., Is it the right order of magnitude? Is it the correct type of number?)
43
-
* Consider potential edge cases or common pitfalls. Did you account for them?
44
-
45
-
5. **Final Answer:**
46
-
* State your final result clearly.
47
-
* The final answer must be a single three-digit integer between 000 and 999, inclusive.
48
-
* Enclose the three-digit integer in the required format: \\boxed{{XXX}}. For example, if the answer is 42, write \\boxed{{042}}. If the answer is 123, write \\boxed{{123}}.
14
+
PROMPT_TEMPLATE="""You are an expert competition mathematician tasked with solving an AIME problem.
15
+
The final answer must be a three-digit integer between 000 and 999, inclusive.
16
+
Please reason step-by-step towards the solution. Keep your reasoning concise.
17
+
Conclude your response with the final answer enclosed in \\boxed{{}}. For example: The final answer is \\boxed{{042}}.
Copy file name to clipboardExpand all lines: examples/prompt/prompt_guide.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,16 +29,17 @@ The primary goal is to enhance the model's reasoning process for these challengi
29
29
30
30
**Ideas to Explore:**
31
31
You don't have to implement all of them, but the following ideas might be helpful:
32
-
***Explicit Workflow Definition:**
33
-
* Define a clear step-by-step thinking process within the prompt template itself. E.g., "1. Understand the problem constraints. 2. Identify relevant theorems/formulas. 3. Formulate a plan. 4. Execute calculations step-by-step. 5. Verify intermediate results. 6. State the final answer in the required format."
34
-
* Use headings or numbered lists within the template to guide the model's output structure during reasoning.
35
-
***Advanced CoT Techniques:**
32
+
***Workflow Patterns:**
33
+
***Linear**: step-by-step thinking process could be a good starting point E.g., "1. Understand the problem constraints. 2. Identify relevant theorems/formulas. 3. Formulate a plan. 4. Execute calculations step-by-step. 5. Verify intermediate results. 6. State the final answer in the required format."
34
+
***List Candidates**: You can ask the model to propose a few solutions in a particular step and pick the best solution. You can potentially also set the criterias in the prompt.
35
+
***Code** Write pesudo code to define even more complex workflows with loops, conditional statement, or go to statement.
36
+
***Other CoT Techniques:**
36
37
* Self-Correction/Reflection
37
38
* Plan Generation
38
-
* Simulated Multi-Path Exploration (within the prompt):
39
-
* Write pesudo code to define complex workflows
40
39
* Debate, simulating multiple characters
40
+
* Tree of thought
41
41
***Few-Shot Examples:** You *could* experiment with adding 1-2 high-quality AIME problem/solution examples directly into the `PROMPT_TEMPLATE` string (similar to how Weco attempted in one of the runs). Ensure the examples clearly show the desired reasoning style and the final `\boxed{XXX}` format. *Caution: This significantly increases prompt length and cost.*
42
+
***Play with format:** The way you format the prompt. Markdown, xml, json, code or natural language. Similarly for the thinking tokens themselves you can also try out different formats.
42
43
43
44
## 5. Constraints
44
45
***Ensure the final output reliably contains `\boxed{XXX}` as the evaluation script depends on it.**
0 commit comments