評価とモデレーションを設定¶
プレミアム機能
評価およびモデレーションガードレールはプレミアム機能です。 この機能を有効にする方法については、DataRobotの担当者または管理者にお問い合わせください。
機能フラグ:モデレーションのガードレールを有効にする(プレミアム)、モデルレジストリでグローバルモデルを有効にする(プレミアム)、予測応答で追加のカスタムモデル出力を有効にする
評価とモデレーションのガードレールは、組織がプロンプトインジェクションや、悪意のある、有害な、または不適切なプロンプトや回答をブロックするのに役立ちます。 また、ハルシネーションや信頼性の低い回答を防ぎ、より一般的には、モデルをトピックに沿った状態に保つこともできます。 さらに、これらのガードレールは、個人を特定できる情報(PII)の共有を防ぐことができます。 多くの評価およびモデレーションガードレールは、デプロイされたテキスト生成モデル(LLM)をデプロイされたガードモデルに接続します。 これらのガードモデルはLLMのプロンプトと回答について予測し、これらの予測と統計を中心的なLLMデプロイに報告します。
評価とモデレーションのガードレールを使用するには、まず、LLMのプロンプトや回答について予測するガードモデルを作成してデプロイします。たとえば、ガードモデルは、プロンプトインジェクションや有害な回答を識別することができます。 次に、ターゲットタイプがテキスト生成またはエージェントのワークフローであるカスタムモデルを作成する場合、評価とモデレーションのガードレールを1つ以上定義します。
重要な前提条件
LLMに評価とモデレーションのガードレールを設定する前に、ガードモデルをデプロイし、LLMのデプロイを設定する際には、以下のガイドラインに従ってください。
- カスタムガードモデルを使用している場合、デプロイする前に、
moderations.input_column_nameとmoderations.output_column_nameを登録モデルバージョンのタグ型キー値{ target=blank }として定義します。 _これらのキー値を設定しない場合、ガードモデルのユーザーは、入力列名と出力列名を手動で入力する必要があります。 - 評価とモデレーションを設定する前に、中心的なLLMの監視に使用するグローバルまたはカスタムガードモデルをデプロイします。
- デプロイされたガードモデルとは異なる予測環境に、中心的なLLMをデプロイします。
- デプロイされたLLMを介して予測を開始する前に、関連付けID{ target=blank }を設定して予測ストレージを有効にします。 _関連付けIDを設定せず、LLMの予測とともに関連付けIDを指定した場合、モデレーションの指標は カスタム指標タブでは計算されません。
- 関連付けIDを定義後、関連付けIDの自動生成を有効にして、これらの指標がカスタム指標タブに表示されるようにできます。 この設定は、デプロイ 中やデプロイ 後に有効化できます。
- If you plan to use any of the NeMo Evaluator metrics (Agent Goal Accuracy, Context Relevance, Faithfulness (NeMo Evaluator), LLM Judge, Response Groundedness, Response Relevancy, Topic Adherence), create a NeMo evaluator workload and workload deployment via the Workload API first. The Workload API has no UI; you must use the API to create the workload and then create the workload deployment. Each of these metrics requires a NeMo evaluator deployment.
予測方法に関する注意事項
チャット生成Q&Aアプリケーションの外部で予測を行う場合、評価とモデレーションは、 リアルタイム予測とのみ互換性があり、 バッチ予測とは互換性がありません。 また、ボルトオンのガバナンスAPIを使ってストリーミングレスポンスをリクエストする場合、評価とモデレーションはストリーミングの効果を無効にします。 ガードレールは、LLMの完全なレスポンスのみを評価するため、レスポンステキストを1つのチャンクで返します。
評価とモデレーションのガードレールを選択する¶
ターゲットタイプがテキスト生成またはエージェントのワークフローであるカスタムモデルを作成する場合、評価とモデレーションのガードレールを1つ以上定義します。
評価およびモデレーションガードレールを選択および設定するには:
-
ワークショップにおいて、ターゲットタイプがテキスト生成またはエージェントのワークフローのカスタムモデルのアセンブルタブを開き、モデルを構築します。構築方法は、DataRobot以外で作成したカスタムモデルから手動で行うか、ユースケースのLLMプレイグラウンドで構築されたモデルから自動で行うかのいずれかです。
モデレーションを使ってテキスト生成モデルを構築する場合、必要なランタイムパラメーター(資格情報など)の設定やリソース設定(パブリックネットワークへのアクセスなど)を必ず行います。 最後に、基本環境をモデレーション対応の環境(たとえば[GenAI] Python 3.12 with Moderations)に設定します。
リソース設定
DataRobotでは、より多くのメモリーおよびCPUリソースを備えた、より大きなリソースバンドルを使用してLLMカスタムモデルを作成することをお勧めします。
-
カスタムモデルに必要な設定を行ったら、評価とモデレーションセクションに移動し、 設定をクリックします。
-
On the Configure evaluation and moderation panel, in the Configuration summary, access the following settings:
設定 説明 Show workflow Review how evaluations are executed in DataRobot. すべての評価とそれぞれのモデレーションは並行して実行されます。 Moderation settings Set the following: - Set moderation timeout: Configure the maximum wait time (in seconds) for moderations before the system automatically times out.
- Timeout action: Define what happens if the moderation system times out: Score prompt / response or Block prompt / response.
NeMo evaluator settings Set the NeMo evaluator deployment used by the NeMo Evaluator metrics. The dropdown shows "No options available" until you have created a NeMo evaluator workload and workload deployment via the Workload API. You must complete that step before you can configure the NeMo Evaluator metrics. -
In the Configure evaluation and moderation panel, click one of the following metric cards to configure the required properties. The panel has two sections: All Metrics and NeMo metrics. From the Configuration summary sidebar you can open Show workflow, Moderation settings, or NeMo evaluator settings to configure the evaluator deployment used by all NeMo evaluator metrics.
評価指標 要件 説明 Content Safety A deployed NIM model llama-3.1-nemoguard-8b-content-safety imported from NVIDIA GPU Cloud (NGC) Catalog. プロンプトと回答を安全または安全でないものとして分類し、検出された安全でないカテゴリーのリストを返します。 コスト LLMコスト設定 提供されたトークンあたりの入力コストと、トークンあたりの出力コストを使用して、LLM回答の生成コストを計算します。 コストの計算には、引用コストも含まれます。 詳細については、コスト指標の設定を参照してください。 カスタムデプロイ カスタムデプロイ 任意のデプロイを使用して、LLM(サポートされているターゲットタイプ:連続値、二値分類、多クラス、テキスト生成)の評価とモデレーションを行います。 感情分類器 感情分類器のデプロイ プロンプトまたはレスポンステキストを感情別に分類します。 忠実度 LLM, vector database LLMの回答がソースと一致するかどうかを測定して、考えられるハルシネーションを識別します。 ジェイルブレイク A deployed NIM model nemoguard-jailbreak-detect imported from NVIDIA GPU Cloud (NGC) Catalog. NemoGuard JailbreakDetectを使ってジェイルブレイクの試みを分類します。 PII検出 PresidioのPII検出 Microsoft Presidioライブラリを使用して、テキスト内の個人識別情報 (PII) を検出します。 プロンプトインジェクション プロンプトインジェクション分類器 モデルの出力変更を意図した入力操作(システムプロンプトの上書きや変更など)を検出します。 プロンプトトークン N/A Track the number of tokens associated with the input to the LLM and/or retrieved text from the vector database. 回答トークン N/A Track the number of tokens associated with the output from the LLM and/or retrieved text from the vector database. ROUGE-1 ベクターデータベース LLMブループリントから生成された回答とベクターデータベースから取得されたドキュメントの間で類似度を計算します。 毒性 毒性分類器 コンテンツの有害性を分類してモデレーション技術を適用し、有害なコンテンツの拡散を防ぎます。 エージェントのワークフロー指標 Agent Goal Accuracy LLM Evaluate agentic workflow performance in achieving specified objectives in scenarios without a known benchmark. (This agentic workflow metric is distinct from the NeMo Evaluator metric of the same name under NeMo metrics.) Task Adherence LLM Measure whether the agentic workflow response is relevant, complete, and aligned with user expectations. Guideline Adherence LLM, guideline setting Evaluate how well the response follows the defined guideline using a judge LLM. Returns true when the guideline is followed, false otherwise. You must supply the guideline and select an LLM (from the gateway or a deployment) when configuring. 評価指標デプロイのグローバルモデル
The deployments required for PII detection, prompt injection detection, emotion classification, and toxicity classification are available as global models in Registry
多クラスカスタムデプロイの指標の制限値
多クラスカスタムデプロイの指標には、以下の制限があります。
-
モデレーション基準の一致リストで定義できるクラスは最大で
10個までです。 -
ガードモデルで使用できるクラス名は最大で
100個までです。
The NeMo Evaluator metrics (Agent Goal Accuracy, Context Relevance, Faithfulness, LLM Judge, Response Groundedness, Response Relevancy, Topic Adherence) require a NeMo evaluator workload deployment, set in NeMo evaluator settings in the Configuration summary sidebar. Create the workload and workload deployment via the Workload API before you can select it; the Select a workload deployment dropdown shows "No options available" until a deployment exists. Each of these metrics also uses an LLM judge (DataRobot deployment or LLM gateway). Response Relevancy additionally requires an embedding deployment. Topic Adherence and LLM Judge have additional configuration. Stay on topic for inputs and Stay on topic for output do not use the NeMo evaluator deployment. They use a NIM deployment of the
llama-3.1-nemoguard-8b-topic-controlmodel (like Content safety and Jailbreak use NIM models). Configure them with LLM type NIM, select the topic-control NIM deployment, and optionally edit the NeMo guardrails configuration files.Evaluator metric 要件 説明 Agent Goal Accuracy Evaluator deployment, LLM Evaluate how well the agent fulfills the user's query. This is distinct from the Agent Goal Accuracy metric under All metrics (agentic workflow). Context Relevance Evaluator deployment, LLM Measure how relevant the provided context is to the response. 忠実度 Evaluator deployment, LLM Evaluate whether the response stays faithful to the provided context using the NeMo Evaluator. This is distinct from the non-NeMo Faithfulness metric listed under All metrics. LLM Judge Evaluator deployment, LLM Use a judge LLM to evaluate a user defined metric. Response Groundedness Evaluator deployment, LLM Evaluate whether the response is grounded in the provided context. Response Relevancy Evaluator deployment, LLM, Embedding deployment Measure how relevant the response is to the user's query. Topic Adherence Evaluator deployment, LLM, Metric mode, Reference topics Assess whether the response adheres to the expected topics. Topic control metrics 入力のトピックを維持 NIM deployment of llama-3.1-nemoguard-8b-topic-control, NVIDIA NeMo guardrails configuration NVIDIA NeMo Guardrailsを使用してトピックの境界を設定することで、プロンプトがトピックに関連し、禁止用語を使用しないようにします。 出力のトピックを維持 NIM deployment of llama-3.1-nemoguard-8b-topic-control, NVIDIA NeMo guardrails configuration NVIDIA NeMo Guardrailsを使用してトピックの境界を設定することで、回答がトピックに関連し、禁止用語を使用しないようにします。 To set the NeMo evaluator deployment used by the NeMo Evaluator metrics, open NeMo evaluator settings from the Configuration summary sidebar. The evaluator deployment will be applied to all NeMo Evaluator metrics. From the Select a workload deployment dropdown list, choose the workload deployment for the NeMo evaluator.
NeMo evaluator settings panel
The dropdown shows "No options available" until you have created a NeMo evaluator workload and workload deployment via the Workload API. You must complete that step before you can configure the NeMo Evaluator metrics.
-
-
上記で選択した指標に応じて、次のフィールドを設定します。
フィールド 説明 全般的な設定 名前 評価指標の複数のインスタンスを追加する場合は、一意の名前を入力します。 適用先 評価指標に応じて、プロンプトと回答のどちらか、または両方を選択します。 プロンプトを選択すると、指標の計算に使用されるのは、最後のLLMプロンプトではなく、ユーザープロンプトであることに注意してください。 This field is only configurable for metrics that apply to both the prompt and the response. カスタムデプロイ、PII検出、プロンプトインジェクション、感情分類器、毒性設定 デプロイ名 ガードモデルによって計算された評価指標の場合、カスタムモデルデプロイを選択します。 カスタムデプロイの設定 入力列名 この名前は、カスタムモデルの作成者によって定義されます。 For global models created by DataRobot, the default input column name is text. If the guard model for the custom deployment has the moderations.input_column_name key value defined, this field is populated automatically. 出力列名 この名前はカスタムモデル作成者によって定義され、モデルのターゲット列を参照する必要があります。 The target name is listed on the deployment's Overview tab (and often has _PREDICTION appended to it). カスタムデプロイからCSVデータをエクスポートして表示することで、列名を確認できます。 If the guard model for the custom deployment has the moderations.output_column_name key value defined, this field is populated automatically. Guideline Adherence setting ガイドライン The rule or criteria the agent's response should follow. The selected LLM acts as a judge to evaluate whether the response adheres to this guideline and returns true (guideline followed) or false (guideline not followed). You must supply the guideline and select an LLM (from the gateway or a deployment) when configuring this metric. Faithfulness, Task Adherence, and Guideline Adherence settings LLM Select an LLM to evaluate the selected metric. 忠実度の場合、LLMを選択すると、DataRobotが提供する資格情報ではなく、ユーザー自身が指定した資格情報を使用するオプションがあります。 NeMo Evaluator metric settings Select LLM as a judge Select an LLM to evaluate the selected metric. Evaluator deployment For the NeMo Evaluator metrics only: set in the NeMo evaluator settings sidebar panel (Select a workload deployment). The NeMo evaluator workload deployment is shared by those metrics. Create the workload and workload deployment via the Workload API before configuring; see the prerequisites above. Topic control settings LLMタイプ Azure OpenAI、OpenAI、またはNIMを選択します。 LLMのタイプがAzure OpenAIの場合、OpenAI APIのデプロイを追加で入力します。NIMの場合は、NIMのデプロイを入力します。 LLM Gatewayを使用する場合、デフォルトでは、DataRobotが提供する資格情報が指定されます。 LLMのタイプがAzure OpenAIまたはOpenAIの場合、資格情報を変更をクリックして、自身の認証情報を入力します。 ファイル トピックの維持の評価については、ファイルの横にあるをクリックして、NeMoガードレール設定ファイルを変更します。 In particular, update prompts.yml with allowed and blocked topics and blocked_terms.txt with the blocked terms, providing rules for NeMo guardrails to enforce. The blocked_terms.txt file is shared between the input and output topic control metrics; therefore, modifying blocked_terms.txt in the input metric modifies it for the output metric and vice versa. Only two topic control metrics can exist in a custom model, one for input and one for output. モデレーション設定 モデレーションの設定と適用 Enable this setting to expand the Moderation section and define the criteria that determine when moderation logic is applied. -
モデレーションセクションで、モデレーションの設定と適用を有効にして、評価指標ごとに以下を設定します。
設定 説明 モデレーションの基準 該当する場合、モデレーションロジックをトリガーするために評価されるしきい値を設定します。 For numeric metrics (int or float), you can use less than, greater than, or equals to with a value of your choice. For binary metrics (for example, Agent Goal Accuracy), use equals to 0 or 1. For the Emotions Classifier, select Matches or Does not match and define a list of classes (emotions) to trigger moderation logic. モデレーション方法 レポート、レポートとブロック、または置換(該当する場合)を選択します。 モデレーションのメッセージ レポートとブロックを選択すると、オプションでデフォルトのメッセージを変更できます。 -
必須フィールドを設定した後、追加をクリックして評価を保存し、評価選択ページに戻ります。 次に、別の指標を選択して設定するか、設定を保存をクリックします。
選択したガードレールは、アセンブルタブの評価とモデレーションセクションに表示されます。
テキスト生成カスタムモデルにガードレールを追加した後、モデルを テスト、 登録、および デプロイして本番環境で予測を作成できます。 予測を作成した後、 カスタム指標 タブで評価指標を表示し、 データ探索タブでプロンプト、回答、およびフィードバック(設定されている場合)を表示できます。
「トレース」タブ
LLMデプロイにモデレーションを追加すると、データ探索 > トレースタブでカスタム指標データを行ごとに表示することはできません。
資格情報を変更¶
DataRobotは、LLM Gatewayを使用して、利用可能なLLMの資格情報を提供します。 With certain metrics and LLMs or LLM types, you can instead use your own credentials for authentication. 続行する前に、資格情報管理ページでユーザー指定の資格情報を定義します。
Topic control metrics¶
入力のトピックを維持または出力のトピックを維持の資格情報を変更するには、LLMタイプを選択し、資格情報を変更をクリックします。
DataRobotが提供する資格情報に戻すには、資格情報を元に戻すをクリックします。
忠実度の指標¶
忠実度の資格情報を変更するには、LLMを選択し、資格情報を変更をクリックします。
必須フィールドは、次の表のとおりです。
| プロバイダー | フィールド |
|---|---|
| Amazon |
|
| Azure OpenAI |
|
|
|
| OpenAI |
|
DataRobotが提供する資格情報に戻すには、資格情報を元に戻すをクリックします。
Considerations for NeMo Evaluator metrics¶
When using NeMo Evaluator metrics, consider the following:
- LLM judge output: The NeMo evaluator expects the LLM judge to return data in the correct JSON schema. Some models (for example, certain Llama versions) may return Python code or other formats instead, which can cause the evaluator to fail. Choose an LLM judge that reliably returns the expected format; newer models are often better at following JSON output instructions.
- Rate and token limits: Be aware of rate limits and token limits when using NeMo Evaluator guards; hitting these limits can cause evaluation failures.
You can use the Activity log > Moderation tab and evaluator logs to debug why a request was blocked or why a guard failed.
評価指標デプロイのグローバルモデル¶
PII検出、プロンプトインジェクション検出、感情分類、毒性分類に必要なデプロイは、レジストリのグローバルモデルとして使用できます。 次のグローバルモデルを使用できます。
| モデル | タイプ | ターゲット | 説明 |
|---|---|---|---|
| プロンプトインジェクション分類器 | 二値 | テキストをプロンプトインジェクションまたは正当なものとして分類します。 このガードモデルには、分類するテキストを含むtextという名前の列が1つ必要です。 詳しくは、 deberta-v3-base-injectionモデルの詳細を参照してください。 |
|
| 毒性分類器 | 二値 | テキストを有毒か無毒に分類します。 このガードモデルには、分類するテキストを含むtextという名前の列が1つ必要です。 詳しくは、 toxic-comment-modelの詳細を参照してください。 |
|
| センチメント分類器 | 二値 | テキストのセンチメントを肯定的か否定的に分類します。 このモデルには、分類するテキストを含むtextという名前の列が1つ必要です。 詳しくは、 distilbert-base-uncased-finetuned-sst-2-englishモデルの詳細を参照してください。 |
|
| 感情分類器 | 多クラス | テキストを感情で分類します。 これは多ラベルモデルです。つまり、複数の感情をテキストに適用できます。 このモデルには、分類するテキストを含むtextという名前の列が1つ必要です。 詳しくは、 roberta-base-go_emotions-onnxモデルの詳細を参照してください。 |
|
| 拒否スコア | 連続値 | プロンプトがモデルに設定されている回答範囲を超えているために、LLMがクエリーへの回答を拒否したケースのリストと、入力を比較して、最大類似度スコアを出力します。 | |
| PresidioのPII検出 | 二値 | テキスト内の個人を特定できる情報(PII)を検出して置き換えます。 このガードモデルには、分類するテキストを含むtextという名前の列が1つ必要です。 必要に応じて、検出するPIIのタイプをコンマ区切りの文字列として列'entities'に指定できます。 この列が指定されていない場合は、サポートされているすべてのエンティティが検出されます。 エンティティのタイプは、PresidioがサポートするPIIエンティティのドキュメントに記載されています。 検出結果に加えて、モデルは anonymized_text列を返します。この列には、検出されたPIIがプレースホルダーに置き換えられた更新バージョンの入力が含まれています。 詳細については、Presidio: Data Protection and De-identification SDKのドキュメントを参照してください。 |
|
| ゼロショット分類器 | 二値 | ユーザー指定のラベルを持つテキストに対してゼロショット分類を実行します。 このモデルでは、textという名前の列に分類されたテキストが必要であり、labelsという名前の列にコンマ区切りの文字列としてクラスラベルが必要です。 すべての行に同じラベルセットが必要であるため、最初の行にあるラベルが使用されます。 詳しくは、 deberta-v3-large-zeroshot-v1モデルの詳細を参照してください。 |
|
| Pythonダミー二値分類 | 二値 | Positiveクラスでは、常に0.75となります。 詳しくは、 python3_dummy_binaryモデルの詳細を参照してください。 |
評価およびモデレーションガードレールの表示¶
ガードレールを含むテキスト生成モデルが登録およびデプロイされると、 登録済みモデルの概要タブと デプロイの概要タブで設定済みのガードレールを表示できます。
評価とモデレーションのログ
評価とモデレーションが設定されたデプロイ済みLLMのアクティビティログ > モデレーションタブで、デプロイの評価とモデレーションに関連するイベントの履歴を表示して、デプロイに設定された評価やモデレーションに関する問題を診断できます。














