PLaMo 3 Translate Samurai Joke 2B MLX
Built with PLaMo
何をするモデル? / What is this?
現代日本語 ↔ フィクションの侍口調(拙者・候)を楽しむ、個人の実験・ジョーク用途の非公式派生モデルです。 古典の正確な翻訳、歴史的な話し方の再現、国語学習の正解集を目的としません。 誤訳、意味の変化、不自然な活用があります。PFNの公式モデル・公式見解ではありません。
A playful, unofficial style-transfer experiment: modern Japanese ↔ samurai-style Japanese. This is a novelty model, not a historically reliable translator. It is not endorsed by Preferred Networks. The intended joke/entertainment use does not waive any license restrictions.
実出力例(PLaMo派生モデルによる生成 / output of this PLaMo derivative):
- 入力: 私は明日、友人に手紙を送ります。
- 出力: 拙者は明日、友人に手紙を送る所存に候。
Run locally (Apple Silicon / MLX)
Standalone merged weights, approximately 5.36 GiB per model. No LoRA adapter is needed. This release is not 4-bit: it was trained from a 4-bit base and then merged/dequantized. Tested on Apple M2 with 16 GB unified memory. Load one model at a time. This is not a GGUF or a standard Transformers/PyTorch checkpoint.
python3.12 -m venv .venv
.venv/bin/pip install mlx==0.32.4 mlx-lm==0.32.0 transformers==5.19.0 numba==0.68.0 huggingface-hub==2.4.0
.venv/bin/hf download hawkymisc/PLaMo-3-Translate-Samurai-Joke-2B-MLX --local-dir model
.venv/bin/python model/translate.py --direction to_classical --text '私は明日、友人に手紙を送ります。'
.venv/bin/python model/translate.py --direction to_modern --text '拙者は明日、友人に手紙を送る所存に候。'
The same dependency pins are included in requirements.txt.
The local model and tokenizer require trust_remote_code=True. Review the bundled Python files before running them.
from huggingface_hub import snapshot_download
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
path = snapshot_download("hawkymisc/PLaMo-3-Translate-Samurai-Joke-2B-MLX") # Pin revision to a published commit for reproducibility.
model, tokenizer = load(path, trust_remote_code=True,
tokenizer_config={"trust_remote_code": True})
tokens = tokenizer.apply_chat_template(
[{"role": "user", "content": "私は明日、友人に手紙を送ります。"}],
direction="to_classical", # or to_modern
add_generation_prompt=True, tokenize=True, return_dict=False)
print(generate(model, tokenizer, prompt=tokens, max_tokens=160,
sampler=make_sampler(temp=0)))
Use translate.py to detect and reject truncated output. Both directions require explicit selection.
The learned PFML3 labels ja and ja-samurai are project-specific; ja-samurai is not an official language code.
Training and evaluation
- Base: pfnet/plamo-3-translate-2b-MLX-4bit, revision
63777ddc6dc80aacacd92a1bf6966105f2f6270c. - Terra-generated synthetic parallel data: 512 training pairs, 70 validation pairs, 32 independent test pairs, expanded into both directions.
- Split by paired examples / near-duplicate groups before direction expansion; test overlap filtered.
- QLoRA: rank 16, scale 16, last 16 layers, 64 attention/MLP matrices; batch 2, 800 steps, Adam learning rate 0.0001, max 256 tokens, seed 42, gradient checkpointing.
- Response-only loss includes EOS and excludes prompt/padding. Best validation checkpoint selected (recorded zero-based iteration 599); tests were not used for checkpoint selection.
- Delta merged into actual matrices; other quantized matrices dequantized. Embeddings/head unchanged.
| Direction | Base chrF | Tuned chrF | Test examples |
|---|---|---|---|
| to_classical | 52.42 | 57.45 | 32 |
| to_modern | 66.74 | 61.71 | 32 |
Scores compare against a single synthetic reference, not expert-annotated historical gold. The base uses the same custom language labels; this is not a comparison with an optimized base prompt. Samurai → modern Japanese did not improve on chrF. Neither model has been validated on long texts or real historical corpora. Negation, tense, subjects, honorifics and information preservation can be wrong. See observed errors, test outputs, metrics, training manifest, and weight verification.
License / 利用条件
This derivative is distributed under the PLaMo Community License Agreement, not MIT or Apache for the weights. Read the full bundled Japanese agreement / English agreement and the official license page. By accessing or using the model, you are subject to that agreement; recipients must comply with all of its terms.
- 再配布時は契約全文を提供し、受領者にも条件を遵守させ、関連ページ等に Built with PLaMo を表示し、AIモデル名に PLaMo を含めてください(第4条)。
- 公表する生成物はPLaMoまたは派生モデルの生成物であることを明示してください(第5条)。
- 商業目的には組織内部・サービス開発等も含まれます。第3条の事前登録と直近年度収入・売上10億円以下の条件を確認してください。 条件を満たさない商業利用にはPFNの別途商業ライセンスが必要です。ジョーク用途という説明は免除を意味しません。
- PFNの事前登録ページ。その他の禁止事項・責任等も契約全文に従ってください。
Redistribution requires the agreement copy, recipient compliance, Built with PLaMo attribution, and PLaMo in derivative AI model names. Public outputs must be identified as PLaMo-derived. Commercial use requires prior PFN registration and annual revenue/sales not exceeding JPY 1 billion, as specified in Article 3; otherwise a separate commercial license is required. This summary does not replace or modify the agreement.
The adapted MLX implementation also includes Apple MIT-licensed portions; their original notice is preserved in LICENSE.mlx-lm. This does not relicense the model weights.