tiny-lm-v3.1-japanese-1b-base
A Japanese language model with 1.0B parameters, pretrained from scratch on 32.5B tokens of Japanese, English and math text. This is the base model, with no instruction tuning and no chat template. See tiny-lm-v3.1-japanese-1b-sft for the instruction-tuned variant.
Model details
| Parameters | 1.0B |
| Context length | 2048 |
| Vocab size | 99,574 |
| Tokenizer | llm-jp/llm-jp-3-440m |
Training
- Data: 32.5B tokens, 21.5B from the sample-10BT subsets of hotchpotch/fineweb-2-edu-japanese and HuggingFaceFW/fineweb-edu, 10.0B from fineweb-2-edu-japanese documents outside sample-10BT and 1.0B from tokyotech-llm/swallow-math-v2 (stage3-textbook and stage3-qa)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "nagohachi/tiny-lm-v3.1-japanese-1b-base"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16")
inputs = tok("日本の首都は", return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=64, do_sample=True, temperature=0.7, top_p=0.9)
print(tok.decode(out[0], skip_special_tokens=True))
Evaluation
llm-jp-eval v1.4.1, 4-shot without a chat template, 100 examples per dataset from the dev split. The scores are those of the SFT models, all evaluated with these settings. The average is the mean of the 10 categories (code generation is excluded).
| Model name | average | EL | FA | HE | MC | MR | MT | NLI | QA | RC | SUM |
|---|---|---|---|---|---|---|---|---|---|---|---|
| tiny-lm-v3.1-japanese-1.5b-a500m-sft | 0.257 | 0.192 | 0.040 | 0.260 | 0.273 | 0.030 | 0.567 | 0.390 | 0.303 | 0.415 | 0.098 |
| tiny-lm-v3.1-japanese-1b-sft | 0.314 | 0.168 | 0.065 | 0.290 | 0.327 | 0.040 | 0.690 | 0.522 | 0.321 | 0.619 | 0.098 |
| llm-jp/llm-jp-3-440m-instruct3 | 0.277 | 0.285 | 0.060 | 0.245 | 0.313 | 0.040 | 0.649 | 0.448 | 0.257 | 0.399 | 0.072 |