Introduction to Generative AI

Anurag Jain
5 min readMar 17, 2024

--

Understanding Generative AI | Google Cloud

What is artificial intelligence and what is the difference between AI and machine learning?

Understanding Artificial Intelligence and Machine Learning

Artificial Intelligence

  • AI is a branch of computer science that deals with the creation of intelligent agents, and are systems that can reason, learn, and act autonomously.
  • In simple terms, AI has to deal with theory and methods for creating smart machines that can do tasks typically requiring human intelligence, like learning from experience or making decisions.

Machine Learning

  • Machine learning, is a subfield of AI.
  • It is a program or system that trains a model from input data.
  • This means that Machine Learning gives the computer the ability to learn without explicit programming.

Common classes of Machine Learning Models :

Two most common types of Machine Learning Models

Machine learning has two main types: supervised and unsupervised.

Supervised ML models

  • These models work with data that’s already labeled, meaning each piece of data comes with a tag or category.
  • They learn from past examples to make predictions about future data. If their prediction is far off from reality, they try to improve it until they get closer.

Unsupervised ML models

  • These models deal with data that isn’t labeled.
  • Instead of being told how to categorize data, they look for patterns or groups within the data itself.

Deep Learning: Understanding Complexity

Deep learning is a powerful form of AI that uses networks inspired by the human brain to understand complex patterns. These networks can learn from both labeled and unlabeled data, which helps them understand a wider range of information.

Large Language Models (LLMs):

LLMs, a key subset of deep learning, transform natural language processing by grasping and producing human language using large amounts of text, resulting in the creation of coherent and contextually relevant text.

Generative Ai:

Generative AI is particularly fascinating because it allows machines to be creative. Using networks with many interconnected parts, these models can learn from both labeled and unlabeled data, which means they can create new things based on what they’ve learned.

What is Generative AI?

What is GenAi ?

Model output is GenAI or not GenAI :

GenAi Model Output(y) = f(x), is GenAi or not GenAi
GenAi Model Output(y) = f(x), is GenAi or not GenAi

It uses artificial neural network contains large number of neurons, that can process both labeled and unlabeled data (called semi-supervised learning).

Foundation model:

Foundation model, Gen AI supervised, semi-supervised and unsupervised learning
Gen AI supervised, semi-supervised and unsupervised learning

Different Kinds of DL/ML Models:

Varieties of Learning Models

Discriminative model

  • It is used to classify or predict the label for input data / new data, based on trained dataset of labeled data.
  • Their aim is to discriminate between different data instances, learning the relationship between input features and corresponding labels.

Generative model

  • It generates new data that is similar to the trained data by understanding the probability distributation of data.
  • It generates new data instances.
  • It learns pattern and contents so that it can generate new content.

Examples: input(dog image) :

Example for Discriminative model and Generative model shows dog image as input and output text or image
  • Here the discriminative model learns the conditional probability distribution or probability of output that input is a dog and not a cat.
  • Here the generative model learns the joint probability distribution p(input , output) and predicts the conditional probability that this is a dog and can generate a picture of dog.

Generative AI shows up in different forms:

Various Forms of Generative AI

Generative Language Models: These models can predict what words might come next in a sentence, based on what they’ve learned about language patterns.

Generative Image Models: From a starting image, these models can make new pictures, write text, or even create videos.

Generative language models and Generative image models
Generative Models

when text as input, outputs can be text, image, audio, decisions:

input text can have output as text, image, audio, decisions
Outputs when text as input

Transformer Models:

  • At a high-level, a Transformer model consists of an encoder and decoder, allowing it to process input sequences in parallel.
  • The encoder encodes the input sequence and passes it to the decoder, which learns how to decode the representations for a relevant task.

Working of Transformer Model:

Transformer containing encoder and decoder
Transformer(encoder and decoder)

Prompt Design :

  • Prompt design is the process of creating a prompt that will generate the desired output from a large language model (LLM).
  • It’s like giving the model a hint about what you want it to do, so it can give you the best possible result.

Prompt Design determins quality of Output:

Prompt Design determins quality of Output
Prompt Design, Prompting

Types of Generative Models:

Varieties in Generative Models: A Simplified Overview

Text to Text:

text-to-text

Text to Image;

text-to-image

Text to Video , Text to 3D:

text-to-video , text-to-3D

Text to Task:

text-to-task

Three ways Google Cloud can help you get more out of Generative AI:

Unlocking the Power of Generative AI with Google Cloud

  • Vertex AI can help you can create your own: Chatbots Digital assistants Custom search engines Knowledge bases Training applications And more.
Vertex AI
  • PaLM API let’s you test and experiment with Google’s Large Language Models and Gen AI tools such as a model training tool, a model deployment tool, and a model monitoring tool.
PaLM API
PaLM API
  • Gemini, a multimodal AI model. It can analyze images, understand the nuances of audio, and even interpret programming code.
  • Discover Gemini in Model Garden is continuously updated to include new models.
Gemini Model Garden

--

--