/ Модель

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

Контекст
4 096 токенов
Параметры
7,1 млрд
Размер весов
15,2 ГБ
Лицензия
Apache 2.0
Архитектура
qwen2 · dense
Опубликована
30 дек 2024

EurusPRM-Stage1

Генерация текстаТекст → текст

EurusPRM-Stage1 — модель PRIME-RL для оценки качества отдельных шагов рассуждения по логарифмическим правдоподобиям языковой модели.

22скачиваний за 30 дней4лайкавеса обновлены19 фев 2025

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

EurusPRM-Stage1 — модель оценки решений, разработанная PRIME-RL. Она использует метод Implicit PRM: модель обучена на метках качества целого ответа, а на этапе вывода позволяет получать оценки отдельных шагов рассуждения через разность логарифмических правдоподобий с базовой языковой моделью Qwen2.5-Math-7B-Instruct.

Это плотная причинная языковая модель архитектуры Qwen2 с 7,1 млрд параметров и контекстом 4096 токенов. Она предназначена для оценки и ранжирования пошаговых решений, прежде всего математических, и может применяться при выборе или проверке ответов в системах рассуждения. Репозиторий содержит веса Safetensors; лицензия — Apache-2.0.

Для вычисления оценок требуется сравнивать логарифмические правдоподобия EurusPRM-Stage1 и базовой модели, поэтому практическое использование предполагает доступ к обоим моделям и согласованную обработку шагов решения. README не указывает точный список поддерживаемых языков или количественные показатели качества.

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

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

Ограничения

Для расчёта процессных оценок README использует базовую модель Qwen2.5-Math-7B-Instruct и вычисление разности логарифмических правдоподобий. README не приводит количественных оценок качества или перечня поддерживаемых языков.

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

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

Открыть на Hugging Face

EurusPRM-Stage1

Links

Introduction

EurusPRM-Stage1 is trained using Implicit PRM, which obtains free process rewards at no additional cost but just needs to simply train an ORM on the cheaper response-level labels. During inference, implicit process rewards are obtained by forward passing and calculating the log-likelihood ratio on each step.

The key ingredient of Implicit PRM is the reward representation, as demonstrated below:

Proposition: Consider an ORM where the reward is parameterized by the log-likelihood ratio of two causal LMs, i.e.

$$ r_\phi(\mathbf{y}) := \beta \log \frac{\pi_\phi(\mathbf{y})}{\pi_\text{ref}(\mathbf{y})}. $$

Define

$$ q_\phi^t(\mathbf{y}{<t}, y_t) := \sum{i=1}^{t} \beta \log \frac{\pi_\phi(y_{i}|\mathbf{y}{<i})}{\pi\text{ref}(y_{i}|\mathbf{y}_{<i})}. $$

is the exponential average of \(r_\theta\) at step \(t\).

$$ q_\phi^t(\mathbf{y}{<t}, y_t) = \beta \log \mathbb{E}{\pi\text{ref}(\mathbf{y}|\mathbf{y}{\leq t})} \left[ e^{\frac{1}{\beta} r\phi(\mathbf{y})} \right] $$

Hence, \(q_\theta^t\)represents an exact expectation of outcome reward \(r_\theta\) at step \(t\), i.e., the Q value.

The proposition indicates that when modeling

$$ r_\phi(\mathbf{y}) := \beta \log \frac{\pi_\phi(\mathbf{y})}{\pi_\text{ref}(\mathbf{y})} $$

to train an ORM with the standard pipeline, where \(\beta\) is a hyperparameter, \(\phi\) can implicitly learn a Q function. Hence, process reward \(r_\phi^t\) can be obtained by:

$$ r_\phi^t := q_\phi^t - q_\phi^{t-1} = \beta \log \frac{\pi_\phi(y_{t}|\mathbf{y}{<t})}{\pi\text{ref}(y_{t}|\mathbf{y}_{<t})}. $$

Therefore, we can indeed obtain PRMs simply by collecting response-level data and training an ORM, without any burden of annotating step labels.

