/ Модель

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

Контекст
131 072 токена
Параметры
7,1 млрд
Размер весов
15,2 ГБ
Лицензия
Своя лицензия
Архитектура
qwen2 · dense
Опубликована
3 июл 2024

SeaLLMs-v3-7B-Chat

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

Диалоговая модель на базе Qwen2 для выполнения инструкций и генерации текста на английском, китайском и языках Юго-Восточной Азии.

955скачиваний за 30 дней74лайкавеса обновлены2 сен 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

  • IFEval

    IFEval Raw · выше — лучше

    Результат

    0,4377

    Open LLM v2 · архив

    Публичная таблицадругая ревизия

  • MUSR

    MUSR Raw · выше — лучше

    Результат

    0,4174

    Open LLM v2 · архив

    Публичная таблицадругая ревизия

  • MATH Lvl 5

    MATH Lvl 5 Raw · выше — лучше

    Результат

    0,1858

    Open LLM v2 · архив

    Публичная таблицадругая ревизия

  • GPQA

    GPQA Raw · выше — лучше

    Результат

    0,2987

    Open LLM v2 · архив

    Публичная таблицадругая ревизия

  • BBH

    BBH Raw · выше — лучше

    Результат

    0,5266

    Open LLM v2 · архив

    Публичная таблицадругая ревизия

  • MMLU-PRO

    MMLU-PRO Raw · выше — лучше

    Результат

    0,3895

    Open LLM v2 · архив

    Публичная таблицадругая ревизия

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

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

SeaLLMs-v3-7B-Chat — диалоговая языковая модель серии SeaLLMs, разработанной для языков Юго-Восточной Азии. Модель содержит 7,1 млрд параметров, использует плотную архитектуру Qwen2 и поддерживает контекст до 131 072 токенов; веса опубликованы в формате safetensors. Модель дообучена следовать инструкциям и вести многошаговый диалог.

Она предназначена для генерации ответов и выполнения инструкций, включая вопросы на общие знания, математические задачи и перевод. Разработчики сообщают об улучшенной работе с местными контекстами региона и о мерах по снижению галлюцинаций, однако возможны неточные, вводящие в заблуждение или вредоносные ответы. Для реального использования рекомендуется независимая проверка и настройка мер безопасности. Условия использования определяются SeaLLMs Terms Of Use; метаданные указывают лицензию как other.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

SeaLLMs-v3 - Large Language Models for Southeast Asia

We introduce SeaLLMs-v3, the latest series of the SeaLLMs (Large Language Models for Southeast Asian languages) family. It achieves state-of-the-art performance among models with similar sizes, excelling across a diverse array of tasks such as world knowledge, mathematical reasoning, translation, and instruction following. In the meantime, it was specifically enhanced to be more trustworthy, exhibiting reduced hallucination and providing safe responses, particularly in queries closed related to Southeast Asian culture.

🔥 Highlights

  • State-of-the-art performance compared to open-source models of similar sizes, evaluated across various dimensions such as human exam questions, instruction-following, mathematics, and translation.
  • Significantly enhanced instruction-following capability, especially in multi-turn settings.
  • Ensures safety in usage with significantly reduced instances of hallucination and sensitivity to local contexts.

Uses

SeaLLMs is tailored for handling a wide range of languages spoken in the SEA region, including English, Chinese, Indonesian, Vietnamese, Thai, Tagalog, Malay, Burmese, Khmer, Lao, Tamil, and Javanese.

This page introduces the SeaLLMs-v3-7B-Chat model, specifically fine-tuned to follow human instructions effectively for task completion, making it directly applicable to your applications.

You may also refer to the SeaLLMs-v3-1.5B-Chat model which requires much lower computational resources and can be easily loaded locally.

Get started with Transformers

To quickly try the model, we show how to conduct inference with transformers below. Make sure you have installed the latest transformers version (>4.40).

from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
  "SeaLLMs/SeaLLMs-v3-7B-Chat", # can change to "SeaLLMs/SeaLLMs-v3-1.5B-Chat" if your resource is limited
  torch_dtype=torch.bfloat16, 
  device_map=device
)
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLMs-v3-7B-Chat")

# prepare messages to model
prompt = "Hiii How are you?"
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
print(f"Formatted text:\n {text}")
print(f"Model input:\n {model_inputs}")

generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, do_sample=True, eos_token_id=tokenizer.eos_token_id)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)

