The development was partially supported by
GENIAC.
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3-172b-instruct3")
4model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-172b-instruct3", device_map="auto", torch_dtype=torch.bfloat16)
5chat = [
6 {"role": "system", "content": "以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。"},
7 {"role": "user", "content": "自然言語処理とは何か"},
8]
9tokenized_input = tokenizer.apply_chat_template(chat, add_generation_prompt=True, tokenize=True, return_tensors="pt").to(model.device)
10with torch.no_grad():
11 output = model.generate(
12 tokenized_input,
13 max_new_tokens=100,
14 do_sample=True,
15 top_p=0.95,
16 temperature=0.7,
17 repetition_penalty=1.05,
18 )[0]
19print(tokenizer.decode(output))
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).
The models have been pre-trained using a blend of the following datasets.
We have fine-tuned the pre-trained checkpoint with supervised fine-tuning and further aligned it with 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.
We evaluated the models using 100 examples from the dev split. Note that we skipped the CG (Code Generation) task.
We evaluated the models using
gpt-4-0613. Please see the
codes for 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.
Hirokazu Kiyomaru and Takashi Kodama.