/ Модель

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

Контекст
2 048 токенов
Параметры
1,3 млрд
Лицензия
Apache 2.0
Архитектура
retrieva-bert · dense
Библиотека
transformers
Опубликована
25 июн 2024

bert-1.3b

Заполнение пропусковТекст → текст4 профессии

Японский энкодерный Transformer на 1,3 млрд параметров для заполнения масок и дообучения под задачи обработки текста.

123скачиваний за 30 дней15лайковвеса обновлены25 ноя 2024

Бенчмарки

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

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

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

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

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

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

RetrievaBERT — предварительно обученный энкодерный Transformer от Retrieva, Inc., созданный на основе архитектуры MegatronBERT и предназначенный прежде всего для японского языка. Модель содержит 1,3 млрд параметров, 48 слоёв, скрытый размер 1536 и контекст до 2048 токенов. В архитектуре используются PreNorm, SwiGLU и Grouped-Query Attention; при предобучении применялась только задача Masked Language Modeling, без Next Sentence Prediction.

Модель можно использовать для заполнения масок, а также дообучать для классификации текста, разметки токенов, ответов на вопросы и других downstream-задач. В карточке приведены оценки дообученных вариантов на JGLUE, но они не являются оценками исходного чекпойнта. Модель поддерживает японский и, дополнительно, английский язык; файлы опубликованы в формате Safetensors. Лицензия — Apache 2.0.

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

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

Ограничения

Для задач помимо заполнения масок модель требуется дообучать; исходный чекпойнт не предназначен для свободной генерации текста как decoder-модель. Для загрузки реализации требуется включить trust_remote_code.

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

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

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

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

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

Открыть на Hugging Face

RetrievaBERT Model

The RetrievaBERT is the pre-trained Transformer Encoder using Megatron-LM. It is designed for use in Japanese.

What's New

  • November 2024 (v1.0.1): Bug fix for the model parameters.
    • The up_proj's bias was initialized with the gate's one. This bug was fixed.

Model Details

Model Description

The RetrievaBERT is the pre-trained Transformer Encoder using Megatron-LM.

It is designed for use in Japanese.

This model offers several advanced features compared to traditional BERT models:

  • PreNorm: Improved stability during training.
  • SwiGLU: Enhanced activation function for better performance.
  • Grouped-Query Attention (Multi-Query Attention): Efficient attention mechanism.
  • Max Sequence Length: 2048 tokens, allowing for longer context.
  • Parameters: 1.3 billion parameters.
  • Pre-training Objective: Only Masked Language Modeling (MLM), not Next Sentence Prediction (NSP).
  • Token Type IDs: Not used in this model.

Model Sources

  • Developed by: Retrieva, Inc.
  • Model type: Based on MegatronBERT Architecture.
  • Language(s) (NLP): Primarily Japanese (optional support for English).
  • License: Apache 2.0

Uses

This model can be used as a Masked Language Model (MLM). However, it is primarily intended to be fine-tuned on downstream tasks. Depending on your use case, follow the appropriate section below.

Direct Use

This model is pre-trained using Masked Language Modeling. The mask token used is <MASK|LLM-jp>. Note that you need to set trust_remote_code to True because RetrievaBERT uses a custom model implementation.

Example code for direct use:

from transformers import AutoModelForMaskedLM, AutoTokenizer, pipeline

model_id = "retrieva-jp/bert-1.3b"
model = AutoModelForMaskedLM.from_pretrained(model_id, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_id)
pipe = pipeline("fill-mask", model=model, tokenizer=tokenizer)

text = "こんにちは!私の名前は<MASK|LLM-jp>です!"
print(pipe(text))

Downstream Use

RetrievaBERT is compatible with Hugging Face's AutoModels. To fine-tune RetrievaBERT for your specific task, use the corresponding AutoModel class. For detailed configuration, refer to the config.json file.

Training Details

Training Data

The RetrievaBERT model was pre-trained on the reunion of five datasets:

The model was trained on 180 billion tokens using the above dataset.

Training Procedure

The model was trained on 4 to 32 H100 GPUs with a batch size of 1,024. We adopted the curriculum learning which is similar to the Sequence Length Warmup and training with the following sequence lengths and number of steps.

  • The sequence length of 128: 31,000 steps.
  • The sequence length of 256: 219,000 steps.
  • The sequence length of 512: 192,000 steps.
  • The sequence length of 2048: 12,000 steps.

Training Hyperparameters

The model was trained on the following hyperparameters.

  • Learning rate: 1.5e-4.
  • Learning rate decay style: Linear.
  • Learning rate warmup fraction: 0.01
  • Minimum learning rate: 1e-6
  • Floating point expression: BF16

Evaluation

We fine-tuned the following models and evaluated them on the JGLUE development set. We adjusted the learning rate and training epochs for each model and task in accordance with the JGLUE paper.

ModelMARC-ja/accJSTS/pearsonJSTS/spearmanJNLI/accJSQuAD/EMJSQuAD/F1JComQA/acc
tohoku-nlp/bert-base-japanese-v30.9570.9140.8760.9060.8780.9460.849
tohoku-nlp/bert-large-japanese-v20.9590.9160.8770.9010.8840.9510.867
ku-nlp/deberta-v3-base-japanese    0.9580.9250.8900.9020.9250.9100.882
retrieva-jp/bert-1.3b                        0.9590.9170.8810.8980.8750.8740.827

Technical Specifications

Model Architectures

The RetrievaBERT model is based on BERT with the following hyperparameters:

  • Number of layers: 48
  • Hidden layer size: 1536
  • FFN hidden layer size: 4096
  • Number of attention heads: 24
  • Maximum length of position embeddings: 2048

As mentioned earlier, the main differences from the original BERT are:

  • PreNorm: Improved stability during training.
  • SwiGLU: Enhanced activation function for better performance.
  • Grouped-Query Attention (Multi-Query Attention): Efficient attention mechanism.

Compute Infrastructure

TSUBAME 4

This model is based on results obtained from the TSUBAME deep-learning mini-camp.

Software

The model was trained using Megatron-LM.

More Information

https://note.com/retrieva/n/n715bea2c2cd1 (in Japanese)

Model Card Authors

Satoru Katsumata, Daisuke Kimura, Jiro Nishitoba

Model Card Contact

pr@retrieva.jp

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

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

0 моделей