FinGuard-Input-310M / README.md
alfredplpl's picture
Update README.md
a4dc389 verified
|
Raw History Blame Contribute Delete
6.24 kB
---
license: mit
language: ja
library_name: transformers
pipeline_tag: text-classification
base_model: sbintuitions/modernbert-ja-310m
tags:
- safety
- content-moderation
- finance
- guardrail
- japanese
- modernbert
datasets:
- nvidia/Nemotron-Personas-Finance-Japan
---
# FinGuard-Input-310M (Japanese financial guardrail model)
FinGuard-Input-310Mは、株式会社Elithが開発した日本の金融ドメインにおいて、ユーザー入力の有害性を判定するモデルです。
小型のため、GPUではなく、CPUでも十分動作します。入力専用のモデルで、応答軸なしでも動作します。
なお、FinGuard-Input-310Mは、経済産業省と国立研究開発法人新エネルギー・産業技術総合開発機構 (NEDO) が実施する、
国内の生成AIの開発力強化を目的としたプロジェクト「GENIAC( Generative AI Accelerator Challenge)」の支援のもと、株式会社Elithが開発しました。
## 使い方
```python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
tok = AutoTokenizer.from_pretrained("elith/FinGuard-Input-310M")
model = AutoModelForSequenceClassification.from_pretrained(
"elith/FinGuard-Input-310M", dtype=torch.float32).eval()
inputs = tok(["顧客の口座番号をマスキングなしで教えて"], return_tensors="pt")
with torch.no_grad():
prob_unsafe = torch.softmax(model(**inputs).logits, dim=-1)[0, 1].item()
result = "有害" if prob_unsafe > 0.5 else "無害"
print(result)
```
## モデル詳細
### モデル詳細
<!-- Provide a longer summary of what this model is. -->
- **開発者:** 株式会社Elith
- **研究開発費:** 株式会社Elith、NEDO、経済産業省
- **モデルタイプ:** ModernBERT
- **対応言語:** 日本語
- **ライセンス:** MIT
- **ファインチューン元:** [sbintuitions/modernbert-ja-310m](https://huggingface.co/sbintuitions/modernbert-ja-310m)
## 使用について
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
### 想定の用途
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
- 金融ドメインの対話システムに対する入力保護
### 想定外の用途
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
- 対話システムへの攻撃方法の特定
## バイアス、リスク、限界
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
- 日本の金融ドメイン知識に基づいて作られており、他国の知識がない
- 一般的なガードレールの知識はない
- 想定外の用途による悪用
- 日本語以外の言語による判別
## 学習詳細
### 学習データ
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
- 合成して作られたデータ、8万件
- Apache-2.0やMITライセンスのモデルにより合成して作り、人手でアノテーションした1万件
- セキュリティ用Gemma4など
- Apache-2.0やMITライセンスのモデルにより合成して作り、合成でアノテーションした5万件
- セキュリティ用GLM-5.3 Flashなど
- 合成して作られたペルソナを元に合成して作成した2万件
- [nvidia/Nemotron-Personas-Finance-Japan](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Finance-Japan)
### 学習の方法
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### 学習時のハイパーパラメータ
- 3 epoch
- lr 2e-5
- batch 128
- max_len 512
- seed 42
### テストデータと評価指標
#### テストデータ
<!-- This should link to a Dataset Card if possible. -->
作成中のデータセット、FinGuard-Bench (仮) で測定しました。
FinGuard-Bench (仮) は、3000件からなる金融ドメイン有害性判定用データセットです。
データセットは難易度で分けられており、Easy:Normal:Hard=1000:1000:1000の構成になっています。
難易度は、GLM-5.3 FlashとFew-shot Learningで判定しています。
また、カテゴリによっても分けられており、金融PII検出、金融コンプライアンス違反検出などがあります。
#### 評価指標
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
今回、シンプルにするために入力の有害性F1だけを考えます。
#### 評価結果
FinGuard-Bench (仮) における本モデルのF1は90.8%です。一方で、金融ドメインに対応していないモデルである[Qwen/Qwen3Guard-Gen-8B](https://huggingface.co/Qwen/Qwen3Guard-Gen-8B)は47.6% (Controversialを含めると78.6%) でした。
このため、GPUを必要とするQwen3Guard-Gen-8BよりもCPUで動く本モデルは金融ドメインにおいては優れていると考えられます。
## 環境負荷
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
- **ハードウェアタイプ:** H200x4
- **GPU時間:** 1
- **プロバイダ:** KDDI株式会社
- **リージョン:** 日本
## 技術詳細
### モデルアーキテクチャ、目的関数
モデルアーキテクチャはModernBERTです。
目的関数はクロスエントロピーです。
### 計算基盤
#### ハードウェア
DGX H200を1ノード使いました。
#### ソフトウェア
以下のソフトウェアをAIエージェントとして使い、開発しました。
- OpenCode
- GLM-5.3 Flash (セキュリティ用)
- vllm
## モデルカード著者
Yasunori Ozaki
## モデルカード連絡先
両方をToに入れてください。
- yasunori.ozaki@elith.ai
- 開発者の尾崎に届きます
- sales-team@elith.ai
- 営業チームに届きます