00:00Hello and welcome to introduction to generative AI
00:03My name is Dr
00:07Gwendelyn Stripling, and I am the artificial intelligence technical curriculum developer here at Google Cloud
00:11In this course, you'll learn to define generative AI, explain how generative AI works, describe generative AI model types, and describe generative AI applications
00:27Generative AI is a type of artificial intelligence technology that can produce various types of content, including text, imagery, audio, and synthetic data
00:39But what is artificial intelligence? Well, since we are going to explore generative artificial intelligence, Let's provide a bit of context, so two very common questions asked are, what is artificial intelligence, and what is the difference between AI and machine learning? One way to think about it is that AI is a discipline, like, like physics, for example
01:08AI is a branch of computer science that deals with the creation of intelligent agents, which are systems that can reason and learn and act autonomously
01:19Essentially, AI has to do with the theory and methods to build machines that think and act like humans
01:30In this discipline, we have machine learning, which is a subfield of AI
01:32It is a program or system that trains a model from input data, the trained model can make useful predictions from new or never-before-seen data drawn from the same one used to train the model
01:47Machine learning gives the computer the ability to learn without explicit programming
01:56Two of the most common classes of machine learning models are supervised and unsupervised ML models
02:00The key difference between the two is that with supervised models, we have labels
02:06Labeled data is data that comes with a tag, like a name, a type, or a number
02:17Unlabeled data is data that comes with no tag
02:19This graph is an example of the sort of problem that a supervised model might try
02:25To solve, for example, let's say you are the owner of a restaurant
02:27You have historical data of the bill amount and how much different people tipped based on order type, whether it was picked up or delivered
02:37In supervised learning, the model learns from past examples to predict future values, in this case, tips
02:46So here, the model uses the total bill amount to predict the future tip amount based on whether an order was picked up or delivered
02:55This is an example of the sort of problem that an unsupervised model might try to solve
03:00So here, you want to look at tenure and income, and then group or cluster employees
03:05To see whether someone is on the fast track, unsupervised problems are all about discovery, about looking at the raw data and seeing if it naturally falls into groups
03:20Let's get a little deeper and show this graphically, as understanding these concepts are the foundation for your understanding of generative AI
03:28In supervised learning, testing data values, or X, are input into the model
03:34The model outputs a prediction and compares that prediction to the training data used to train the model
03:44If the predicted test data values and actual training data values are far apart, that's called error, and the model Tries to reduce this error until the predicted and actual values are closer together
03:59This is a classic optimization problem
04:03Now that we've explored the difference between artificial intelligence and machine learning, and supervised and unsupervised learning, let's briefly explore where deep learning fits as a subset of machine learning methods
04:19While machine learning is a broad field that encompasses many different techniques, deep learning is a type of machine learning that uses artificial neural networks, allowing them to process more complex patterns than machine learning
04:32Artificial neural networks are inspired by the human brain
04:35They are made up of many interconnected nodes, or neurons, that can learn to perform tasks by processing data and making predictions
04:46Deep learning models typically have many layers of neurons, which allows them to learn more complex patterns than traditional machine learning models, and neural networks can use both labeled and UNL data
04:57This is called semi-supervised learning
05:01In semi-supervised learning, a neural network is trained on a small amount of labeled data and a large amount of unlabeled data
05:10The labeled data helps the neural network
05:14To learn the basic concepts of the task, while the unlabeled data helps the neural network to generalize to new examples, now we finally got to where generative AI fits into this AI discipline
05:30Gen AI is a subset of deep learning, which means it uses artificial neural networks, and can process both labeled and unlabeled data using supervised, unsupervised, and semi-supervised methods
05:46Large language models are also a subset of deep learning
05:50Deep learning models, or machine learning models in general, can be divided into two types: generative and discriminative
05:58A discriminative model is a type of model that is used
06:01To classify or predict labels for data points, discriminative models are typically trained on a data set of labeled data points, and they learn the relationship between the features of the data points and the labels
06:15Once a discriminative model is trained, it can be used to predict the label for new data points
06:21A generative model generates new data instances based on a learned probability distribution of existing data
06:30Thus, generative models generate new content
06:37Take this example here, the discriminative model learns the conditional probability distribution, or the probability of why our output
06:44Given X, our input, that this is a dog, and classifies it as a dog and not a cat, the generative model learns the joint probability distribution, or the probability of X and Y, and predicts the conditional probability that this is a dog, and can then generate a picture of a dog
07:08So, to summarize, generative models can generate new data instances, while discriminative models discriminate between different kinds of data instances
07:20The top image shows a traditional machine learning model, which attempts to learn the relationship between the data and the label, or what you want to predict
07:29The bottom image shows a Generative AI model, which attempts to learn patterns on content so that it can generate new content
07:36A good way to distinguish what is Gen and what is not, is shown in this illustration
07:45It is not Gen when the output, or Y, or label is a number or a class of, for example, spam or not spam, or a probability
07:56It is Gen when the output is natural language like speech or text, an image, or audio
08:04For example, visualizing this mathematically would look like this
08:10If you haven't seen this for a while, the Y is equal to F of X equation, calculates the dependent output of a process given different inputs
08:20The Y stands for the model
08:23Output, the F, embodies the function used in a calculation, and the X represents the input or inputs used for the formula, so the model output is a function of all the inputs
08:35If the Y is a number, like predicted sales, it is not gen
08:39If Y is a sentence, like "Define sales," it is generative, as the question would elicit a text response
08:49The response would be based on all the massive, large data the model was already trained on
08:58To summarize at a high level, the traditional, classical supervised and unsupervised learning process takes training code and label data to build a model, depending on the use case or problem
09:11model can give you a prediction, it can classify something, or cluster something
09:17We use this example to show you how much more robust the Gen process is
09:23The Gen process can take training code, labeled data, and unlabeled data of all data types, and build a foundation model
09:32The foundation model can then generate new content, for example, text, code, images, audio, video, etc
09:42We've come a long way from traditional programming to neural networks to generative models
09:46In traditional programming, we used to have to hardcode the rules for distinguishing a cap, the type animal, legs four, ears two, fur yes, likes yarn and catnip
10:00In the wave of neural networks, we could give the network pictures of cats and dogs and ask, "Is this a cat?" and it would predict a cat
10:11In the generative wave, we as users can generate our own content, whether it be text, images, audio, video, etc
10:18For example, models like Palm, or Pathways Language Model, or Lambda Language Model for dialogue application ingest very, very large data from multiple sources across the internet and build Foundation Language Models we can use simply by asking a question, whether typing it into a prompt or verbally talking into the prompt itself
10:43So when you ask it, "What's a cat?" it can give You everything it has learned about a cat
10:52Now we come to our formal definition, what is generative AI? Gen AI is a type of artificial intelligence that creates new content based on what it has learned from existing content
11:03The process of learning from existing content is called training and results in the creation of a statistical model
11:10When given a prompt, Gen AI uses the model to predict what an expected response might be, and this generates new content
11:19Essentially, it learns the underlying structure of the data and can then generate new samples that are similar to the data it was trained on, as previously
11:29Mentioned a generative language model can take what it has learned from the examples it's been shown, and create something entirely new based on that information
11:41Large language models are one type of generative AI, since they generate novel combinations of text in the form of natural sounding language
11:53A generative image model takes an image as input and can output text, another image, or video
12:04For example, under the output text, you can get visual question answering, while under output image, an image completion is generated, and under output video, animation is generated, a generative language model
12:20Takes text as input and can output more text, an image, audio, or decisions
12:26For example, under the output text, question answering is generated, and under output image, a video is generated
12:34We've stated that generative language models learn about patterns in language through training data, then, given some text, they predict what comes next
12:45Thus, generative language models are pattern matching systems
12:48They learn about patterns based on the data you provide
12:54Here is an example: based on things it's learned from its training data, it offers predictions of how to complete this sentence, "I'm making a sandwich." With peanut butter and jelly, here is the same example using Bard, which is trained on a massive amount of text data and is able to communicate and generate humanlike text in response to a wide range of prompts and questions
13:21Here is another example: "The meaning of life is..." and Bard gives you a contextual answer, and then shows the highest probability response
13:34The power of generative AI comes from the use of Transformers
13:40Transformers produce the 2018 revolution in natural language processing
13:43At a high level, a Transformer model consists of an encoder and decoder
13:48The encoder encodes the input sequence
13:51And passes it to the decoder, which learns how to decode the representation for a relevant task
13:57In Transformers, hallucinations are words or phrases that are generated by the model that are often nonsensical or grammatically incorrect
14:12Hallucinations can be caused by a number of factors, including the model is not trained on enough data, or the model is trained on noisy or dirty data, or the model is not given enough context, or the model is not given enough constraints
14:32Hallucinations can be a problem for Transformers because they can make the output text difficult to understand
14:39They can also make the model more likely to generate incorrect or misleading information
14:45A prompt is a short piece of text that is given to the large language model as input, and it can be used to control the output of the model in a variety of ways
14:58Prompt designing is the process of creating a prompt that will generate the desired output from a large language model
15:06As previously mentioned, AI depends a lot on the training data that you have fed into it, and it analyzes the patterns and structures of the input data, and thus learns, but with access to a browser based prompt, you, the user, can generate your own content
15:26We've shown Illustrations of the types of input based upon data, here are the associated model types: text to text
15:35Text-to-text models take a natural language input and produce a text output
15:39These models are trained to learn the mapping between a pair of text, e.g., for example, translation from one language to another
15:47Text to image, text-to-image models are trained on a large set of images, each captioned with a short text description
15:56Diffusion is one method used to achieve this
15:59Text to video and text to 3D, text-to-video models aim to generate a video representation from text input
16:07The input text can be anything from a Single sentence to a full script, and the output is a video that corresponds to the input text
16:19Similarly, text to 3D models generate three-dimensional objects that correspond to a user's text description
16:29For example, this can be used in games or other 3D worlds
16:33Text to task: text to task models are trained to perform a defined task or action based on text input
16:41This task can be a wide range of actions, such as answering a question, performing a search, making a prediction, or taking some sort of action
16:54For example, a text to task model could be trained to navigate a web UI or make changes to a doc through the GUI
17:03A foundation model is a large AI model pre-trained on a vast quantity of data, designed to be adapted or fine-tuned to a wide range of downstream tasks, such as sentimental analysis, image captioning, and object recognition
17:23Foundation models have the potential to revolutionize many industries, including healthcare, finance, and customer service
17:31They can be used to detect fraud and provide personalized customer support
17:38Vertex AI offers a Model Garden that includes foundation models
17:41The language foundation models include Palm API for chat and text
17:46The vision foundation models include stable
17:49Diffusion, which has been shown to be effective at generating high quality images from text description
18:00Let's say you have a use case where you need to gather sentiments about how your customers are feeling about your product or service, you can use the classification task sentiment analysis task model for just that purpose
18:12And what if you needed to perform occupancy analytics? There is a task model for your use case
18:21Shown here are Gen AI applications
18:26Let's look at an example of code generation shown in the second block under code at the top
18:31In this example, I've input a code file conversion problem
18:37Converting from Python to JSON, I use Bard, and I insert into the prompt box the following: "I have a Pandas data frame with two columns, one with the file name and one with the hour in which it is generated
18:52I'm trying to convert this into a JSON file in the format shown on screen." Bard returns the steps I need to do this and the code snippet, and here my output is in a JSON format
19:02It gets better
19:11I happen to be using Google's free browser-based Jupiter notebook, known as Colab, and I simply export the Python code to Google's Colab
19:21To summarize, Bard code generation can help you debug your lines of source code, explain your code
19:28To you, line by line, craft SQL queries for your database, translate code from one language to another, and generate documentation and tutorials for source code
19:42Generative AI Studio lets you quickly explore and customize gen models that you can leverage in your applications on Google Cloud
19:50Generative AI Studio helps developers create and deploy gen AI models by providing a variety of tools and resources that make it easy to get started
20:04For example, there's a library of pre-trained models, there is a tool for fine-tuning models, there is a tool for deploying models to production, and there is a
20:15Community forum for developers to share ideas and collaborate
20:20Generative AI app builder lets you create gen apps without having to write any code
20:26AI app builder has a drag and drop interface that makes it easy to design and build apps
20:32It has a visual editor that makes it easy to create and edit app content
20:37It has a built-in search engine that allows users to search for information within the app, and it has a conversational AI engine that helps users to interact with the app using natural language
20:48You can create your own digital assistance, custom search engines, knowledge bases, and training applications
20:58And much more
21:01Palm API lets you test and experiment with Google's large language models and Gen AI tools to make prototyping quick and more accessible
21:11Developers can integrate Palm API with Maker Suite and use it to access the API using a graphical user interface
21:19The suite includes a number of different tools, such as a model training tool, a model deployment tool, and a model monitoring tool
21:29The model training tool helps developers train ML models on their data using different algorithms
21:38The model deployment tool helps developers deploy ML models to production with a number of different
21:45Deployment options, the model monitoring tool helps developers monitor the performance of their ML models in production using a dashboard and a number of different metrics
22:00Thank you for watching our course, introduction to generative AI.