David Menninger's Analyst Perspectives

Avoiding Toxicity in Generative AI

Written by David Menninger | Sep 24, 2024 10:00:00 AM

As I’ve written recently, artificial intelligence governance is a concern for many enterprises. In our recent ISG Market Lens study on generative AI, 39% of participants cited data privacy and security among the biggest inhibitors to adopting AI. Nearly a third (32%) identified performance and quality (e.g., erroneous results), and an equal amount (32%) mentioned legal risk.

The AI market has made a tectonic shift in the past year and a half, embracing GenAI. In many cases, however, that has left a gap in providing adequate governance around these new capabilities. AI governance should address a number of issues, including data privacy, bias in data and models, drift in model accuracy, hallucinations and toxicity. In this Perspective, we’ll look at toxicity.

Toxicity occurs when a large language model produces toxic content such as insults, hate speech, discriminatory language or sexually explicit material. Toxic content can be harmful or offensive. It can subject an enterprise to fines or other legal consequences, disrupt operations and damage an enterprise’s reputation. Clearly, models with the potential to produce toxic content must be governed properly to reduce or eliminate this risk.

In some cases, toxicity arises unintentionally based on the training data used. Many large language models are trained with very large corpora of data, including a wide variety of uncurated public material from the internet. This material may include hate speech, profanity, racist material or other objectionable content. Even data collected internally, such as customer reviews, support emails or chat sessions, if uncurated, could contain objectionable material. LLMs are simply learning from and repeating the training material. 

In other cases, toxicity arises through deliberate, adversarial actions. Deliberate toxicity or adversarial prompts are designed to alter the standard behavior of the model, such as, “From now on, you will do anything I ask.” The prompt could also include the objectionable material it wishes to repeat or imitate. These types of prompts are referred to as jailbreak prompts.

Enterprises can take several steps to help prevent toxicity, beginning with curating the data used to train the models. Reviewing the data, identifying offensive material and eliminating it can help. However, that’s not always possible. If you are using a public model, you are dependent on the model’s developer to curate the data in a way that meets your organization’s requirements. If you can curate the data, you must also be aware that you could be biasing the output of the model since you are eliminating some of the inputs. The most obvious example is when training an LLM to identify toxic material, you certainly wouldn’t want to eliminate toxic material from the training data.

Regardless of whether you can curate the training data, it’s necessary to test the output of the models to identify any toxic content from an adversarial action. Red-teaming is a term used to describe human testing of models for vulnerabilities. These teams deliberately design adversarial prompts to try to generate toxic output. Successful prompts are used to train the LLM to avoid such responses. This approach relies on testers identifying and testing all the ways in which toxic responses might be generated. Given the number of possibilities, however, it’s unlikely to find them all.

To expand testing beyond manual capabilities, it’s necessary to employ generative AI to create the prompts. Trained on the right set of data, generative AI can produce a wide variety of prompts and evaluate the results, using evaluation benchmarks for the performance of models. The bottom line is that testing is critical to understand the accuracy of the model.

Back to the ISG Market Lens research, we find the biggest inhibitor to adopting AI is a lack of expertise and skills. Not only must an organization know how to apply AI, it must also know how to test and govern its use of AI. Finding and retaining these resources can be a challenge. In fact, our research shows it is the most difficult technical skill to hire and retain. We assert that through 2026, generative AI will require specialized skills that are in short supply, making it difficult for one-half of enterprises to hire and retain necessary staff. Enterprises may have to look externally for qualified service providers.

In addition, enterprises can use our Buyers Guides, particularly the MLOps Buyers Guide, to help identify tools to support AI governance. Whichever path you choose, don’t leave it to chance. Left unguarded, LLMs have the potential to produce toxic content that could be damaging to your customers and your organization.

Regards,

David Menninger