matsuo-lab/weblab-10b-instruction-sft
weblab-10b-instruction-sft
Overview
This repository provides a Japanese-centric multilingual GPT-NeoX model of 10 billion parameters.
- Library
The model was trained using code based on EleutherAI/gpt-neox.
- Model architecture
A 36-layer, 4864-hidden-size transformer-based language model.
- Pre-training
The model was trained on around 600B tokens from a mixture of the following corpora.
- Instruction-supervised-finetuning
The model was finetuned on a subset records from a mixture of the following dataset. Training epoch: 1.
- Alpaca (English)
- Alpaca (Japanese translation)
- Flan 2021 (English)
- Flan CoT (English)
- Flan Dialog (English)
- Model Series
- Authors
Takeshi Kojima
Benchmarking
- Japanese benchmark : JGLUE 8-task (2023-08-27)
- We used [Stability-AI/lm-evaluation-harness](https://github.com/Stability-AI/lm-evaluation-harness/tree/2f1583c0735eacdfdfa5b7d656074b69577b6774) library for evaluation.
- The 8-task average accuracy is based on results of JCommonsenseQA-1.1, JNLI-1.1, MARC-ja-1.1, JSQuAD-1.1, jaqket_v2-0.2, xlsum_ja-1.0, xwinograd_ja, and mgsm-1.0.
- model loading is performed with float16, and evaluation is performed with template version 0.3 using the few-shot in-context learning.
- The number of few-shots is 3,3,3,2,1,1,0,5.
- special_tokens_map.json is modified to avoid errors during the evaluation of the second half benchmarks. As a result, the results of the first half benchmarks became slightly different.
- Japanese benchmark : JGLUE 4-task (2023-08-18)
- We used [Stability-AI/lm-evaluation-harness](https://github.com/Stability-AI/lm-evaluation-harness/tree/2f1583c0735eacdfdfa5b7d656074b69577b6774) library for evaluation.
- The 4-task average accuracy is based on results of JCommonsenseQA-1.1, JNLI-1.1, MARC-ja-1.1, and JSQuAD-1.1.
- model loading is performed with float16, and evaluation is performed with template version 0.3 using the few-shot in-context learning.
- The number of few-shots is 3,3,3,2.
How to use the model
~~~~python import torch from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.frompretrained("matsuo-lab/weblab-10b-instruction-sft") model = AutoModelForCausalLM.frompretrained("matsuo-lab/weblab-10b-instruction-sft", torch_dtype=torch.float16)
if torch.cuda.is_available(): model = model.to("cuda")
text = "大規模言語モデルについて説明してください。" text = f'以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。\n\n### 指示:\n{text}\n\n### 応答:' tokenids = tokenizer.encode(text, addspecialtokens=False, returntensors="pt")
with torch.nograd(): outputids = model.generate( tokenids.to(model.device), maxnewtokens=100, dosample=True, temperature=0.7, top_p=0.95 )
output = tokenizer.decode(output_ids.tolist()[0]) print(output)
~~~~ ---