print(f"Response:\n {response[0]}")

You can also utilize the following code snippet, which uses the streamer TextStreamer to enable the model to continue conversing with you:

from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import TextStreamer

device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
  "SeaLLMs/SeaLLMs-v3-7B-Chat",  # can change to "SeaLLMs/SeaLLMs-v3-1.5B-Chat" if your resource is limited
  torch_dtype=torch.bfloat16, 
  device_map=device
)
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLMs-v3-7B-Chat")

# prepare messages to model
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
]

while True:
    prompt = input("User:")
    messages.append({"role": "user", "content": prompt})
    text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    model_inputs = tokenizer([text], return_tensors="pt").to(device)
    
    streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
    generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, streamer=streamer)
    generated_ids = [
        output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
    ]
    response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
    messages.append({"role": "assistant", "content": response})

Inference with vllm

You can also conduct inference with vllm, which is a fast and easy-to-use library for LLM inference and serving. To use vllm, first install the latest version via pip install vllm.

from vllm import LLM, SamplingParams

prompts = [
    "Who is the president of US?",
    "Can you speak Indonesian?"
]

llm = LLM(ckpt_path, dtype="bfloat16")
sparams = SamplingParams(temperature=0.1, max_tokens=512)
outputs = llm.generate(prompts, sparams)

# print out the model response
for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt}\nResponse: {generated_text}\n\n")

Bias, Risks, and Limitations

Disclaimer: We must note that even though the weights, codes, and demos are released in an open manner, similar to other pre-trained language models, and despite our best efforts in red teaming and safety fine-tuning and enforcement, our models come with potential risks, including but not limited to inaccurate, misleading or potentially harmful generation. Developers and stakeholders should perform their own red teaming and provide related security measures before deployment, and they must abide by and comply with local governance and regulations. In no event shall the authors be held liable for any claim, damages, or other liability arising from the use of the released weights, codes, or demos.

Evaluation

We conduct our evaluation along two dimensions:

  1. Model Capability: We assess the model's performance on human exam questions, its ability to follow instructions, its proficiency in mathematics, and its translation accuracy.
  2. Model Trustworthiness: We evaluate the model's safety and tendency to hallucinate, particularly in the context of Southeast Asia.

Model Capability

Multilingual World Knowledge - M3Exam

M3Exam consists of local exam questions collected from each country. It reflects the model's world knowledge (e.g., with language or social science subjects) and reasoning abilities (e.g., with mathematics or natural science subjects).

Modelenzhidthviavgavg_sea
Sailor-7B-Chat0.660.6520.4750.4620.5130.5520.483
gemma-7b0.7320.5190.4750.460.5940.5560.510
SeaLLM-7B-v2.50.7580.5810.4990.5020.6220.5920.541
Qwen2-7B0.8150.8740.530.4790.6280.6650.546
Qwen2-7B-Instruct0.8090.880.5580.5550.6240.6850.579
Sailor-14B0.7480.840.5360.5280.6210.6550.562
Sailor-14B-Chat0.7490.8430.5530.5660.6370.670.585
SeaLLMs-v3-7B0.8090.8630.5450.5300.6280.6750.568
SeaLLMs-v3-7B-Chat0.8090.8740.5580.5690.6490.6920.592

Multilingual Instruction-following Capability - SeaBench

SeaBench consists of multi-turn human instructions spanning various task types. It evaluates chat-based models on their ability to follow human instructions in both single and multi-turn settings and assesses their performance across different task types. The dataset and corresponding evaluation code will be released soon!

modelidturn1idturn2idavgthturn1thturn2thavgviturn1viturn2viavgavg
Qwen2-7B-Instruct5.935.845.895.475.205.346.175.605.895.70
SeaLLM-7B-v2.56.274.965.625.793.824.816.024.025.025.15
Sailor-14B-Chat5.265.535.404.624.364.495.314.745.034.97
Sailor-7B-Chat4.604.044.323.943.173.564.823.624.224.03
SeaLLMs-v3-7B-Chat6.736.596.666.485.906.196.345.796.076.31

Multilingual Math

We evaluate the multilingual math capability using the MGSM dataset. MGSM originally contains Chinese and Thai testing sets only, we use Google Translate to translate the same English questions into other SEA languages. Note that we adopt the tradition of each country to represent the number, e.g., in Indonesian and Vietnamese, dots are used as thousands separators and commas as decimal separators, the opposite of the English system.

