/ Модель

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

Контекст
131 072 токена
Параметры
7,5 млрд
Размер весов
16,1 ГБ
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
Llama-3.1-8B-Instruct
Библиотека
transformers
Опубликована
25 дек 2024

CodeRM-8B

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

CodeRM-8B — дообученная модель на базе Llama 3.1 8B Instruct для генерации Python-модульных тестов к задачам программирования.

319скачиваний за 30 дней6лайковвеса обновлены20 янв 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CodeRM-8B — специализированная модель генерации модульных тестов для кода, разработанная авторами проекта CodeRM. Она принимает условие задачи и готовое решение в виде функции и генерирует тестовый класс на Python с использованием библиотеки unittest и подробными комментариями. Модель основана на Llama 3.1 8B Instruct и дообучена на 60 тысячах синтетических Python-тестов, созданных с помощью Llama 3.1 70B Instruct на основе наборов CodeFeedback-Filtered-Instruction и обучающей части TACO.

Модель имеет плотную архитектуру LlamaForCausalLM, около 7,5 млрд параметров и контекст до 131 072 токенов. Карточка приводит результаты оценки генерации тестов в сценарии Best-of-N и сообщает о сопоставимости с Llama 3.1 70B Instruct в этом режиме; качество зависит от корректности постановки задачи, решения и выбранных тестов. Лицензия — Apache 2.0.

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

  • генерация тестов unittest для функции Python
  • проверка решений задач по программированию
  • создание тестовых случаев для отбора решений Best-of-N

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Introduction

CodeRM-8B is a small yet powerful model designed to enable efficient and high-quality unit test generation. It is trained on a dataset of 60k high-quality synthetic Python unit tests using Llama3.1-70B-Instruct. These unit tests are synthesized based on two well-regarded code instruction tuning datasets: CodeFeedback-Filtered-Instruction and the training set of TACO. The training dataset used for unit test generation is openly available under CodeRM-UnitTest.

For further information and details of training, refer to our paper: "Dynamic Scaling of Unit Tests for Code Reward Modeling" available on arXiv.

You can also visit the homepage and the github repo of the paper.

Model Information

The model is trained based on Llama3.1-8B-Instruct.

Prompt Format

Below is a question and it's corresponding code answer. Please write test cases to check the correctness of the code answer. You need to use the unittest library in Python and create a test class for testing.

### question
{question}

### code solution
{code in function format}

Please add detailed comments to the test cases you write. You do not need to test the function's ability to throw exceptions.

Performance

Best-of-N

First, we evaluate the performance of CodeRM-8B using a best-of-N setting. In this setup, an LLM (policy model) generates 100 candidate code solutions for a given programming problem, while another LLM (reward model) generates 100 unit tests. The optimal code solution is then selected based on majority voting derived from the execution results of these unit tests.

Under this framework, our trained unit test generator demonstrates performance comparable to Llama3.1-70B-Instruct, despite having an 8x smaller parameter size. The detailed evaluation results across three well-known benchmarks are as follows:

ModelPolicy: Llama3-8BPolicy: Llama3-70BPolicy: GPT-3.5Policy: GPT-4o-mini
Benchmark: HumanEval Plus
Vanilla53.5873.7467.8382.96
Reward: Llama3.1-8B66.84 (+13.26)77.14 (+3.40)76.32 (+8.49)83.11 (+0.15)
Reward: Llama3.1-70B72.04 (+18.46)78.54 (+4.80)79.76 (+11.93)85.45 (+2.49)
Reward: CodeRM-8B72.01 (+18.43)78.69 (+4.95)78.01 (+10.18)86.38 (+3.42)
Benchmark: MBPP Plus
Vanilla49.2069.3370.5371.59
Reward: Llama3.1-8B64.31 (+15.11)71.64 (+2.31)74.18 (+3.65)74.48 (+2.89)
Reward: Llama3.1-70B65.26 (+16.06)71.85 (+2.52)75.72 (+5.19)74.96 (+3.37)
Reward: CodeRM-8B66.71 (+17.51)72.44 (+3.11)75.96 (+5.43)75.20 (+3.61)
Benchmark: LiveCodeBench
Vanilla11.9825.3020.5534.83
Reward: Llama3.1-70B13.28 (+1.30)28.46 (+3.16)22.80 (+2.25)38.60 (+3.77)
Reward: CodeRM-8B15.21 (+3.23)27.73 (+2.43)21.76 (+1.21)39.20 (+4.37)

Quality of Unit Test

We evaluate the quality of the unit test generated by CodeRM-8B. As each unit test functions as a classifier to determine correct or incorrect solutions, we first utilize accuracy and F1 score as metrics to assess the classification performance of the unit test.

We further propose two new metrics to detailed evaluate the possibility of the unit test making incorrect judgments. False Acceptance Rate (FAR) measures the probability of wrong solutions being accepted by unit tests. False Rejection Rate (FRR) measures the probability of correct solutions being rejected by unit tests. The calculation formulas for these four metrics are introduced in Appendix D of the paper.

Below is the quality of individual unit tests and the combination of multiple unit tests on HumanEval Plus, utilizing Llama3.1-8B as the policy model. The top two performances are marked in bold and underlined.

ModelAcc (↑)F1 (↑)FAR (↓)FRR (↓)
Quality of Individual Unit Tests
Llama3.1-8B60.0244.9713.6646.13
Llama3.1-70B73.6570.1511.1034.51
CodeRM-8B (Ours)69.6463.6311.1738.55
Quality of Multiple Unit Tests
Llama3.1-8B74.2174.3520.4430.55
Llama3.1-70B78.3078.7617.1925.97
CodeRM-8B (Ours)80.4681.2716.4822.71

Citation

If you find our model helpful, please cite the original paper:

@misc{ma2025coderm,
      title={Dynamic Scaling of Unit Tests for Code Reward Modeling}, 
      author={Zeyao Ma and Xiaokang Zhang and Jing Zhang and Jifan Yu and Sijia Luo and Jie Tang},
      year={2025},
      eprint={2501.01054},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.01054}, 
}

Contact

If you have any problems, feel free to raise an issue or reach out to us via email at: zeyaoma@gmail.com.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
13f7659

0 моделей