/ Модель

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

Контекст
8 192 токена
Параметры
19,3 млрд
Размер весов
39,7 ГБ
Лицензия
Своя лицензия
Архитектура
internlm2 · dense
Опубликована
22 янв 2024

internlm2-math-20b

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

Двуязычная математическая языковая модель InternLM на 20 млрд параметров для решения, объяснения и проверки математических задач.

251скачиваний за 30 дней18лайковвеса обновлены13 мар 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

InternLM2-Math-20B — двуязычная языковая модель для математических рассуждений, разработанная командой InternLM. Это дообученный вариант InternLM2-Base: модель продолжительно обучали на математических текстах, а затем на размеченных задачах на китайском и английском языках. Архитектура — плотная causal language model InternLM2 с 19,3 млрд параметров; контекст — до 8192 токенов. Репозиторий содержит веса в формате safetensors.

Модель предназначена для решения и пошагового объяснения математических задач, генерации простых доказательств и кода Lean 3, проверки рассуждений и подготовки синтетических математических примеров. Также описана поддержка сценариев с code interpreter и оценки цепочек рассуждений, однако эти возможности не гарантируются для каждой задачи. Основные языки — китайский и английский; Lean используется как язык формализации доказательств.

В карточке отмечены пропуски вычислительных шагов, слабые результаты на китайских заданиях с заполнением пропусков и английских задачах с выбором ответа, а также переключение языков и склонность предлагать Code Interpreter для китайских задач. Качество возможностей Lean ограничено простыми задачами типа GSM8K и не гарантируется. Лицензия указана как other, поэтому условия использования следует сверить с лицензией репозитория.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

InternLM-Math

State-of-the-art bilingual open-sourced Math reasoning LLMs. A solver, prover, verifier, augmentor.

💻 Github 🤗 Demo 🤗 Checkpoints OpenXLab ModelScope

News

  • [2024.01.29] We add checkpoints from ModelScope. Tech report is on the way!
  • [2024.01.26] We add checkpoints from OpenXLab, which ease Chinese users to download!

Introduction

  • 7B and 20B Chinese and English Math LMs with better than ChatGPT performances. InternLM2-Math are continued pretrained from InternLM2-Base with ~100B high quality math-related tokens and SFT with ~2M bilingual math supervised data. We apply minhash and exact number match to decontaminate possible test set leakage.
  • Add Lean as a support language for math problem solving and math theorem proving. We are exploring combining Lean 3 with InternLM-Math for verifiable math reasoning. InternLM-Math can generate Lean codes for simple math reasoning tasks like GSM8K or provide possible proof tactics based on Lean states.
  • Also can be viewed as a reward model, which supports the Outcome/Process/Lean Reward Model. We supervise InternLM2-Math with various types of reward modeling data, to make InternLM2-Math can also verify chain-of-thought processes. We also add the ability to convert a chain-of-thought process into Lean 3 code.
  • A Math LM Augment Helper and Code Interpreter. InternLM2-Math can help augment math reasoning problems and solve them using the code interpreter which makes you generate synthesis data quicker!

hungarian

Models

InternLM2-Math-Base-7B and InternLM2-Math-Base-20B are pretrained checkpoints. InternLM2-Math-7B and InternLM2-Math-20B are SFT checkpoints.

ModelModel TypeTransformers(HF)OpenXLabModelScopeRelease Date
InternLM2-Math-Base-7BBase🤗internlm/internlm2-math-base-7bOpen in OpenXLab internlm2-math-base-7b2024-01-23
InternLM2-Math-Base-20BBase🤗internlm/internlm2-math-base-20bOpen in OpenXLab internlm2-math-base-20b2024-01-23
InternLM2-Math-7BChat🤗internlm/internlm2-math-7bOpen in OpenXLab internlm2-math-7b2024-01-23
InternLM2-Math-20BChat🤗internlm/internlm2-math-20bOpen in OpenXLab internlm2-math-20b2024-01-23

Performance

Pretrain Performance

We evaluate pretrain checkpoints based on greedy decoding with few-shot COT. Details of pretraining will be introduced in the tech report.

ModelGSM8KMATH
Llama2-7B11.83.2
Llemma-7B36.418.0
InternLM2-Base-7B36.58.6
InternLM2-Math-Base-7B49.221.5
Minerva-8B16.214.1
InternLM2-Base-20B54.613.7
InternLM2-Math-Base-20B63.727.3
Llemma-34B51.525.0
Minerva-62B52.427.6
Minerva-540B58.833.6

SFT Peformance

All performance is based on greedy decoding with COT. We notice that the performance of Hungary has a big variance between our different checkpoints, while other performance is very stable. This may be due to the problem amount about Hungary.

