/ Модель

Характеристики

Контекст
4 096 токенов
Параметры
7,1 млрд
Размер весов
15,3 ГБ
Лицензия
Своя лицензия
Архитектура
qwen2 · dense
Базовая модель
Qwen2.5-Math-7B-Instruct
Библиотека
transformers
Опубликована
13 янв 2025

Qwen2.5-Math-7B-PRM800K

Классификация текстаТекст → label3 профессии

Процессная reward-модель Qwen оценивает правильность математического рассуждения по отдельным шагам и подходит для ранжирования решений и воспроизведения экспериментов ProcessBench.

292скачиваний за 30 дней22лайкавеса обновлены17 янв 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Qwen2.5-Math-7B-PRM800K — процессная reward-модель, разработанная командой Qwen на базе Qwen2.5-Math-7B-Instruct и дообученная на обучающей части открытого датасета PRM800K. Она оценивает качество математического решения по шагам: для каждого промежуточного шага модель выдаёт оценку вероятности положительной метки, которую можно использовать как награду при проверке рассуждений или выборе решения. Модель предназначена для воспроизведения базового эксперимента ProcessBench, а не для генерации ответов.

Модель построена на плотной архитектуре Qwen2, содержит 7,1 млрд параметров и работает с текстом на английском и китайском языках; длина контекста — 4096 токенов. Для разделения шагов рекомендуется использовать двойной перевод строки, а оценка извлекается для специального токена после каждого шага. Модель распространяется в формате safetensors; в карточке указана лицензия other.

Сценарии применения

  • оценка корректности промежуточных шагов математического решения
  • выбор лучшего из нескольких пошаговых решений задачи
  • вычисление награды для обучения или поиска с обратной связью по рассуждениям
  • воспроизведение базового эксперимента ProcessBench

Ограничения

Модель предназначена для оценки пошаговых рассуждений, а не для генерации ответов. Рекомендуется явно разделять шаги двойными переводами строк; применение в карточке заявлено как воспроизведение базового результата ProcessBench.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen2.5-Math-7B-PRM800K

Introduction

Qwen2.5-Math-7B-PRM800K serves as the baseline in ProcessBench, solely for reproduction purposes. It is obtained by fine-tuning Qwen2.5-Math-7B-Instruct on the training set of open-source dataset PRM800K. We treat the original 1 and 0 labels in PRM800K as our positive labels, while -1 as negative ones. To eliminate test data contamination, we also remove the PRM800K training samples that have the same math queries in MATH test set.

Model Details

For more details, please refer to our ProcessBench Paper, PRM Paper and ProcessBench GitHub repo.

Requirements

  • transformers>=4.40.0 for Qwen2.5-Math models. The latest version is recommended.

[!Warning]

For requirements on GPU memory and the respective throughput, see similar results of Qwen2 here.

Quick Start

[!Important]

Qwen2.5-Math-7B-PRM800K is a process reward model typically used for offering feedback on the quality of reasoning and intermediate steps rather than generation.

Prerequisites

  • Step Separation: We recommend using double line breaks ("\n\n") to separate individual steps within the solution if using responses from Qwen2.5-Math-Instruct.
  • Reward Computation: After each step, we insert a special token "<extra_0>". For reward calculation, we extract the probability score of this token being classified as positive, resulting in a reward value between 0 and 1.

🤗 Hugging Face Transformers

Here we show a code snippet to show you how to use the Qwen2.5-Math-7B-PRM800K with transformers:

import torch
from transformers import AutoModel, AutoTokenizer
import torch.nn.functional as F


def make_step_rewards(logits, token_masks):
    probabilities = F.softmax(logits, dim=-1)
    probabilities = probabilities * token_masks.unsqueeze(-1) # bs, seq_len, num_labels
    
    all_scores_res = []
    for i in range(probabilities.size(0)):
        sample = probabilities[i] # seq_len, num_labels
        positive_probs = sample[sample != 0].view(-1, 2)[:, 1] # valid_tokens, num_labels
        non_zero_elements_list = positive_probs.cpu().tolist()
        all_scores_res.append(non_zero_elements_list)
    return all_scores_res


model_name = "Qwen/Qwen2.5-Math-7B-PRM800K"
device = "auto"

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModel.from_pretrained(
    model_name, 
    device_map=device, 
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
).eval()


data = {
    "system": "Please reason step by step, and put your final answer within \\boxed{}.",
    "query": "Sue lives in a fun neighborhood.  One weekend, the neighbors decided to play a prank on Sue.  On Friday morning, the neighbors placed 18 pink plastic flamingos out on Sue's front yard.  On Saturday morning, the neighbors took back one third of the flamingos, painted them white, and put these newly painted white flamingos back out on Sue's front yard.  Then, on Sunday morning, they added another 18 pink plastic flamingos to the collection. At noon on Sunday, how many more pink plastic flamingos were out than white plastic flamingos?",
    "response": [
      "To find out how many more pink plastic flamingos were out than white plastic flamingos at noon on Sunday, we can break down the problem into steps. First, on Friday, the neighbors start with 18 pink plastic flamingos.",
      "On Saturday, they take back one third of the flamingos. Since there were 18 flamingos, (1/3 \\times 18 = 6) flamingos are taken back. So, they have (18 - 6 = 12) flamingos left in their possession. Then, they paint these 6 flamingos white and put them back out on Sue's front yard. Now, Sue has the original 12 pink flamingos plus the 6 new white ones. Thus, by the end of Saturday, Sue has (12 + 6 = 18) pink flamingos and 6 white flamingos.",
      "On Sunday, the neighbors add another 18 pink plastic flamingos to Sue's front yard. By the end of Sunday morning, Sue has (18 + 18 = 36) pink flamingos and still 6 white flamingos.",
      "To find the difference, subtract the number of white flamingos from the number of pink flamingos: (36 - 6 = 30). Therefore, at noon on Sunday, there were 30 more pink plastic flamingos out than white plastic flamingos. The answer is (\\boxed{30})."
    ]
}

messages = [
    {"role": "system", "content": data['system']},
    {"role": "user", "content": data['query']},
    {"role": "assistant", "content": "<extra_0>".join(data['response']) + "<extra_0>"},
]
conversation_str = tokenizer.apply_chat_template(
    messages, 
    tokenize=False, 
    add_generation_prompt=False
)

input_ids = tokenizer.encode(
    conversation_str, 
    return_tensors="pt", 
).to(model.device)

outputs = model(input_ids=input_ids)

step_sep_id = tokenizer.encode("<extra_0>")[0]
token_masks = (input_ids == step_sep_id)
step_reward = make_step_rewards(outputs[0], token_masks)
print(step_reward)  # [[0.9921875, 0.2333984375, 0.6796875, 0.94140625]]

Citation

If you find our work helpful, feel free to give us a citation.

@article{processbench,
  title={ProcessBench: Identifying Process Errors in Mathematical Reasoning}, 
  author={
    Chujie Zheng and Zhenru Zhang and Beichen Zhang and Runji Lin and Keming Lu and Bowen Yu and Dayiheng Liu and Jingren Zhou and Junyang Lin
  },
  journal={arXiv preprint arXiv:2412.06559},
  year={2024}
}
@article{prmlessons,
  title={The Lessons of Developing Process Reward Models in Mathematical Reasoning}, 
  author={
    Zhenru Zhang and Chujie Zheng and Yangzhen Wu and Beichen Zhang and Runji Lin and Bowen Yu and Dayiheng Liu and Jingren Zhou and Junyang Lin
  },
  journal={arXiv preprint arXiv:2501.07301},
  year={2025}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen2ForProcessRewardModel
Ревизия весов
9d6e292

0 моделей