Building upon the LLM-jp-3 series, the LLM-jp-3.1 models incorporate mid-training (
instruction pre-training
), which significantly enhances their instruction-following capabilities compared to the original LLM-jp-3 models.
This repository provides the
llm-jp-3.1-13b
model.
For an overview of the LLM-jp-3.1 models across different parameter sizes, please refer to:
For more details on the training procedures and evaluation results, please refer to
this blog post
(in Japanese).
Checkpoints format: Hugging Face Transformers
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
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3.1-13b")
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3.1-13b", device_map="auto", torch_dtype=torch.bfloat16)
text = "自然言語処理とは何か"
tokenized_input = tokenizer.encode(text, add_special_tokens=False, 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))
Model Details
Model type:
Transformer-based Language Model
Architectures:
Dense model:
Params
Layers
Hidden size
Heads
Context length
Embedding parameters
Non-embedding parameters
1.8b
24
2048
16
4096
407,498,752
1,459,718,144
13b
40
5120
40
4096
1,018,746,880
12,688,184,320
MoE model:
Params
Layers
Hidden size
Heads
Routed Experts
Activated Experts
Context length
Embedding parameters
Non-embedding parameters
Activated parameters
Total parameters
8x13b
40
5120
40
8
2
4096
1,018,746,880
72,144,081,920
22,200,806,400
73,162,828,800
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
.
Please refer to
README.md
of
llm-jp-tokenizer
for details on the vocabulary construction procedure (the pure SentencePiece training does not reproduce our vocabulary).
Datasets
Pre-training
The models have been pre-trained using a blend of the following datasets.
In the LLM-jp-3.1 series, we performed continuous pre-training based on
Instruction Pre-Training
.
Instruction Pre-Training enhances a model’s ability to follow instructions by continuing pre-training on a large collection of instruction–response pairs.
We prepared approximately 90B tokens of instruction–response data and mixed it with our pre-training datasets, conducting continuous pre-training on a total of 400B tokens.
Each model was initialized from existing checkpoints (
llm-jp/llm-jp-3-1.8b
,
llm-jp/llm-jp-3-13b
, and
llm-jp/llm-jp-3-8x13b
) and underwent continuous instruction pre-training.
Since the LLM-jp-3 series was originally pre-trained on 2.1T tokens, the total pre-training token count amounts to 2.5T tokens.
Details of this training process will be released in a forthcoming paper. The instruction–response dataset used for this training will also be made publicly available.
Post-training
We have 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:
For Direct Preference Optimization (DPO), we adopted rejection sampling.
Prompts were sampled from the dataset used in SFT, and multiple responses were generated for each prompt.
These responses were then scored (by
Qwen/Qwen2.5-32B-Instruct
), and DPO was performed by treating high-scoring responses as positive examples and low-scoring responses as negative examples.
We conducted DPO in two stages.
In the second stage, we additionally used
ac-self-inst
, a Japanese preference dataset focused on safety.
Evaluation
MT Bench (Japanese and English)
We evaluated the models using
gpt-4o-2024-08-06
.
The scores represent the average values obtained from three rounds of inference and evaluation.
For more details, please refer to the
codes
.
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-4o-2024-08-06
.
The scores represent the average values obtained from three rounds of inference and evaluation.
For more details, please refer to the
codes
.
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.
llm-jp-3.1-13b huggingface.co is an AI model on huggingface.co that provides llm-jp-3.1-13b's model effect (), which can be used instantly with this llm-jp llm-jp-3.1-13b model. huggingface.co supports a free trial of the llm-jp-3.1-13b model, and also provides paid use of the llm-jp-3.1-13b. Support call llm-jp-3.1-13b model through api, including Node.js, Python, http.
llm-jp-3.1-13b huggingface.co is an online trial and call api platform, which integrates llm-jp-3.1-13b's modeling effects, including api services, and provides a free online trial of llm-jp-3.1-13b, you can try llm-jp-3.1-13b online for free by clicking the link below.
llm-jp llm-jp-3.1-13b online free url in huggingface.co:
llm-jp-3.1-13b is an open source model from GitHub that offers a free installation service, and any user can find llm-jp-3.1-13b on GitHub to install. At the same time, huggingface.co provides the effect of llm-jp-3.1-13b install, users can directly use llm-jp-3.1-13b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.