Instructions to use iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1") model = AutoModelForMaskedLM.from_pretrained("iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
metadata
language:
- ja
license: mit
library_name: transformers
pipeline_tag: fill-mask
tags:
- mirei
- modernbert
- masked-lm
- pretraining
base_model: iamtatsuki05/ModernBERT-JP-0.5B-init
datasets:
- hotchpotch/fineweb-2-edu-japanese
ModernBERT-JP-0.5B-PT-stage1
English / Japanese
Overview
ModernBERT-JP-0.5B-PT-stage1 は、iamtatsuki05/ModernBERT-JP-0.5B-init を hotchpotch/fineweb-2-edu-japanese で学習した非埋め込みパラメータが約 0.5B パラメータの日本語の ModernBERT モデルです。 最大 1,024 トークンで 10B トークン学習させました。
Usage
Requirements
transformers>=4.51.0
accelerate>=1.6.0
sentencepiece>=0.2.0
flash-attn>=2.7.3
Sample Code
import torch
from transformers import AutoModelForMaskedLM, AutoTokenizer
model_name = "iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1"
model_kwargs = {
"torch_dtype": torch.bfloat16,
"attn_implementation": "flash_attention_2",
"device_map": "auto",
}
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForMaskedLM.from_pretrained(model_name, **model_kwargs)
text = f"ハチワレは{tokenizer.mask_token}のキャラクターです。"
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model(**inputs)
masked_index = inputs["input_ids"][0].tolist().index(tokenizer.mask_token_id)
print(tokenizer.decode(outputs.logits[0, masked_index].argmax(axis=-1)))
Model Details
- ベースモデル: iamtatsuki05/ModernBERT-JP-0.5B-init
- アーキテクチャ: ModernBERT
- 最大シーケンス長: 8,192トークン
- 埋め込み次元: 1280
- トークナイザ: SentencePiece / 語彙数 102,400
- 位置エンコーディング: RoPE
- 対応言語: 日本語
Model Series
初期化済みモデルに対して hotchpotch/fineweb-2-edu-japanese で最大 1,024 トークンを約 10B トークン分事前学習したモデル群です。
| ID | Architecture | #Param. | #Param. w/o Emb. |
|---|---|---|---|
| iamtatsuki05/ModernBERT-JP-0.5B-PT-stage1 (this model) |
ModernBERT | 679M | 548M |
| iamtatsuki05/Llama-JP-0.5B-PT-stage1 | Llama | 661M | 530M |
Licence
このモデルは MIT でライセンスされています。
How to Cite
@article{MIREI
title={同一条件下における Encoder/Decoder アーキテクチャによる文埋め込みの性能分析},
author={岡田 龍樹 and 杉本 徹},
journal={言語処理学会第 32 回年次大会 (NLP2026)},
year={2026}
}
