An introduction to Generative AI

Josué Carvajal
6 min readDec 4, 2024

--

Imagine a super smart robot that has a special power: it can create amazing things! It can write stories, draw pictures, and even make up new songs. This robot learned how to do all this by looking at lots and lots of examples made by humans. It’s like a magical toy that can use its imagination to come up with brand new ideas, just like you do when you play pretend! That’s what Gen AI is — a super smart robot that uses its knowledge to create cool and surprising things, including text, images, audio and synthetic data.

The sentence above was created using Gemini’s GenAI by asking it to explain GenAI to a kid, pretty cool huh? In this post we are going to cover all the basics you need to know to understand where GenAI comes from and a more formal approach of What Gen AI is.

Before we start, we need to understand the difference between Machine Learning and Artificial Intelligence.

Machine Learning & Artificial Intelligence

Artificial Intelligence (AI) is a broad field of computer science dedicated to creating intelligent agents, which are systems capable of reasoning, learning, and independent action. The ultimate goal of AI is to develop machines that can think and act like humans.

Machine learning (ML) is a subfield of AI that focuses on the development of algorithms and models that empower computers to learn from data and make predictions or decisions without explicit programming. It teaches computers to learn from experience, mirroring the way humans learn from their own encounters. Through this process, a model is trained on input data, enabling it to generate useful predictions when presented with new, previously unseen data that is similar in nature to the training data.

Deep learning, a subset of machine learning, plays a crucial role in this process. In essence, AI can be viewed as a scientific discipline such as physics is on science, while ML represents a specialized subfield within that discipline.

This might be a little overwhelming, isn’t it? Let’s ask AI to generate an explanation of the difference between AI and ML so a 5 year old can understand it.

Imagine you have a big box of toys. That big box is like Artificial Intelligence (AI). Inside that big box, there’s a special set of toys. These toys are like Machine Learning (ML). They help the machines learn and get better at things, just like you learn to ride a bike or draw a picture. These special toys help the machines learn from examples, so they can figure out how to do new things without being told exactly what to do every step of the way. So, remember, AI is the big box of all the smart toys, and ML is a special set of toys inside that help the machines learn and get even smarter!

A little bit easier, huh?

Learning methods for Machine Learning

Learning methods are ways of teaching a machine new things, each learning method has its strengths and weaknesses, and the choice depends on the specific problem and the available data.

Let’s explore the two primary training methods:

Supervised learning

Supervised Learning is a powerful technique that can be used to solve a wide variety of problems, such as image classification, natural language processing, and speech recognition.

Here a model learns to make predictions based on labeled data that has been annotated with the correct answer or outcome. For example, a dataset of images of cats and dogs that has been labeled with the correct animal name would be a labeled dataset.

In this type of learning, the model is given a set of labeled data and is asked to learn the relationship between the input features and the output labels. Once the model has learned this relationship, it can be used to make predictions on new, unseen data.

Here’s a simplified example of how supervised learning works:

  • We have a dataset of labeled images of cats and dogs.
  • We split the dataset into a training set and a test set.
  • We train a machine learning model on the training set.
  • We test the model on the test set to see how well it can predict the correct animal name for new, unseen images.
  • If the model performs well on the test set, then we can be confident that it has learned the relationship between the input features (the pixels in the images) and the output labels (the animal names).

Unsupervised Learning

Here a model learns from unlabeled data, that is, data that has not been annotated with the correct answer or outcome. The goal of unsupervised learning is to find patterns or structures in the data without being explicitly told what to look for.

Unsupervised learning is often used for tasks such as:

  • Clustering: Grouping similar data points together
  • Dimensionality reduction: Reducing the number of features in a dataset without losing important information
  • Anomaly detection: Identifying data points that are significantly different from the rest of the data

Here’s a simplified example of how unsupervised learning works:

  • We have a dataset of images of cats and dogs, but the images are not labeled with the correct animal name.
  • We train an unsupervised learning model on the dataset.
  • The model learns to group the images into two clusters, one for cats and one for dogs.
  • We can then use the model to label new, unseen images of cats and dogs.

Unsupervised learning can be a powerful tool for exploring data and finding patterns that would not be immediately obvious to a human observer.

Here are some of the key benefits of unsupervised learning:

  • It can be used to find patterns in data that is not labeled.
  • It can be used to reduce the dimensionality of data, making it easier to analyze.
  • It can be used to detect anomalies in data.

However, unsupervised learning also has some limitations:

  • It can be difficult to interpret the results of unsupervised learning models.
  • Can be sensitive to noise and outliers in the data.
  • Can be computationally expensive to train.

Other types of learning

  • Semi-Supervised Learning: This approach combines a small amount of labeled data with a larger amount of unlabeled data. It leverages the benefits of both supervised and unsupervised learning.
  • Reinforcement Learning: This method involves an agent learning to interact with an environment by receiving rewards or penalties for its actions. It’s like training a pet with treats and corrections.

What actually is GenAI

Generative AI is a subset of Deep Learning. Which can process both labeled and unlabeled data using supervised, unsupervised and semi-supervised methods, meaning GenAI is a specific type of deep learning focused on generating new content like text, images, or audio, rather than just analyzing existing data; essentially, it uses deep learning techniques to create new things that resemble existing data. LLM is also a subset of deep learning.

Here’s a breakdown of the relationships between some key AI concepts:

  • Deep Learning: A subset of machine learning, deep learning uses artificial neural networks inspired by the human brain. These networks excel at processing complex patterns.
  • Generative AI: A subset of deep learning, generative AI models can create new content like text, images, or music.
  • Large Language Models (LLMs): These are a specific type of generative AI model focused on understanding and generating text.

Key Points:

  • Deep learning models can learn from both labeled and unlabeled data using various methods (supervised, unsupervised, and semi-supervised).
  • Semi-supervised learning is particularly useful when there’s limited labeled data available.
  • Labeled data provides initial guidance, while unlabeled data helps the model generalize and learn broader patterns.

Remember:

  • Deep learning is a powerful tool within the larger field of machine learning.
  • Generative AI, including LLMs, is a specialized application of deep learning with a focus on creating new content.

In conclusion, deep learning, including generative AI and LLMs, offers a range of powerful techniques for learning from both labeled and unlabeled data. While supervised learning provides guidance, unsupervised and semi-supervised learning enable models to discover patterns and make predictions on new data. This opens up exciting possibilities for further advancements in AI and machine learning.

PD: In the next chapter we are going to cover the security challenges that we face with GenAI and some of the benefits that they bring into security as well.

--

--

Josué Carvajal
Josué Carvajal

Written by Josué Carvajal

Privacy, Security & AI for web3. +6 years of experience.

No responses yet