llm-jp/llm-jp-3-172b-instruct3

Model

llm-jp-3-172b-instruct3

11

189 commits

4 linked in READMEs

updated Jan 20, 2025

See the code

README

llm-jp-3-172b-instruct3

This repository provides large language models developed by the Research and Development Center for Large Language Models at the National Institute of Informatics.

The development was partially supported by GENIAC.

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-172b-instruct3")
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-172b-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))

Model Details

  • Model type: Transformer-based Language Model
  • Total seen tokens::
    • llm-jp-3-1.8b: 2.1T
    • llm-jp-3-3.7b: 2.1T
    • llm-jp-3-13b: 2.1T
    • llm-jp-3-172b-beta1: 0.7T
    • llm-jp-3-172b-beta2: 1.4T
    • llm-jp-3-172b: 2.1T
ParamsLayersHidden sizeHeadsContext lengthEmbedding parametersNon-embedding parameters
1.8b242048164096407,498,7521,459,718,144
3.7b283072244096611,248,1283,171,068,928
13b4051204040961,018,746,88012,688,184,320
172b96122889640962,444,992,512169,947,181,056

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.

LanguageDatasetTokens
JapaneseWikipedia2.6B
Common Crawl762.8B
WARP/PDF237.3B
WARP/HTML2.7B
Kaken1.8B
EnglishWikipedia4.7B
Dolma/CC-head608.5B
Dolma/C4181.6B
Dolma/Reddit83.1B
Dolma/PeS2o62.9B
Dolma/Gutenberg5.5B
Dolma/Wiki3.9B
CodeThe Stack114.1B
ChineseWikipedia0.8B
KoreanWikipedia0.3B

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:

LanguageDatasetDescription
Japaneseichikara-instruction-004-002A manually constructed Japanese instruction dataset.
answer-carefully-002A manually constructed instruction dataset focusing on LLMs' safety.
ichikara-instruction-formatA small subset of the ichikara-instruction dataset, edited with some constraints on the output format.
AutoMultiTurnByCalm3-22BA synthetic instruction dataset.
ramdom-to-fixed-multiturn-Calm3A synthetic instruction dataset.
wizardlm8x22b-logical-math-coding-sft-jaA synthetic instruction dataset. We used a sampled subset.
wizardlm8x22b-logical-math-coding-sft_additional-jaA synthetic instruction dataset. We used a sampled subset.
magpie-sft-v1.0A synthetic instruction dataset we created.
EnglishDaring-Anteater-
FLANWe used a sampled subset.
Japanese & EnglishSynthetic-JP-EN-Coding-Dataset-567kA synthetic instruction dataset. We used a sampled subset.

Direct Preference Optimization

We used synthetic preference data to improve both the helpfulness and harmlessness of the LLM. The datasets will be made available soon.

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.

Model nameaverageELFAHEMCMRMTNLIQARCSUM
llm-jp-3-172b-beta10.51740.44600.25560.37000.64000.61000.82650.56000.57200.85050.0434
llm-jp-3-172b-beta1-instruct0.57000.43060.22920.43500.84330.62000.82280.68200.58730.89640.1529
llm-jp-3-172b-beta20.54220.33370.27250.47000.77670.69000.82830.59600.61330.83800.0037
llm-jp-3-172b-beta2-instruct20.60220.54700.26650.51000.86000.70000.83920.68000.63460.87700.1076
llm-jp-3-172b0.54310.40770.26620.51500.76330.67000.82270.57400.56860.82890.0148
llm-jp-3-172b-instruct30.61300.51730.27110.57000.87330.73000.84370.72800.60120.88290.1121

Japanese MT Bench

We evaluated the models using gpt-4-0613. Please see the codes for details.

Model nameaveragecodingextractionhumanitiesmathreasoningroleplaystemwriting
llm-jp-3-172b-beta1-instruct5.142.905.308.802.152.456.957.455.15
llm-jp-3-172b-beta2-instruct26.724.106.907.604.006.358.707.958.15
llm-jp-3-172b-instruct37.574.858.559.563.757.68.18.959.2

Risks and Limitations

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.

Send Questions to

llm-jp(at)nii.ac.jp

License

See the LICENSE file.

Model Card Authors

The names are listed in alphabetical order.

Hirokazu Kiyomaru and Takashi Kodama.

conversational
llama
safetensors
text-generation
text-generation-inference
transformers