MGSMenidmsthvizhavg
Sailor-7B-Chat33.622.422.421.625.229.225.7
Meta-Llama-3-8B-Instruct77.64857.65646.858.857.5
glm-4-9b-chat72.853.653.634.852.470.856.3
Qwen1.5-7B-Chat6434.438.425.23653.641.9
Qwen2-7B-instruct8266.462.458.464.476.868.4
aya-23-8B28.816.414.421612.815.1
gemma-1.1-7b-it58.832.434.831.239.635.238.7
SeaLLMs-7B-v2.579.669.270.861.266.862.468.3
SeaLLMs-v3-7B-Chat74.871.270.871.271.279.673.1

Translation

We use the test sets from Flores-200 for evaluation and report the zero-shot chrF scores for translations between every pair of languages. Each row in the table below presents the average results of translating from various source languages into the target languages. The last column displays the overall average results of translating from any language to any other language for each model.

modelenidjvkmlomsmytathtlvizhavg
Meta-Llama-3-8B-Instruct51.5449.0322.4615.345.4246.7221.2432.0935.7540.839.3114.8731.22
Qwen2-7B-Instruct50.3647.5529.3619.2611.0642.4319.3320.0436.0737.9139.6322.8731.32
Sailor-7B-Chat49.449.7828.332.686.8547.755.3518.2338.922941.7620.8728.24
SeaLLM-7B-v2.555.0953.7118.1318.0915.5351.3319.7126.140.5545.5844.5624.1834.38
SeaLLMs-v3-7B-Chat54.6852.5229.8627.326.3445.0421.5431.9341.5238.5143.7826.136.52

Model Trustworthiness

Hallucination

Performance of whether a model can refuse questions about the non-existing entity. The following is the F1 score. We use refuse as the positive label. Our test set consists of ~1k test samples per language. Each unanswerable question is generated by GPT4o. The ratio of answerable and unanswerable questions are 1:1. We define keywords to automatically detect whether a model-generated response is a refusal response.

Refusal-F1 Scoresenzhvithidavg
Qwen1.5-7B-Instruct53.8551.7052.8535.5058.4050.46
Qwen2-7B-Instruct58.7933.0856.2144.6055.9849.73
SeaLLM-7B-v2.512.900.772.4519.420.787.26
Sailor-7B-Chat33.4918.825.199.6816.4216.72
glm-4-9b-chat44.4837.8918.664.271.9721.45
Llama-3-8B-Instruct72.080.001.230.803.9115.60
gemma-1.1-7b-it52.3927.7423.9622.9731.7231.76
SeaLLMs-v3-7B-Chat71.3678.3977.9361.3168.9571.59

Safety

Multijaildataset consists of harmful prompts in multiple languages. We take those relevant prompts in SEA languages here and report their safe rate (the higher the better).

Modelenjvthvizhavg
Qwen2-7B-Instruct88.5743.8163.8173.0287.3071.30
Sailor-7B-Chat78.7354.9262.2267.6276.1967.94
Meta-Llama-3-8B-Instruct88.2526.3571.1169.8477.1466.54
Sailor-14B-Chat86.9830.4853.6560.9572.7060.95
glm-4-9b-chat77.1421.2730.1660.6374.9252.82
SeaLLMs-v3-7B-Chat88.8960.0073.3383.8192.7079.75

Acknowledgement to Our Linguists

We would like to express our special thanks to our professional and native linguists, Tantong Champaiboon, Nguyen Ngoc Yen Nhi and Tara Devina Putri, who helped build, evaluate, and fact-check our sampled pretraining and SFT dataset as well as evaluating our models across different aspects, especially safety.

Citation

If you find our project useful, we hope you would kindly star our repo and cite our work as follows:

@article{damonlp2024seallm3,
  author = {Wenxuan Zhang*, Hou Pong Chan*, Yiran Zhao*, Mahani Aljunied*,
            Jianyu Wang*, Chaoqun Liu, Yue Deng, Zhiqiang Hu, Weiwen Xu,
            Yew Ken Chia, Xin Li, Lidong Bing},
  title = {SeaLLMs 3: Open Foundation and Chat Multilingual Large Language Models for Southeast Asian Languages},
  year = {2024},
  url = {https://arxiv.org/abs/2407.19672}
}

Corresponding Author: l.bing@alibaba-inc.com

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей