Share
Explore

Building "Deep Brew": The Minimal Viable Product

How StarBucks uses AI to connect with each individual Customer:
Goal =Mass personalization: Create a Marketing Plan for each individual customer:
Why:
Maximize customers, and customer engagement → Customer Satisfaction and Profit.
image.png
Learning Point 1: AI is what business users thought that the Internet was back in the 1990s
The Internet was originally visioned as being The Global Brain.
In fact, the Internet was the Global Filing Cabinet. You can put lots of information onto web servers (in the Database partition) →But this did not mean that you could personalize that experience of every user connecting to a Web Site.

Lab Exercise: Building our own Deep Brew


We will use this case study to introduce and create some understanding context around our Course Outline
Topics of:
CI / CD Building and Deployment Process: (How will you serve up your Model for customers to interact with)
Continually train and update the Model for SRE (Safety and Reliability Engineering),
Preventing Model Drift. And achieving Safety in our AI MODEL.
AI Safety means: Creating “alignments” in how your model will converse with users to not present any “bad” content.
megaphone

# Researching ​Searching for **AI model safety engineering case studies 2024**

Searching for **Companies implementing AI safety measures in models**
Searching for **Latest references on AI model safety engineering**
# Current Case Studies on AI Model Safety Engineering
## Industry Commitments to AI Safety
Major tech companies like Microsoft, Amazon, and IBM have made a public commitment to AI safety by pledging to publish the safety measures they are implementing when developing foundation models. These models are versatile AI systems capable of handling various types of data inputs, such as images and text, and are designed for a wide range of applications. Sixteen companies in total have agreed to this pledge, which includes a commitment not to develop or deploy AI models if the associated risks cannot be adequately controlled or mitigated. They will also outline the risks posed by their models and their plans for safe deployment. These findings are expected to be published before the next AI safety summit in 2025.
## Case Studies in Safety Engineering Frameworks
A case study involving text-to-image models applied two established safety engineering frameworks, FMEA and STPA, to the ML product development pipeline. This analysis revealed a range of potential failures and hazards, including social and ethical risks, by examining interactions between ML models, users, and development teams, as well as data preparation and usage workflows.
## AI Safety in Safety-Critical Systems
AI is increasingly being used in autonomous systems that are safety-critical, meaning that failures could lead to severe consequences. Examples include self-driving cars, surgical robots, and unmanned aerial vehicles. Research in AI safety for these systems is crucial and multidisciplinary, involving AI, software engineering, safety engineering, and ethics. The field aims to improve safety and provide certifiably safe AI-powered systems.
## AI Integration in the Aviation Industry
The aviation industry has been integrating AI into various operations. Companies like Delta Air Lines, Southwest Airlines, Airbus, Boeing, and United Airlines have all embarked on AI-driven initiatives to enhance their services and operations.
## Benchmarking AI Safety
MLCommons has established an AI safety working group to develop benchmarks for AI safety, with the first benchmark focusing on large language models. These benchmarks are designed to address a range of hazard categories and are developed in collaboration with experts and civil society groups. The working group is open to all professionals in the field.
## Diverse Applications of AI
Case studies across various industries showcase the diverse applications of AI. These include IBM Watson Health in patient care, Google DeepMind's AlphaFold in protein folding, Amazon in supply chain management, Tesla in autonomous vehicles, and many more. Each case study provides insights into how AI is revolutionizing different sectors, from retail and entertainment to banking and healthcare.
In summary, companies are actively engaging in AI model safety engineering by committing to transparency in safety measures, applying safety engineering frameworks to development pipelines, focusing on safety-critical systems, and benchmarking AI safety. Case studies from various industries demonstrate the breadth of AI applications and the importance of safety in its deployment.

Big Data, JSON: How the AI Model maintains it conversational memory.
See some practical examples of how AI Models are integrated into Business Processes.

3 Step Formula for Career Success:

