Files
ModelHub XC 32021563cb 初始化项目,由ModelHub XC社区提供模型
Model: AcroYAMALEX/acro-yamalex-llmjp-4-math-tir
Source: Original Platform
2026-04-22 03:28:12 +08:00

206 lines
6.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
language:
- ja
license: mit
library_name: transformers
tags:
- math
- tool-integrated-reasoning
- tir
- code-execution
- reasoning
- japanese
- sft
- llm-jp
base_model: llm-jp/llm-jp-4-8b-v4-8b-decay2m-ipt_v3.1-instruct4
pipeline_tag: text-generation
model-index:
- name: acro-yamalex-llmjp-4-math-tir
results:
- task:
type: text-generation
name: 日本語数学推論
dataset:
name: FT-LLM2026 開発用評価データセット
type: custom
metrics:
- type: accuracy
value: 0.880
name: 正解率(全体)
- type: accuracy
value: 1.000
name: 正解率中1
- type: accuracy
value: 1.000
name: 正解率中2
- type: accuracy
value: 0.938
name: 正解率中3
- type: accuracy
value: 0.867
name: 正解率数学I・A
- type: accuracy
value: 0.731
name: 正解率数学II・B
- type: accuracy
value: 0.800
name: 正解率数学III・C
---
# acro-yamalex-llmjp-4-math-tirモデル
日本語数学推論のためのTool-Integrated Reasoning (TIR) モデルです。
CoTモデルllm-jp-4-8bをCoTデータでSFTしたモデルをベースに、134,834件のTIRデータセットでさらにSFTを行った**最終モデル**です。
自然言語による推論とPythonコード実行を組み合わせて数学問題を解くことができます。
開発用評価データセット100問において**正解率88.0%**を達成しました。
本モデルは[FT-LLM2026コンペティション](https://llm-jp.github.io/tuning-competition/)における我々の提出モデルです。
## モデル概要
| 項目 | 値 |
|---|---|
| ベースモデル | [llm-jp-4-8b](https://huggingface.co/llm-jp/llm-jp-4-8b-v4-8b-decay2m-ipt_v3.1-instruct4) (80億パラメータ) |
| 学習手法 | 2段階SFTCoT SFT → TIR SFT/ フルパラメータ |
| 学習データ | CoTデータ306,366件→ TIRデータ134,834件 |
| フレームワーク | NeMo + Megatron-LM |
| 精度 | bf16-mixed |
## 学習パイプライン
[OpenMathReasoning](https://arxiv.org/abs/2504.16891)NVIDIAのAIMO-2優勝手法に倣い、2段階のSFTを実施しました。
```
llm-jp-4-8b (ベースモデル)
↓ CoT SFT306,366件
CoTモデル
↓ TIR SFT134,834件
TIRモデル本モデル
```
## 学習設定
| パラメータ | CoT SFT第1段階 | TIR SFT第2段階 |
|---|---|---|
| ベースモデル | llm-jp-4-8b | CoTモデル |
| 学習率 | 2e-5 | 2e-5 |
| エポック数 | 2 | 2 |
| バッチサイズ | 96 | 64 |
| 最大系列長 | 4,096 | 4,096 |
| オプティマイザ | AdamW (β₁=0.9, β₂=0.98) | AdamW (β₁=0.9, β₂=0.98) |
| 重み減衰 | 0.1 | 0.1 |
| ウォームアップ | 20 steps | 20 steps |
| スケジューラ | CosineAnnealing | CosineAnnealing |
| 精度 | bf16-mixed | bf16-mixed |
| PEFT | なし(フルパラメータ) | なし(フルパラメータ) |
## 評価結果
開発用評価データセット100問における正解率です。推論時には1問あたり15個の回答候補を生成し、多数決majority votingにより最終回答を決定しています。
| カテゴリ | 正解率 |
|---|---|
| 中1 | 1.000 |
| 中2 | 1.000 |
| 中3 | 0.938 |
| 数学I・A | 0.867 |
| 数学II・B | 0.731 |
| 数学III・C | 0.800 |
| **全体** | **0.880** |
### 推論設定
| パラメータ | 値 |
|---|---|
| サンプル数(多数決用) | 15 |
| 最大コード実行回数 | 5回 |
| 最大生成トークン数 | 4,096 |
## 使い方
### 基本的な使い方
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "AcroYAMALEX/acro-yamalex-llmjp-4-math-tir"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="bfloat16", device_map="auto")
prompt = """あなたは「自然言語の推論」と「Pythonコードの実行」を組み合わせて数学問題を解くアシスタントです。
### 指示:
1から100までの自然数の和を求めてください。
### 応答:
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### TIR推論パイプラインコード実行付き
本モデルの性能を最大限に引き出すには、生成されたPythonコードブロックを検出・実行し、結果をモデルにフィードバックするTIR推論パイプラインが必要です。
1. モデルが応答を生成(思考過程 + Pythonコード
2. `` ```python `` ブロックを検出し、サンドボックスで実行
3. 実行結果を `` ```output `` ブロックとしてモデルにフィードバック
4. 最終回答(`\boxed{}`形式が得られるまで繰り返し最大5回
5. 複数サンプル15個推奨を生成し、多数決で最終回答を決定
## 入出力フォーマット
### 入力
システムプロンプトでTIR推論の役割を指定し、ユーザーメッセージとして数学の問題を与えます。
### 出力
`<think>`タグで囲まれた思考過程、Pythonコードブロック、コード実行結果を含むマルチターン対話を生成し、最終的に`\boxed{}`形式で回答を出力します。
```
<think>
Python を使ってシミュレーションしよう。
</think>
```python
total = sum(range(1, 101))
print(total)
```
```output
5050
```
<think>
計算結果は5050です。
</think>
1から100までの自然数の和は:
$$\boxed{5050}$$
```
## 関連リソース
| リソース | リンク |
|---|---|
| CoTデータセット | [AcroYAMALEX/acro-yamalex-llmjp-4-math-cot](https://huggingface.co/datasets/AcroYAMALEX/acro-yamalex-llmjp-4-math-cot) |
| TIRデータセット | [AcroYAMALEX/acro-yamalex-llmjp-4-math-tir](https://huggingface.co/datasets/AcroYAMALEX/acro-yamalex-llmjp-4-math-tir) |
| CoTモデル中間モデル | [AcroYAMALEX/acro-yamalex-llmjp-4-math-cot](https://huggingface.co/AcroYAMALEX/acro-yamalex-llmjp-4-math-cot) |
| 論文 | NLP2026にて発表予定 |
## 参考文献
- Ivan Moshkov et al. "AIMO-2 Winning Solution: Building State-of-the-Art Mathematical Reasoning Models with OpenMathReasoning dataset." arXiv:2504.16891, 2025.
- Ting Zhang et al. "StackMathQA: A Curated Collection of 2 Million Mathematical Questions and Answers Sourced from Stack Exchange." 2024.
- Keiran Paster et al. "OpenWebMath: An Open Dataset of High-Quality Mathematical Web Text." arXiv:2310.06786, 2024.
- DeepSeek-AI. "DeepSeek-V3 Technical Report." arXiv:2412.19437, 2024.
## 著者
佐々木峻・山本大輝・樋口慎・吉岡駿(アクロクエストテクノロジー株式会社)
## ライセンス
MIT License