/ Модель

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

Контекст
24 576 токенов
Параметры
7,4 млрд
Размер весов
22,2 ГБ
Лицензия
Своя лицензия
Архитектура
internlm2 · dense
Библиотека
transformers
Опубликована
21 янв 2025

internlm-xcomposer2d5-7b-reward

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

Мультимодальная модель InternLM оценивает ответы по человеческим предпочтениям, сравнивает диалоги и ранжирует варианты.

92скачиваний за 30 дней11лайковвеса обновлены20 мая 2025

Бенчмарки

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

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

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

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

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

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

InternLM-XComposer2.5-Reward — мультимодальная модель оценки предпочтений, разработанная командой InternLM на базе internlm/internlm-xcomposer2d5-7b. Она обучена на примерах предпочтений для текста, изображений и видео и присваивает ответам оценки, отражающие человеческие предпочтения. Модель предназначена для оценки диалогов, сравнения ответов и ранжирования нескольких вариантов, в том числе при проверке качества общения, безопасности и рассуждений.

Модель построена на архитектуре InternLM2, содержит 7,4 млрд параметров и использует формат PyTorch. Указана длина контекста 24 576 токенов; карточка называет английский и китайский языки. В README приведены результаты на VLRewardBench, RewardBench и RM-Bench, включая оценивание безопасности, рассуждений, математики и кода. Лицензия обозначена как other, поэтому условия использования следует сверять с файлами лицензии репозитория.

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

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

Ограничения

Оценки модели отражают предпочтения, усвоенные из обучающих данных, и могут не совпадать с оценками конкретных пользователей или приложений. Лицензия указана как other; перед использованием проверьте её условия в репозитории.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

💻Github Repo

Paper (ACL 2025 Findings)

News and Updates

Introduction

InternLM-XComposer2.5-Reward is a multi-modal reward model trained on the foundation of internlm/internlm-xcomposer2d5-7b. This model has been trained using preference samples across text, image and video domains, and assigning appropriate reward scores that align with human preferences.

Performance Evaluation

  • Result on VLRewardBench

    ModelsGeneralHallucinationReasoningOverallMacro
    InternLM-XComposer2.5-7B-Reward84.762.562.965.870.0
  • Result on RewardBench | Models | Score | Chat | Chat Hard | Safety | Reasoning | | --- | --- | --- | --- | --- | --- | | InternLM-XComposer2.5-7B-Reward | 88.6 | 90.8 | 83.8 | 87.8 | 90.0 |

  • Result on RM-Bench | Models | Chat | Math | Code | Safety | Easy | Normal | Hard | Average | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | InternLM-XComposer2.5-7B-Reward | 65.5 | 55.9 | 51.7 | 93.8 | 87.5 | 71.3 | 47.4 | 68.8 |

Basic Usage

Here is an example of how to use the model to get the reward score of a chat, compare two chats, or rank multiple chats.