Look for things to get excited about and
Become skillful at presenting and delivering ways to make it happen
Become the Recognized Thought Leader in getting things done in that field: Find and develop a specialization:
Emerging Job Trends:
AI safety specialist
AI System Administrator
Cognitive Systems trainer

megaphone

The Tale of Starbucks and Mass Personalization

Once upon a time, in the bustling city of Seattle, there lived a coffee company called Starbucks. Known for its iconic green and white logo, Starbucks was a renowned establishment known for its high-quality coffee persented in a uniquely engaging scene, and exceptional customer service.
What does Starbucks sell?
The Experience of being in a classical European Coffee Shop.
However, the company realized that to offer a truly personalized experience to its customers, it would need to harness the power of technology: How to find out every thing about each individual customer.
The Goal: The Internet and Mass Personalization
The dream of mass personalization had long been pursued by Starbucks.
Internet: Good as a COLLECTOR of information, not so much as a PRESENTER of customized personal information.
The Internet provided an ideal platform for this vision, as it allowed the company to collect vast amounts of customer data and leverage it to deliver tailored recommendations and interactions.
However, despite their efforts, Starbucks faced significant challenges in achieving this goal.
The Limitations of Traditional Marketing Approaches

3 Core Drivers of the Model of How Emerging Technologies evolve - and therefore how we can predict emerging business opportunties and cut ourselves a slice of the Pie:
Technology enablement:
As new technologies emerge:
New tools become cost-affordable and every one wants them: Killer apps emerge as many consumers start interacting with these technologies: 1980s: PC computer killer app: Word Processing. Databases grew up in companies to manage their data.
1990s: The Internet became available for Public Use. Synergies and interconnections grew: All these small personal computers got hooked together and formed “islands of data”. →Small bottom-up data warehouses grew up.
Mid 90s to mid 2000s : Smart Phones and ubiquitous public (free) WIFI)
This synergy of smart phones and wifi gave rise to “BIG DATA”:
4 Vs:
Volume : LOTS of data flooding in from smart phones, cameras Velocity: Coming in Very Quickly Veracity: How truthful is this data? Variety: LOTS of different formats of data (e.g. BIOMETRICS)
Emerging Business Models: (FB, ABNB, Amazon, Uber). These business built their brand becuase some people somewhere formed and sold an exciting Vision of how some new technology could be applied to doing a better jobs of creating valuable outputs that people want and are willing to pay for:
The Platform business model is superseding the old school “Pipeline” Business Model.
Amazon’s Business Model:
Financial Escrow Service: My money is safe.
Reputational Service.
Emerging Public Sentiment and Consumer Acceptance and Demand:
Social Media : connect, communicate, build shared narratives and communities of Interest.
The value engine of Social Media is:
Curate collections of people.
Encourage them with the promise of group validations to share their content (FB is getting free content)
Monetizing access to the content by the users. Content that we got for free. The AI LLM is the engine that:
Creates the recommendation Engines.
AI does the data harvesting that enables these platforms to create “Digital Twins” of each user.
Basic components of what drives people to do and to want things:
Connection and communication with each other. Be part of the Digital ONLINE Tribe.
Assets: manage and take care of their things better.
Resources: Things which form the basis of your “You Inc” your own personal services corporation: the stuff you have that you can use to generate money with.

Traditional methods of personalization, such as analyzing customer demographics or past purchase history, proved to be insufficient in capturing the unique preferences and tastes of each customer.
Remember how SQL, due to its nature in normalizing data - making everything look the same - washes out subtle nuances and details in the data model:
These subtle details (which are washed out when we normalize data records with the Primary Key in SQL) are the monetization hooks we need to connect to, to monetize a Platform Business.
image.png
image.png
The sheer scale (VOLUME, Velocity) and complexity (Variety and heterogeneity of data types) of Starbucks' customer base, coupled with the limitations of traditional (sql) algorithms, made mass personalization a seemingly unattainable goal.
image.png
The LLM AI is the Portal which Unlocks the methodologies of Mass Personalization
Just when all hope seemed lost, a new technological marvel emerged: the Large Language Model (LLM AI).
This cutting-edge artificial intelligence system possessed extraordinary capabilities, enabling it to understand, interpret, create schematically meaningful connections between vast amounts of text data, video, images, map locations, correlations of other customer behavior data.
Equipped with the abilities to model and predict these connections, Starbucks embarked on a journey to transform its customer experience by harnessing the power of mass personalization.
By integrating the LLM AI into its systems, the company was able to analyze and process the vast amounts of customer data it had accumulated over the years, unlocking unprecedented insights into individual customer preferences.
If it is a PLATFORM BUSINESS: Its core business is DATA and data MODELING.

