大規模言語モデル(LLM)は、テキストの生成に極めて長けています。私たちはこれらを使って質問に答えたり、コードを書いたり、問題について推論したりと、実に多くのことを行っています。しかし、すべての問題においてテキスト生成が必要なわけではありません。
カスタマーサポートシステムが以下のメッセージを受け取ったと想像してみてください。
「サブスクリプションの料金が二重に請求されました。今日中に返金してほしいです。」
システムは、どのチームがこのリクエストを処理すべきか、緊急度はどの程度か、そして顧客が返金を求めているかどうかを判断する必要があります。
この場合、LLM にこれらの回答を含む JSON オブジェクトを返させることができます。
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つずつ生成させて回答を作らせるのではなく、アプリケーション側がすでに理解している回答に対して確率を割り当てるよう求めるのです。
[
](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/de