Chikamiyama v14 — LLM-jp-4-8B-Thinking

Chikamiyama(近見山) is a Japanese reasoning language model based on LLM-jp-4-8B-thinking, trained using full-parameter supervised fine-tuning (SFT).
The model supports four reasoning and response channels for Imabari dialect and standard Japanese, along with three levels of Reasoning Effort: Low, Medium, and High.
The name Chikamiyama comes from Mount Chikami (近見山), a mountain in Imabari City, Ehime Prefecture, Japan. This is the first successfully trained model following a series of development experiments.
日本語の説明は下にあります。 / Japanese documentation follows below.
1. Key Features
Channels
The custom chat template supports four channels:
| Channel | Purpose | Language |
|---|---|---|
analysis_imabari | Reasoning | Imabari dialect |
final_imabari | Final response | Imabari dialect |
analysis | Reasoning | Standard Japanese |
final | Final response | Standard Japanese |
Available channels are specified using the valid_channels argument of tokenizer.apply_chat_template().
For Imabari dialect:
valid_channels = [
"analysis_imabari",
"final_imabari",
"commentary",
]
For standard Japanese:
valid_channels = [
"analysis",
"final",
"commentary",
]
The valid_channels parameter informs the model which channels are available. It does not strictly constrain the generated output.
The initial generation channel can also be explicitly specified using an assistant channel prefix.
Reasoning Effort
The model supports three reasoning-effort levels:
| Level | Value | Intended behavior |
|---|---|---|
| Low | low | Short reasoning |
| Medium | medium | Moderate reasoning |
| High | high | Detailed reasoning |
Reasoning effort is specified through the reasoning_effort argument:
reasoning_effort="high"
The default value is medium.
The custom chat template converts this parameter into a system instruction such as Reasoning: high.
Reasoning effort is a conditioning mechanism and does not guarantee a specific reasoning length or accuracy.
Framework versions
- TRL: 1.13.0
- Transformers: 5.17.0
- Pytorch: 2.14.0
- Datasets: 5.0.1
- Tokenizers: 0.23.2
2. Inference
The following example demonstrates how to select the language channels and reasoning effort using Hugging Face Transformers.
Set:
LANGUAGEto"imabari"or"standard".REASONING_EFFORTto"low","medium", or"high".
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
MODEL_ID = (
"ikedachin/"
"llm-jp-4-8b-thinking-imabari-chikamiyama-v14"
)
# Inference settings
LANGUAGE = "imabari" # "imabari" or "standard"
REASONING_EFFORT = "medium" # "low", "medium", "high"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
dtype=(
torch.bfloat16
if torch.cuda.is_available()
else torch.float32
),
device_map="auto",
)
model.eval()
# Select channels
if LANGUAGE == "imabari":
analysis_channel = "analysis_imabari"
final_channel = "final_imabari"
elif LANGUAGE == "standard":
analysis_channel = "analysis"
final_channel = "final"
else:
raise ValueError("Invalid LANGUAGE")
valid_channels = [
analysis_channel,
final_channel,
"commentary",
]
# User message
messages = [
{
"role": "user",
"content": "今治市について教えてください。",
}
]
# Apply the custom chat template
prompt = tokenizer.apply_chat_template(
messages,
valid_channels=valid_channels,
reasoning_effort=REASONING_EFFORT,
add_generation_prompt=True,
tokenize=False,
)
# Explicitly specify the initial reasoning channel
prompt += f"<|channel|>{analysis_channel}<|message|>"
inputs = tokenizer(
prompt,
return_tensors="pt",
add_special_tokens=False,
).to(model.device)
# Generate response
with torch.inference_mode():
outputs = model.generate(
**inputs,
max_new_tokens=2048,
do_sample=False,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
generated = outputs[0][
inputs["input_ids"].shape[-1]:
]
print(
tokenizer.decode(
generated,
skip_special_tokens=False,
)
)
Notes:
- The model's custom chat template automatically creates the system message.
reasoning_effortandvalid_channelsare passed as template arguments, not as fields inside the user message.- The assistant prefix specifies the initial reasoning channel but does not guarantee the subsequent final response channel.
- For multi-turn conversations, explicitly specify the
channelfield in previous assistant messages when preserving language-specific channels. - Use the tokenizer distributed with this model.
3. Training
Chikamiyama v14 was trained using Full-Parameter Supervised Fine-Tuning, without LoRA or PEFT.
An assistant-only loss masking strategy was used. System and user tokens remain available as context, while the training loss targets assistant-generated reasoning, final responses, and assistant-side structural tokens.
| Parameter | Value |
|---|---|
| Base Model | llm-jp/llm-jp-4-8b-thinking |
| Training Method | Full Fine-Tuning (SFT) |
| Precision | BF16 |
| Learning Rate | 5e-5 |
| Epochs | 1 |
| Maximum Training Sequence Length | 8192 |
| Batch Size / GPU | 1 |
| Gradient Accumulation | 16 |
| Optimizer | AdamW |
| LR Scheduler | Cosine |
| Warmup | 5% of optimizer steps |
| Gradient Checkpointing | Enabled |
| Seed | 42 |
Training Datasets
| Dataset | Description |
|---|---|
| Imabari Wiki QA v4 | General QA in Imabari dialect |
| Standard Japanese Wiki QA v4 | General QA in standard Japanese |
| Imabari Wiki QA v5 Difficult | Difficult reasoning in Imabari dialect |
| Standard Japanese Wiki QA v5 Difficult | Difficult reasoning in standard Japanese |
| AnswerCarefully | Japanese safety instruction data |
The AnswerCarefully configurations v3.0, borderline-v1.0, v2.2, v2.0, and v1.0 were used.
4. Limitations
- Repetitive generation (Doom Loop): Previous models in this development series exhibited repetitive outputs, particularly with
mediumandhighreasoning effort. The frequency of this behavior in v14 has not yet been systematically evaluated. - Channel selection: The model may generate output in an unintended channel or mix Imabari dialect and standard Japanese.
- Reasoning effort: The specified level does not guarantee a particular output length or reasoning quality.
- Accuracy: Generated reasoning and final answers may contain errors.
5. License
This model was trained using sources with different licenses and terms of use.
| Source | License / Terms |
|---|---|
| LLM-jp-4-8B-thinking | Apache-2.0 |
| Imabari and standard Japanese QA datasets | CC BY-SA 4.0 |
| AnswerCarefully | AnswerCarefully Dataset Terms of Use |
AnswerCarefully has specific usage restrictions, including restrictions on purposes unrelated to improving LLM safety and redistribution of the original dataset.
The licenses of the training data are not asserted to automatically apply to the trained model weights; however, in consideration of the licenses of the data used, we release this model under CC BY-SA 4.0.
日本語説明
1. モデル概要
Chikamiyama(近見山)v14 は、LLM-jp-4-8B-thinking をFull Fine-Tuningした日本語推論モデルです。
主な特徴は、今治弁・標準語に対応した4種類のChannelと、Low / Medium / Highの3段階のReasoning Effortです。
モデル名は愛媛県今治市の近見山(ちかみやま)に由来します。試行錯誤を重ね、初めて学習に成功したモデルです。
2. Channel
独自のChat Templateにより、以下の4つのChannelを使用できます。
| Channel | 用途 | 言語 |
|---|---|---|
analysis_imabari | 思考・推論 | 今治弁 |
final_imabari | 最終回答 | 今治弁 |
analysis | 思考・推論 | 標準語 |
final | 最終回答 | 標準語 |
tokenizer.apply_chat_template() の valid_channels 引数に、使用可能なChannelを指定します。
今治弁の場合
valid_channels = [
"analysis_imabari",
"final_imabari",
"commentary",
]
標準語の場合
valid_channels = [
"analysis",
"final",
"commentary",
]
valid_channels は、利用可能なChannelをSystemメッセージで通知する仕組みです。
生成するChannelを厳密に制限するものではありません。
生成開始時のChannelは、AssistantプレフィックスにChannelを明示することで指定できます。
3. Reasoning Effort
推論量を3段階で指定できます。
| 設定 | 値 | 意図する推論量 |
|---|---|---|
| Low | low | 短い推論 |
| Medium | medium | 標準的な推論 |
| High | high | 詳細な推論 |
tokenizer.apply_chat_template() の reasoning_effort 引数に指定します。
reasoning_effort="high"
省略時は medium が使用されます。
Chat Templateは、この値を Reasoning: high などのSystemメッセージに変換します。
ただし、実際の推論長や推論精度が設定どおりになることを保証するものではありません。
4. 推論方法
推論コードは、上記の 「2. Inference」 を参照してください。
以下の2つのパラメータを変更することで、言語と推論量を切り替えられます。
LANGUAGE = "imabari" # "imabari" or "standard"
REASONING_EFFORT = "medium" # "low", "medium", "high"
messagesについて
本モデルのChat Templateでは、通常のUserメッセージは次の形式で渡します。
messages = [
{
"role": "user",
"content": "今治市について教えてください。",
}
]
reasoning_effort と valid_channels は、messages 内ではなく apply_chat_template() の引数として渡します。
学習時のAssistantメッセージでは、以下の独自フィールドを使用します。
| フィールド | 内容 |
|---|---|
role | assistant |
thinking | 思考・推論内容 |
thinking_channel | 思考Channel |
content | 最終回答 |
channel | 最終回答Channel |
例えば、今治弁での学習データは次の形式です。
messages = [
{
"role": "user",
"content": "今治市について教えてください。",
},
{
"role": "assistant",
"thinking_channel": "analysis_imabari",
"thinking": "ここに今治弁の思考内容を記述します。",
"channel": "final_imabari",
"content": "ここに今治弁の最終回答を記述します。",
},
]
Chat Templateは、Assistantの思考文と最終回答を、それぞれ独立したChannelとして展開します。
なお、通常の複数ターン推論では、過去のAssistantメッセージの思考文は省略されます。会話履歴で言語別のChannelを維持したい場合は、過去のAssistantメッセージにも channel を明示してください。
5. 学習データ
以下の5種類のデータセットを使用しています。
AnswerCarefullyは v3.0、borderline-v1.0、v2.2、v2.0、v1.0 を使用しています。
imabari_、std_のデータセットはimabarizeで作成しました
QAデータセットは既存のtrain/validation分割を使用し、AnswerCarefullyでは各構成のdevを学習用、testを検証用に使用しています。
6. 学習設定
LoRAを使用せず、すべてのモデルパラメータを更新するFull Fine-Tuningを実施しています。
また、Assistantの推論・回答・生成側構造トークンのみを損失計算対象とする Assistant-Only Loss を採用しています。
SystemやUserの入力側トークンは文脈として保持し、教師ラベルを -100 にマスクしています。
| 項目 | 設定 |
|---|---|
| Base Model | llm-jp/llm-jp-4-8b-thinking |
| Training | Full Fine-Tuning (SFT) |
| Precision | BF16 |
| Learning Rate | 5e-5 |
| Epochs | 1 |
| Max Training Sequence Length | 8192 |
| Batch Size / GPU | 1 |
| Gradient Accumulation | 16 |
| Optimizer | AdamW |
| Scheduler | Cosine |
| Warmup | 総更新ステップの5% |
| Gradient Checkpointing | 有効 |
| Packing | 無効 |
| Seed | 42 |
7. 注意事項
- Doom Loop: 従来モデルでは、特に
medium/highにおいて、同じ文字列の繰り返しや終了トークンの未生成が発生しています。v14での発生頻度は未評価です。 - Channel: 今治弁と標準語の完全な分離は保証されません。
- Reasoning Effort: 推論量や推論品質の厳密な制御を保証するものではありません。
- 推論精度: 生成される思考過程・回答に誤りが含まれる可能性があります。
8. ライセンス
本モデルの学習元には、それぞれ異なるライセンス・利用規約が適用されます。
| 対象 | ライセンス・利用規約 |
|---|---|
| LLM-jp-4-8B-thinking | Apache-2.0 |
| 今治弁・標準語QAデータセット | CC BY-SA 4.0 |
| AnswerCarefully | AnswerCarefully Dataset Terms of Use |
AnswerCarefullyには、LLMの安全性向上を目的とした利用への制限など、独自の条件があります。また、元データセットの再配布は禁止されています。
本モデルの利用・再配布に際しては、それぞれの利用条件を確認してください。
学習データのライセンスが学習済みモデルの重みに自動的に適用されると断定するものではありませんが、使用したデータのライセンスを鑑み、cc-by-sa-4.0で公開します。
Model: ikedachin/llm-jp-4-8b-thinking-imabari-chikamiyama-v14
Base Model: llm-jp/llm-jp-4-8b-thinking
Author: ikedachin