/ Модель

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

Контекст
4 096 токенов
Параметры
6,6 млрд
Размер весов
27 ГБ
Лицензия
Llama 2
Архитектура
llama · dense
Опубликована
6 мая 2024

Xwin-Math-7B-V1.1

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

Xwin-Math-7B-V1.1 — дообученная на математических данных модель LLaMA 2 для решения задач и генерации пошаговых ответов.

18скачиваний за 30 дней8лайковвеса обновлены24 мая 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Xwin-Math-7B-V1.1 — модель генерации текста для решения математических задач, разработанная командой Xwin-LM на основе LLaMA 2. Это плотная авторегрессионная модель с архитектурой LlamaForCausalLM и 6,6 млрд параметров; она дообучена методом supervised fine-tuning на синтетических математических данных, включая 1,92 млн примеров GSM8K и 960 тыс. примеров MATH.

Модель предназначена для пошагового решения школьных текстовых задач и задач по математике, а также для генерации объяснений и ответов. В README сообщаются результаты pass@1: 84,4% на GSM8K и 44,7% на MATH. Контекст составляет 4096 токенов. Метаданные указывают библиотеку Transformers и формат PyTorch; лицензия — Llama 2 License. Результаты зависят от способа оценки, а математические ответы модели следует проверять; README отдельно отмечает возможные небольшие расхождения результатов из-за среды и оборудования.

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

  • решение текстовых задач по арифметике и алгебре
  • получение пошаговых решений математических задач
  • ответы на задачи формата GSM8K
  • генерация решений задач уровня MATH
  • подготовка черновых объяснений для учебных задач

Ограничения

Модель может ошибаться в вычислениях и рассуждениях, поэтому ответы требуют проверки. Результаты бенчмарков могут немного различаться в зависимости от среды и способа оценки.

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

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

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

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

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

Открыть на Hugging Face

Xwin-Math

Paper Link Xwin-Math is a series of powerful SFT LLMs for math problems based on LLaMA-2.

🔥 News

  • 💥 [May, 2024] The Xwin-Math-70B-V1.1 model achieves 51.9 pass@1 on the MATH benchmark and 90.6 pass@1 on the GSM8K benchmark. This is a new SoTA model based on LLaMA-2-70B!
  • 💥 [May, 2024] The Xwin-Math-7B-V1.1 model achieves 44.7 pass@1 on the MATH benchmark and 84.4 pass@1 on the GSM8K benchmark. This is a new SoTA model based on LLaMA-2-7B!
  • 💥 [Nov, 2023] The Xwin-Math-70B-V1.0 model achieves 31.8 pass@1 on the MATH benchmark and 87.0 pass@1 on the GSM8K benchmark. This performance places it first amongst all open-source models!
  • 💥 [Nov, 2023] The Xwin-Math-7B-V1.0 and Xwin-Math-13B-V1.0 models achieve 66.6 and 76.2 pass@1 on the GSM8K benchmark, ranking as top-1 among all LLaMA-2 based 7B and 13B open-source models respectively!

✨ Model Card

ModelGSM8KMATHCheckpointLicense
Xwin-Math-7B-V1.066.617.4🤗 HF LinkLlama 2 License
Xwin-Math-7B-V1.184.444.7🤗 HF LinkLlama 2 License
Xwin-Math-13B-V1.076.221.7🤗 HF LinkLlama 2 License
Xwin-Math-70B-V1.087.031.8🤗 HF LinkLlama 2 License
Xwin-Math-70B-V1.190.651.9🤗 HF LinkLlama 2 License
  • Xwin-Math-7B-V1.1 uses 1.92M GSM8K and 960K MATH synthetic data
  • Xwin-Math-70B-V1.1 uses 960K GSM8K and 480K MATH synthetic data

🚀 Benchmarks

Xwin-Math performance on MATH and GSM8K.

Xwin-Math-70B-V1.0 has achieved 31.8% on MATH and 87.0% on GSM8K. These scores are 5.3 and 3.1 points higher, respectively, than the previous state-of-the-art open-source MetaMath and LEMAv1 model.

ModelMATH (Our test)GSM8K (Our test)
GPT-4 (zero-shot)52.494.8
GPT-35-Turbo (8-shot)37.181.0
WizardMath-70B23.981.1
MAmmoTH-70B20.872.6
MetaMath-70B26.582.0
LEMAv1-70B25.983.9
Xwin-Math-70B-V1.031.887.0
Xwin-Math-70B-V1.151.990.6
WizardMath-13B15.063.7
MAmmoTH-13B12.356.2
MetaMath-13B22.770.9
LEMAv1-13B13.665.0
Xwin-Math-13B-V1.021.776.2
WizardMath-7B10.955.0
MAmmoTH-7B9.650.2
MetaMath-7B20.166.6
LEMAv1-7B10.054.7
Xwin-Math-7B-V1.017.466.6
Xwin-Math-7B-V1.144.784.4

We obtain these results using our flexible evaluation strategy. Due to differences in environment and hardware, the test results may be slightly different from the report, but we ensure that the evaluation is as accurate and fair as possible.

Xwin-Math performance on other math benchmarks.