The Transformation Begins

With the LLM AI in place, Starbucks revolutionized its approach to mass personalization.
Customers were now greeted with personalized suggestions, tailored to their unique preferences and tastes.
Whether it was recommending a particular coffee blend or suggesting a customized beverage, Starbucks ensured that each customer's visit was as enjoyable and unique as possible.
Behind the scenes, the Deep Brew LLM AI analyzed customer data, including reviews, comments, and even social media interactions, to continually refine its understanding of customer preferences.
This data-driven approach allowed Starbucks to constantly adapt and personalize its offerings, ensuring that customers were always delighted and coming back for more.
The Impact of Mass Personalization
The successful implementation of mass personalization at Starbucks had a profound impact on both the company and its customers.
The ability to create memorable unique and valued experiences not only enhanced customer satisfaction but also increased loyalty and engagement and therefore “MONEY IN” revenue.
Customers began to seek out Starbucks not just for their coffee but for the overall experience it offered.
Furthermore, mass personalization also improved operational efficiency {the money you are spending to run the business} at Starbucks.
By understanding customer preferences, the company could predictively optimize inventory, reduce waste, and streamline operations.
This not only improved profitability but also allowed Starbucks to reinvest in innovation and customer satisfaction.
The Legacy of Mass Personalization
The story of Starbucks and mass personalization serves as a testament to the power of technology and the relentless pursuit of innovation.
From humble beginnings in Seattle to revolutionizing the coffee industry, the company's journey is a testament to the potential of artificial intelligence to transform businesses and create exceptional customer experiences.
Starbucks' commitment to mass personalization not only transformed its own success but also served as a beacon of inspiration for other businesses.
By embracing technology and innovation, the company not only achieved its goal of mass personalization but also set a precedent for a new era of personalized products and services.

Class Learning Outcomes: Our objective for today's lecture is twofold:
First, to explore the critical role that AI and ML play in transforming marketing and business operations strategies of businesses globally,
Second, to delve into the practicalities of building AI and ML applications using Python and PyTorch {Application Development aspects} and Google Machine Learning Flow to manage the CI / CD.
Google ML Flow is the Model Server Platform we will be working with in our Class Activities.
Our focus here is not just to understand the concepts, but also to develop hands-on skills necessary for applying these technologies.

Prelude: How we got here

First it was the introduction of the personal computer in the 1980s.
And then word processing, spread sheets, presentation software like PowerPoint, and - biggest business impact of all - databases.
Today, Large language learning models ARE the new databases.
CASE means computer-aided software engineering. Rational Rose is CASE tool.
** Thought Experiment: IF you were to create a CASE tool: which would let the user design graphically in some UML-like language an LLM:
What functionalities would your Tool have and what would they look like?

Entire industries have sprung up around front ending databases and Excel Sheets with Analytical Dashboards like PowerBI.
In the 1990s, the Internet sprung into the public space and all those Word Documents, PowerPoints, Excel Sheets, and Databases were bolted on to front-end presentation portals called web servers and made available to the world.
What is the key difference between a database and a large language learning model?
With a Database, you must understand the data model and all the tables.
You need to know WHAT you are looking for.
In the 2000s, Social Media, sparked by ubiquitous smart phones and pervasive WIFI, lead businesses to make their business processes centric around social-media enablement of customer engagement with the company's core value generating back end processes.
In the 2010s, this convergence of technology creted the phenomen we call Big Data, which amplified the application of real-time customer demographic analyze to get you want you wanted, faster, better, and for less cost.

