/ Модель

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

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

Eurus-2-7B-PRIME

Генерация текстаТекст → текст3 профессии

Eurus-2-7B-PRIME — текстовая модель на базе Qwen2.5-Math-7B, обученная для улучшения рассуждений при решении математических задач и написании кода.

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

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Eurus-2-7B-PRIME — языковая модель PRIME-RL, построенная на базе Qwen2.5-Math-7B-Base и обученная командой PRIME-RL методом PRIME: онлайн-обучением с подкреплением, использующим неявные оценки процесса решения. Модель предназначена для генерации ответов с рассуждениями, особенно при решении математических задач и написании кода; авторы сообщают об улучшении результатов на ряде математических тестов относительно версии Eurus-2-7B-SFT.

Это плотная причинная модель Qwen2 с 7,1 млрд параметров, работающая через Transformers и принимающая текстовые запросы. Заявленный контекст — 4096 токенов. Для задач по математике и программированию README предлагает специальные формулировки запросов; приведённые результаты относятся к указанным бенчмаркам и не гарантируют аналогичного качества на других задачах. Модель распространяется под лицензией Apache-2.0.

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

  • Решение задач по математике с пошаговыми рассуждениями
  • Подготовка решений для задач олимпиадной математики
  • Написание Python-кода для задач по заданному условию

Ограничения

Контекст модели ограничен 4096 токенами. Приведённые в README оценки относятся к отдельным математическим бенчмаркам и сами по себе не подтверждают качество на других задачах.

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

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

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

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

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

Открыть на Hugging Face

Eurus-2-7B-PRIME

Links

Introduction

image-20241230162026156

Eurus-2-7B-PRIME is trained using PRIME (Process Reinforcement through IMplicit rEward) method, an open-source solution for online reinforcement learning (RL) with process rewards, to advance reasoning abilities of language models beyond imitation or distillation. It starts with Eurus-2-7B-SFT and trains on Eurus-2-RL-Data.

As shown in the animation above, in PRIME, the policy model and PRM are both initialized with the SFT model. For each RL iteration, the policy model first generates rollouts. Then, the implicit PRM and outcome verifier score the rollouts, and the implicit PRM gets updated on the rollouts with the outcome reward. Finally, the outcome reward \(r_o\) and process reward \(r_p\) are combined and used to update the policy model.

The PRIME implementation pseudocode is as follows:

The algorithm flow includes:

  1. Prompt filtering based on policy model performance, only preserving those on which the policy model \(\pi_\theta\) achieves a accuracy between 0.2 and 0.8.
  2. Calculate implicit process reward \(r^t\).
  3. Update Implicit PRM \(\pi_\psi\) based on predicted implicit process reward \(r^t\) and ground truth outcome label \(r\).
  4. Advantage estimation with RLOO. Specifically, we first calculate the return of outcome rewards and implicit process rewards separately:
  • For ground truth outcome rewards, we directly adopt RLOO without any modification.

  • For implicit process rewards, we perform a three-step process to calculate return: (1) Use the averaged implicit process rewards to calculate the leave-one-out baseline (2) Normalize the process reward at step \(t\) by subtracting the baseline; (3) Calculate the discounted return for each response.

    Finally, advantage is set to the combination of both returns.

​ 5. Update the policy \(\pi_\theta\) using PPO loss for legit importance sampling.

Usage

We apply tailored prompts for coding and math task:

Coding

{question} + "\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end."

Math

{question} + "\n\nPresent the answer in LaTex format: \\boxed{Your answer}"
import os
from tqdm import tqdm
import torch
from transformers import AutoTokenizer
from vllm import LLM, SamplingParams
os.environ["NCCL_IGNORE_DISABLED_P2P"] = "1"
os.environ["TOKENIZERS_PARALLELISM"] = "true"

def generate(question_list,model_path):
    llm = LLM(
        model=model_path,
        trust_remote_code=True,
        tensor_parallel_size=torch.cuda.device_count(),
        gpu_memory_utilization=0.90,
    )
    sampling_params = SamplingParams(max_tokens=8192,
                                    temperature=0.0,
                                    n=1)
    outputs = llm.generate(question_list, sampling_params, use_tqdm=True)
    completions = [[output.text for output in output_item.outputs] for output_item in outputs]
    return completions

def make_conv_hf(question, tokenizer):
    # for math problem
    content = question + "\n\nPresent the answer in LaTex format: \\boxed{Your answer}"
    # for code problem
    # content = question + "\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end." 
    msg = [
        {"role": "user", "content": content}
    ]
    chat = tokenizer.apply_chat_template(msg, tokenize=False, add_generation_prompt=True)
    return chat
    
def run():
    model_path = "PRIME-RL/Eurus-2-7B-PRIME"
    all_problems = [
        "which number is larger? 9.11 or 9.9?"
    ]
    tokenizer = AutoTokenizer.from_pretrained(model_path)
    completions = generate([make_conv_hf(problem_data, tokenizer) for problem_data in all_problems],model_path)
    print(completions)
    # [['[ASSESS]\n\n# The problem asks us to compare two decimal numbers, 9.11 and 9.9, to determine which one is larger.\n# We need to compare the whole parts and the decimal parts of the numbers.\n\nNext action: [ADVANCE]\n\n# Compare the whole parts of the numbers: both 9.11 and 9.9 have the same whole part, which is 9.\n# Compare the decimal parts of the numbers: 0.11 (from 9.11) is less than 0.9 (from 9.9).\n\nNext action: [ADVANCE]\n\n# Since the whole parts are the same and the decimal part of 9.9 is greater than the decimal part of 9.11, we can conclude that 9.9 is larger than 9.11.\n\nNext action: [OUTPUT]\n\nThe final answer is $\\boxed{9.9}$.\n\n']]
if __name__ == "__main__":
    run()

Evaluation

Through PRIME, we successfully achieve substantial improvements on key reasoning benchmarks over our SFT version of the model, leading to 16.7% improvement on average, and over 20% on AMC&AIME competitions. Our final model Eurus-2-7B-PRIME, based on Qwen-2.5-Math-7B-Base, surpassed its instruct version on 5 key reasoning benchmarks.

The final results are presented below:

Eurus-2-7B-PRIMEEurus-2-7B-SFTQwen-2.5-Math-7B-InstructLlama-3.1-70B-InstructGPT-4o
AIME 202426.7 (+23.3)3.313.316.79.3
MATH-50079.2 (+14.1)65.179.864.676.4
AMC57.8 (+27.7)30.150.630.145.8
Minerva Math38.6 (+5.9)32.734.635.336.8
OlympiadBench42.1 (+12.3)29.840.731.943.3
Avg.48.9 (+ 16.7)32.243.836.443.3

We achieved this with only 1/10 data and model resources compared with Qwen-Math.

Eurus-2-7B-PRIMEQwen2.5-Math-7B-Instruct
Base ModelQwen2.5-Math-7BQwen2.5-Math-7B
SFT Data230K (open-source)2.5M (open-source and in-house)
RM Data0618K (in-house)
RMEurus-2-7B-SFTQwen2.5-Math-RM (72B)
RL Data150K queries \(\times\)4 samples66K queries \(\times\) 32 samples

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

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

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

Подбираем GPU…

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

0 моделей