mkhalifa commited on
Commit
23a4c47
·
verified ·
1 Parent(s): 2861c2c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -16
README.md CHANGED
@@ -60,9 +60,9 @@ llm = LLM(model=model_id, max_model_len=16384)
60
 
61
  # Example problem and solution
62
  problem = "Solve for x: 2x + 3 = 7"
63
- prefix = "Step 1: Subtract 3 from both sides: 2x = 4\nStep 2: Divide by 2: x = 2"
64
 
65
- # Format the prompt -- this is the prompt used for the results in the paper.
66
  prompt = f"""You are given a math problem and a proposed step-by-step solution:
67
 
68
  [Math Problem]
@@ -78,7 +78,7 @@ Review and critique each step in the proposed solution to determine whether each
78
 
79
  prompt = tokenizer.apply_chat_template([
80
  {'role': "user", "content": prompt}
81
- ], tokenize=False, add_generation_prompt=True) # construct prompt
82
 
83
  # Set sampling parameters
84
  sampling_params = SamplingParams(
@@ -92,23 +92,34 @@ outputs = llm.generate(prompt, sampling_params)
92
  verification_cot = outputs[0].outputs[0].text
93
 
94
  print(verification_cot)
95
- # Alright, I've got this math problem to solve: 2x + 3 = 7. And there's a proposed solution in multiple steps that I need to review and critique.
96
- # ...
97
- # Yes, that checks out. So, the solution is correct.
 
 
 
 
 
 
 
 
 
 
 
98
 
99
- # Alternatively, I could think about it differently. Maybe I could first divide both sides by 2, but that would give me x + 1.5 = 3.5, and then subtract 1.5 from both sides to get x = 2. But that's more complicated than the given solution.
100
 
101
- # The given solution is straightforward and efficient.
102
 
103
- # So, in conclusion, both steps are correct, and the solution is accurate.
104
 
105
- # But according to the instructions, since both steps are correct, I don't need to go into more detail. I just need to state that each step is correct.
106
 
107
- # So, my output should be:
108
 
109
- # Step 1: The step is to subtract 3 from both sides, resulting in 2x = 4. This is a correct operation to isolate the term with x. The step is \boxed{correct}
110
- #
111
- ## Step 2: The step is to divide both sides by 2, resulting in x = 2. This is the correct operation to solve for x. The step is \boxed{correct}
112
 
113
- # </think>
114
- # Is the solution correct? Yes
 
 
 
60
 
61
  # Example problem and solution
62
  problem = "Solve for x: 2x + 3 = 7"
63
+ prefix = "Step 1: Subtract 3 from both sides: 2x = 4\nStep 2: Divide by 2: x = 1"
64
 
65
+ # Format the prompt
66
  prompt = f"""You are given a math problem and a proposed step-by-step solution:
67
 
68
  [Math Problem]
 
78
 
79
  prompt = tokenizer.apply_chat_template([
80
  {'role': "user", "content": prompt}
81
+ ], tokenize=False, add_generation_prompt=True) + "\nLet's verify step by step:"
82
 
83
  # Set sampling parameters
84
  sampling_params = SamplingParams(
 
92
  verification_cot = outputs[0].outputs[0].text
93
 
94
  print(verification_cot)
95
+ """
96
+ Step 1: Subtract 3 from both sides: 2x = 4
97
+
98
+ Critique: Starting with the equation 2x + 3 = 7, subtracting 3 from both sides is a correct operation to isolate the term with the variable. So, 2x + 3 - 3 = 7 - 3, which simplifies
99
+ to 2x = 4. This step seems correct.
100
+
101
+ Step 2: Divide by 2: x = 1
102
+
103
+ Critique: Now, to solve for x, we need to divide both sides of the equation by 2. So, 2x / 2 = 4 / 2, which simplifies to x = 2. Wait a minute, the solution says x = 1, but accordin
104
+ g to this calculation, it should be x = 2. This seems incorrect.
105
+
106
+ Therefore, the first step is correct, but the second step has an error.
107
+
108
+ **Final Output:**
109
 
110
+ Let's verify step by step:
111
 
112
+ Step 1: Subtract 3 from both sides: 2x = 4
113
 
114
+ Critique: This step is correct. Subtracting 3 from both sides of the equation 2x + 3 = 7 properly isolates the term with the variable, resulting in 2x = 4.
115
 
116
+ Step 1 is \boxed{correct}
117
 
118
+ Step 2: Divide by 2: x = 1
119
 
120
+ Critique: This step is incorrect. Dividing both sides of the equation 2x = 4 by 2 should yield x = 2, not x = 1.
 
 
121
 
122
+ Step 2 is \boxed{incorrect}
123
+ </think>
124
+ Is the solution correct? No
125
+ """