Instructions to use elith/FinGuard-Input-310M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use elith/FinGuard-Input-310M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="elith/FinGuard-Input-310M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("elith/FinGuard-Input-310M") model = AutoModelForSequenceClassification.from_pretrained("elith/FinGuard-Input-310M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download README.md from elith/FinGuard-Input-310M: direct link, hf CLI and curl.
- Browser
- Download file 6.24 kB
-
https://huggingface.co/elith/FinGuard-Input-310M/resolve/main/README.md
- Command line
-
hf download hf://elith/FinGuard-Input-310M/README.md
-
curl -L -o README.md https://huggingface.co/elith/FinGuard-Input-310M/resolve/main/README.md
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が開発しました。
使い方
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)
モデル詳細
モデル詳細
- 開発者: 株式会社Elith
- 研究開発費: 株式会社Elith、NEDO、経済産業省
- モデルタイプ: ModernBERT
- 対応言語: 日本語
- ライセンス: MIT
- ファインチューン元: sbintuitions/modernbert-ja-310m
使用について
想定の用途
- 金融ドメインの対話システムに対する入力保護
想定外の用途
- 対話システムへの攻撃方法の特定
バイアス、リスク、限界
- 日本の金融ドメイン知識に基づいて作られており、他国の知識がない
- 一般的なガードレールの知識はない
- 想定外の用途による悪用
- 日本語以外の言語による判別
学習詳細
学習データ
- 合成して作られたデータ、8万件
- Apache-2.0やMITライセンスのモデルにより合成して作り、人手でアノテーションした1万件
- セキュリティ用Gemma4など
- Apache-2.0やMITライセンスのモデルにより合成して作り、合成でアノテーションした5万件
- セキュリティ用GLM-5.3 Flashなど
- 合成して作られたペルソナを元に合成して作成した2万件
- Apache-2.0やMITライセンスのモデルにより合成して作り、人手でアノテーションした1万件
学習の方法
学習時のハイパーパラメータ
- 3 epoch
- lr 2e-5
- batch 128
- max_len 512
- seed 42
テストデータと評価指標
テストデータ
作成中のデータセット、FinGuard-Bench (仮) で測定しました。 FinGuard-Bench (仮) は、3000件からなる金融ドメイン有害性判定用データセットです。 データセットは難易度で分けられており、Easy:Normal:Hard=1000:1000:1000の構成になっています。 難易度は、GLM-5.3 FlashとFew-shot Learningで判定しています。 また、カテゴリによっても分けられており、金融PII検出、金融コンプライアンス違反検出などがあります。
評価指標
今回、シンプルにするために入力の有害性F1だけを考えます。
評価結果
FinGuard-Bench (仮) における本モデルのF1は90.8%です。一方で、金融ドメインに対応していないモデルであるQwen/Qwen3Guard-Gen-8Bは47.6% (Controversialを含めると78.6%) でした。 このため、GPUを必要とするQwen3Guard-Gen-8BよりもCPUで動く本モデルは金融ドメインにおいては優れていると考えられます。
環境負荷
- ハードウェアタイプ: 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
- 営業チームに届きます