/ Модель

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

Контекст
4 096 токенов
Параметры
12,9 млрд
Размер весов
52,1 ГБ
Лицензия
MIT
Архитектура
llama · dense
Опубликована
8 фев 2024

UltraLink-LM

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

Мультиязычная модель Llama-2 с 12,9 млрд параметров для диалога, генерации кода и решения математических задач по инструкциям на пяти языках.

34скачиваний за 30 дней5лайковвеса обновлены22 фев 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

UltraLink-LM — мультиязычная авторегрессионная языковая модель на архитектуре Transformer, разработанная OpenBMB. Это дообученная модель семейства Llama-2 размером около 13 млрд параметров, предназначенная для генерации текста по инструкциям и многораундового диалога на английском, французском, русском, испанском и китайском языках.

Модель ориентирована на ответы в чате, написание кода и решение математических задач. При дообучении использовались UltraLink, UltraChat, наборы Magicoder, MetaMathQA и англоязычная часть ShareGPT; карточка сообщает о сравнительных оценках на мультиязычных бенчмарках кода, математики и диалога. Контекст модели — 4096 токенов.

Веса опубликованы в формате safetensors под лицензией MIT. Заявленные возможности и качество основаны на оценках из карточки; бенчмарки для части языков были переведены с помощью GPT-3.5, а сама карточка отмечает возможную предвзятость оценок. Модель имеет 12,9 млрд параметров, поэтому для запуска требуется соответствующая вычислительная память.

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

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

Ограничения

Контекст ограничен 4096 токенами. Карточка предупреждает, что сравнительные оценки могут быть предвзятыми; часть мультиязычных тестов кода была получена переводом бенчмарка с помощью GPT-3.5.

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

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

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

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

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

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

Открыть на Hugging Face

multi-lingual, knowledge-grounded, multi-round dialogue dataset and model

Model Card for UltraLink-LM

Model Summary

The UltraLink-LM is a massively multilingual generative language model that follows instructions in 5 languages, English, French, Russian, Spanish, and Chinese. The model is capable of generating text in 5 languages with high quality and diversity. UltraLink-LM outperforms PolyLM-Chat-13b, Guanaco, and Bloomz-7b1-mt in code, math and chat abilities in four languages, and has a high-quality and diverse text generation performance in all languages. The UltraLink-LM is trained using UltraLink, UltraChat, Magicoder-Evol, Magicoder-OSS, MetaMathQA, and ShareGPT. We release the checkpoints under a MIT license to further our mission of multilingual technologies empowering a multilingual world.

Use

from transformers import AutoModelForCausalLM, AutoTokenizer

checkpoint = "R0k1e/UltraLink-LM"

tokenizer = AutoTokenizer.from_pretrained(checkpoint)
ultralink_lm = AutoModelForCausalLM.from_pretrained(checkpoint)

# Chat abilities in Chinese
# What is heavy cavalry?
first_question = "<s>[INST] 什么是重骑兵? [/INST]"
chat_inputs = tokenizer.encode(first_question, add_special_tokens=False, return_tensors="pt")
chat_outputs = ultralink_lm.generate(chat_inputs, max_new_tokens=512)
first_answer = tokenizer.decode(chat_outputs[0])
print(first_answer)
# Expected output: 
"""
<s> [INST] 什么是重骑兵? [/INST] 重骑兵是一种历史上的战斗单位,通常由骑兵组成,他们在战斗中使用重型装甲和长矛。他们以在战场上的强大攻击能力而闻名,并且通常被用于突破敌军阵线或攻击敌方骑兵。重骑兵通常被认为是中世纪战争中最强大和最具威慑力的单位之一。</s>
"""
# Translations in English:
"""
<s> [INST] What is heavy cavalry? [/INST] The Heavy Cavalry is a historical fighting unit, usually consisting of cavalrymen who use heavy armour and spears in battle. They were known for their powerful attacks on the battlefield and were often used to break through enemy lines or attack enemy cavalry. Heavy cavalry is often considered one of the most powerful and intimidating units in medieval warfare.</s>
"""

