{"id":3556,"date":"2023-10-22T12:49:08","date_gmt":"2023-10-22T19:49:08","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/surface-duo\/?p=3556"},"modified":"2024-01-03T16:05:56","modified_gmt":"2024-01-04T00:05:56","slug":"responsible-ai-and-content-safety","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/surface-duo\/responsible-ai-and-content-safety\/","title":{"rendered":"Responsible AI and content safety"},"content":{"rendered":"<p>\n  Hello prompt engineers,\n<\/p>\n<p>\n  This week we\u2019re taking a break from code samples to highlight the <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/azure-ai-services-blog\/announcing-general-availability-of-azure-ai-content-safety\/ba-p\/3956309\">general availability of Azure AI Content Safety<\/a>. In this blog series we\u2019ve touched briefly on the using prompt engineering to restrict the types of responses an LLM will provide, such as <a href=\"https:\/\/devblogs.microsoft.com\/surface-duo\/android-openai-chatgpt-14\/\">setting the system prompt<\/a> to set boundaries on what questions will be answered:\n<\/p>\n<p>\n  <img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/model-refuses-to-write-a-poem.png\" class=\"wp-image-3557\" alt=\"Model refuses to write a poem\" width=\"500\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/model-refuses-to-write-a-poem.png 970w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/model-refuses-to-write-a-poem-300x158.png 300w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/model-refuses-to-write-a-poem-768x405.png 768w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><br\/><em>Figure 1: System prompt set to &#8220;You will answer questions about the speakers and sessions at the droidcon SF conference.&#8221;<\/em>\n<\/p>\n<p>\n  However, ensuring a high-quality user experience goes beyond simple guardrails like this. You want your application\u2019s responses to be not only accurate, but also embody your brand\u2019s values and prevent harmful or inappropriate output. With AI capabilities expanding so rapidly, it can be challenging just to keep track of the challenges around ensuring high-quality responses, let alone the steps required to protect against bad output (triggered either by malicious usage or inadvertently).\n<\/p>\n<h2>What is Responsible AI?<\/h2>\n<p>\n  Microsoft has a portal that covers various aspects of <a href=\"https:\/\/www.microsoft.com\/en-us\/ai\/responsible-ai\">Responsibe AI<\/a>, including the <a href=\"https:\/\/www.linkedin.com\/pulse\/z-responsible-ai-microsoft-on-the-issues\/\">A-Z of responsible AI<\/a> which acts like a glossary of terms like Jailbreak, Impact assessment, and Red-teaming that will help inform your understanding of these concepts. Microsoft Learn also has an overview of <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/machine-learning\/concept-responsible-ai\">what is Responsible AI<\/a> that introduces issues like reliability, safety, inclusiveness, privacy, and security; things you should consider in your implementation of AI features and how to address them. \n<\/p>\n<p>\n  These things can be addressed in different layers of your application architecture:\n<\/p>\n<ul>\n<li>\n    User experience \u2013 some mitigations will be extensions of your existing engineering efforts \u2013 for example, privacy and security controls that you already have in place should be extended to cover your AI features, with special attention given to how AI systems handle data, and how that data might be used (eg. whether it is stored and used for training).\n  <\/li>\n<li>\n    Metaprompt &amp; grounding \u2013 as with the code examples shared in this blog, the system prompt (and other prompts that drive RAG responses and function calling) can help to keep the AI on-track and ensure it\u2019s responding with factual information in appropriate ways.\n  <\/li>\n<li>\n    Safety system \u2013 Additional protections you can add to how your code interacts with LLMs, to address both inappropriate user input (including malicious input) as well as model output.\n  <\/li>\n<li>\n    Model \u2013 Building atop models that themselves have safety protections in place (and being aware of their shortcomings).\n  <\/li>\n<\/ul>\n<p>\n  Many of these concerns are new and specific to AI implementations and will need new solutions that keep up with the changing landscape of AI capabilities and heightened user expectations.\n<\/p>\n<p>\n  <img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/thumbnail-image-1-of-blog-post-titled.png\" class=\"wp-image-3558\" alt=\"Announcing General Availability of Azure AI Content Safety\" width=\"500\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/thumbnail-image-1-of-blog-post-titled.png 999w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/thumbnail-image-1-of-blog-post-titled-300x169.png 300w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/thumbnail-image-1-of-blog-post-titled-768x432.png 768w\" sizes=\"(max-width: 999px) 100vw, 999px\" \/><br\/><em>Figure 2: Mitigation layers (image from the <\/em><a href=\"https:\/\/techcommunity.microsoft.com\/t5\/azure-ai-services-blog\/announcing-general-availability-of-azure-ai-content-safety\/ba-p\/3956309\"><em>Azure Content Safety blog post<\/em><\/a><em>)<\/em>\n<\/p>\n<h2>Azure Content Safety<\/h2>\n<p>\n  The new <a href=\"https:\/\/azure.microsoft.com\/products\/ai-services\/ai-content-safety\/\">Azure Content Safety<\/a> service can be a part of your AI toolkit to ensure your users have high-quality interactions with your app. It is a content moderation platform that can detect offensive or inappropriate content in user interactions, and provide your app with a content risk assessment based on different types of problem (eg. violence, hate, sexual, and self-harm) and severity. This high level of granularity provides your app with the tools to block interactions, trigger moderation, add warnings, or otherwise handle each safety incident appropriately to provide the best experience for your users.\n<\/p>\n<p>\n  Azure Content Safety is multi-lingual aware and multi-model \u2013 it works on both text and image inputs \u2013 and can form an important part of your AI safety system.\n<\/p>\n<p>\n  The service includes the interactive <a href=\"https:\/\/contentsafety.cognitive.azure.com\/\">Content Safety Studio<\/a> and dashboard as well as the <a href=\"https:\/\/learn.microsoft.com\/azure\/ai-services\/content-safety\/quickstart-text\">API<\/a> that you\u2019ll incorporate into your app architecture.\n<\/p>\n<p>\n  <img decoding=\"async\" width=\"1216\" height=\"1201\" src=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2.png\" class=\"wp-image-3559\" alt=\"Content Safe Studio homepage\" srcset=\"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2.png 1216w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2-300x296.png 300w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2-1024x1011.png 1024w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2-768x759.png 768w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2-24x24.png 24w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2-48x48.png 48w, https:\/\/devblogs.microsoft.com\/surface-duo\/wp-content\/uploads\/sites\/53\/2023\/10\/a-screenshot-of-a-computer-description-automatica-2-96x96.png 96w\" sizes=\"(max-width: 1216px) 100vw, 1216px\" \/><br\/><em>Figure 3: Content Safety Studio<\/em>\n<\/p>\n<p>\n  Refer to the <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/azure-ai-services-blog\/announcing-general-availability-of-azure-ai-content-safety\/ba-p\/3956309\">announcement blog post<\/a> and <a href=\"https:\/\/learn.microsoft.com\/azure\/ai-services\/content-safety\/overview\">documentation<\/a> for more information, including quickstarts and code samples in C#, Python, Java, and JavaScript.\n<\/p>\n<h2>Feedback and resources<\/h2>\n<p>\n  We\u2019d love your feedback on this post, including any tips or tricks you\u2019ve learned from playing around with ChatGPT prompts.\n<\/p>\n<p>\n  If you have any thoughts or questions, use the <a href=\"http:\/\/aka.ms\/SurfaceDuoSDK-Feedback\">feedback forum<\/a> or message us on <a href=\"https:\/\/twitter.com\/surfaceduodev\">Twitter @surfaceduodev<\/a>.\n<\/p>\n<p>\n  There will be no livestream this week, but you can check out the <a href=\"https:\/\/youtube.com\/c\/surfaceduodev\">archives on YouTube<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello prompt engineers, This week we\u2019re taking a break from code samples to highlight the general availability of Azure AI Content Safety. In this blog series we\u2019ve touched briefly on the using prompt engineering to restrict the types of responses an LLM will provide, such as setting the system prompt to set boundaries on what [&hellip;]<\/p>\n","protected":false},"author":570,"featured_media":3558,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[741],"tags":[739,734,733],"class_list":["post-3556","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-azure","tag-chatgpt","tag-openai"],"acf":[],"blog_post_summary":"<p>Hello prompt engineers, This week we\u2019re taking a break from code samples to highlight the general availability of Azure AI Content Safety. In this blog series we\u2019ve touched briefly on the using prompt engineering to restrict the types of responses an LLM will provide, such as setting the system prompt to set boundaries on what [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/posts\/3556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/users\/570"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/comments?post=3556"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/posts\/3556\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/media\/3558"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/media?parent=3556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/categories?post=3556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/surface-duo\/wp-json\/wp\/v2\/tags?post=3556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}