๐ llm-jp-3-8x13b-instruct3
LLM-jp-3 is a series of large language models developed by the Research and Development Center for Large Language Models at the National Institute of Informatics. This repository offers the llm-jp-3-8x13b-instruct3 model. For an overview of LLM-jp-3 models with different parameter sizes, refer to:
Checkpoints format: Hugging Face Transformers
๐ Quick Start
โจ Features
- Developed by the Research and Development Center for Large Language Models at the National Institute of Informatics.
- Supports multiple programming languages including C, C++, C#, Go, Java, JavaScript, Lua, PHP, Python, Ruby, Rust, Scala, and TypeScript.
- Suitable for text generation tasks.
๐ฆ Installation
Required Libraries and Their Versions
- torch>=2.3.0
- transformers>=4.40.1
- tokenizers>=0.19.1
- accelerate>=0.29.3
- flash-attn>=2.5.8
๐ป Usage Examples
Basic Usage
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3-8x13b-instruct3")
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-8x13b-instruct3", device_map="auto", torch_dtype=torch.bfloat16)
chat = [
{"role": "system", "content": "ไปฅไธใฏใใฟในใฏใ่ชฌๆใใๆ็คบใงใใ่ฆๆฑใ้ฉๅใซๆบใใๅฟ็ญใๆธใใชใใใ"},
{"role": "user", "content": "่ช็ถ่จ่ชๅฆ็ใจใฏไฝใ"},
]
tokenized_input = tokenizer.apply_chat_template(chat, add_generation_prompt=True, tokenize=True, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(
tokenized_input,
max_new_tokens=100,
do_sample=True,
top_p=0.95,
temperature=0.7,
repetition_penalty=1.05,
)[0]
print(tokenizer.decode(output))
๐ Documentation
Model Details
Property |
Details |
Model Type |
Transformer-based Language Model |
Total seen tokens |
2.1T tokens |
Params |
Layers |
Hidden size |
Heads |
Routed Experts |
Activated Experts |
Context length |
Embedding parameters |
Non-embedding parameters |
Activated parameters |
Total parameters |
8x1.8b |
24 |
2048 |
16 |
8 |
2 |
4096 |
407,498,752 |
8,858,863,616 |
2,924,279,808 |
9,266,362,368 |
8x13b |
40 |
5120 |
40 |
8 |
2 |
4096 |
1,018,746,880 |
72,144,081,920 |
22,200,806,400 |
73,162,828,800 |
If you want to learn more about the pretraining of the LLM-jp-3 MoE series, refer to this blog post.
Tokenizer
The tokenizer of this model is based on huggingface/tokenizers Unigram byte-fallback model. The vocabulary entries were converted from llm-jp-tokenizer v3.0
. For details on the vocabulary construction procedure (the pure SentencePiece training does not reproduce our vocabulary), refer to README.md of llm-jp-tokenizer
.
Datasets
Pre-training
The models were pre-trained using a combination of the following datasets:
Post-training
We fine-tuned the pre-trained checkpoint with supervised fine-tuning and further aligned it with Direct Preference Optimization.
Supervised Fine-tuning
The datasets used for supervised fine-tuning are as follows:
Direct Preference Optimization
The datasets used for supervised fine-tuning are as follows:
Language |
Dataset |
Description |
Japanese |
aya-ja-evol-inst |
A synthetic preference dataset focusing on LLMs' helpfulness. |
|
ac-self-inst |
A synthetic preference dataset focusing on LLMs' safety. |
Evaluation
llm-jp-eval (v1.4.1)
We evaluated the models using 100 examples from the dev split. Note that we skipped the CG (Code Generation) task.
Japanese MT Bench
We evaluated the models using gpt-4o-2024-08-06
. The scores represent the average values obtained from five rounds of inference and evaluation. For more details, refer to the codes.
AnswerCarefully-Eval
AnswerCarefully-Eval assesses the safety of Japanese language model outputs using the LLM-as-a-Judge approach, based on the test set from llm-jp/AnswerCarefully. We evaluated the models using gpt-4-0613
. The scores represent the average values obtained from five rounds of inference and evaluation.
๐ง Technical Details
The models released here are in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
๐ License
Apache License, Version 2.0
How to cite
If you find our work helpful, please feel free to cite the paper.
@inproceedings{
nakamura2025dropupcycling,
title={Drop-Upcycling: Training Sparse Mixture of Experts with Partial Re-initialization},
author={Taishi Nakamura and Takuya Akiba and Kazuki Fujii and Yusuke Oda and Rio Yokota and Jun Suzuki},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=gx1wHnf5Vp}
}
Model Card Authors
The names are listed in alphabetical order.
Hirokazu Kiyomaru, Takashi Kodama and Taishi Nakamura.
Send Questions to
llm-jp(at)nii.ac.jp