CoolFace
Modelpublic

nagohachi/tiny-lm-japanese-500m-sft-v1

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes50downloads
Model Card

tiny-lm-japanese-500m-sft-v1

Instruction-tuned (SFT) version of tiny-lm-japanese-500m-base-v1, a ~500M-parameter Japanese LLM pretrained from scratch on ~10B tokens. See tiny-lm-japanese-500m-dpo-v1 for the preference-aligned variant.

The model uses a custom Llama-style implementation shipped with the repo (trust_remote_code=True required).

Model details

Parameters480M
Context length2048
Vocab size99,574
Tokenizerllm-jp/llm-jp-3-440m

Training

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "nagohachi/tiny-lm-japanese-500m-sft-v1"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype="bfloat16")

messages = [{"role": "user", "content": "日本の首都はどこですか?"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
out = model.generate(inputs, max_new_tokens=128, do_sample=True, temperature=0.7, top_p=0.9)
print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))

Evaluation

llm-jp-eval (v2.1.5)

Base models use the 4-shot setting; SFT/DPO models and the instruct baseline are prompted through their chat template.

Model nameaverageCRELFAHE-ENHE-JAMRMTNLIQARC
tiny-lm-japanese-500m-base-v10.1980.2230.1300.0350.2070.1300.0070.5040.4830.0720.190
tiny-lm-japanese-500m-sft-v10.1910.3100.1020.0360.1870.0700.0130.5230.3800.0820.210
tiny-lm-japanese-500m-dpo-v10.1940.3100.1300.0360.1870.0700.0130.5310.3450.0820.240
------------------------------------
llm-jp/llm-jp-3-440m0.2490.2800.2660.0590.1700.0800.0270.7600.5250.1440.180
llm-jp/llm-jp-3-440m-instruct30.2540.3170.2890.0660.2230.1100.0170.7440.5200.1550.100