--- language: ja tags: - ja - japanese - gpt2 - text-generation - lm - nlp license: mit datasets: - wikipedia - cc100 --- # 日本語 gpt2 蒸留モデル このモデルは[rinna/japanese-gpt2-meduim](https://huggingface.co/rinna/japanese-gpt2-medium)を教師として蒸留したものです。 蒸留には、HuggigFace Transformersの[コード](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation)をベースとし、[りんなの訓練コード](https://github.com/rinnakk/japanese-pretrained-models)と組み合わせてデータ扱うよう改造したものを使っています。 訓練用コード: https://github.com/knok/japanese-pretrained-models ## 学習に関して 学習に当たり、Google Startup Programにて提供されたクレジットを用いました。 a2-highgpu-4インスタンス(A100 x 4)を使って4か月程度、何度かのresumeを挟んで訓練させました。 ## 精度について Wikipediaをコーパスとし、perplexity 40 程度となります。 rinna/japanese-gpt2-meduim を直接使った場合、27 程度なので、そこまで及びません。 何度か複数のパラメータで訓練の再開を試みたものの、かえって損失が上昇してしまう状態となってしまったので、現状のものを公開しています。 ## トークナイザについて トークナイザは rinna/japanese-gpt2-meduim を使ってください。 # Japanese GPT-2 model This model is a dillated model from [rinna/japanese-gpt2-medium](https://huggingface.co/rinna/japanese-gpt2-medium). To train, I combined HuggingFace Transformers [code](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) and [rinna gpt2 train code](https://github.com/rinnakk/japanese-pretrained-models). The code is available at: https://github.com/knok/japanese-pretrained-models ## training environment To train, I used GCP credit offered by Google Startup Progam. Using a2-highgpu-4 instance (A100 x4), it takes about 4 months with some stopping and resume training. ## perplexity The model gets about 40 perplexity with Wikipedia corpus. The teacher model rinna/japanese-gpt2-meduim gets about 27 perplexity, so the student model is worse. ## tokenizer The repository don't have tokenizer, so you shoud use rinna/japanese-gpt2-medium. # LICENSE MIT (same as rinna/japanese-gpt2-medium)