KAZAMI-1B-v0.1-base-v4
日本語 | English | References
KAZAMI-1B-PreviewSeries — Developed by Project KAZAMI Developers. A from-scratch Japanese language model preview family combining a Sandwich Looped Transformer (recurrent-depth latent computation) with an Engram-style Conditional Memory N-gram Table (800M sparse lookup parameters with optional CPU RAM offloading).Note: This checkpoint belongs to the
KAZAMI-1B-Previewseries (early preview models with room for further improvement). Future improved models may be released separately under a distinct series such asKAZAMI-1B.
日本語
概要
品質選別コーパス(上位 29.7% 厳選の日本語 Web テキスト)で継続事前学習した KAZAMI-1B ベースモデル(累計 4.72 億トークン)。v0.1-base 比で検証 PPL を -24.4% 改善し、文法最小対正答率 91.7%(11/12)に到達しました。
プレビュー版の位置づけ: 本モデルは
KAZAMI-1B-Previewシリーズに属する初期プレビュー版であり、性能面には今後の改善余地が残されています。今後の改良版モデルはKAZAMI-1B等の別シリーズとして公開する可能性があります。
KAZAMI-1B-Preview 系譜
| Model | Stage | Type | Cumulative Tokens | Loop Mode | Notes |
|---|---|---|---|---|---|
KAZAMI-1B-v0.1-base | Stage 1-A | Base | 210M | Fixed R=2 | First from-scratch 1B base |
KAZAMI-1B-v0.1-base-v4 (this model) | Stage 1-B | Base | 472M | Fixed R=2 | Quality-filtered web CPT |
KAZAMI-1B-v0.1-chat | Stage 1-B | Chat | 474M | Fixed R=2 | 1st-gen chat + <think> |
KAZAMI-1B-v0.2-base | Stage 1-C | Base | 1.16B | Multi-Loop R=1,2,3 | Latest 5-corpus base |
KAZAMI-1B-v0.2-chat | Stage 1-C | Chat | 1.16B | Multi-Loop R=1,2,3 | Latest recommended chat |
技術仕様(アーキテクチャ)
知識保持を担う Engram Conditional Memory(N-gram Table、約 8.00 億パラメータ) と、反復推論を担う Sandwich Looped Transformer(演算本体 約 1.95 億パラメータ) を組み合わせた構造を採用しています。
input_ids
│
▼
[Prelude] 2 層(GQA + RoPE + QK-Norm + SwiGLU)
└─ 第 2 層直後に [Engram Conditional Memory] を挿入
・2-gram / 3-gram × 各 8 ヘッド(計 16 ヘッド, 25,000,112 行 × 32 次元 = 800.0M パラメータ)
・日本語正規化マップ(NFKC・全半角・空白統合)をモデル内部バッファへ同梱
・文脈ゲート α + ゼロ初期化因果拡張 Conv1D(kernel=4, dilation=3)
・`engram_offload_to_cpu=True` でホスト RAM へ退避し、GPU VRAM <400 MB で推論可能
│
▼ h_pre(Input Injection アンカー)
[Recurrent Core] 物理 8 層 × R ループ(重み共有 + Gated Input Injection + ループ固有 Norm スケール)
│ R=1 → 実効 12 層 / R=2 → 実効 20 層 / R=3 → 実効 28 層
▼
[Coda] 2 層 → RMSNorm → Weight-Tied LM Head
| 項目 | 仕様 |
|---|---|
| 開発者 | Project KAZAMI Developers |
| シリーズ | KAZAMI-1B-Preview |
| 総パラメータ数 | 994,583,552 (~1.0B) |
| 内訳:演算本体(Backbone) | 194,579,968 (~195M)(Embedding 33.6M 含む・入出力重み共有) |
| 内訳:Engram N-gram Table | 800,003,584 (~800M)(2-gram / 3-gram × 8 ヘッド, 各 1,562,507 行 × 32 次元) |
| 層構成(物理 / 実効) | Prelude 2 + Core 8×R + Coda 2(物理 12 層 / R=2 時 実効 20 層) |
| 隠れ次元 / FFN 中間次元 | hidden_size = 1024 / intermediate_size = 3456 (SwiGLU) |
| Attention | GQA(16 Query Heads / 4 KV Heads, head_dim = 64), RoPE (theta=10000), QK-Norm |
| コンテキスト長 | 2,048 トークン |
| トークナイザ | 独自日本語 SentencePiece Unigram 32,768 語彙(約 2.12 文字/トークン, byte_fallback=True) |
| 保存形式 / 精度 | safetensors(BF16 単一ファイル, 約 1.99 GB) |
クイックスタート(transformers)
pip install torch transformers safetensors sentencepiece で動作します(外部リポジトリ不要、trust_remote_code=True で自己完結ロード)。
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "PROJECT-KAZAMI/KAZAMI-1B-v0.1-base-v4"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
# Option A: Full BF16 on GPU (~2.0 GB VRAM)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
).to("cuda").eval()
# Option B: Ultra-low VRAM mode (<400 MB VRAM + ~1.6 GB host RAM)
# model = AutoModelForCausalLM.from_pretrained(
# model_id,
# trust_remote_code=True,
# dtype=torch.bfloat16,
# engram_offload_to_cpu=True,
# ).to("cuda").eval()
prompt = "今日は朝から雨が降っていたので、"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(
**inputs,
max_new_tokens=128,
do_sample=True,
temperature=0.8,
top_p=0.9,
top_k=40,
repetition_penalty=1.1,
num_loops=2, # 2 (trained default)
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
学習詳細
- 学習段階: Stage 1-B 継続事前学習(
KAZAMI-1B-v0.1-baseから初期化) - データ: 2 段階品質選別(決定フィルタ+軽量日本語回帰分類器)で
HuggingFaceFW/fineweb-2jpn_Jpan170.9 万文書から上位 29.7% を厳選(3.20 億トークン) - ステップ / トークン: +4,000 steps / +262.1M トークン(累計 472M トークン,
seq_len=1024, 65,536 tok/step) - ループ設定: 固定
R=2(物理 12 層 / 実効 20 層) - オプティマイザ: Hybrid Muon + AdamW(本体)+行チャンク AdamW(GPU 常駐 Engram Table)
評価結果
| 評価指標 | 結果 |
|---|---|
検証 PPL (public_v3 32b) | 40.54 (v0.1-base 53.65 比 -24.4%, BPC 2.5505) |
検証 PPL (public_v4 val) | 42.81 (BPC 2.6497) |
検証 PPL (public_v5 対称比較, seq=512) | 55.52 (BPC 2.9398) |
ループスケーリング (public_v3 32b) | R=1: 194.09 → R=2: 40.54 (-79.1%) → R=3 外挿: 51.67 |
| 日本語文法最小対 (12 問診断) | 11 / 12 (91.7%) |
制限事項・想定用途
- 本モデルは
KAZAMI-1B-Previewシリーズとして公開する初期プレビュー版であり、性能にはまだ改善の余地があります。 - 事実の正確性や最新情報は保証されず、ハルシネーションや不正確な応答を生成する可能性があります。医療・法律・金融・安全に関わる意思決定には使用しないでください。
- ベースモデルのため対話フォーマットには未適応です。最新版ベースは
KAZAMI-1B-v0.2-base、対話版はKAZAMI-1B-v0.2-chatを推奨します。 - 固定
R=2学習に特化しているため、R=1実行時は精度が大きく低下します(既定のnum_loops=2を使用してください)。
ライセンス・名称保護方針・データ帰属表示
- ライセンス: Apache License 2.0(LICENSE および NOTICE を参照)
- 名称・ブランド保護方針(Apache License 2.0 第 6 条):
- Apache License 2.0 はモデル重みおよびコードの利用を許諾するものであり、「KAZAMI」「風見」「PROJECT-KAZAMI」 の名称・ブランド使用権は許諾していません(第 6 条)。
- 本モデルからファインチューニング・量子化・マージ・改変等を行った派生モデルやサービスに 「KAZAMI」 等の名称を使用することは、事前の書面許諾がない限り禁止します(事実としての出所表示のみ可)。詳細は TRADEMARK_POLICY.md をご覧ください。
- 使用した公開事前学習コーパス(帰属表示):
- FineWeb-2 (
jpn_Jpan):HuggingFaceFW/fineweb-2(ODC-By v1.0)
- FineWeb-2 (
English
Overview
Continued-pretrained KAZAMI-1B base model (472M cumulative tokens) trained on quality-filtered Japanese web text (top 29.7% selection), improving validation PPL by -24.4% over v0.1-base and reaching 91.7% (11/12) on the Japanese grammar diagnostic.
Preview Release Status: This model is part of the
KAZAMI-1B-Previewseries—early preview checkpoints with room for further performance improvement. Future improved releases may be published separately under a distinct series such asKAZAMI-1B.
KAZAMI-1B-Preview Model Lineage
| Model | Stage | Type | Cumulative Tokens | Loop Mode | Notes |
|---|---|---|---|---|---|
KAZAMI-1B-v0.1-base | Stage 1-A | Base | 210M | Fixed R=2 | First from-scratch 1B base |
KAZAMI-1B-v0.1-base-v4 (this model) | Stage 1-B | Base | 472M | Fixed R=2 | Quality-filtered web CPT |
KAZAMI-1B-v0.1-chat | Stage 1-B | Chat | 474M | Fixed R=2 | 1st-gen chat + <think> |
KAZAMI-1B-v0.2-base | Stage 1-C | Base | 1.16B | Multi-Loop R=1,2,3 | Latest 5-corpus base |
KAZAMI-1B-v0.2-chat | Stage 1-C | Chat | 1.16B | Multi-Loop R=1,2,3 | Latest recommended chat |
Technical Specifications
KAZAMI pairs an Engram Conditional Memory N-gram Table (800.0M sparse lookup parameters) with a Sandwich Looped Transformer compute backbone (194.6M parameters):
| Component | Specification |
|---|---|
| Developers | Project KAZAMI Developers |
| Series | KAZAMI-1B-Preview |
| Total Parameters | 994,583,552 (~1.0B) |
| Compute Backbone | 194,579,968 (~195M) (including 33.6M tied input/output embeddings) |
| Engram Conditional Memory | 800,003,584 (~800M) (2-gram & 3-gram × 8 heads, 1,562,507 rows/head × dim 32) |
| Layers (Physical / Effective) | Prelude 2 + Core 8×R + Coda 2 (12 physical / 20 effective at R=2) |
| Hidden / FFN Size | 1024 / 3456 (SwiGLU) |
| Attention | GQA (16 Q / 4 KV heads, head_dim=64), RoPE (theta=10000), QK-Norm |
| Context Length | 2,048 tokens |
| Tokenizer | Custom 32,768-vocab Japanese SentencePiece Unigram (~2.12 chars/token, byte fallback) |
| Weight Format | Single-file BF16 model.safetensors (~1.99 GB) |
Quickstart (transformers)
Install torch, transformers, safetensors, and sentencepiece. No external repository is required (trust_remote_code=True).
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "PROJECT-KAZAMI/KAZAMI-1B-v0.1-base-v4"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
# Option A: Full BF16 on GPU (~2.0 GB VRAM)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
).to("cuda").eval()
# Option B: Ultra-low VRAM mode (<400 MB VRAM + ~1.6 GB host RAM)
# model = AutoModelForCausalLM.from_pretrained(
# model_id,
# trust_remote_code=True,
# dtype=torch.bfloat16,
# engram_offload_to_cpu=True,
# ).to("cuda").eval()
prompt = "今日は朝から雨が降っていたので、"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(
**inputs,
max_new_tokens=128,
do_sample=True,
temperature=0.8,
top_p=0.9,
top_k=40,
repetition_penalty=1.1,
num_loops=2, # 2 (trained default)
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))
Training Summary
- Stage: Stage 1-B continued pretraining (initialized from
KAZAMI-1B-v0.1-base) - Data: Two-stage quality-curated subset (top 29.7% of 1.71M scanned
HuggingFaceFW/fineweb-2jpn_Jpandocs, 320M tokens) - Steps / Tokens: +4,000 steps / +262.1M tokens (472M cumulative tokens,
seq_len=1024, 65,536 tok/step) - Loop setting: Fixed
R=2(12 physical layers / 20 effective layers) - Optimizer: Hybrid Muon + AdamW (backbone) + row-chunked AdamW (GPU-resident Engram table)
Evaluation Results
| Metric | Score |
|---|---|
Validation PPL (public_v3 32b) | 40.54 (-24.4% vs v0.1-base 53.65, BPC 2.5505) |
Validation PPL (public_v4 val) | 42.81 (BPC 2.6497) |
Validation PPL (public_v5 symmetric, seq=512) | 55.52 (BPC 2.9398) |
Loop scaling (public_v3 32b) | R=1: 194.09 → R=2: 40.54 (-79.1%) → R=3 extrap.: 51.67 |
| Japanese grammar minimal-pair (12 diagnostic items) | 11 / 12 (91.7%) |
Limitations & Intended Use
- This checkpoint is released as part of the
KAZAMI-1B-Previewseries; performance remains early-stage with significant room for improvement. - Like all small-scale language models, it may hallucinate facts or make reasoning errors and must not be relied upon for medical, legal, financial, or safety-critical decisions.
- Pure base model without chat adaptation. See
KAZAMI-1B-v0.2-base(latest base) orKAZAMI-1B-v0.2-chat(latest chat). - Specialized for fixed
R=2;R=1degrades sharply (use defaultnum_loops=2).
License, Trademark Policy & Dataset Attributions
- License: Apache License 2.0 (see LICENSE and NOTICE).
- Trademark & Naming Policy (Apache License 2.0, Section 6):
- Apache License 2.0 grants rights to the model weights and code, not to the names "KAZAMI", "風見", or "PROJECT-KAZAMI" (Section 6).
- Third-party derivative models, fine-tunes, quantizations, merges, products, or services must not be named "KAZAMI" (or confusingly similar variations) without prior written permission from Project KAZAMI Developers; only truthful descriptive provenance attribution is permitted. See TRADEMARK_POLICY.md for full terms.
- Open Pretraining Corpus Attributions:
- FineWeb-2 (
jpn_Jpan):HuggingFaceFW/fineweb-2(ODC-By v1.0)
- FineWeb-2 (
References
Technical specifications documented above build upon the following published works:
- Sandwich Looped Transformer / Recurrent Depth: Jonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, Brian R. Bartoldson, Bhavya Kailkhura, Abhinav Bhatele, and Tom Goldstein. Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approach (2025). https://arxiv.org/abs/2502.05171
- Engram Conditional Memory: Xin Cheng, Rui Tian, Wangding Zeng, Damai Dai, et al. (Peking University & DeepSeek-AI). Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models (2026). https://arxiv.org/abs/2601.07372
- Muon Optimizer: Jingyuan Liu, Jianlin Su, Xingcheng Yao, et al. (Moonshot AI). Muon is Scalable for LLM Training (2025). https://arxiv.org/abs/2502.16982
- Grouped-Query Attention (GQA): Joshua Ainslie, James Lee-Thorp, Michiel de Jong, Yury Zemlyanskiy, Federico Lebrón, and Sumit Sanghai. GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints (2023). https://arxiv.org/abs/2305.13245
- Rotary Position Embedding (RoPE): Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. RoFormer: Enhanced Transformer with Rotary Position Embedding (2021). https://arxiv.org/abs/2104.09864
- Query-Key Normalization (QK-Norm): Alex Henry, Prudhvi Raj Dachapally, Shubham Shantaram Pawar, and Yuxuan Chen. Query-Key Normalization for Transformers (2020). https://arxiv.org/abs/2010.04245
- SwiGLU: Noam Shazeer. GLU Variants Improve Transformer (2020). https://arxiv.org/abs/2002.05202
- RMSNorm: Biao Zhang and Rico Sennrich. Root Mean Square Layer Normalization (2019). https://arxiv.org/abs/1910.07467
- SentencePiece: Taku Kudo and John Richardson. SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing (2018). https://arxiv.org/abs/1808.06226
Citation
@misc{kazami1b_preview_2026,
title = {KAZAMI-1B-v0.1-base-v4: Japanese Sandwich Looped Transformer with Engram Conditional Memory (KAZAMI-1B-Preview Series)},
author = {Project KAZAMI Developers},
year = {2026},
url = {https://huggingface.co/PROJECT-KAZAMI/KAZAMI-1B-v0.1-base-v4}
}