ModelModel TypeGSM8KMATHHungary
Qwen-7B-ChatGenearl51.711.6-
DeepSeek-7B-ChatGeneral63.015.828.5
InternLM2-Chat-7BGeneral70.723.0-
ChatGLM3-6BGeneral53.820.432
MetaMath-Mistral-7BMathematics77.728.229
MetaMath-Llemma-7BMathematics69.230.0-
InternLM2-Math-7BMathematics78.134.655
InternLM2-Chat-20BGeneral79.631.9-
MetaMath-Llemma-34BMathematics75.834.8-
InternLM2-Math-20BMathematics82.637.766
Qwen-72BGeneral78.935.252
DeepSeek-67BGeneral84.132.658
ChatGPT (GPT-3.5)General80.834.141
GPT4 (First version)General92.042.568

Inference

LMDeploy

We suggest using LMDeploy(>=0.2.1) for inference.

from lmdeploy import pipeline, TurbomindEngineConfig, ChatTemplateConfig

backend_config = TurbomindEngineConfig(model_name='internlm2-chat-7b', tp=1, cache_max_entry_count=0.3)
chat_template = ChatTemplateConfig(model_name='internlm2-chat-7b', system='', eosys='', meta_instruction='')
pipe = pipeline(model_path='internlm/internlm2-math-7b', chat_template_config=chat_template, backend_config=backend_config)

problem = '1+1='
result = pipe([problem], request_output_len=1024, top_k=1)

Huggingface

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("internlm/internlm2-math-20b", trust_remote_code=True)
# Set `torch_dtype=torch.float16` to load model in float16, otherwise it will be loaded as float32 and might cause OOM Error.
model = AutoModelForCausalLM.from_pretrained("internlm/internlm2-math-20b", trust_remote_code=True, torch_dtype=torch.float16).cuda()
model = model.eval()
response, history = model.chat(tokenizer, "1+1=", history=[], meta_instruction="")
print(response)

Special usages

We list some instructions used in our SFT. You can use them to help you. You can use the other ways to prompt the model, but the following are recommended. InternLM2-Math may combine the following abilities but it is not guaranteed.

Translate proof problem to Lean:

nl2lean3

Using Lean 3 to solve GSM8K problem:

gsm8k_lean

Generate problem based on Lean 3 code:

lean_problem

Play 24 point game:

24

Augment a harder math problem:

augment_hard

DescriptionQuery
Solving question via chain-of-thought{Question}
Solving question via Lean 3{Question}\nSolve this via Lean 3
Outcome reward modelGiven a question and an answer, check is it correct?\nQuestion:{Question}\nAnswer:{COT}
Process reward modelGiven a question and an answer, check correctness of each step.\nQuestion:{Question}\nAnswer:{COT}
Reward modelGiven a question and two answers, which one is better? \nQuestion:{Question}\nAnswer 1:{COT}\nAnswer 2:{COT}
Convert chain-of-thought to Lean 3Convert this answer into Lean3. Question:{Question}\nAnswer:{COT}
Convert Lean 3 to chain-of-thoughtConvert this lean 3 code into a natural language problem with answers:\n{LEAN Code}
Translate question and chain-of-thought answer to a proof statementConvert this question and answer into a proof format.\nQuestion:{Question}\nAnswer:{COT}
Translate proof problem to Lean 3Convert this natural langauge statement into a Lean 3 theorem statement:{Theorem}
Translate Lean 3 to proof problemConvert this Lean 3 theorem statement into natural language:{STATEMENT}
Suggest a tactic based on Lean stateGiven the Lean 3 tactic state, suggest a next tactic:\n{LEAN State}
Rephrase ProblemDescribe this problem in another way. {Question}
Augment ProblemPlease augment a new problem based on: {Question}
Augment a harder ProblemIncrease the complexity of the problem: {Question}
Change specific numbersChange specific numbers: {Question}
Introduce fractions or percentagesIntroduce fractions or percentages: {Question}
Code Interpreterlagent
In-context LearningQuestion:{Question}\nAnswer:{COT}\n...Question:{Question}\nAnswer:{COT}

Fine-tune and others

Please refer to InternLM.

Known issues

Our model is still under development and will be upgraded. There are some possible issues of InternLM-Math. If you find performances of some abilities are not great, welcome to open an issue.

  • Jump the calculating step.
  • Perform badly at Chinese fill-in-the-bank problems and English choice problems due to SFT data composition.
  • Tend to generate Code Interpreter when facing Chinese problems due to SFT data composition.
  • The reward model mode can be better leveraged with assigned token probabilities.
  • Code switch due to SFT data composition.
  • Some abilities of Lean can only be adapted to GSM8K-like problems (e.g. Convert chain-of-thought to Lean 3), and performance related to Lean is not guaranteed.

Citation and Tech Report

To be appended.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей