Skip to content

Commit

Permalink
Merge pull request #399 from MicrosoftDocs/main
Browse files Browse the repository at this point in the history
9/19/2024 PM Publish
  • Loading branch information
Taojunshen authored Sep 19, 2024
2 parents 655e817 + e9b49e3 commit daa818e
Show file tree
Hide file tree
Showing 80 changed files with 962 additions and 299 deletions.
86 changes: 86 additions & 0 deletions articles/ai-services/content-safety/how-to/improve-performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: "Mitigate false results in Azure AI Content Safety"
titleSuffix: Azure AI services
description: Learn techniques to improve the performance of Azure AI Content Safety models by handling false positives and false negatives.
#services: cognitive-services
author: PatrickFarley
manager: nitinme
ms.service: azure-ai-content-safety
ms.topic: how-to
ms.date: 09/18/2024
ms.author: pafarley
#customer intent: As a user, I want to improve the performance of Azure AI Content Safety so that I can ensure accurate content moderation.
---

# Mitigate false results in Azure AI Content Safety

This guide provides a step-by-step process for handling false positives and false negatives from Azure AI Content Safety models.

False positives are when the system incorrectly flags non-harmful content as harmful; false negatives are when harmful content is not flagged as harmful. Address these instances to ensure the integrity and reliability of your content moderation process, including responsible generative AI deployment.

## Prerequisites

* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
* Once you have your Azure subscription, <a href="https://aka.ms/acs-create" title="Create a Content Safety resource" target="_blank">create a Content Safety resource </a> in the Azure portal to get your key and endpoint. Enter a unique name for your resource, select your subscription, and select a resource group, supported region (see [Region availability](/azure/ai-services/content-safety/overview#region-availability)), and supported pricing tier. Then select **Create**.

## Review and verification

Conduct an initial assessment to confirm that the flagged content is really a false positive or false negative. This can involve:
- Checking the context of the flagged content.
- Comparing the flagged content against the content safety risk categories and severity definitions:
- If you're using content safety in Azure OpenAI, see the [Azure OpenAI content filtering doc](/azure/ai-services/openai/concepts/content-filter).
- If you're using the Azure AI Content Safety standalone API, see the [Harm categories doc](/azure/ai-services/content-safety/concepts/harm-categories?tabs=warning) or the [Prompt Shields doc](/azure/ai-services/content-safety/concepts/jailbreak-detection), depending on which API you're using.

## Customize your severity settings

If your assessment confirms that you found a false positive or false negative, you can try customizing your severity settings to mitigate the issue. The settings depend on which platform you're using.

#### [Content Safety standalone API](#tab/standalone-api)

If you're using the Azure AI Content Safety standalone API directly, try experimenting by setting the severity threshold at different levels for [harm categories](/azure/ai-services/content-safety/concepts/harm-categories?tabs=definitions) based on API output. Alternatively, if you prefer the no-code approach, you can try out those settings in [Content Safety Studio](https://contentsafety.cognitive.azure.com/) or Azure AI Studio’s [Content Safety page](https://ai.azure.com/explore/contentsafety). Instructions can be found [here](/azure/ai-studio/quickstarts/content-safety?tabs=moderate-text-content).

In addition to adjusting the severity levels for false negatives, you can also use blocklists. More information on using blocklists for text moderation can be found in [Use blocklists for text moderation](/azure/ai-services/content-safety/how-to/use-blocklist?tabs=windows%2Crest).


#### [Azure OpenAI](#tab/azure-openai-studio)

Read the [Configurability](/en-us/azure/ai-services/openai/concepts/content-filter?tabs=warning%2Cuser-prompt%2Cpython-new#configurability-preview) documentation, as some content filtering configurations may require approval through the process mentioned there.

Follow the steps in the documentation to update configurations to handle false positives or negatives: [How to use content filters (preview) with Azure OpenAI Service](/azure/ai-services/openai/how-to/content-filters).

In addition to adjusting the severity levels for false negatives, you can also use blocklists. Detailed instruction can be found in [How to use blocklists with Azure OpenAI Service](/azure/ai-services/openai/how-to/use-blocklists).

#### [Azure AI Studio](#tab/azure-ai-studio)

Read the [Configurability](/azure/ai-studio/concepts/content-filtering#configurability-preview) documentation, as some content filtering configurations may require approval through the process mentioned there.

Follow the steps in the documentation to update configurations to handle false positives or negatives: [Azure AI Studio content filtering](/azure/ai-studio/concepts/content-filtering#create-a-content-filter).

In addition to adjusting the severity levels for false negatives, you can also use blocklists. Detailed instruction can be found in [Azure AI Studio content filtering](/azure/ai-studio/concepts/content-filtering#use-a-blocklist-as-a-filter).

---

## Create a custom category based on your own RAI policy

Sometimes you might need to create a custom category to ensure the filtering aligns with your specific Responsible AI policy, as prebuilt categories or content filtering may not be enough.

Refer to the [Custom categories documentation](/azure/ai-services/content-safety/concepts/custom-categories) to build your own categories with the Azure AI Content Safety API.

## Document issues and send feedback to Azure

If, after you’ve tried all the steps mentioned above, Azure AI Content Safety still can't resolve the false positives or negatives, there is likely a policy definition or model issue that needs further attention.

Document the details of the false positives and/or false negatives by providing the following information to the [Content safety support team](mailto:[email protected]):
- Description of the flagged content.
- Context in which the content was posted.
- Reason given by Azure AI Content Safety for the flagging (if positive).
- Explanation of why the content is a false positive or negative.
- Any adjustments already attempted by adjusting severity settings or using custom categories.
- Screenshots or logs of the flagged content and system responses.

This documentation helps in escalating the issue to the appropriate teams for resolution.

## Related content

- [Azure AI Content Safety overview](/azure/ai-services/content-safety/overview)
- [Harm categories](/azure/ai-services/content-safety/concepts/harm-categories?tabs=warning)
2 changes: 2 additions & 0 deletions articles/ai-services/content-safety/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ items:
href: how-to/custom-categories-rapid.md
- name: Use a blocklist
href: how-to/use-blocklist.md
- name: Mitigate false results
href: how-to/improve-performance.md
- name: Encryption of data at rest
href: how-to/encrypt-data-at-rest.md
- name: Migrate from public preview to GA
Expand Down
14 changes: 4 additions & 10 deletions articles/ai-services/openai/assistants-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ manager: nitinme
ms.service: azure-ai-openai
ms.custom: devx-track-python, devx-track-dotnet, devx-track-extended-java, devx-track-js
ms.topic: quickstart
author: mrbullwinkle
ms.author: mbullwin
ms.date: 07/18/2024
author: aahill
ms.author: aahi
ms.date: 09/18/2024
zone_pivot_groups: openai-quickstart-assistants
recommendations: false
---
Expand All @@ -18,15 +18,9 @@ recommendations: false

Azure OpenAI Assistants (Preview) allows you to create AI assistants tailored to your needs through custom instructions and augmented by advanced tools like code interpreter, and custom functions.

::: zone pivot="programming-language-studio"

[!INCLUDE [Azure OpenAI Studio quickstart](includes/assistants-studio.md)]

::: zone-end

::: zone pivot="programming-language-ai-studio"

[!INCLUDE [AI Studio (Preview)](includes/assistants-ai-studio.md)]
[!INCLUDE [AI Studio](includes/assistants-ai-studio.md)]

::: zone-end

Expand Down
12 changes: 5 additions & 7 deletions articles/ai-services/openai/how-to/quota.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ The flexibility to distribute TPM globally within a subscription and region has

When you create a model deployment, you have the option to assign Tokens-Per-Minute (TPM) to that deployment. TPM can be modified in increments of 1,000, and will map to the TPM and RPM rate limits enforced on your deployment, as discussed above.

To create a new deployment from within the Azure AI Studio under **Management** select **Deployments** > **Create new deployment**.

The option to set the TPM is under the **Advanced options** drop-down:
To create a new deployment from within the Azure AI Studio under **Shared Resources** select **Deployments** > **Deploy model** > **Deploy base model** > **Select Model** > **Confirm**.

:::image type="content" source="../media/quota/deployment.png" alt-text="Screenshot of the deployment UI of Azure AI Studio" lightbox="../media/quota/deployment.png":::

Post deployment you can adjust your TPM allocation by selecting **Edit deployment** under **Management** > **Deployments** in Azure AI Studio. You can also modify this selection within the new quota management experience under **Management** > **Quotas**.
Post deployment you can adjust your TPM allocation by selecting **Edit** under **Shared resources** > **Deployments** in Azure OpenAI Studio. You can also modify this selection within the new quota management experience under **Management** > **Quotas**.

> [!IMPORTANT]
> Quotas and limits are subject to change, for the most up-date-information consult our [quotas and limits article](../quotas-limits.md).
Expand All @@ -70,10 +68,10 @@ For an all up view of your quota allocations across deployments in a given regio

:::image type="content" source="../media/quota/quota.png" alt-text="Screenshot of the quota UI of Azure AI Studio" lightbox="../media/quota/quota.png":::

- **Quota Name**: There's one quota value per region for each model type. The quota covers all versions of that model. The quota name can be expanded in the UI to show the deployments that are using the quota.
- **Deployment**: Model deployments divided by model class.
- **Usage/Limit**: For the quota name, this shows how much quota is used by deployments and the total quota approved for this subscription and region. This amount of quota used is also represented in the bar graph.
- **Request Quota**: The icon in this field navigates to a form where requests to increase quota can be submitted.
- **Quota type**: There's one quota value per region for each model type. The quota covers all versions of that model.
- **Quota allocation**: For the quota name, this shows how much quota is used by deployments and the total quota approved for this subscription and region. This amount of quota used is also represented in the bar graph.
- **Request Quota**: The icon navigates to a form where requests to increase quota can be submitted.

## Migrating existing deployments

Expand Down
8 changes: 1 addition & 7 deletions articles/ai-services/openai/how-to/working-with-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can get a list of models that are available for both inference and fine-tuni

## Model updates

Azure OpenAI now supports automatic updates for select model deployments. On models where automatic update support is available, a model version drop-down is visible in Azure OpenAI Studio under **Create new deployment** and **Edit deployment**:
Azure OpenAI now supports automatic updates for select model deployments. On models where automatic update support is available, a model version drop-down is visible in Azure OpenAI Studio under **Deployments** and **Edit**:

:::image type="content" source="../media/models/auto-update.png" alt-text="Screenshot of the deploy model UI of Azure OpenAI Studio." lightbox="../media/models/auto-update.png":::

Expand All @@ -44,16 +44,10 @@ For currently deployed models, from Azure OpenAI Studio select **Deployments**:

:::image type="content" source="../media/models/deployments.png" alt-text="Screenshot of the deployment UI of Azure OpenAI Studio." lightbox="../media/models/deployments.png":::

To view retirement dates for all available models in a given region from Azure OpenAI Studio, select **Models** > **Column options** > Select **Deprecation fine tune** and **Deprecation inference**:

:::image type="content" source="../media/models/column-options.png" alt-text="Screenshot of the models UI of Azure OpenAI Studio." lightbox="../media/models/column-options.png":::

## Model deployment upgrade configuration

You can check what model upgrade options are set for previously deployed models in [Azure OpenAI Studio](https://oai.azure.com). Select **Deployments** > Under the deployment name column select one of the deployment names that are highlighted in blue.

:::image type="content" source="../media/how-to/working-with-models/deployments.png" alt-text="Screenshot of the deployments pane with a deployment name highlighted." lightbox="../media/how-to/working-with-models/deployments.png":::

Selecting a deployment name opens the **Properties** for the model deployment. You can view what upgrade options are set for your deployment under **Version update policy**:

:::image type="content" source="../media/how-to/working-with-models/update-policy.png" alt-text="Screenshot of the model deployments property UI." lightbox="../media/how-to/working-with-models/update-policy.png":::
Expand Down
3 changes: 3 additions & 0 deletions articles/ai-services/openai/includes/assistants-ai-studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ author: mrbullwinkle

## Go to the Azure AI Studio (Preview)

> [!NOTE]
> While you can use [Azure OpenAI Studio](https://oai.azure.com/), we recommend using the steps here to use [Azure AI Studio](https://ai.azure.com). AI Studio lets you use Assistants v2 which provides several upgrades such as the [file search](../how-to/file-search.md) tool which is faster and supports more files.
1. Sign in to [Azure AI Studio](https://ai.azure.com).
1. Go to your project or [create a new project](../../../ai-studio//how-to/create-projects.md) in Azure AI Studio.
1. From your project overview, select **Assistants**, located under **Project playground**.
Expand Down
Loading

0 comments on commit daa818e

Please sign in to comment.