/ Модель

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

Лицензия
Llama 2
Библиотека
transformers
Опубликована
7 фев 2024

komodo-7b-base

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

Базовая модель Yellow.ai на архитектуре Llama 2 для генерации текста на английском, индонезийском и региональных языках Индонезии.

3 860скачиваний за 30 дней87лайковвеса обновлены15 мар 2024

Бенчмарки

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

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

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

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

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

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

Komodo-7B-Base — базовая языковая модель, разработанная Yellow.ai путём дополнительного предварительного обучения и расширения словаря Llama-2-7B-Base. Это декодерная модель на архитектуре Llama 2 с 7 млрд параметров. Она предназначена для генерации текста на английском, индонезийском и 11 региональных языках Индонезии: ачехском, балийском, банжарском, бугийском, мадурском, минангкабау, яванском, даяк-нгажу, сунданском, тоба-батакском и лампунгском.

Модель подходит как основа для дальнейшей настройки под прикладные задачи, включая генерацию и продолжение текста на поддерживаемых языках. Это не instruction-tuned модель: для диалоговых сценариев и выполнения инструкций требуется дополнительное дообучение, а готового шаблона промпта нет. Лицензия — Llama 2; доступ к репозиторию на Hugging Face ограничен и требует входа в учётную запись.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for Komodo-7B-Base

Komodo-7B-Base is a large language model that is developed through incremental pretraining and vocabulary expansion on top of Llama-2-7B-Base. This model can handle Indonesian, English and 11 regional languages of Indonesia.

Disclaimer : This is not an instruction-tuned model, further fine-tuning is needed for downstream tasks. For example, people usually utilize the Alpaca dataset for further fine-tuning on top of Llama-2-7B-Base model. Hence, there is no prompt template for this model.

Model Details

Model Description

More details can be found in our paper: https://arxiv.org/abs/2403.09362

  • Developed by: Yellow.ai
  • Model type: Decoder
  • Languages: English, Indonesian, Acehnese, Balinese, Banjarese, Buginese, Madurese, Minangkabau, Javanese, Dayak Ngaju, Sundanese, Toba Batak, Lampungnese
  • License: llama2

Usage Example

Since this is a gated model, you need to logged in to your HF account before using the model. Below is one way to do this. You can get the HF Token from your profile (Profile -> Settings -> Access Tokens)

import huggingface_hub
huggingface_hub.login("YOUR_HF_TOKEN")

Once you are logged in, you can start download and load the model & tokenizer. We wrote a custom decoding function for Komodo-7B, that's why we need to pass the trust_remote_code=True. The code also works without this parameter, but decoding process will not work as expected.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

device = "cuda:0" if torch.cuda.is_available() else "cpu"

tokenizer = AutoTokenizer.from_pretrained("Yellow-AI-NLP/komodo-7b-base",trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("Yellow-AI-NLP/komodo-7b-base",trust_remote_code=True)
model = model.to(device)

Then, you can try using the model.

full_prompt = "Candi borobudur adalah"

tokens = tokenizer(full_prompt, return_tensors="pt").to(device)
output = model.generate(tokens["input_ids"], eos_token_id=tokenizer.eos_token_id)

print(tokenizer.decode(output[0], skip_special_tokens=True))
# Candi borobudur adalah candi yang terletak di Magelang, Jawa Tengah.

Technical Specifications

Model Architecture and Objective

Komodo-7B is a decoder model using the Llama-2 architecture.

ParameterKomodo-7B
Layers32
d_model4096
head_dim32
Vocabulary35008
Sequence Length4096

Tokenizer Details

Recognizing the importance of linguistic diversity, we focused on enhancing our language model's proficiency in both Indonesian and regional languages. To achieve this, we systematically expanded the tokenizer's vocabulary by identifying and incorporating approximately 2,000 frequently used words specific to Indonesian and 1,000 words for regional languages that were absent in the Llama-2 model.

The standard method for enhancing a vocabulary typically involves developing a new tokenizer and integrating it with the existing one. This technique has shown impressive results in projects like Chinese-LLaMA and Open-Hathi. The effectiveness of this strategy can be attributed to the significant linguistic distinctions between languages such as Chinese and Hindi when compared to English. In contrast, the Indonesian language employs the same Latin script as English, which presents a different set of challenges.

We tested the traditional method, as well as a new approach where we included the top n words (not tokens) from the Indonesian vocabulary. We discovered that with the new approach, we could achieve better fertility scores by adding around 3000 new vocabulary words. Adding more than 3000 words did not significantly improve the fertility score further, but it increased the size of the embedding matrix, leading to longer training times.

More details can be found in our paper: https://arxiv.org/abs/2403.09362

Training Data

More details can be found in our paper: https://arxiv.org/abs/2403.09362

Training Procedure

More details can be found in our paper: https://arxiv.org/abs/2403.09362

Preprocessing

More details can be found in our paper: https://arxiv.org/abs/2403.09362

Evaluation & Results

Please note that the benchmarking values below are based on our SFT Model, Komodo-7B-Instruct, while here we only release the base model, Komodo-7B-base.

OrganizationModel NameIndo MMLUID-ENXCOPA-IDIntent ClassificationColloquial DetectionNusaX-SentiID-Hate SpeechTydiQA-IDIndosumAverage
OpenAIGPT-3.5-turbo-030151.364.570.082.064.147.268.085.341.063.7
OpenAIGPT-3.5-turbo-061352.766.888.284.075.163.363.786.440.068.9
OpenAIGPT-3.5-turbo-110653.369.789.384.064.259.856.688.042.067.4
OpenAIGPT-4-preview-110669.878.098.389.092.766.173.472.033.074.7
MetaLlama-2-7B-Chat30.445.641.557.031.42.941.311.734.032.9
MetaLlama-2-13B-Chat32.061.738.059.031.158.757.271.940.050.0
GoogleGemma-7B-it37.473.657.777.118.844.254.873.344.053.4
MistralMixtral-8x7B-v0.1-Instruct45.257.888.786.041.152.868.890.314.060.5
AISingaporeSealion-7B-Instruct-NC23.926.941.337.041.830.757.365.326.038.9
CohereAya-101-13B47.747.384.064.018.974.672.781.339.058.8
MBZUAIBactrian-X-Llama-7B23.643.245.342.050.344.542.465.015.041.3
AlibabaQwen-1.5-7B-chat40.056.029.585.041.858.763.951.2229.050.6
Yellow.aiKomodo-7B-Instruct43.290.579.684.073.679.356.290.343.071.1

More details can be found in our paper: https://arxiv.org/abs/2403.09362

Infrastructure

Training DetailsKomodo-7B
AWS EC2 p4d.24xlarge1 instances
Nvidia A100 40GB GPU8
Training Duration300 hours

Citation

@misc{owen2024komodo,
      title={Komodo: A Linguistic Expedition into Indonesia's Regional Languages}, 
      author={Louis Owen and Vishesh Tripathi and Abhay Kumar and Biddwan Ahmed},
      year={2024},
      eprint={2403.09362},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Model Card Authors

Louis Owen Vishesh Tripathi Abhay Kumar Biddwan Ahmed

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

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

GPU в ailist

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

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

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
bf2ca08

0 моделей