Skip to main content
Practice

How Generative AI Works

Generative AI goes beyond just processing data to actually creating new content.

So, how does this AI work?

In this session, we'll look into the basic structure of artificial neural networks and the core concepts of the Transformer model to understand how generative AI functions.


Artificial Neural Networks Inspired by the Brain

Artificial Neural Networks (ANNs) are structures inspired by the human brain.

Just as neurons in the brain process information by sending signals to each other, artificial neural networks consist of multiple layers of nodes that receive input data, process it, and output the result.

Artificial neural networks are divided into an Input Layer, Hidden Layers, and an Output Layer.

The input layer receives data, the hidden layers perform complex calculations, and the output layer produces the final result.

For example, in an image classification AI, the input layer receives an image, the hidden layers analyze the image, and the output layer produces a result such as "This is a cat."


The Heart of Generative AI, the Transformer Model

The Transformer model is the technology at the core of many modern generative AIs.

This model was designed to handle complex tasks like natural language processing, achieving significant breakthroughs particularly through the Attention Mechanism.


Focusing on What Matters with Attention

Much like how humans don't pay equal attention to every word in a sentence, Attention determines "where to focus" in the input data.

For example, in the sentence "She threw the yellow ball in the park," the word "ball" holds more crucial significance.

The Attention mechanism in the Transformer model emphasizes such important parts, enabling more accurate results.


Encoder-Decoder Structure

The Transformer model fundamentally has an Encoder-Decoder structure.

  • Encoder: Processes input data and extracts important information.
  • Decoder: Generates the final output based on the information extracted by the Encoder.

For example, in a text translation AI, the Encoder analyzes the original text, and the Decoder generates the translated sentence based on that analysis.


Process of Generative AI

Let's briefly explore how generative AI works.

  1. Data Input: First, the AI receives data in the desired form, such as text, images, or music.
  2. Data Processing: The input data is processed through various layers of the artificial neural network. Important information is extracted during this process, allowing for prediction of the results.
  3. Content Generation: Finally, new content is generated based on the extracted information. Using the Attention mechanism in Transformer models allows for more accurate and natural results.

Thus, generative AI can create new text, images, music, and other forms of content based on the input data.

In the next session, we will delve deeper into the learning processes of these AI models.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.