llm-jp/llm-jp-3-172b-instruct3

Model

llm-jp-3-172b-instruct3

11

189 commits

4 linked in READMEs

updated Jan 20, 2025

See the code

README

llm-jp-3-172b-instruct3

This repository provides large language models developed by the Research and Development Center for Large Language Models at the National Institute of Informatics.

The development was partially supported by GENIAC.

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-172b-instruct3")
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-172b-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))

Model Details

  • Model type: Transformer-based Language Model
  • Total seen tokens::
    • llm-jp-3-1.8b: 2.1T
    • llm-jp-3-3.7b: 2.1T
    • llm-jp-3-13b: 2.1T
    • llm-jp-3-172b-beta1: 0.7T
    • llm-jp-3-172b-beta2: 1.4T
    • llm-jp-3-172b: 2.1T
ParamsLayersHidden sizeHeadsContext lengthEmbedding parametersNon-embedding parameters
1.8b242048164096407,498,7521,459,718,144
3.7b283072244096611,248,1283,171,068,928
13b4051204040961,018,746,88012,688,184,320
172b96122889640962,444,992,512169,947,181,056

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.

LanguageDatasetTokens
JapaneseWikipedia2.6B
Common Crawl762.8B
WARP/PDF237.3B
WARP/HTML2.7B
Kaken1.8B
EnglishWikipedia4.7B
Dolma/CC-head608.5B
Dolma/C4181.6B
Dolma/Reddit83.1B
Dolma/PeS2o62.9B
Dolma/Gutenberg5.5B
Dolma/Wiki3.9B
CodeThe Stack114.1B
ChineseWikipedia0.8B
KoreanWikipedia0.3B

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:

LanguageDatasetDescription
Japaneseichikara-instruction-004-002A manually constructed Japanese instruction dataset.
answer-carefully-002A manually constructed instruction dataset focusing on LLMs' safety.
ichikara-instruction-formatA small subset of the ichikara-instruction dataset, edited with some constraints on the output format.
AutoMultiTurnByCalm3-22BA synthetic instruction dataset.
ramdom-to-fixed-multiturn-Calm3A synthetic instruction dataset.
wizardlm8x22b-logical-math-coding-sft-jaA synthetic instruction dataset. We used a sampled subset.
wizardlm8x22b-logical-math-coding-sft_additional-jaA synthetic instruction dataset. We used a sampled subset.
magpie-sft-v1.0A synthetic instruction dataset we created.
EnglishDaring-Anteater-
FLANWe used a sampled subset.
Japanese & EnglishSynthetic-JP-EN-Coding-Dataset-567kA synthetic instruction dataset. We used a sampled subset.

Direct Preference Optimization

We used synthetic preference data to improve both the helpfulness and harmlessness of the LLM. The datasets will be made available soon.

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.

Model nameaverageELFAHEMCMRMTNLIQARCSUM
llm-jp-3-172b-beta10.51740.44600.25560.37000.64000.61000.82650.56000.57200.85050.0434
llm-jp-3-172b-beta1-instruct0.57000.43060.22920.43500.84330.62000.82280.68200.58730.89640.1529
llm-jp-3-172b-beta20.54220.33370.27250.47000.77670.69000.82830.59600.61330.83800.0037
llm-jp-3-172b-beta2-instruct20.60220.54700.26650.51000.86000.70000.83920.68000.63460.87700.1076
llm-jp-3-172b0.54310.40770.26620.51500.76330.67000.82270.57400.56860.82890.0148
llm-jp-3-172b-instruct30.61300.51730.27110.57000.87330.73000.84370.72800.60120.88290.1121

Japanese MT Bench

We evaluated the models using gpt-4-0613. Please see the codes for details.

Model nameaveragecodingextractionhumanitiesmathreasoningroleplaystemwriting
llm-jp-3-172b-beta1-instruct5.142.905.308.802.152.456.957.455.15
llm-jp-3-172b-beta2-instruct26.724.106.907.604.006.358.707.958.15
llm-jp-3-172b-instruct37.574.858.559.563.757.68.18.959.2

Risks and Limitations

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.

Send Questions to

llm-jp(at)nii.ac.jp

License

See the LICENSE file.

Model Card Authors

The names are listed in alphabetical order.

Hirokazu Kiyomaru and Takashi Kodama.

conversational
llama
safetensors
text-generation
text-generation-inference
transformers