Curbing AI creativity: How to provide effective guardrails

AI models can generate astonishingly creative content. However, their outputs can become cliched, unpredictable, and problematic without proper guardrails. How can we harness their potential while maintaining control? In this article, we’ll show you what you can do to provide guardrails for your AI chatbot. Thanks to these techniques, you can ensure its creative outputs align with your specific needs and objectives.

Table of contents

Understanding the need for guardrails

As AI continues to evolve, so do its capabilities to generate creative content. Generative AI can do everything, from writing articles and creating marketing copy to composing music and generating artwork. However, this comes with great responsibilities. Unchecked creativity in AI can lead to various challenges and risks. It’s very important to implement guardrails.

What is AI creativity?

Generative AI refers to the ability of models to generate new content. This can include text, images, music, and other forms of media. AI models like GPT-4, for instance, can write poetry, draft emails, create fictional stories, and even generate code. At Yoast, we use it to power the AI title and meta description generator in Yoast SEO. There are various ways to determine how creative the chatbot or AI system can get while generating that content. For instance, various AI tools like Copilot and Gemini have options to make the output more or less adventurous.

Where AI gets its creativity from

AI models, particularly Large Language Models (LLMs) like GPT-4, exhibit creativity through their ability to generate content. But where does this creativity come from? The answer lies at the intersection of training data, deep learning architectures, and fine-tuned parameters.

Diverse training data

The foundation of AI creativity is the huge datasets used during training. These datasets contain a range of text sources, including books, articles, websites, and other forms of written content. Exposure to a wide variety helps the model learn patterns, styles, and contextual nuances across different genres and topics. Diversity helps AI generate content that is not only coherent but also varied and imaginative.

Deep neural networks

At the heart of LLMs are deep neural networks, specifically transformer architectures. These consist of multiple layers of attention mechanisms. These layers allow the model to understand and generate complex language structures by focusing on the relationships between words and their context. With billions of parameters fine-tuned during training, these models can produce human-like text that mirrors the creativity found in their training data.

Predictive text generation

LLMs’ predictive text generation capabilities also drive creativity. The models generate text one token (word or subword) at a time, predicting the next token based on the preceding context. This token-by-token generation, influenced by probability distributions, allows the AI to craft coherent and contextually relevant content that can surprise and engage readers.

Influence of parameters

Parameters like temperature and top_p are crucial in modulating the model’s output. Temperature controls the randomness of predictions, with higher values leading to more diverse and “creative” outputs, while lower values result in more deterministic and focused text. Top_p, or nucleus sampling, controls the diversity of the output by sampling from a subset of probable tokens. By fine-tuning these parameters, users can balance creativity with coherence — more on this later. These are helpful tools to guide the AI in producing content that meets your needs.

Pattern recognition and replication

Ultimately, the AI’s creativity stems from its ability to recognize and replicate patterns from its training data. By mimicking the linguistic and stylistic patterns it has learned, the model can generate content that feels original and inspired. This pattern recognition allows LLMs to compose poetry, write stories, create marketing copy, and generate artistic descriptions that resonate with human creativity.

AI creativity is a product of training on diverse datasets, neural network architectures, and calibrated parameters. Understanding these components helps harness AI’s creativity while ensuring the content aligns with your objectives.

Human creativity vs. AI creativity

Various forms of creativity often produce similar outputs but from very different backgrounds. Human creativity is rooted in personal experiences, emotions, and conscious thought. This allows people to create art, literature, and innovations that resonate emotionally and culturally. It involves intuition, inspiration, and the ability to make abstract connections that are uniquely human.

In contrast, AI creativity consists of processing data and recognizing patterns within that data. AI generates new content based on learned patterns and statistical probabilities, not personal experiences or emotions. While AI can mimic human creativity and make coherent and relevant content, it lacks human understanding and emotional depth. Fusing human and AI creativity can lead to interesting results, but it’s crucial to recognize and appreciate each’s distinct nature.

Letting the AI run wild

While AI’s creative capabilities are impressive, they come with inherent risks. With proper guardrails, the outputs can become predictable and manageable.

AI can produce off-topic, irrelevant, or even inappropriate content without proper constraints. As a result, businesses and content creators might get hurt. For instance, an AI writing tool might generate marketing copy that is in the wrong tone or even offensive, which can damage a brand’s reputation.

Controlled creativity can generate content that aligns differently with the brand’s voice or message. The end goal, of course, is clarity and consistency.

Guardrails are critical for generative AI

Given these risks, it’s clear that guardrails help control AI’s creative potential. Here’s why guardrails are crucial:

  • Maintaining relevance and focus:
    • Guardrails help keep the AI’s outputs focused on the intended topic, preventing deviations that can dilute the message.
  • Ensuring appropriateness:
    • Guardrails protect your brand’s reputation and ensure that the content suits your audience by filtering out inappropriate or offensive content.
  • Aligning with brand voice:
    • Guardrails ensure that AI-generated content is consistent with your brand’s voice and tone, maintaining coherence in your messaging.
  • Enhancing credibility:
    • By preventing factual inaccuracies, guardrails enhance the credibility and reliability of AI-generated content, especially in fields that require precision.
  • Optimizing user experience:
    • Well-implemented guardrails contribute to a better user experience by ensuring the content is engaging, relevant, and valuable to the audience.

The following sections will explore practical techniques for providing these guardrails to manage AI creativity effectively.

Techniques for providing guardrails

Effective guardrails for AI are strategies that can help control the output, ensuring it meets specific requirements and aligns with your objectives.

Keyword filtering

Without limiting what the LLM does, it loves to come up with sentences/words like: “In the ever-evolving landscape of…” and “As we stand on the cusp of this new era, the possibilities are as limitless as our imagination.” It uses long-winded sentences with very expressive language, full of cliches. You can curb this by limiting the words or expressions it can use.

Keyword filtering involves setting up filters to exclude specific words, phrases, or types of content deemed inappropriate, irrelevant, or not aligned with your brand’s voice. This technique is useful for maintaining content suitability and relevance.

It’s not hard to implement:

  • Identify keywords: List words or phrases that should be excluded. This can include offensive language, jargon, or off-topic terms.
  • Set up filters: Use AI tools that support keyword filtering. Configure these tools to flag or exclude content containing the identified keywords.
  • Continuous monitoring: Regularly update the list of keywords based on feedback and new requirements.

Try this as an experiment. You’ll notice it’s fairly easy to influence what chatbots use and don’t use.

Write a short piece on the future of content creation with generative AI. Don't use the following words:

Buckle up
Delve
Dive
Elevate
Embark
Embrace
Explore
Discover
Demystified

but do use:

Unleash
Unlocked
Unveiled
Beacon
Bombastic
Competitive digital world

You can also make this process more proficient and scalable using APIs to communicate with LLMs and chatbots.

Prompt engineering

Prompt engineering involves writing prompts to guide the AI in generating content that meets the criteria. Leo S. Lo from the University of New Mexico developed the CLEAR method (context, limitations, examples, audience, requirements), an effective approach to prompt engineering. Of course, there are plenty of other ways to write great prompts for your content.

A practical example of using the CLEAR framework

Imagine we are creating content for a travel blog. Using the CLEAR framework, we devised the following prompt to inspire the AI chatbot to create a blog post about Kyoto, Japan.

Prompt: “Describe a day in the life of a local in Kyoto, Japan. Focus on their morning routine, interactions with neighbors, and favorite spots in the city. Use a descriptive and engaging tone to captivate travel enthusiasts. Include at least two historical landmarks and one local cuisine.”

  1. Clear: The instructions are straightforward to understand. We specifically ask for a description of a day in the life of a local in Kyoto, including particular elements like their morning routine, interactions, and favorite spots.
  2. Logical: The prompt is logically structured. It begins with a general description of a day in the life and then narrows down to specific details such as the morning routine, interactions with neighbors, and favorite spots. This logical flow helps generate a coherent and comprehensive piece of content.
  3. Engaging: The tone is described as “descriptive and engaging,” which is crucial for captivating travel enthusiasts. The prompt invites the writer to create a vivid and relatable narrative by focusing on personal interactions and favorite spots.
  4. Accurate: The prompt asks for at least two historical landmarks and one local cuisine. This ensures that the description is rooted in Kyoto’s actual cultural and historical elements.
  5. Relevant: The topic is highly relevant to travel enthusiasts interested in different places’ cultural and daily life aspects. The prompt taps into a subject of high interest by focusing on Kyoto, a city known for its rich history and cultural landmarks.
Enhanced prompt

To refine it even further, you can add a few more specific guidelines to enhance clarity and completeness:

“Describe a day in the life of a local in Kyoto, Japan. Focus on their morning routine, interactions with neighbors, and favorite spots in the city. Use a descriptive and engaging tone to captivate travel enthusiasts. Include at least two historical landmarks (e.g., Kinkaku-ji, Fushimi Inari Taisha) and one local cuisine (e.g., yudofu, kaiseki). Ensure the narrative captures the essence of Kyoto’s culture and daily life.”

Why these improvements work:
  • Clear: Specific examples such as Kinkaku-ji and yudofu provide clarity.
  • Logical: The flow from morning routine to interactions and favorite spots remains logical.
  • Engaging: The descriptive and engaging tone is maintained.
  • Accurate: Named landmarks and cuisines ensure accuracy.
  • Relevant: Provides a detailed, culturally rich experience relevant to travel enthusiasts.

Now, the prompt is well-crafted and aligns with the CLEAR framework, and the enhanced version provides additional guidance and specificity.

Template usage

Templates provide a structured framework the AI chatbot can follow, ensuring consistency and completeness in the generated content. Templates can be particularly useful for recurring content types like blog posts, reports, product descriptions, etc. Using templates, you can maintain a uniform structure across different pieces of content. As a result, all necessary elements are included and appropriately organized.

  • Identify common content types: Determine the types of content you frequently generate, such as blog posts, product descriptions, social media posts, etc.
  • Create templates: Develop templates for each content type. These templates should include sections and prompts for each part of the content.
  • Provide clear instructions: Include detailed instructions within each template section to guide the AI. This can involve specifying the tone, style, length, and key points to cover.
  • Consistent use: Use these templates consistently to maintain uniformity across all generated content. Review and update the templates regularly to reflect new requirements or insights.

Parameter tuning

Adjusting parameters like temperature and top_p can control the randomness and creativity of the AI’s output. This might seem like it controls creativity, but that’s not actually the case. Instead, it fine-tunes how the model balances creativity with coherence. Temperature affects the variability of the generated content, while top_p controls the diversity by sampling from a subset of probable tokens.

Understanding temperature and top_p in LLMs

Imagine you’re baking cookies, and you want to experiment with different flavors. You have a big jar of various ingredients (chocolate chips, nuts, dried fruits, etc.), and you can either stick to the classic recipe or get a bit adventurous.

Temperature:
Think of temperature as the level of adventurousness in your cookie recipe.

  • Low temperature (e.g., 0.2): You’re playing it safe. You mostly stick to the classic ingredients like chocolate chips and maybe a few nuts. Your cookies are predictable but reliably good.
  • High temperature (e.g., 0.8): You’re feeling adventurous! You start throwing in various ingredients, like mango bits, chili flakes, and marshmallows. The cookies are more unpredictable — some might be amazing, while others might be too wild.

In AI text generation, a lower temperature means the model plays it safe and chooses more predictable words. A higher temperature allows for more creativity and variety but with the risk of less coherence.

Top_p (Nucleus sampling):
Now, imagine you have a friend who helps you pick the ingredients. Top_p is like telling your friend only to consider the most popular ingredients but with a twist.

  • Low top_p (e.g., 0.1): Your friend only picks the top 10% of frequently used ingredients. You end up with a very standard and safe mix.
  • High top_p (e.g., 0.9): Your friend considers a wider variety of ingredients, maybe the top 90%. This allows for more interesting and diverse combinations but still within a reasonable limit, so the cookies don’t turn out too strange.

In AI text generation, a lower top_p value means the model selects from a smaller set of high-probability words. This makes the output more predictable. A higher top_p value lets the model choose from a larger set of words, increasing the output’s diversity and “creativity” while maintaining coherence.

Adjusting temperature and top_p controls how adventurous or safe the AI is in generating text. This is much like how you control the ingredients in your cookie recipe.

A misconception

As we’ve mentioned, the temperature and top_p control the randomness and diversity of AI-generated text. However, they do not create or improve creativity. Instead, they manage how the AI explores different word choices. True creativity in AI comes from the model’s ability to generate new content based on the patterns it has learned from its training data.

Experimenting with and fine-tuning these parameters helps you guide the AI. These tools help it produce imaginative and relevant content without veering off into incoherence or irrelevance.

Generative AI tools like TypingMind let you carefully control the performance of various language models

Combining techniques

Combining the above techniques can provide a more robust framework for controlling AI creativity. Each technique complements the others, creating a comprehensive system of guardrails.

An integrated approach combines keyword filtering, prompt engineering, template usage, and parameter tuning to create a multi-layered control system. You can support this using a feedback loop that considers all aspects of the content generation process, from initial prompts to final outputs.

Conclusion to creativity in AI

It’s important to maintain control while still harnessing AI’s creative potential. Use guardrails such as keyword filtering, prompt engineering with frameworks, template usage, and parameter tuning to help the AI produce relevant, high-quality content that aligns with your objectives.

Remember that parameters like temperature and top_p do not define creativity; they merely influence the randomness and diversity of the output. True creativity in AI is limited and cannot be replicated without outside help from real people.

With some help from these techniques, we can purposefully use generative AI’s creative capabilities. Whether generating blog posts, marketing copy, or educational content, these strategies help the AI to add value and meet desired standards.

Coming up next!

seo enhancements
AI Overviews by Google and how Yoast SEO helps you prepare

As Google rolls out its new AI Overviews, SEO professionals and website owners must adapt to these changes to maintain and improve their search rankings. Google’s AI Overview, powered by the advanced Gemini model, integrates generative AI into the SERP. It provides users with summarized answers to complex queries at the top — well above the organic results. Google intends to improve user experience by offering quick, comprehensive answers; however, it also introduces new dynamics in interacting and preparing for these AI Overviews.

Understanding Google’s AI Overviews

Google’s AI Overviews are designed to summarize information from multiple web pages to answer user queries more efficiently. These overviews appear at the top of search results. They include links to the source websites, potentially driving more traffic to diverse sites. According to reports, users tend to click on links within AI Overviews more frequently than traditional search listings. This suggests an opportunity for increased visibility for well-optimized content​​. AI Overviews are widely available in the US and will gradually roll out worldwide.

Steps to prepare for Google’s AI Overview rollout

  1. Enhance content quality:
    • Focus on creating high-quality, comprehensive content that addresses user queries in depth. Google’s AI will pull from various sources, so ensure your content is detailed and authoritative. Your ability to influence or to be cited in the summary will be directly related to your existing authority on the subject.
    • Use structured data to help Google understand and categorize your content accurately.
  2. Optimize for user intent:
    • Identify and target the specific user intents behind searches. Use tools to determine your audience’s questions and tailor your content to provide clear, concise answers.
    • Incorporate FAQs and summaries that Google’s AI can easily extract for overviews.
  3. Leverage Yoast SEO features:
    • Content analysis: Use Yoast SEO’s readability and SEO analysis tools to ensure your articles are well-optimized with relevant keywords, meta descriptions, and readability scores.
    • Schema markup: Implement structured data with Yoast SEO’s schema markup feature. This makes your content more accessible and understandable to search engines.
    • Internal linking: Improve your site’s internal linking structure to guide users and search engines to your most important content.
  4. Monitor performance:
    • Keep an eye on your Google Search Console for changes in traffic and visibility. Google plans to include AI Overview impressions and clicks in Search Console reports. Unfortunately, these won’t be distinguished from traditional search results​ (SiliconANGLE)​​ (Search Engine Land)​.
    • Use this data to adjust your strategies and optimize underperforming content.
  5. Stay informed and adaptive:
    • Update your SEO knowledge regularly and stay informed about changes in Google’s algorithms and AI capabilities.
    • Participate in SEO communities and forums to share insights and strategies with peers.

How Yoast SEO can help

Yoast SEO can help you navigate the upcoming AI upheaval. Here’s how:

  • Content optimization: Yoast SEO’s analysis tools help you create content that meets high-quality standards. Quality is crucial if you want to feature in AI Overviews.
  • Readability checks: Ensure your content is easy to read and understand. This increases the chance of AI summarizing your content effectively.
  • Keyword optimization: Yoast helps you target the right keywords and phrases that align with user intent. As a result, you improve your chances of getting into AI-driven summaries.
  • Structured data implementation: Use Yoast SEO to add structured data to your pages. With structured data, you make it easier for Google to extract and present your content in AI Overviews.

Use Yoast SEO and be proactive

Use Yoast SEO and stay proactive with your SEO strategies. This way, you prepare for and thrive in today’s world of AI-driven search results. Stay adaptable and focus on high-quality content. Use the powerful tools at your disposal to maintain your visibility and traffic in this new era of search.

Coming up next!

seo enhancements
Are Google’s new AI Overviews the future of search?

Artificial intelligence (AI) continues to reshape how we interact with information. Google introduced AI Overviews in its search engine yesterday, marking a new milestone. These new features promise to enhance user experience by providing quick, comprehensive answers to complex queries. However, they also raise important questions about the future of content creation, monetization, and information diversity. Where is all of this heading?

Overview of Google’s new AI features

There were many AI announcements at Google I/O yesterday, but we think the AI Overviews will most impact our audience and customers.

AI Overviews are designed to directly summarize search results from multiple sources on the search page. By leveraging advanced generative AI, these overviews provide users with a concise and comprehensive understanding of complex queries without the need to click through multiple websites. AI Overviews won’t appear for every search, only the complex ones.

Benefits of AI Overviews

According to Google, AI Overviews significantly improve users’ efficiency and satisfaction by delivering quick, accurate, and contextually relevant answers. This can be particularly beneficial for users needing immediate information or conducting broad research.

Google understands everything contextually. The AI’s ability to understand and respond to complex, multistep queries ensures that users receive detailed and logically structured answers, which is invaluable for research and education.

AI Overviews provide students, researchers, and professionals with a structured way to access and digest information, making the learning and research process more streamlined and effective.

Challenges and concerns

One of the most significant concerns is the potential reduction in traffic to original content sites. As users find their answers directly on Google, fewer clicks are directed toward independent publishers. This negatively impacts their revenue and overall visibility.

There are also concerns about proper credit and compensation for content creators. If AI Overviews aggregate information without adequately attributing sources, it could disincentivize content creation and harm publishers in the broadest sense.

The shift towards providing answers directly on the search results page may also pose monetization challenges for Google. Less traffic directed to third-party sites could disrupt the traditional ad-based revenue model, but Google has such a stronghold on the ad market it must surely have found a way forward.

Broader implications for our ecosystem

Centralizing information within Google’s ecosystem could reduce content diversity and the number of voices available online. This monopolization of information flow is a significant concern for the web.

As Google becomes more adept at providing comprehensive answers, user reliance on its services will likely increase. This growing dependence could stifle competition and innovation.

Then, there are the privacy and data concerns plaguing AI in general. The extensive data collection required for personalized AI features raises important privacy issues. Ensuring user consent and data security will be paramount as AI evolves.

Google wants to become your Star Trek Communicator

Google’s advancements in AI are steering it towards becoming a highly personalized digital assistant, akin to the Communicator from Star Trek. It has hinted at this many times over the past. Still, with yesterday’s news, that vision is becoming clearer. This vision involves creating a seamless, always-available assistant to understand and respond to complex human queries and tasks in real time.

Google aims to offer a seamless user experience by integrating multimodal AI capabilities across its ecosystem. This includes personalized interactions that understand user preferences and provide tailored recommendations and insights.

Looking ahead, Google is likely to further integrate AI into various aspects of daily life, from home automation to personal finance and health, making it an indispensable part of users’ routines.

Balancing innovation with responsibility

Google doesn’t owe us traffic or high rankings, but the future of the web does hang in the balance of whatever Google thinks of next. The discussions about who feeds all those AI machines continue. As a site owner, quitting publishing content is not an easy decision. However, seeing the ROI of these publications slowly die might make that decision easier.

We think it is too early to write off search yet. There are plenty of opportunities to be had, and Google might devise a way to balance providing enough value for site owners vs. ad revenue. To address the impact on content creators, Google could find ways to ensure fair compensation for using their content in AI Overviews.

Ethical development of AI

Google’s AI Overviews will occasionally be flat-out wrong — as we’ve seen many times over the past year. Hallucinations are still happening, and they could put Google in a jam. Therefore, it must prioritize ethical considerations in AI development, including transparency, fairness, and user consent. This will help build trust and ensure that AI advancements benefit everyone.

To create a sustainable digital ecosystem for everyone, we need a collaborative approach involving Google, publishers, regulators, and users. Open dialogue and cooperation can help address the challenges and harness AI’s full potential.

Conclusion to Google’s AI Overviews

The introduction of AI Overviews in Google search represents a significant advancement. It has the potential to transform how we access information.

While the benefits for users are clear, the challenges for independent publishers and our ecosystem cannot be ignored. Ultimately, Google hopes to create a future where AI enhances our lives while supporting a diverse and thriving web.

Now that AI-driven search is here, Google wants you to “Let Google do the googling for you,” but we hope it has carefully considered the broader impacts on our ecosystem. Ultimately, we hope everyone benefits from these advancements — not just Google.

Coming up next!