megaphone

Continuing with the theme of how businesses on the 1990s created new business opportunities by enabling crowd (public) access to their company’s backend data bases and business processes via Web Services →


What new businesses can you see coming into the market place and people come up with new business models built around building AI LLMS to enable customers to interact with the company’s core value generating engines?
Now here we are in 2024, and cognition-boosting cybernetics systems are carrying the load of boring, checklist-based job tasks to free human creativity for interesting, value-generating thinking.
Generative AI language models are what we wanted the Internet to be.
The Internet was heralded as the Global Brain, but that promise fizzed out to being the global filing cabinet.

Generative AI Language models like ChatGPT are the emerging global brain.
I. Introduction
Brief on the lecture's objective and relevance
Quick look at Starbucks and its role as a leading global brand
II. Context Setting: The Evolution of Marketing and Role of AI/ML
Traditional Marketing vs. Personalized Marketing
The importance and impact of AI/ML in Personalized Marketing
III. Starbucks and Personalized Marketing
Introduction to Starbucks' Personalized Marketing strategy
Role of Digital in Starbucks' Marketing approach
IV. Python Basics: Introduction and Use in AI/ML
Introduction to Python programming language
Importance of Python in AI/ML
Brief tutorial on Python syntax and functions
V. Building AI/ML Models with Python: PyTorch and Bayesian Model Training
Introduction to PyTorch
How to install and use PyTorch for AI/ML applications
Basics of Bayesian model training
Practical example: building a simple Bayesian model in PyTorch
VI. Role of AI in Starbucks' Personalized Marketing: Deep Dive with Python
Detailed examination of Starbucks' 'Deep Brew' AI initiative
Practical Python session: how to use Python for understanding and predicting customer preferences
Building a basic AI model in PyTorch, simulating Starbucks' real-time personalization
VII. Role of ML in Starbucks' Personalized Marketing: Deep Dive with Python
Detailed examination of Starbucks' use of ML for predicting customer behavior and optimizing marketing messages
Practical Python session: how to use Python and PyTorch to build a basic ML model for personalized marketing
VIII. Building a Minimal Viable Product: Python, AI and ML
Concept and importance of Minimal Viable Product (MVP)
Steps to build an MVP for an AI/ML platform, similar to Starbucks' using Python and PyTorch
IX. Conclusion: Practical Lessons and Future Trends
Key takeaways from Starbucks' approach to AI and ML
Future trends in AI/ML applications for personalized marketing
Role of Python in these future trends
X. Interactive Q&A and Code Review
Open floor for questions and answers
Review of Python codes used in the session
Discussion and clarification of technical concepts

Today, we are standing at the crossroads of technology and commerce, at a juncture where artificial intelligence (AI) and machine learning (ML) are not just buzzwords but game-changers in our modern digital economy.
Here will will practice our AI Application Development Build Skills, were we dive deep into the nexus of these advanced technologies and the world of marketing.

As a case study, we will be examining a brand that needs no introduction: Starbucks. This global giant has made waves, not just for its quality coffee but also for its innovative use of technology to craft customer experiences.
Starbucks is a perfect example of a company leveraging AI and ML to redefine its marketing, using personalized strategies to connect with its customers at a deeper level.
Starbucks's journey showcases how businesses can intelligently harness AI and ML to drive growth, profitability, and customer satisfaction.
It highlights the future of marketing, a future where AI and ML are central to understanding/modelling/predicting consumer behavior and crafting customized consumer experiences.

As we embark on this journey to decode the successful amalgamation of technology and marketing at Starbucks, we will also learn how to code in Python and use PyTorch.
Your project will be to create your own DEEP BREW for some fictional company you will invent, and wrap this up to showcase to employers.
We'll see how to build a simplified model similar to Starbucks's DEEP BREW AI/ML platform. So, not only will we unravel the strategy behind a global brand's success, but we'll also work towards creating a similar success blueprint.
The purpose of this is to build familiarity, comfort, exposure: NLP calls this SOMATIC BODY STATES.

When you walk into Day 1 of the Job, you will be used to thinking about things in the way of doing.
Let's get started on this exciting journey, where technology meets coffee, and innovation brews success!


II. Context Setting: The Evolution of Marketing and Role of AI/ML

A. Traditional Marketing vs. Personalized Marketing

Let's embark on our journey by traversing the road from traditional marketing to personalized marketing.
Traditional marketing:
Push only, no feedback loop
Making guesses about our users: who are they, what do they want, where will be advertize the product to connect with them (go to market channels, demand-generation).
We created customer Segments out of our own imagination, but we don’t know if that standards the ACID Test.

Each Customer A Segment of One.
Now we can make each of our customers to be a segment of one. [Segmentation is how we create Customer Demographic Profiles].
In the past, marketing was generally a "one-size-fits-all" approach. Advertisements were broad, targeting a mass audience rather than catering to the individual tastes and preferences of individual consumers.
This practice resulted from a lack of actionable data to understand each customer's unique psychometrics : thinking, wants profile, coupled with the absence of advanced tools to process such information.

However, as the digital age evolved, so did marketing strategies.

The Development of Big Data Technologies in the 2000s:
With an unprecedented amount of consumer data becoming accessible, companies began realizing the power of personalization.
Personalized marketing, as opposed to the one-size-fits-all methodology, is a strategic approach aiming to deliver individualized content to recipients through data collection, analysis, and automated delivery of content to specific devices and accounts.
The paradigm shift (mental reality model) from traditional to personalized marketing was significant. Personalized marketing proved itself more effective, garnering higher customer engagement, satisfaction, and ultimately leading to increased loyalty and revenue growth.

B. The Importance and Impact of AI/ML in Personalized Marketing

The crux of this evolution from traditional to personalized marketing lies in two revolutionary technologies:
The ability to build very fine grained pictures of each customer.
Artificial Intelligence (AI)
Machine Learning (ML)
megaphone

Why is the Open AI Foundation paying for you to have free Chat GPT ??


AI and ML have emerged as game-changers, allowing companies to understand, predict, and cater to customer preferences on an unprecedented scale. With AI, companies can analyze vast amounts of data to identify patterns and insights that can guide marketing strategies.

Meanwhile, Machine Learning, a subset of AI, allows systems to:
learn from data traing sets identify patterns
make decisions with minimal human intervention. {Baysian Training Methods.}

In marketing, ML models can be trained to:
predict customer behavior
segment customers into Demographic Profiles
create personalized content
optimize marketing campaigns.

To paint a vivid picture, consider this:
Every interaction a customer has with a brand, every click they make on a website, every product they view or purchase, every review they leave - all these data points feed into AI and ML models.
These models then analyze and learn from this data, creating a comprehensive understanding of each customer's preferences, behaviors, and needs.
This granular understanding of the customer enables brands to deliver highly personalized marketing that resonates with each individual's unique profile and psychometrics.
Personalized product recommendations, targeted promotions, optimized email campaigns - these are just a few examples of how AI/ML can power personalized marketing.
In essence, AI/ML have enabled the shift from a 'segmentation' approach in marketing to a 'segment of one' approach, where each customer is their own segment, receiving highly personalized marketing content.
This transformative power of AI/ML is the engine of economic growth in the modern economy.
In this course, we will learn how to build systems like Deep Brew, delving deeper into the how and the why of it, using Starbucks' application of these technologies as our guiding case study.

III. Starbucks and Personalized Marketing

A. Introduction to Starbucks' Personalized Marketing Strategy

As we embark on exploring Starbucks' approach to personalized marketing, it's important to understand the unique nature of the brand's strategy.
Starbucks, a global leader in the coffee industry, has consistently been at the forefront of employing innovative strategies to engage with its customers.
The brand has carved a niche in the realm of personalized marketing, transforming it from being a mere coffee retailer to a tech-savvy, customer-centric organization.
Starbucks' personalized marketing strategy revolves around their loyalty program, the Starbucks Rewards app.
Each customer's past purchases, preferences, and behaviors are tracked through this platform, enabling Starbucks to create an individualized customer profile.
Starbucks uses this profile to send personalized offers and product recommendations to each customer, often in real-time.
The approach is simple yet effective: understand each customer as an individual, anticipate their needs and preferences, and provide highly relevant and engaging offers. This unique approach not only drives customer loyalty but also encourages higher frequency of purchases.

B. Role of Digital in Starbucks' Marketing Approach

An integral component of Starbucks' marketing strategy is its embracement of digital technology. The Starbucks Rewards app, a central piece of their strategy, is an embodiment of this digital transformation.
The app allows Starbucks to connect directly with its customers, offering a seamless and personalized customer experience. Every interaction a customer has with the app, from orders to payments, feeds valuable data back to Starbucks.
This data-driven, digital approach has several advantages. It allows Starbucks to:
Collect valuable data: Every order, click, and review is a piece of the customer's preference puzzle. Starbucks uses these data points to understand and anticipate customer needs.
Engage in real-time: The app allows Starbucks to interact with customers in real-time. Personalized offers can be sent when a customer is in or near a Starbucks store, increasing their relevance and effectiveness.
Personalize at scale: The digital platform enables Starbucks to offer personalized experiences to millions of customers simultaneously, something that would be nearly impossible with traditional marketing methods.
Boost loyalty: By providing a seamless, engaging, and personalized experience, Starbucks strengthens its relationship with customers, enhancing loyalty and driving repeat business.
In conclusion, Starbucks' personalized marketing strategy is a powerful blend of customer-centricity and digital innovation.
Leveraging AI/ML technologies, Starbucks has managed to understand and cater to each customer's unique preferences, revolutionizing the customer experience in the process.
We will delve deeper into the AI/ML technologies powering this strategy in the following sections, while also exploring how to create such solutions using Python and PyTorch.

IV. Python Basics: Introduction and Use in AI/ML
A. Introduction to Python Programming Language
Python, named after the British comedy group "Monty Python," is a high-level, interpreted programming language that is known for its simplicity and readability. Python was developed by Guido van Rossum and first released in 1991. It is now one of the most popular programming languages, particularly in the field of AI/ML.
Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming. It has a large standard library that includes areas like web service tools, string operations, Internet, operating system interfaces, and protocols. Most of the Python libraries are cross-platform compatible on UNIX, Windows, and Macintosh.
Python is used in many application domains including web development, automation, scientific computing, data science, AI, and ML.
B. Importance of Python in AI/ML
Python has become a leading language in AI/ML for several reasons:
Simplicity and Consistency: Python’s syntax is simple, making it easy to learn and use. Python code is readable and maintainable.
Extensive Libraries: Python has a rich set of libraries useful for AI/ML, such as TensorFlow, PyTorch, Scikit-learn, Keras, and Pandas.
Community and Support: Python has a large community of developers who contribute to its vast set of libraries and packages. This community also provides excellent support and documentation.

megaphone

Detailed Workings of Starbucks' Deep Brew AI and Its Maintenance

You can think about using this as a template as you build your Project.
Elements of Starbucks’ AI Development Methodology:

1. Overview of Deep Brew: This is Starbucks AI Marketing Model.
Deep Brew is Starbucks' AI-powered personalization engine,
designed to enhance customer experience by delivering tailored recommendations and
optimizing operational efficiency.
By leveraging advanced AI technologies, Deep Brew processes vast amounts of customer data to provide personalized interactions.

2. AI Software Architecture:
Data Collection: Deep Brew collects data from various sources, including purchase history, customer feedback, app interactions, and social media activity.
This data is stored in a centralized data warehouse.
Data Processing: The collected data undergoes preprocessing to clean, normalize, and organize it.
This step is crucial for ensuring high-quality inputs for the AI models.
Model Training: AI models, primarily Large Language Models (LLMs), are trained using this data.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.