Our 70B model shows strong mathematical reasoning capabilities among all open-sourced models. Also note that our model even approaches or surpasses the performance of GPT-35-Turbo on some benchmarks.

ModelSVAMPASDivNumGlueAlgebraMAWPSAverage
GPT-35-Turbo (8-shot)80.684.181.890.591.785.7
WizardMath-70B80.275.871.464.074.973.3
MAmmoTH-70B71.273.962.758.172.267.6
MetaMath-70B85.881.177.579.781.481.1
LEMAv1-70B-MATH *81.677.172.169.481.876.5
Xwin-Math-70B-V1.084.084.181.378.490.883.7

* LEMAv1 has two models, and we report the better LEMAv1-70B-MATH model in these benchmarks.

🔨 Evaluation

In order to evaluate a model's mathematical capabilities more flexibly and ensure a fair comparison of results, particularly for the MATH benchmark, we have developed a new evaluation tool. We have also assessed the pass@1 results of recent models on MATH and GSM8K benchmarks, which provides more accurate results.

We hope this toolkit can benefit open-source community by providing more accurate insights and conclusions. For a deeper understanding of our evaluation tool and methods, please visit here

  • "Report" refers to the accuracy stated in the original papers.
  • "Repro" indicates the results is reproduced by generating responses and evaluating them using the respective open-source models and scripts.
  • "Strict" and "Flex" denote the results we achieved by employing our two strategies to extract answer and evaluate the same responses as "Repro".
ModelMATH (Report) MATH (Repro) MATH (Strict) MATH (Flex) GSM8K (Report) GSM8K (Repro) GSM8K (Strict) GSM8K (Report)
GPT-35-Turbo (8-shot)34.1-23.837.180.8-77.981.0
WizardMath-70B22.723.023.923.981.681.481.181.1
MAmmoTH-70B21.118.020.020.872.472.672.672.6
MetaMath-70B26.625.926.326.582.382.382.082.0
Xwin-Math-70B-V1.0--31.831.8--87.087.0
WizardMath-13B14.014.214.915.063.963.963.763.7
MAmmoTH-13B12.910.811.812.356.356.256.156.2
MetaMath-13B22.422.522.622.772.371.070.970.9
Xwin-Math-13B-V1.0--21.621.7--76.276.2
WizardMath-7B10.710.310.910.954.955.255.055.0
MAmmoTH-7B10.48.69.19.650.550.250.250.2
MetaMath-7B19.819.619.920.166.566.666.666.6
Xwin-Math-7B-V1.0--17.317.4--66.666.6

Installation

Before you start, please install the requirements.

pip install -r requirements.txt

We tested our result using python 3.8 and cuda 11.8. We recommend you use docker.

docker run --gpus all -it --rm --ipc=host superbench/dev:cuda11.8

Generate

To generate the model's responses, you can use the generate.py script. Please be aware that generating responses is separate from verifying their correctness. After that, we will then check for their correctness.

For the generation process, we use the Vicuna-v1.1 system prompt with chain-of-thought and format instruction. We also employ a greedy decoding strategy and set the maximum sequence length to 2048.

"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {instruction} Give your solution in detail. In the end, write your final answer in the format of 'The answer is: <ANSWER>.'. ASSISTANT:"

Here is an simple example to generate using vLLM.

cd eval

python generate.py --dataset_path dataset/gsm8k.json --model_path path/to/your/model --tensor_parallel_size 4

By default the results will be output to the eval/response, using the prompt eval/prompt/xwin_math.json. If you wish to change the output path or use a different prompt

python generate.py --dataset_path dataset/gsm8k.json --model_path path/to/your/model --tensor_parallel_size 4 --output_path /your/path --prompt_path /your/path

We provide some datasets (in eval/dataset):

  • gsm8k.json: GSM8K.
  • math.json: MATH.
  • combination.json: A combination of many benchmarks, can evaluate the OOD capability of the model.

If you wan't to use your own datasets, please format your dataset like this.

[
    {
        "question": "Janet\u2019s ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?",
        "answer": "18",
        "type": "GSM8K",
        "subtype": "",
        "level": 0,
    },
    // ... more data items
]

Evaluate

To verify the accuracy of the answers after generation, you can use the `check.py script.

Here is an simple example

cd eval

python eval.py /path/to/model/response

The result will be saved in eval/evaluation

If you do not want to save the results or want to change the save path

python eval.py --data_path /path/to/model/response --save_path /path/to/save --save_result True

Once you run the script, the terminal will display the output as a table. This table will show the number of instances for each benchmark and the corresponding accuracy. Here is a hypothetical example of what the output might look like:

TypeSubtypeLevelCorrectIncorrectTotalAccuracy
0MAWPSaddsub0359333920.915816
1MAWPSmultiarith0586146000.976667
...

Citation

Please consider citing our work if you use the data or code in this repo.

@software{xwin-math,
  title = {Xwin-Math},
  author = {Xwin-Math Team},
  url = {https://github.com/Xwin-LM/Xwin-LM/Xwin-Math},
  version = {pre-release},
  year = {2023},
  month = {11},
}

Acknowledgements

Thanks to Llama 2, FastChat, and vLLM.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей