Braze Learning Resource - AI Fundamentals
Find a sample of Braze lessons here for AI fundamentals.
Unlock the knowledge you need to succeed with Braze and become a leader in customer engagement. For a list of all lessons, visit the Braze Learning site.
In this learning path, you'll discover the fundamental concepts of how AI works by diving into machine learning and its subtypes—supervised learning, unsupervised learning, generative AI, and reinforcement learning—in order to effectively power predictions, generate unique content, harness data, and more.
Decoding Artificial Intelligence
Understand the fundamental concepts of artificial intelligence and its various applications.
What is Artificial Intelligence?
Artificial intelligence** (AI) **has become a central topic of conversation throughout the business world. As its prevalence continues to grow, you may have found yourself wondering:
- What is artificial intelligence?
- How does artificial intelligence work?
- What are the different types of artificial intelligence?
- How can I use artificial intelligence to optimize my workflows?
While the widespread adoption of AI is recent, the concepts behind it are not. In fact, you've likely used various forms of artificial intelligence without even realizing it. For instance, if you've ever navigated using a digital map or received personalized song recommendations from a music streaming service, you've used AI.
For many, AI evokes images of personal robots, self-driving cars, and unbeatable chess opponents, but its applications are far broader, especially for marketers.
Fundamentally, artificial intelligence is a machine performing a cognitive task that would otherwise be done by a human.
What You Will Learn in this Course
You don't have to be a machine learning engineer or data scientist to understand artificial intelligence. A basic understanding of core AI concepts is all you need to adapt to these new technologies and effectively utilize their strengths.
By the end of this course, you will be able to:
- Define the concept of artificial intelligence (AI)
- Define machine learning and its purpose
- Describe the difference between linear vs. non-linear statistics and their applicability to machine learning
- Explain how AI technologies are applicable to various marketing use cases and can optimize workflows by addressing common bottlenecks
- Describe how recent improvements in AI have led to its increased prevalence and public awareness
How Artificial Intelligence Works
Artificial intelligence is a system that uses computers to simulate intelligence or perform cognitive tasks traditionally done by humans. Machine learning is the technique that enables that system to work.
You can think of it this way: human intelligence is our overall ability to think and reason, while human learning is the process we use to gain new skills and knowledge. Similarly, artificial intelligence is the broad field of enabling machines to think and reason, and machine learning is the specific process that helps those machines learn from past information to become more effective.
While the terms are often used interchangeably, machine learning is a subset of artificial intelligence. It uses statistical methods to analyze historical data and create predictive models, which are then used to generate various outputs.
How Statistics Power Machine Learning
Machine learning is an advanced form of classical statistics. Historically, statistics used linear models, which assume that relationships in data are simple and can be shown as a straight line. For example, the relationship between hours worked and total pay for an hourly employee is linear: for every constant increase in hours, pay increases by a constant amount, creating a straight line on a graph.
However, real-world relationships aren't always so simple. The development of non-linear statistics allows us to model more complex, curved relationships in data.
An example of a nonlinear relationship is the connection between a car's age and its price over time. This relationship is nonlinear because the rate at which a car loses value isn't constant. Instead, the value depreciates most steeply in its first few years before the rate of decline slows and eventually levels off.
The development of new research methods, like non-linear modeling, was made feasible by computers, as computers have the ability to store vast amounts of data and algorithms enabling them to learn and solve complex problems on their own.
Using AI to Solve Marketing Bottlenecks
Advancements in artificial intelligence have made it applicable to more business use cases than ever before. AI can now be used for tasks like segment-based personalization, data transformation, and research. This technology can directly solve critical challenges that often slow down marketing teams. Select each tab below to learn more.
The Artificial Intelligence Boom
The recent rise and advancements in artificial intelligence, specifically generative AI, can be traced to two significant studies:
- "Attention Is All You Need” published in 2017 by Google
- “Scaling Laws for Neural Language Models” published by researchers at OpenAI and Johns Hopkins University in 2020
Attention is All You Need
This paper introduced the Transformer network architecture, completely changing how some AI systems work. Unlike previous methods that processed information step-by-step or by scanning small areas, the transformer is able to focus on many different parts of the information at the same time and from various angles, helping it understand complex relationships without losing detail.
This innovative approach has enabled the Transformer to process information much faster and in parallel, which is what led to the development of incredibly powerful AI models like ChatGPT and other large language models.
Scaling Laws for Neural Language Models
This study examined how well AI language models, especially those built on the Transformer design, perform based on their size, the amount of data they train on, and the computer power used.
The study discovered clear patterns, called "power laws," showing that a language model's performance (its error rate) improved reliably as the model got larger, used more data, or had more computing power.
These predictable scaling laws have significantly influenced the AI field, making large investments in developing and training bigger language models seem justified.
Wrap Up
In this lesson you learned the fundamental concepts of AI, how it works, its rise in popularity, and how it can be used to optimize marketing workflows.
What’s Next
You have completed the first of four courses in the AI Fundamentals learning path.
In the next course, you'll dive deeper into the four main types of machine learning:
- Supervised learning, which powers predictions.
- Unsupervised learning, which identifies patterns.
- Reinforcement learning, which enables decision-making.
- Generative AI, a type of supervised learning that creates new content.
Continue through the learning path to acquire the knowledge necessary to take the Braze AI Fundamentals Certification exam and earn your certification.
Machine Learning Fundamentals
Learn about the key subtypes of machine learning
What is Machine Learning?
Machine learning (ML) is a type of artificial intelligence (AI) that allows computers to learn from data. Instead of following a strict set of instructions, ML finds complex and non-obvious patterns in large amounts of information.
Machine learning is an extension of statistics. Unlike linear statistical models that find simple patterns in data, machine learning uses non-linear models to process large datasets and identify complex patterns and relationships.
Essentially, ML involves machines using data to identify non-linear patterns and relationships, learn from these patterns and relationships, and improve their performance over time, leading to better predictions or outputs across various applications. This is what allows AI technology to do things like accurately predict the weather, recognize faces, or provide personalized product recommendations.
Non-linear model example
To better understand how ML uses data to make better predictions and learn from data, let’s go through an example.
Goal: You want to build a simple model to predict the time it will take for you to commute home.
How Would a Linear Model Do This?
A linear model might look at two variables: the distance between your home and work, and the commute time in minutes. You would see a proportional relationship where increased distance, like taking a longer driving route, will lead to an increased commute time. This would appear as a straight line in a graph.
How a Non-Linear Model Can Improve Predictive Accuracy
What if you consider other variables to get a more accurate prediction, such as traffic and road closures? When you add more complex variables, the relationship between your inputs (distance, traffic, road closures) and your output (commute time) is no longer a straight line.
Think of a linear model as trying to predict your commute using only a simple ruler. A non-linear model is more like a flexible wire that can bend and curve to accurately trace the true, complex path of your commute, taking all variables into account. This illustrated how machine learning algorithms go beyond simple statistics to find deeper, more realistic patterns in data.
Now, let's think about how this applies to your marketing use cases: To resonate with your audience, there are countless variables that you must consider to truly understand what each individual user wants and needs. This is where machine learning can help you to process vast amounts of user data to create memorable and personalized experiences, at scale. To get started, you need to understand the basics and types of machine learning so that you can decide what type of machine learning best fits your brand's needs and tech stack.
Machine Learning Examples
AI that uses machine learning is becoming more common and integrated into the activities of daily life. In fact, you may have already interacted with ML, sometimes without even realizing it!
Some other examples of ML that you may have already encountered include:
- ChatGPT
- Spotify’s personalized playlists
- Email spam filters
- Ride sharing apps (effectively pairing riders and drivers based on location and availability)
- Netflix’s content recommendations
Types of Machine Learning
The four types of machine learning include:
- Prediction, also known as supervised learning
Pattern identification, also known as unsupervised learning
Generative AI - Decision-making, also known as reinforcement learning
Select the numbered icons below to learn about the four types of machine learning covered in this course:
What You Will Learn in This Course
This course will teach you the fundamentals of machine learning so you can leverage ML to enhance your customer engagement strategy. By the end of this course, you will be able to:
- Explain how predictive AI models function and their relevance to marketing
- Describe how ensembling techniques work to prevent model overfitting
- Recognize how pattern identification models find insights in data for marketing purposes
- Leverage prompt engineering strategies to get the most out of generative AI tools
- Explain how decisioning agents make automated choices in marketing scenarios
- Identify common problems that necessitate data cleaning and methods for handling missing data.
Supervised Learning (Predictive AI)
What is Predictive AI (Supervised Learning)?
Supervised learning, also known as predictive AI, is a type of machine learning where a model learns from clearly labelled historical data that includes known outcomes or an "answer key."
For example, if a marketing team wants to use supervised learning to predict which customers are most likely to make a purchase, they could train a model on historical data that includes customer information and whether they made a purchase or not. This process allows the model to identify patterns and then use these learned patterns to predict future outcomes for new, unseen situations where the answer is not yet known.
Training Predictive Models
To effectively train predictive models, the historical data is typically split into two distinct sets:
- A training set, also called in-sample data.
- A testing set, also called out-of-sample data.
The in-sample data is used to build and train the model so it can learn to make accurate predictions. It is also a larger part of the historical dataset. A smaller, separate portion of data is set aside and used as the testing set. This is the out-of-sample data. It remains unseen by the model during the training phase and is used to test and simulate how the model would perform on new-real-world data.
The split into training and testing sets is crucial for evaluating how well a model processes new information. If a model performs well only on the data it was trained on but poorly on the testing data, which is the data it has never seen before, it indicates a problem called **overfitting. **We’ll discuss overfitting in the next lesson, but for now understand that overfitting skews the results of predictive models. Testing with out-of-sample data prevents this issue.
Decision Tree Models in Predictive Modeling: An AI Flowchart
Components of a Decision Tree
To explain how decision trees work in supervised learning, let’s walk through an example.
A skincare brand launching a premium anti-aging line wants to predict which users to send an early access promotion to.
Select the numbered icons below to learn more about the components of a decision tree used in this example.
Decision trees are useful tools in predictive modeling because they are easy for humans to interpret, while also capturing complex, non-linear relationships. They are also the basis for more advanced non-linear models, which we will cover in the next lesson.
How Marketers Can Leverage Supervised Learning
Now that you know how predictive models work, select the options below to learn about how supervised learning can be leveraged in common marketing use cases:
Supervised Learning Use Case
Select the tabs to learn more about how one brand used supervised learning to identify at-risk users and send targeted reactivation campaigns:
Enhancing Predictions with Ensembling
In the previous lesson, you learned about supervised learning, a type of machine learning that uses historical data with known outcomes to build models that make predictions about future events. The models often use decision trees to come to a specific prediction.
While a single predictive model can be useful, it's often prone to making inaccurate predictions due to **overfitting**.
What is Overfitting?
Let’s revisit the Steppington predictive churn model examined in the previous lesson. What would happen if the predictive model struggled with overfitting and produced inaccurate predictions instead?
The model uses a decision tree to identify users at risk of canceling their subscriptions. During training, the decision tree learned a very specific pattern: Users who only completed yoga workouts in June and had exactly three incomplete strength training sessions are likely to churn.
While this pattern existed in the historical data, it's too unusual and specific to be applied as a general pattern. Because the model learned this rigid rule, it made accurate predictions on the data it was trained on but was inaccurate when applied to new users.
Ensembling: The Power of Teamwork
It is always a challenge trying to maximize a model's accuracy on a training set without overfitting. One way to improve accuracy without overfitting is to use **ensembling**.
Instead of relying on a single model to make a prediction, ensembling leverages the combined logic of several models to improve performance and reduce overfitting issues. Ensembling reduces the ability of a model to memorize quirks in the data, resulting in a more reliable and generalized prediction.
The two ensembling techniques we will cover in this lesson are **gradient boosting** and the** random forest model**. Both of these techniques combine multiple decision trees, but in different ways and are useful in different situations.
Gradient Boosting
How It Works
- Start with a Simple Model: The first decision tree makes a basic guess about every customer's churn risk. Naturally, it makes many mistakes.
- Focus on the Errors: The model calculates the differences between its predictions and the actual outcomes. These differences are the mistakes.
- Correct the Mistakes: The next decision tree is trained on the mistakes, not on the original data. Its job is to predict the errors of the first model.
- Repeat and Refine: This process is repeated over and over. Each new tree learns from the errors of the entire ensemble of trees that came before it. This iterative, error-correcting process is what makes gradient boosting so powerful.
- Final Prediction: The final prediction is the sum of the predictions from all the trees, with each tree's contribution being a small correction to the overall prediction.
Gradient Boosting Example
Let’s revisit the prediction churn model from Steppington. In this example, Steppington will use gradient boosting to predict customer churn.
The gradient boosting model is trained on historical customer data, including workout frequency, subscription tier, and engagement with marketing emails. The first tree might predict a customer's churn risk based on their workout frequency. The second tree would then focus on the customer predictions the first tree got wrong. For example, the first tree predicted all customers with low workout frequencies will churn. The second tree found that those with low workout frequency but high email engagement did not churn.
By iteratively correcting these errors, the final gradient boosting model would provide an accurate prediction of which users are likely to cancel their subscription, allowing the marketing team to proactively send personalized re-engagement messages or special offers to those specific at-risk customers.
While gradient boosting can result in high predictive accuracy, it can be prone to overfitting if not carefully tuned during training.
Random Forest Models
How It Works
- Build Multiple Decision Trees: Instead of using just one decision tree, a random forest constructs many trees independently and in parallel.
- Introduce Randomness: To ensure each tree produces diverse predictions, randomness is introduced during their creation. This involves using different, random subsets of the original data and randomly selecting which features (or filters) to use for the splits within the tree. This results in each tree learning differently.
- Individual Predictions: Each of these independently built decision trees then makes its own prediction using their unique subset of data.
- Combine Predictions: The final prediction of the random forest model is made by combining the predictions from all the individual trees. This is often done by having them "vote" on the most likely outcome or by averaging their predictions.
Benefits of the Random Forest Model
Select the options below to learn more about how random forest models reduce overfitting and errors:
Random Forest Model Example
Let’s return to the prediction churn model from Steppington. In this example, Steppington will use a **random forest model** to predict customer churn.
The model is trained on the same historical customer data set: demographic information, completed workouts, last completed workout date, as well as subscription tier, and engagement with marketing emails. Unlike gradient boosting, a random forest doesn't train trees one by one to fix mistakes. Instead, it trains many trees at the same time, each on a different random subset of the data.
For example, one tree might learn to predict churn based on **last completed workout date **and **subscription tier**, while another tree might focus on **email engagement** and **demographics**. Each tree learns a different set of patterns.
When a new customer's data is entered, each individual tree makes its own churn prediction (a "vote"). The random forest then combines all these votes to arrive at a final, more reliable prediction. If most of the trees vote that a customer is "at-risk," the model's final prediction will be "at-risk," allowing the marketing team to proactively send personalized messages or special offers to that customer.
Gradient Boosting vs Random Forests
Both ensembling techniques can ensure improved predictive outcomes and reduce overfitting. However, they both suit different use cases:
Gradient Boosting
- High Predictive Accuracy: Gradient boosting can result in more accurate predictions than a random forest because it is constantly learning and correcting its predictions.
- Complex data: Gradient boosting can capture intricate patterns in large, complex datasets more effectively than random forests because of its iterative and self-correcting approach.
Random Forests
- Overfitting Concerns: Random forests are better suited to situations where overfitting is a concern because they are less likely to learn the "noise" in the training data too well, leading to more reliable performance on new, unseen data.
- Computational Efficiency: Random forests can process large data sets more efficiently since trees are built in parallel.
Unsupervised Learning (Pattern Identification)
What is Unsupervised Learning (Pattern Identification)?
Unsupervised learning, or pattern identification, is a type of machine learning that analyzes historical data to identify trends, patterns, or clusters of similar items without a predefined "answer key." Instead of being told what to predict, unsupervised models are given raw data and tasked with finding inherent structures, groupings, or relationships within it.
Supervised Learning vs Unsupervised Learning
Unlike supervised learning, the goal of unsupervised learning is to **generalize patterns from data that were not already known**. There isn't a "right or wrong answer" that the model is trained on.
Supervised learning models are provided with labelled data with clear outcomes (i.e. this user churned), and asked to predict specific outcomes. Unsupervised learning is adept at **discovering hidden insights** that might not be immediately obvious to humans due to the sheer volume and complexity of the data.
Example
For example, Movie Canon, a movie streaming service, could use supervised learning to power its recommendation engine. The model would be trained on historical, **labeled** data where it already knows which users watched and enjoyed specific movies. The model learns to predict what new movies a customer will enjoy based on their past viewing habits and characteristics like age and location. Movie Canon can then recommend similar movies to the customers predicted to enjoy them.
At the same time, Movie Canon could feed its **unlabeled** historical data into an unsupervised learning model to understand its customer base better. The model would find hidden patterns and automatically group customers into segments, such as "True Crime Documentary Buffs" or "Jason Statham Fans." These were not customer segments previously known by Movie Canon. Movie Canon can then use these newly discovered groups to curate personalized content and create targeted marketing campaigns for each one.
Clustering: A Key Technique to Uncover Patterns
One prominent technique within unsupervised learning is **clustering**.
Clustering can be used for advanced customer segmentation that goes beyond simple, rule-based divisions. This allows marketers to uncover more nuanced groupings within their customer base.
For example, a marketing team could use clustering to discover groups of customers who behave similarly, such as "frequent shoppers" who visit the website daily, "deal hunters" who only buy during sales, and "seasonal buyers" who shop for holidays. These newly identified groups provide valuable insights that a brand can then use to create more personalized marketing campaigns or special offers for each segment.
How It Works
- Data Collection: A clustering algorithm starts with an unlabeled dataset, such as Movie Canon's user data, which includes information like a user's age, viewing history, and favorite genres. There are no pre-existing labels to indicate if a user is a "Family Viewer" or a "Horror Buff."
- Finding Similarities: The algorithm analyzes the data to find similarities between users. It discovers that users who frequently watch independent films and critically acclaimed dramas are very similar to each other, but very different from users who prefer animated movies and family comedies.
Creating Clusters: Based on these similarities, the algorithm automatically creates "clusters" or groups. It creates one cluster for "Art-House Film Lovers" and another for "Family Night Viewers." - Interpretation and Application: Once the clusters are formed, Movie Canon must interpret what each group represents. They can then use these insights to create personalized campaigns. For instance, they send an email with the subject line, "Discover hidden gems from the Art-House collection!" to the "Art-House Film Lovers" cluster.
The Value of Unsupervised Learning
Unsupervised learning is a valuable machine learning technique that allows marketers to:
- Discover hidden patterns in your customer data that would be impossible to find manually
- Understand your customers more deeply by identifying trends in their behaviors
- Improve message targeting by building campaigns around the patterns and trends identified
How Can Marketers Leverage Unsupervised Learning
Select the options below to learn how marketers can use unsupervised learning to improve audience targeting:
Generative AI
What is Generative AI?
Generative AI is a type of machine learning that **creates new content** such as text, video, or images in response to a user prompt. It operates by analyzing and learning patterns from large datasets so that they can produce content based on the observed patterns, aiming to produce content that is as realistic as possible based on its training data. One of the most common types of generative AI today are **Large Language Models**.
LLMs function by predicting the next most probable token in a sequence, much like an autocomplete function. Tokens can be a word in a sentence, a pixel in an image, or a frame in a video. Although LLMs like ChatGPT can understand complex language, their responses are simulations derived from pre-existing content, rather than genuine analytical processes like those of a human brain.
### Examples of Generative AI
You may have already interacted with and used popular forms of generative AI! A few examples of generative AI include:
- ChatGPT by OpenAI
- Gemini by Google
- Copilot by Microsoft
- The AI Copywriting Assistant by Braze
How Marketers Can Leverage Generative AI
Now that you know how generative AI models work, select the options below to learn how they can be applied to marketing use cases.
Get The Most Out Of LLMs
LLMs are highly sensitive to the prompts you enter, so how you interact with LLMs and write your prompts will result in vastly different responses. **Prompt engineering** is a strategy you can employ to ensure you receive the desired output.
Carefully crafting your prompts is essential because slight changes in phrasing can lead to vastly different responses that vary in quality. By learning to write effective prompts, you can transform LLMs from a simple chatbot into a powerful tool that consistently delivers relevant content.
Poorly Crafted Prompts
What happens when you don’t prompt an LLM well? Let’s look at an example prompt from a food delivery app, Calorie Rocket:
Reinforcement Learning (Decisioning)
What is Reinforcement Learning or Decisioning?
Reinforcement learning (RL) is a type of machine learning where an AI agent learns to make decisions by taking actions and getting rewarded or penalized for it, similar to the way humans learn through trial and error.
How It Works
Reinforcement learning models use an AI decisioning agent that is trained through a continuous cycle of **trial and error**. The process begins by giving the agent a specific goal, such as increasing conversion rates, and a set of possible actions it can take to achieve that goal. The agent then takes an action and receives immediate feedback—a reward for a positive outcome or a penalty for a negative one.
Based on this feedback, the agent learns and adjusts its strategy, refining its decisions to maximize rewards over time. This cycle of taking an action, receiving feedback, and learning is repeated continuously, allowing the agent to adapt and improve its performance in real time to achieve its defined objective.
In contrast to supervised learning models that focus on making predictions, RL agents take actions. A supervised model aims for an **accurate prediction**, while an RL model aims for the **best possible decision**.
Reinforcement Learning Concepts
A decisioning agent's main goal is to learn how to achieve an objective (i.e. increase conversions) by maximizing its total rewards (i.e. users making purchases) over time. The core challenge in doing this is balancing the **exploitation-exploration trade-off**.
An example of this trade-off is **A/B testing**. Initially, a company might explore by showing different versions of a webpage to various user groups to see which one performs best. Once a clear winner is determined, the company exploits that knowledge by showing the winning version to all users. This process demonstrates a simple, yet effective way to navigate the exploitation-exploration trade-off.
How Marketers Can Leverage Reinforcement Learning
Select the options below to learn about how decisioning agents can be leveraged in common marketing use cases:
Data Preparation for Machine Learning
The Importance of Data Cleaning
AI models rely on data to make predictions, identify patterns and make decisions. However, the effectiveness of all of these outcomes depends on the data collected. AI outcomes are only as good as the data it was trained on.
But what happens when there is missing data, inconsistent data quality, or data is scattered across different platforms? The result is inaccurate data and inaccurate outcomes.
To overcome this challenge,** data cleaning** is an essential step for brands to take before training AI models to ensure the efficacy of the data used.
Common Data Problems
So what are common data problems brands run into when attempting to train their machine learning models? Select the numbered icons below to learn more.
Strategies For Handling Missing Data
Select the options below to learn more about strategies for handling missing data to ensure the reliability of your machine learning models:
Knowledge Check
Complete the following quiz to ensure you've fully grasped the key concepts from this course.
Wrap Up
Let's review some of the key takeaways covered in this course.
Machine learning is type of artificial intelligence that allows computers to learn from data to make predictions or decisions. In this course, you explored four key types of machine learning: **prediction**, **pattern identification**, **generation**, and **decisioning**.
- Supervised learning (prediction) relies on using labelled historical data. Predictive models learn from historical outcomes and use that data to predict future outcomes. You saw how these models use in-sample data for training and out-of-sample data for testing to prevent **overfitting**, a problem where a model learns "noise" instead of the true underlying patterns. To further boost accuracy and prevent overfitting, you learned about **ensembling** techniques like **gradient boosting** (which builds trees sequentially to fix errors) and **Random Forest models** (which combine many trees trained on different data subsets).
- Unsupervised learning (pattern identification) is a type of machine learning that analyzes historical data to identify trends, patterns, or clusters of similar items without a predefined "answer key." A key technique here is **clustering**, which automatically groups similar data points together.
- Generative AI is a type of machine learning that creates new content such as text, video, or images in response to a user prompt. You learned about a type of generative AI, Large Language Models (LLMs), can be used for content creation and personalization at scale.
- Finally, Reinforcement Learning (Decisioning) is a type of machine learning where an AI agent learns to make decisions by taking actions and getting rewarded or penalized for it. RL models must balance exploration (trying new things) and exploitation (using what it already knows) to find the best possible outcome.
Before training any of these models, remember that **data cleaning** is crucial to ensure the data is accurate and reliable. You looked at common issues like missing or inconsistent data and explored methods like imputing values and removing data to handle them. Remember, the quality of your data directly impacts the quality of your AI's outcomes!
What's Next?
In the next course on Generative AI, you'll learn about:
- the function of a token in the context of large language models (LLMs) and generative AI
- the importance of prompt engineering and common prompt engineering techniques
- the importance of context engineering
- the difference between reasoning models and traditional LLMs
- the key components of an Agentic AI system, including Tools, Memory, Planning, Agent
Generative AI Fundamentals
Understand the fundamental concepts of generative artificial intelligence and its various applications.
Introduction to Generative AI
Generative AI is a type of artificial intelligence that can create new content, such as text, images, or audio, from a given prompt. It is able to accomplish this by using Large Language Models (LLMs). LLMs operate much like a highly advanced autocomplete function. By analyzing training data, LLMs predict the next likely token in a sequence to produce a realistic output.
What You Will Learn in This Course
In this course, you will discover core concepts of generative AI, prompt and context engineering, and how you can use them to help you achieve optimal performance from your AI models.
By the end of this course, you’ll be able to:
- Explain the function of a token in the context of large language models (LLMs) and generative AI
- Explain the importance of prompt engineering
- Demonstrate the most common prompt engineering techniques
- Explain the importance of context engineering
- Explain the difference between reasoning models and traditional LLMs
- Describe the key components of an agentic AI system, including tools, memory, and planning
Maximize Your AI Output
Large Language Models (LLMs) are highly sensitive to the prompts you enter; how you interact with them and write your prompts can produce very different results. The quality of your prompt directly affects the quality of the LLMs output—this is where prompt engineering comes in.
Prompt engineering is the process of writing and refining prompts with specific context and constraints to steer the LLM's powerful "autocomplete" function toward generating the content you want. This effective strategy ensures you consistently produce accurate, relevant content and establish reliable patterns for interacting with these models in order to get your desired output.
There are many different prompt engineering techniques you can utilize when prompting your AI model. Learn more about each technique by selecting the numbered icons below.
Going Beyond Prompt Engineering
Your prompt isn’t the only way you can provide information to a large language model. For more powerful applications, you can combine prompt engineering with another technique called **context engineering** to unlock an AI’s full potential.
Context engineering is a more advanced way of providing an AI model with information. It provides your model with all the background information, or context, that it needs to have “a full picture” before generating a response. This context can include:
- Conversation history: What has already been said
- User data: Information about the person using the AI
- External documents: Access to files or databases
- Specific rules: Guidelines on what the AI should and should not do
Imagine a marketer building a campaign for a new serum. The **prompt engineering** approach is straightforward: they give an AI a simple command like, _"Write a 3-paragraph email for a new anti-aging serum using a professional and luxurious tone."_ This produces a polished but one-size-fits-all email.
In contrast, **context engineering** allows the marketer to build a smarter system. They would integrate customer data—like purchase history and loyalty status—and create a dynamic email template. The AI would then use all of this contextual information to generate unique messages that are relevant to each customer's individual relationship with the brand.
The Emergence of Agentic AI
The Rise of Reasoning
Are LLMs actually capable of “thinking”?
When LLMs were originally released, they were effective for tasks like brainstorming or converting content formats, but struggled with strategic thinking, generating nuanced copy without human intervention, or solving complex math and logic problems.
This was because their "reasoning" was often a simulation derived from pre-existing content where humans have already performed the actual reasoning, rather than genuinely reasoning themselves.
However, new capabilities have emerged that are designed to have AI models incorporate more structured thinking or a logic chain before generating an answer. This type of AI is referred to as a **reasoning model**, which aims to emulate human reasoning to generate answers and are expected to check their work.
Advancements in AI have enabled models to move beyond simple content generation to perform decision-making and continuous learning, leading to the rise of a new category of products and companies known as** agentic AI.**
What is Agentic AI?
Agentic AI can be defined as when you give an AI system agency to take actions or complete tasks on your behalf.
Agentic AI refers to artificial intelligence systems that use “agents” designed to perform tasks by taking actions, planning, and often leveraging memory. Review the key capabilities of an agentic AI model below:
- Autonomy: Agentic AI can initiate and complete tasks without constant human oversight.
- Goal-Driven: Agentic AI systems operate with clear objectives and break down complex goals into smaller, executable tasks.
- Reasoning and Planning: Agentic AI uses large language models as a “brain” to plan—analyzing data, understanding context, and deriving a strategy to achieve its goal.
- Execution: Agentic AI can take real-world actions by using tools, interacting with external systems (like APIs and databases), or providing responses to users.
- Adaptability: Agentic AI can learn from its environment and adapt its plans in real time to overcome challenges or incorporate new information.
How Does Agentic AI Work?
Agentic AI systems often require coordinating across multiple capabilities, including planning, using tools, and maintaining context or memory throughout the activities involved.
Planning
First, agentic AI uses two techniques, subgoal and decomposition, to break down a big goal into smaller, simpler steps. This is like a Braze marketer breaking down the task of "send an email campaign" into "write the email copy," "create a segment to send to," and "add a campaign conversion event".
The agent also uses reflection and refinement to learn from its past actions. If a step didn't work, the agent can "think" about what went wrong and adjust its approach for next time. This self-correction allows the agent to get better over time.
Memory
An AI agent needs to remember information to complete a task. It has two types of memory:
- Short-term memory: This is temporary information that the agent uses for the current task, such as everything you've said in the current conversation.
- Long-term memory: This is information it needs to remember for a long time to achieve its goal. It does so by using an external database to store and quickly recall large amounts of information.
Tools
Finally, agentic AI can utilize different tools to execute its task. These tools include access and use of external programs or databases—like a web browser, a calculator, or a company's sales data—to get real-time or specific information it doesn't already know. This allows the AI to perform a wide range of actions and access information that isn't included in its training.
Wrap Up
In this course, you learned how to:
- Explain the function of a token in the context of large language models (LLMs) and generative AI
- Explain the importance of prompt engineering
- Demonstrate the most common prompt engineering techniques
- Explain the importance of context engineering
- Explain the difference between reasoning models and traditional LLMs
- Describe the key components of an agentic AI system, including Tools, Memory, and Planning
What’s Next
In the final course of the AI Fundamentals Learning Path, you'll learn about reinforcement learning and how you can use it to create personalized marketing experiences.
Once you've completed this path, you'll be ready to take the Braze AI Fundamentals Certification exam to validate your knowledge on the topic. Learn more about the [Braze AI Fundamentals Certification](https://learning.braze.com/braze-certified-ai-fundamentals/2332880)_ _on Braze Learning.
Reinforcement Learning Fundamentals
Understand how decisioning agents learn and make decisions
Introduction to Decisioning
The Personalization Bottleneck
The goal of modern marketing is to achieve the gold standard of personalization: delivering the right message, with the right product, on the right channel, at the right time, for each customer.
However, many traditional personalization methods, such as A/B testing or rule-based segmentation, fall short of true 1:1 personalization at scale. These methods are not designed to handle the growing audiences and infinite number of customer journeys that brands now face. This creates a significant bottleneck for achieving this personalization gold standard.
One solution that is gaining popularity is the use of reinforcement learning models. **Reinforcement learning** (RL) models, also known as AI decisioning agents, are sophisticated AI tools that allow brands to make the right decisions for each individual customer. They learn and adapt in real time, enabling the kind of precise, individual-level personalization that traditional methods cannot provide.
What is Reinforcement Learning (AI Decisioning)?
Reinforcement learning involves an AI agent attempting to achieve a specific outcome by iteratively performing actions and receiving rewards or penalties in response. The agent then modifies its future behavior to maximize rewards over time.
How It Works
Select the numbered icons to learn how a reinforcement learning agent works:
Reinforcement Learning in Marketing
Reinforcement learning is uniquely suited for marketing scenarios where the goal is to optimize a series of sequential decisions to achieve a specific outcome. Here are common examples of reinforcement learning in marketing:
AI Decisioning vs Predictive AI
Supervised learning or predictive AI is a form of machine learning that uses labelled, historical data to predict future outcomes. Reinforcement learning focuses on finding the best action to achieve a goal. While predictive AI provides insights without telling marketers what actions to take, an RL agent actually makes decisions and takes actions. This is the key difference that allows the two types of AI to work together.
Let's look at an example to see how a brand can use both.
What You Will Learn in This Course
This course will teach you how decisioning agents learn and make the optimal decisions to meet specific marketing goals. By the end of this course, you will be able to:
- Describe the explore-exploit tradeoff in reinforcement learning
- Explain how to navigate the explore-exploit tradeoff with multi-armed bandits and contextual bandits
- Identify strategies for solving multi-armed bandit problems
- Evaluate the advantages and disadvantages of contextual bandits compared to multi-armed bandits
- Explain how customer features, environmental features and action features can help reinforcement learning agents drive more personalized experiences
Core Reinforcement Learning Concepts
How Does an RL Agent Make Decisions?
Reinforcement learning agents are provided with several decisions they can make in order to find the best action and achieve their goal. In order to find the best action, RL agents must navigate **exploiting** and **exploring** the many decisions they can make.
What is the Exploitation-Exploration Trade-Off?
**Exploration **involves **trying new, unproven options** to discover potentially better outcomes or to gain more information.
**Exploitation **involves **leveraging the options that are already known** to yield the best rewards based on current knowledge.
The exploitation-exploration trade-off is trying to find the right balance between these two. If an agent only exploits, it will miss out on potentially better options. If it only explores, it will make a lot of mistakes and never fully take advantage of what it has already learned.
Exploiting vs. Exploring in Everyday Life
The exploration-exploitation trade-off is a fundamental concept in reinforcement learning, but it's also something you navigate every day. When deciding what to watch tonight, do you put on your favorite sitcom that always makes you laugh (exploiting)? Or do you watch that new show your coworkers can't stop talking about (exploring)? Every day you choose between sticking with your tried-and-true options, like your go-to restaurant, barber, or TV show, and risking trying new ones that could provide a potentially better experience. This is the key problem RL agents have to navigate as well.
Exploiting and Exploring in Marketing
Let's examine a marketing example of the exploration-exploitation trade-off that you're likely already familiar with: **A/B testing**.
Brands often test different versions of a message to see which one performs best. For instance, they might create four different email variants, each with a unique subject line, body copy, or image. Initially, they might send each variant to 25% of their audience. Once they see which message performs best, they exploit that knowledge by sending that winning variant to 100% of their future audience. Reinforcement learning operates on this same basic logic, but in a far more complex way.
When you conduct an A/B testing however, you end up losing a lot of value by showing suboptimal experiences to a large number of customers during the experiment phase. **Multi-armed bandits** are a reinforcement learning technique that allows you to get the best answer for a population faster and more efficiently than with A/B testing. But that still only optimizes at a segment or group level. If you want to optimize down to each individual customer, we'll introduce a more advanced framework called **contextual bandits**.
In the next lesson, let’s look at multi-armed bandits.
Multi-Armed Bandits
What Is a Multi-Armed Bandit?
To understand how a multi-armed bandit works, let's look at a real-world example: playing the slots!
Imagine you're at a casino and there's a row of 10 slot machines in front of you. You have 1,000 coins to use, and your goal is to make as much money as possible. Each machine has a different, unknown payout rate. Since you’re facing multiple machines at once, this situation is called the **multi-armed bandit problem**. The multi-armed bandit is a metaphor for a classic problem in decision-making, and it is named after the "one-armed bandit," a colloquial term for a slot machine. The problem involves a gambler facing multiple slot machines, where the goal is to figure out which machine offers the best payout by repeatedly choosing which one to play.
You put your first coin in machine #7 and get five coins back. You now know this machine has a chance of paying out. You are faced with a choice: do you **explore** your other options by putting coins in different machines, or do you **exploit** the knowledge you already have about which machine gives the best rewards? As you continue to spend your coins, you might settle on a particular machine you think will give the best payout, or you might keep trying to learn more about the other machines.
In a marketing context, the actions—the array of slot machines—are the various choices (or “multi-arms”) a marketer might make. Instead of learning which slot machines pay out the most money, the multi-armed bandit is learning which subject lines, message copy, sending time or frequency generate the most conversions. Just as in the case of the slot machines, the central problem is how to balance exploration and exploitation.
Multi-Arm Bandit Learning Strategies (Policies)
Multi-armed bandits can solve the problem of deciding when to explore vs when to exploit using a few different strategies. Select the numbered icons below to learn more about these strategies (also known as policies).
Use Case: Optimizing Email Subject Lines
Let’s look at how a brand can leverage both strategies using a specific use case. Pyrite Financial is a financial services brand launching a new premium credit card. They plan to promote the new product by sending an email campaign and they want to test email subject lines to increase user open rates. They have created five different subject lines they want to test.
Select the options below to learn more about how they could leverage either an epsilon-greedy or epsilon-decay strategy:
Limitations to Multi-Armed Bandits
A major limitation when using MAB’s is that they are unable to differentiate between individual customers. An MAB focuses on finding the “big winner” for a user group, rather than personalizing the action for each user.
Let’s see how this could be a problem through a use case.
The single "best" recommendation wasn't the best for everyone, and the MAB didn't have the context to figure that out.
In scenarios where deeper personalization is the goal, **contextual bandits** are the preferred type of decisioning agent.
Contextual Bandits
What is a Contextual Bandit?
A contextual bandit looks at the situation (the "context") before making a decision. This context could be a user's location, their browsing history, the time of day, or anything else that's relevant. They don't just learn which actions are generally best; they learn which actions are best for a specific situation or user.
How Contextual Bandits Use Context
Contextual bandits use context to improve decision-making and maximize rewards. By understanding how different contexts correspond to different outcomes, they can better exploit what they've learned. This allows the model to apply knowledge from various contexts when making decisions, even about customers with limited information.
For example, a contextual bandit model learns that people in Toronto buy more winter jackets, especially in November. When a new customer enters the model's audience, they may not live in Toronto but they do live in Canada, and it's currently November. The model can still apply the knowledge it learned to recommend a promotion on winter jackets, as they're likely to respond.
Types of Contextual Features
Select the numbered icons below to learn more about the type of features, or contexts, that contextual bandits can consider when making decisions.
Action Features
**Action features** describe the qualities of the choices a contextual bandit can make. They help the system understand **why** some choices are better than others.
Instead of just learning that "Option A" works well, the model learns that "Option A" works well because of its specific attributes. This lets the system make smart recommendations, even for new options it has never seen before.
For example, when Pyrite Financial recommends accounts to a new customer, it could use action features about the account, like:
- Type of account: Is it a savings or checking account?
- Account features: Does it have features such as no minimum balance or unlimited transactions?
- Promotions: Does it come with a special bonus, like "get a $50 bonus for opening this account"?
By using these features, the system might learn that new customers under the age of 35 who want to save for retirement are more likely to respond to a high-risk investment account, even if it hasn't directly tested that exact combination before.
Contextual Bandits Use Case
To see how contextual bandits can provide personalized messaging for users, let’s revisit the credit card recommendation use case for Pyrite Financial. By using a multi-armed bandit, Pyrite Financial originally recommended the PY Cobalt Card to the majority of its users. The goal of this campaign is to maximize the number of users who have signed up for a credit card.
In this use case, let's see how a contextual bandit provides a highly-personalized credit card recommendation for a user named Louise.
Pyrite Financial’s RL agent considers the following features when deciding what to recommend:
The Personalized Outcome
Based on the combination of all these features, the contextual bandit analyzes Louise's profile. Her age and high household income suggest she is financially stable and could be interested in premium products. The timing (start of vacation season) and low interest rates indicate that she may be planning to travel and could be in a good position to take on a new card with a higher fee if it offers significant travel benefits.
The contextual bandit decides that Louise will be most likely to respond to a recommendation for the **PY Platinum Card**. It understands that the card's premium action features align perfectly with the current environmental factors and Louise’s financial situation.
The system then presents Louise with a personalized offer for the PY Platinum Card, highlighting its travel perks. By using all of the features together, the contextual bandit has made a smart, tailored recommendation that is much more likely to result in a successful sign-up than a generic offer would be.
Contextual Bandits vs. Multi-Armed Bandits
Benefits Of Contextual Bandits Over Multi-Armed Bandits
Select the options below to learn more about the benefits contextual bandits can provide when compared to MABs:
Challenges of Using Contextual Bandits
Select the options below to learn more about the challenges of using contextual bandits when compared to MABs:
Wrap Up
This course introduced you to the fundamentals of reinforcement learning (RL) and its applications in marketing use cases. You learned how an RL agent, or AI decisioning agent, makes decisions through a **continuous cycle of taking actions, receiving feedback in the form of rewards or penalties**, and adjusting its behavior to maximize a specific goal. This distinguishes it from supervised learning, which uses historical data to make predictions rather than active decisions.
You also explored the central challenge for any RL agent: **navigating the explore-exploit trade-off**, which involves balancing trying new options (exploring) with using known successful ones (exploiting). To solve this challenge, you learned about two common types of RL agents: **multi-armed bandits (MABs)** and **contextual bandits**.
You learned about how MABs use strategies (also called policies) like **epsilon-greedy** and **epsilon-decay** to find the single best option for a group of users. You also learned that contextual bandits are the preferred choice for achieving true 1:1 personalization because they use various types of context, like customer features, environmental features, and action features, to make smart, personalized decisions for each individual.