コンテンツにスキップ
メインサイト ニュース コンソール

Hugging Face における意思決定モデル

· Hugging Face 翻訳済
教程模型卡

大規模言語モデル(LLM)は、テキストの生成に極めて長けています。私たちはこれらを使って質問に答えたり、コードを書いたり、問題について推論したりと、実に多くのことを行っています。しかし、すべての問題においてテキスト生成が必要なわけではありません。

カスタマーサポートシステムが以下のメッセージを受け取ったと想像してみてください。

「サブスクリプションの料金が二重に請求されました。今日中に返金してほしいです。」

システムは、どのチームがこのリクエストを処理すべきか、緊急度はどの程度か、そして顧客が返金を求めているかどうかを判断する必要があります。

この場合、LLM にこれらの回答を含む JSON オブジェクトを返させることができます。

Terminal window
llama cli -hf ggml-org/gemma-4-e4b-it-GGUF:Q4_0
> We have the following customer support ticket, "I was charged twice for my subscription. I need a refund today.", which team should handle the request, how urgent it is, and whether the customer is requesting a refund. Give the answers in JSON.
[Start thinking]
...
[end thinking]
```json
{
"team_to_handle": "Billing",
"urgency": "High",
"request_refund": true
}

しかし、もしモデルが_テキストを一切生成することなく_、利用可能な選択肢を直接評価し、それらの確率分布を返すことができるとしたらどうでしょうか?

from transformers import pipeline
decide = pipeline("decision", model="autotrust/GEV-26B-Decide")
decision = decide(
{
"state": "I was charged twice for my order and want a refund.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments and refunds",
"technical": "Bugs and technical issues",
"sales": "Pricing and subscriptions"
}
},
}
}
)
# {
# 'department': {
# 'type': 'choice',
# 'choice': 'billing',
# 'confidence': 0.9974000453948975,
# 'probabilities': {
# 'billing': 0.9982666969299316,
# 'technical': 0.0010246571619063616,
# 'sales': 0.0007087149424478412
# }
# }
# }

これこそが、**意思決定モデル(decision models)**の根底にある中核的なアイデアです。

意思決定モデルとは?

意思決定モデルは、いくつかの入力コンテキスト(状態:state)を受け取り、事前定義された回答候補のセット(プリミティブ:primitives)と照らし合わせて質問を評価し、確率を伴う構造化された意思決定を返します。モデルにトークンを1つずつ生成させて回答を作らせるのではなく、アプリケーション側がすでに理解している回答に対して確率を割り当てるよう求めるのです。

[Image 12: 意思決定モデルの状態とプリミティブ](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/de

#教程#模型卡#4Allapi.com

4All API チームによる投稿

原文リンク:https://huggingface.co/blog/decision

主流 AI モデル API をお探しですか?4All API は OpenAI / Anthropic / Google Gemini / Qwen / DeepSeek など数十種類のモデルを単一の API キーで呼び出せます。公式準拠の価格、エンタープライズ品質の通信路、5 分で接続完了。

4All API コンソールに登録 →