import torch
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained(
    "internlm/internlm-xcomposer2d5-7b-reward", 
    device_map="cuda", 
    torch_dtype=torch.float16, 
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("internlm/internlm-xcomposer2d5-7b-reward", trust_remote_code=True)
model.tokenizer = tokenizer

chat_1 = [
    {"role": "user", "content": 'I want to buy a car from the input image, analyze the advantages and weaknesses.'},
    {"role": "assistant", "content": "The car in the image is a Mercedes-Benz G-Class. This is a luxury SUV known for its ruggedness, off-road capability, and iconic boxy design. Here's an analysis of its advantages and weaknesses: Advantages: Off-road capability: The G-Class is built on a robust ladder frame chassis and has a powerful engine, making it highly capable in off-road conditions. It features a low-range transfer case, locking differentials, and a high ground clearance. Luxury and comfort: Despite its rugged exterior, the G-Class offers a luxurious interior with high-quality materials, comfortable seats, and advanced technology features. Iconic design: The distinctive boxy shape of the G-Class has made it a cult classic. It's instantly recognizable and has a timeless appeal. Strong resale value: Due to its exclusivity and desirability, the G-Class tends to hold its value well over time. Weaknesses: Fuel efficiency: The G-Class is not known for its fuel efficiency, especially with the larger engine options. Ride quality: The firm suspension is designed for off-road performance, which can make the ride a bit bumpy on paved roads. Price: The G-Class is a very expensive vehicle, even for a luxury SUV. Size and maneuverability: The large size of the G-Class can make it challenging to park and maneuver in tight spaces."}
]
chat_2 = [
    {"role": "user", "content": 'I want to buy a car from the input image, analyze the advantages and weaknesses.'},
    {"role": "assistant", "content": "Based on the image, it appears to be a Ferrari F8 Tributo. Advantages: Performance: Ferraris are renowned for their exceptional performance. The F8 Tributo is no exception, boasting a powerful twin-turbocharged V8 engine that delivers exhilarating acceleration and top speed. Handling: Ferraris are known for their precise handling and agility. The F8 Tributo continues this tradition, with advanced aerodynamics and sophisticated suspension systems ensuring a thrilling driving experience. Design: Ferrari is synonymous with iconic and head-turning designs. The F8 Tributo is a testament to this, featuring sleek lines, aggressive styling, and a captivating presence. Exclusivity: Owning a Ferrari is a status symbol. It represents luxury, exclusivity, and a passion for high-performance automobiles. Weaknesses: Price: Ferraris come with a hefty price tag. The F8 Tributo is no exception, making it an investment for those with significant financial resources. Fuel Efficiency: High-performance sports cars like the F8 Tributo are not known for their fuel efficiency. You can expect lower miles per gallon compared to everyday vehicles. Maintenance Costs: Owning a Ferrari comes with associated maintenance costs, which can be higher than those for regular cars. Practicality: The F8 Tributo is primarily a two-seater sports car, making it less practical for everyday use or carrying passengers. Ride Comfort: While the F8 Tributo offers a thrilling driving experience, its stiff suspension might not be ideal for long-distance comfort."}
]
image = ['./examples/cars1.jpg']
hd_num = 9


# get reward score for a single chat
with torch.autocast(device_type='cuda', dtype=torch.float16):
    score1 = model.get_score(chat_1, image, hd_num=hd_num)
    score2 = model.get_score(chat_2, image, hd_num=hd_num)
print("score1: ", score1)
print("score2: ", score2)
# >>> score1:  5.76
# >>> score2:  -2.84375


# batch inference, get multiple scores at once
with torch.autocast(device_type='cuda', dtype=torch.float16):
    scores = model.get_scores([chat_1, chat_2], [image, image], hd_num=hd_num)
print("scores: ", scores)
# >>> scores:  [5.76171875, -2.845703125]


# compare whether chat_1 is better than chat_2
with torch.autocast(device_type='cuda', dtype=torch.float16):
    compare_res = model.compare(chat_1, image, chat_2, image, hd_num=hd_num)
print("compare_res: ", compare_res)
# >>> compare_res:  True


# rank multiple chats, it will return the ranking index of each chat
# the chat with the highest score will have ranking index as 0
with torch.autocast(device_type='cuda', dtype=torch.float16):
    rank_res = model.rank([chat_1, chat_2], [image, image], hd_num=hd_num)
print("rank_res: ", rank_res)  # lower index means higher score
# >>> rank_res:  [0, 1]  

Open Source License

The code is licensed under Apache-2.0, while model weights are fully open for academic research and also allow free commercial usage. To apply for a commercial license, please fill in the application form (English)/申请表(中文). For other questions or collaborations, please contact internlm@pjlab.org.cn.

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

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

GPU в ailist

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

Нельзя запустить

Код из репозитория вместе с pickle-весами (.bin) не запускается из соображений безопасности.

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

0 моделей