# Second turn:
second_question = "<s>[INST] 重骑兵对中世纪的战场有哪些影响? [/INST]"
second_question = first_answer + second_question 
chat_inputs = tokenizer.encode(second_question, add_special_tokens=False, return_tensors="pt")
chat_outputs = ultralink_lm.generate(chat_inputs, max_new_tokens=512)
second_answer = tokenizer.decode(chat_outputs[0])
print(second_answer)
# Expected output: 
"""
<s>  [INST] 什么是重骑兵? [/INST] 重骑兵是一种历史上的战斗单位,通常由骑兵组成,他们在战斗中使用重型装甲和长矛。他们以在战场上的强大攻击能力而闻名,并且
通常被用于突破敌军阵线或攻击敌方骑兵。重骑兵通常被认为是中世纪战争中最强大和最具威慑力的单位之一。</s><s> [INST] 重骑兵对中世纪的战场有哪些影响? [/INST]
 重骑兵在中世纪的战场上起到了重要的作用。他们的强大攻击能力使他们成为战斗中的强大力量,并且他们的存在常常能够改变战斗的结果。重骑兵通常被用于突破敌军阵线
,并在战斗中创造突破口,这使得其他部队能够进入敌方阵地。他们还被用于攻击敌方骑兵,并且他们的重型装甲和长矛使他们在这种情况下具有优势。总的来说,重骑兵的 
存在使得中世纪的战场更加复杂和不可预测,他们的存在对战斗的结果产生了重大影响。</s>      
"""
#Translations in English:
"""
<s> [INST] What is heavy cavalry? [/INST] The Heavy Cavalry is a historical fighting unit, usually consisting of cavalrymen who use heavy armour and spears in battle. They were known for their powerful attacks on the battlefield and were often used to break through enemy lines or attack enemy cavalry. Heavy cavalry is often considered one of the most powerful and intimidating units in medieval warfare.</s><s>[INST] What impact did heavy cavalry have on the medieval battlefield? [/INST] Heavy cavalry played an important role on the battlefields of the Middle Ages. Their powerful attacks made them a formidable force in battle and their presence could often change the outcome of a battle. Heavy cavalry were often used to break through enemy lines and create breaches in battle, which allowed other troops to move into enemy positions. They were also used to attack enemy cavalry, and their heavy armour and spears gave them an advantage in such situations. Overall, the presence of heavy cavalry made the medieval battlefield more complex and unpredictable, and their presence had a major impact on the outcome of battles.</s>
"""

# Code abilities in Russian
# Please implement a bubble sort algorithm in Python.
code_inputs = tokenizer.encode("<s>[INST] Реализуйте алгоритм пузырьковой сортировки на Python. [/INST]", add_special_tokens=False, return_tensors="pt")
code_outputs = ultralink_lm.generate(code_inputs, max_new_tokens=512)
print(tokenizer.decode(code_outputs[0]))
# Expected output: 
"""                                                                                 
<s> [INST] Реализуйте алгоритм пузырьковой сортировки на Python. [/INST] Конечно, вот простая реализация алгоритма пузырьковой сортировки на Python:

```python
def bubbleSort(arr):
    n = len(arr)

    # Проходимся по всем элементам массива
    for i in range(n):
        # Последние i элементов уже отсортированы
        for j in range(0, n-i-1):
            # Проходимся по массиву, пока не найдем элемент, больший, чем следующий
            if arr[j] > arr[j+1]:
                # Обмениваем элементы местами
                arr[j], arr[j+1] = arr[j+1], arr[j]

# Проверяем функцию
arr = [64, 34, 25, 12, 22, 11, 90]
bubbleSort(arr)
print("Отсортированный массив:", arr)
\```

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

Вы можете изменить размер массива и его начальное состояние, чтобы увидеть, как функция работает с разными входными данными.

Примечание: Алгоритм пузырьковой сортировки не является эффективным для больших наборов данных, так как его средняя и худшая временная сложность составляют O(n^2), где n - количество элементов в массиве.</s>
"""
# Translations in English:
"""
<s> [INST] Implement the bubble sorting algorithm in Python. [/INST] Sure enough, here's a simple implementation of the bubble sort algorithm in Python:

```python
def bubbleSort(arr):
    n = len(arr)

    # Go through all elements of the array
    for i in range(n):
        # The last i elements are already sorted
        for j in range(0, n-i-1):
            # We traverse the array until we find an element greater than the next one
            if arr[j] > arr[j+1]:
                # Swapping elements
                arr[j], arr[j+1] = arr[j+1], arr[j]

# Check the function
arr = [64, 34, 25, 12, 22, 11, 90]
bubbleSort(arr)
print("Sorted array:", arr)
\```

This implementation works by repeatedly traversing the array and comparing neighbouring elements. If an element is compared more than the next element, they are swapped. This process is repeated until the array is sorted.

You can change the array size and initial state to see how the function works with different input data.

Note: The bubble sort algorithm is not efficient for large datasets because its average and worst-case time complexity are O(n^2), where n is the number of elements in the array.</s>
"""