The proposition is agnostic to specific choices of the training objective of ORMs. It can be instantiated with different objectives as vanilla ORM training, with the only difference being substituting the \(r_\phi \left( \mathbf{y} \right)\) with \(\beta \log \frac{\pi_\phi(\mathbf{y})}{\pi_\text{ref}(\mathbf{y})}\).

For example, DPO already meets our assumption and serves as a strong variant, while in this work, we instantiate our implicit PRM with cross entropy (CE) loss due to memory efficiency:

$$ \small \mathcal{L}{CE} = l \cdot \log \sigma \left( \beta \log \frac{\pi\phi(\mathbf{y})}{\pi_\text{ref}(\mathbf{y})} \right) + (1 - l) \cdot \log \left[ 1 - \sigma \left( \beta \log \frac{\pi_\phi(\mathbf{y})}{\pi_\text{ref}(\mathbf{y})} \right) \right] $$

We applied the above \(L_{CE}\) to train implicit PRM. We used a learning rate of 5e-7 and a batch-size of 64 for training.

Usage

We show an example leveraging EurusPRM-Stage1 below:

import torch
from transformers import AutoTokenizer,AutoModelForCausalLM
coef=0.001
d = {'query':'Convert the point $(0,3)$ in rectangular coordinates to polar coordinates.  Enter your answer in the form $(r,\\theta),$ where $r > 0$ and $0 \\le \\theta < 2 \\pi.$',
     'answer':[
            "Step 1: To convert the point (0,3) from rectangular coordinates to polar coordinates, we need to find the radius (r) and the angle theta (\u03b8).",
            "Step 2: Find the radius (r). The radius is the distance from the origin (0,0) to the point (0,3). Since the x-coordinate is 0, the distance is simply the absolute value of the y-coordinate. So, r = |3| = 3.",
            "Step 3: Find the angle theta (\u03b8). The angle theta is measured counterclockwise from the positive x-axis. Since the point (0,3) lies on the positive y-axis, the angle theta is 90 degrees or \u03c0\/2 radians.",
            "Step 4: Write the polar coordinates. The polar coordinates are (r, \u03b8), where r > 0 and 0 \u2264 \u03b8 < 2\u03c0. In this case, r = 3 and \u03b8 = \u03c0\/2.\n\nTherefore, the polar coordinates of the point (0,3) are (3, \u03c0\/2).\n\n\n\\boxed{(3,\\frac{\\pi}{2})}"
     ]
     }
model = AutoModelForCausalLM.from_pretrained('PRIME-RL/EurusPRM-Stage1')
tokenizer = AutoTokenizer.from_pretrained('PRIME-RL/EurusPRM-Stage1')
ref_model = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-Math-7B-Instruct')
input_ids = tokenizer.apply_chat_template([
    {"role": "user", "content": d["query"]},
    {"role": "assistant", "content": "\n\n".join(d["answer"])},
], tokenize=True, add_generation_prompt=False,return_tensors='pt')
attention_mask = input_ids!=tokenizer.pad_token_id
step_last_tokens = []
for step_num in range(0, len(d["answer"])+1):
    conv = tokenizer.apply_chat_template([
        {"role":"user", "content":d["query"]},
        {"role":"assistant", "content":"\n\n".join(d["answer"][:step_num])},
    ], tokenize=False, add_generation_prompt=False)
    conv = conv.strip()
    if step_num!=0 and step_num!=len(d['answer']):
        conv+='\n\n'
    currect_ids = tokenizer.encode(conv,add_special_tokens=False)
    step_last_tokens.append(len(currect_ids) - 2)


inputs = {'input_ids':input_ids,'attention_mask':attention_mask,'labels':input_ids}
label_mask = torch.tensor([[0]*step_last_tokens[0]+[1]*(input_ids.shape[-1]-step_last_tokens[0])])
step_last_tokens = torch.tensor([step_last_tokens])

def get_logps(model,inputs):
    logits = model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask']).logits
    labels = inputs['labels'][:, 1:].clone().long()
    logits = logits[:, :-1, :]
    labels[labels == -100] = 0
    per_token_logps = torch.gather(logits.log_softmax(-1), dim=2, index=labels.unsqueeze(2)).squeeze(2)
    return per_token_logps

with torch.no_grad():
    per_token_logps = get_logps(model, inputs)
    ref_per_token_logps = get_logps(ref_model,inputs)

raw_reward = per_token_logps - ref_per_token_logps
beta_reward = coef * raw_reward * label_mask[:,1:]
beta_reward = beta_reward.cumsum(-1)
beta_reward = beta_reward.gather(dim=-1, index=step_last_tokens[:,1:])
print(beta_reward)

Evaluation

Evaluation Code

We use codes in Implicit PRM to evaluate the performance of EurusPRM. The reference model is Qwen2.5-Math-7B-Instruct.

Evaluation Base Model

We adopt Eurus-2-7B-SFT, Qwen2.5-7B-Instruct and Llama-3.1-70B-Instruct as generation models to evaluate the performance of our implicit PRM. For all models, we set the sampling temperature as 0.5, p of the top-p sampling as 1.

Best-of-N Sampling

We use Best-of-64 as our evaluation metric. The weighting methods are different for several PRMs below.

  • For Skywork-o1-Open-PRM-Qwen-2.5-7B, we use simple average reward across all steps.
  • For EurusPRM-Stage 1, we use the minimum reward across all steps.
  • For EurusPRM-Stage 2, we use the accumulative rewards.

Eurus-2-7B-SFT

MethodReward ModelMATHAMCAIME_2024OlympiadBenchMinerva MathAvg
Greedy Pass @ 1N/A65.130.13.329.832.732.2
Majority Voting @ 64N/A65.653.013.339.122.438.7
Best-of-64Skywork-o1-Open-PRM-Qwen-2.5-7B47.245.810.032.316.230.3
EurusPRM-Stage 144.641.06.732.917.328.5
EurusPRM-Stage 247.243.413.333.819.231.4
Weighted Best-of-64Skywork-o1-Open-PRM-Qwen-2.5-7B64.655.413.341.323.239.6
EurusPRM-Stage 166.054.213.339.629.040.4
EurusPRM-Stage 266.054.213.339.729.040.4

Llama-3.1-70B-Instruct

MethodReward ModelMATHAMCAIME 2024OlympiadBenchMinerva MathAvg
Greedy Pass @ 1N/A64.630.116.731.935.335.7
Majority Voting @ 64N/A80.253.026.740.438.647.8
Best-of-N @ 64Skywork-o1-Open-PRM-Qwen-2.5-7B77.856.623.339.031.645.7
EurusPRM-Stage 177.844.626.735.341.545.2
EurusPRM-Stage 280.659.020.037.644.948.4
Weighted Best-of-64Skywork-o1-Open-PRM-Qwen-2.5-7B81.256.623.342.438.248.3
EurusPRM-Stage 180.453.026.740.946.749.5
EurusPRM-Stage 280.453.026.741.046.349.5

Qwen2.5-7B-Instruct

MethodReward ModelMATHAMCAIME 2024OlympiadBenchMinerva MathAvg
Greedy Pass @ 1N/A73.347.013.339.435.341.7
Majority Voting @ 64N/A82.053.016.743.036.446.2
Best-of-N @ 64Skywork-o1-Open-PRM-Qwen-2.5-7B85.260.220.044.732.748.6
EurusPRM-Stage 181.847.016.740.141.545.4
EurusPRM-Stage 286.059.016.741.441.548.9
Weighted Best-of-64Skywork-o1-Open-PRM-Qwen-2.5-7B83.655.413.343.736.846.6
EurusPRM-Stage 182.653.016.742.745.248.0
EurusPRM-Stage 284.853.016.743.245.648.7

Citation

@article{cui2025process,
  title={Process reinforcement through implicit rewards},
  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},
  journal={arXiv preprint arXiv:2502.01456},
  year={2025}
}
@article{yuan2024implicitprm,
  title={Free Process Rewards without Process Labels},
  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},
  journal={arXiv preprint arXiv:2412.01981},
  year={2024}
}

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

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

GPU в ailist

Универсальный рантайм

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

Подбираем GPU…

Класс архитектуры
Qwen2ForCausalLM
Ревизия весов
4966467

0 моделей