Views
No views yet



{question} + "\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end."{question} + "\n\nPresent the answer in LaTex format: \\boxed{Your answer}"1
2import os
3from tqdm import tqdm
4import torch
5from vllm import LLM, SamplingParams
6os.environ["NCCL_IGNORE_DISABLED_P2P"] = "1"
7os.environ["TOKENIZERS_PARALLELISM"] = "true"
8
9def generate(question_list,model_path):
10 llm = LLM(
11 model=model_path,
12 trust_remote_code=True,
13 tensor_parallel_size=torch.cuda.device_count(),
14 gpu_memory_utilization=0.90,
15 )
16 sampling_params = SamplingParams(max_tokens=8192,
17 temperature=0.0,
18 n=1)
19 outputs = llm.generate(question_list, sampling_params, use_tqdm=True)
20 completions = [[output.text for output in output_item.outputs] for output_item in outputs]
21 return completions
22
23
24def make_conv_zero(question):
25 question = question + "\n\nPresent the answer in LaTex format: \\boxed{Your answer}"
26 content = f"A conversation between User and Assistant. The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> answer here </answer>. User: {question}. Assistant:"
27 print(content)
28 return content
29
30def run():
31 model_path = "PRIME-RL/Eurus-2-7B-PRIME-Zero"
32 all_problems = [
33 "which number is larger? 9.11 or 9.9?"
34 ]
35 completions = generate([make_conv_zero(problem_data) for problem_data in all_problems],model_path)
36 print(completions)
37 # " Let's compare the numbers 9.11 and 9.9.\n\nTo determine which number is larger, we can compare them digit by digit from left to right.\n\nFirst, let's look at the digits in the ones place:\n- Both numbers have a 9 in the ones place.\n\nNext, let's look at the digits in the tenths place:\n- The number 9.11 has a 1 in the tenths place.\n- The number 9.9 has a 9 in the tenths place.\n\nSince 9 is greater than 1, we can conclude that 9.9 is greater than 9.11.\n\nSo, the larger number is \\(\\boxed{9.9}\\)."
38if __name__ == "__main__":
39 run()
40
411@article{cui2025process,
2 title={Process reinforcement through implicit rewards},
3 author={Cui, Ganqu and Yuan, Lifan and Wang, Zefan and Wang, Hanbin and Li, Wendi and He, Bingxiang and Fan, Yuchen and Yu, Tianyu and Xu, Qixin and Chen, Weize and others},
4 journal={arXiv preprint arXiv:2502.01456},
5 year={2025}
6}1@article{yuan2024implicitprm,
2 title={Free Process Rewards without Process Labels},
3 author={Lifan Yuan and Wendi Li and Huayu Chen and Ganqu Cui and Ning Ding and Kaiyan Zhang and Bowen Zhou and Zhiyuan Liu and Hao Peng},
4 journal={arXiv preprint arXiv:2412.01981},
5 year={2024}
6}