# Math abilities in French
# When the length of a rectangle is twice its width, calculate the area of the rectangle if its perimeter is 18 units?
math_inputs = tokenizer.encode("<s>[INST] Lorsque la longueur d'un rectangle est le double de sa largeur, calculer l'aire du rectangle si son périmètre est de 18 unités? [/INST]", add_special_tokens=False, return_tensors="pt")
math_outputs = ultralink_lm.generate(math_inputs, max_new_tokens=512)
print(tokenizer.decode(math_outputs[0]))
# Expected output: 
"""
<s> [INST] Lorsque la longueur d'un rectangle est le double de sa largeur, calculer l'aire du rectangle si son périmètre est de 18 unités? [/INST] 
Soit la largeur du rectangle $w$. Alors la longueur du rectangle est $2w$.
Le périmètre du rectangle est $2(w+2w)=18$.
En simplifiant, nous avons $6w=18$, donc $w=3$.
L'aire du rectangle est $w \cdot (2w) = 3 \cdot 6 = \boxed{18}$ unités carrées.
La réponse est : 18</s>
"""
# Translations in English:
"""
<s> [INST] When the length of a rectangle is twice its width, calculate the area of the rectangle if its perimeter is 18 units? [/INST] 
Let $w$ be the width of the rectangle. Then the length of the rectangle is $2w$.
La réponse est : 18
The perimeter of the rectangle is $2(w+2w)=18$. 
Simplifying, we have $6w=18$, so $w=3$. 
The area of the rectangle is $w \cdot (2w) = 3 \cdot 6 = \boxed{18}$ square units. 
The answer is: 18</s>
"""

Model Details

Finetuning

  • Architecture: Same as Llama-2-13b
  • Number of Samples seen during Finetuning: 1023K
  • Batch size: 128
  • Hardware: NVIDIA A100 80GB PCIe
  • Software: BMTrain

Data Sources

The UltraLink-LM is trained on the following datasets:

We randomly select 10k samples from the UltraChat dataset and use them as the training set. And ShareGPT is filtered to keep only the English part of the dataset whose sample length is greater than 4k. The other datasets are used as auxiliary datasets for training. All the datasets are integrated into the UltraLink dataset.

Evaluation

We report three evaluations in this section: multilingual HumanEval, MGSM, and OMGEval. Evaluations of modern LLMs may be biased and affected by many factors, we are also actively working on more comprehensive evaluation methods.

Multilingual HumanEval

HumanEval is a well-known benchmark for evaluating the code ability of LLMs. It execute the code snippets generated by the model and evaluate their correctness. Since there are no existing multilingual test set for code generation, we use GPT-3.5 with carefully-designed prompts to translation HumanEval into other languages.

ModelEnZhEsRuFrAvg
Bloomz-7b1-mt8.57.36.18.56.17.3
Phoenix-inst-chat-7b11.010.48.51.213.412.2
PolyLM-Multialpaca-13b8.57.36.16.16.16.8
PolyLM-Chat-13b10.47.96.17.38.58.1
Chimera-inst-chat-13b14.613.414.612.814.013.9
Okapi-7b12.211.08.58.58.59.8
Guanaco-7b9.26.711.09.812.89.9
Guanaco-13b18.315.99.88.514.612.2
UltraLink-LM60.443.940.949.439.646.8

MGSM

We employ MGSM to evaluate the math reasoning abilities, which is a multilingual benchmark. It compares the result with correct answers and evaluates the model's ability to perform mathematical reasoning.

ModelEnZhEsRuFrAvg
Bloomz-7b1-mt2.81.62.00.42.81.7
Phoenix-inst-chat-7b3.23.22.83.23.23.1
PolyLM-Multialpaca-13b1.22.81.62.82.42.4
PolyLM-Chat-13b10.86.44.84.45.65.3
Chimera-inst-chat-13b14.011.610.012.012.811.6
Okapi-7b4.02.43.64.44.83.8
Guanaco-7b4.01.63.22.84.43.0
Guanaco-13b13.610.811.26.45.28.4
UltraLink-LM70.456.070.464.863.663.7

OMGEval

We use the OMGEval to evaluate the chat ability, which is a multilingual version of the widely-used English benchmark AlpacaEval.

ModelEnZhEsRuFrAvg
Bloomz-7b1-mt0.00.90.10.50.30.4
Phoenix-inst-chat-7b6.913.37.42.98.17.7
PolyLM-Multialpaca-13b3.45.02.15.12.23.6
PolyLM-Chat-13b7.714.06.15.54.87.6
Chimera-inst-chat-13b15.59.711.813.713.812.9
Okapi-7b8.86.25.012.18.78.2
Guanaco-7b4.63.80.41.81.22.4
Guanaco-13b29.08.616.915.417.317.5
UltraLink-LM28.821.923.537.629.028.2

Citation

Feel free to cite the repo if you think UltraLink is useful.

@misc{wang2024ultralink,
      title={UltraLink: An Open-Source Knowledge-Enhanced Multilingual Supervised Fine-tuning Dataset}, 
      author={Haoyu Wang and Shuo Wang and Yukun Yan and Xujia Wang and Zhiyu Yang and Yuzhuang Xu and Zhenghao Liu and Ning Ding and Xu Han and Zhiyuan Liu and Maosong Sun},
      year={2024},
      eprint={2402.04588},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей