GENERATIVE AI • LESSON 3

AI Models

An AI model is the part of an AI system that has learned patterns from data and can use those learned patterns to produce a result. In Generative AI, the model can take input such as text, an image, audio, or code and generate a new output.

CORE IDEA

An AI model learns patterns from data and uses those patterns to produce an output.

Think of an AI model as the "brain" of an AI system. During training, the model processes many examples and adjusts its internal values so it becomes better at recognizing and generating patterns.

01

What Exactly Is an AI Model?

An AI model is a mathematical system that has been trained to recognize patterns in data.

The model does not simply store a list of answers. Instead, training changes its internal parameters so that it becomes better at performing a particular task.

For Generative AI, that task can include understanding language, generating text, creating images, producing code, generating speech, or other forms of content.

INPUT Text / Image / Audio / Code
AI MODEL Learned Patterns Internal parameters
OUTPUT Generated Result
SIMPLE EXAMPLE

Ask an AI model to explain photosynthesis.

You provide a text prompt. The model processes the input using patterns it learned during training and generates a response.

INPUT "Explain photosynthesis simply."
MODEL Processes learned language patterns
OUTPUT Explanation
02

A Model Is Not the Same as an AI Application

This distinction is important for developers. An AI model is only one part of a complete AI application.

A real application may contain a user interface, backend code, databases, APIs, business rules, authentication, tools, and an AI model.

USER Question
APPLICATION Python / PHP / JavaScript
AI MODEL Understands & Generates
RESULT Useful Response
DEVELOPER NOTE

Building with AI usually means integrating models into software — not training a giant model from scratch.

This is why API usage, prompts, structured outputs, RAG, tool calling, databases, and application architecture become important later in this course.

03

How Does an AI Model Learn Patterns?

During training, an AI model processes a very large number of examples.

The model makes predictions, compares them with the expected result, calculates an error, and adjusts its internal parameters.

This process is repeated many times. Over time, the model becomes better at recognizing patterns in the training data.

01 Training Data Many examples
02 Model Prediction Model produces a prediction
03 Calculate Error How wrong was the prediction?
04 Adjust Parameters Improve the model
↻ Repeat many times
PRACTICAL EXAMPLE

Learning to predict the next word

Suppose the training text contains:

The cat is sitting on the mat

The model may receive:

The cat is sitting on the

and try to predict the next token.

MODEL PREDICTION mat
EXPECTED mat
RESULT Good prediction

Across enormous numbers of examples, this type of learning allows the model to develop useful representations of language patterns.

04

Different AI Models Solve Different Problems

There is no single AI model that is automatically best for every task.

Different models can be designed, trained, or optimized for different types of inputs and outputs.

T

Text Models

Work with language and can generate, summarize, classify, translate, or explain text.

Example: AI assistant
I

Image Models

Can understand images or generate new visual content depending on the model.

Example: Product image generation
A

Audio Models

Can process speech or generate spoken audio and other audio content.

Example: Voice assistant
C

Code Models

Specialized for understanding and generating programming code.

Example: Code assistant
05

Real-World Example — Customer Support AI

Imagine an e-commerce company receives thousands of customer questions every day.

Customers may ask:

"Where is my order?"
"Can I return this product?"
"What is your refund policy?"
"Which payment methods do you accept?"

What does the AI model do?

The model can understand the customer's language and generate a natural-language response.

CUSTOMER "Can I return this product?"
AI MODEL Understands the request Generates an appropriate response
RESPONSE "Yes. You can return the product within 30 days..."
IMPORTANT

In a real production system, the model should not invent company policies. The application should provide trusted company information, often through mechanisms such as retrieval or tool calling. You will learn those techniques later in this course.

06

Real-World Example — Coding Assistant

A developer can give an AI model a programming problem and ask it to generate code.

DEVELOPER PROMPT
Write a Python function that
checks whether a number is prime.
MODEL OUTPUT
def is_prime(n):
    if n < 2:
        return False

    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False

    return True

The model is generating code based on patterns it learned from programming examples.

But the generated code still needs to be reviewed, tested, and validated by the developer. A model can produce syntactically valid code that is logically wrong.

07

What Is Inside an AI Model?

One of the most important concepts you will encounter is the model's parameters.

Parameters are internal numerical values that are adjusted during training. They help the model represent the patterns it has learned.

INPUT "The sky is..."
MODEL Parameters
0.18   -0.42   0.77   0.31
OUTPUT "blue"
REMEMBER

Parameters are learned numerical values inside the model.

You do not normally program every parameter by hand. Training algorithms adjust them based on the model's errors during training.

08

Model vs Training Data vs Application

These three concepts are easy to confuse. Keep them separate.

TRAINING DATA

Examples

The information used to train the model.

Books, documents, code, images, audio, and other data.
AI MODEL

Learned Patterns

The trained mathematical system that uses learned patterns.

Parameters represent learned information.
APPLICATION

Useful Product

Software that connects users and business logic with the AI model.

Chatbot, coding assistant, support system, search assistant, etc.
09

A Simple Mental Model

Remember the following sequence whenever you think about an AI model.

01 DATA Examples
02 TRAINING Learn patterns
03 MODEL Learned parameters
04 INPUT User request
05 OUTPUT Generated result
REMEMBER THIS

The AI model is the trained system that turns learned patterns into useful outputs.

  • An AI model learns patterns from training data.
  • Training changes the model's internal parameters.
  • Different models can be designed for different tasks and modalities.
  • A model is not the same thing as a complete AI application.
  • Real applications connect models with software, data, APIs, tools, and users.
  • Generated output should still be evaluated, tested, and validated.
QUICK CHECK

Test Your Understanding

1. What is an AI model?

Answer: A trained mathematical system that has learned patterns from data and can use those patterns to produce predictions or outputs.

2. What changes during model training?

Answer: The model's internal parameters are adjusted so that the model becomes better at its task.

3. Is an AI model the same as a complete AI application?

Answer: No. An application can contain the model plus frontend code, backend logic, databases, APIs, tools, security, and other components.

4. Can a model generate code?

Answer: Yes. Generative AI models can generate code based on patterns learned from programming data.

LESSON 3 • TOPIC COMPLETE

You now understand what an AI model is.

You have seen how models learn patterns, how they fit into AI applications, how different models solve different problems, and how learned parameters help models produce outputs.

Next, we will look at Foundation Models and understand why one large pretrained model can become the foundation for many different AI applications.