Lecture 1 basics of AI
Module 1

- Artificial Intelligence (AI)
AI is the broadest field whose goal is to make machines think, reason, and make decisions like humans.
Analogy: AI is the entire world of intelligent machines. - Machine Learning (ML)
Machine Learning is a branch of AI where computers learn patterns from data instead of being explicitly programmed.
Analogy: Like a school student who studies many examples, learns concepts (math, science), and improves with practice. - Large Language Models (LLMs)
LLMs are a type of Machine Learning model trained on massive amounts of text to understand and generate human language.
Analogy: Like a baby who has grown up reading millions of books and conversations, so it can now talk, answer questions, and write naturally. - RAG (Retrieval-Augmented Generation)
RAG is a technique that gives an LLM access to external knowledge before it answers, so it can provide accurate and up-to-date information.
Analogy: Like an open-book exam where the student first looks in the textbook before answering instead of relying only on memory. - Agentic AI
Agentic AI is an AI system that can plan tasks, make decisions, use tools, and take actions to achieve a goal with minimal human guidance.
Analogy: Like a personal assistant who doesn't just answer questions but also plans your trip, books tickets, sends emails, and checks the weather on your behalf.
One-line analogy
- AI → The dream of making intelligent machines.
- ML → The way machines learn from experience.
- LLM → A language expert trained on huge amounts of text.
- RAG → Giving the language expert a library to look things up.
- Agentic AI → Giving that expert hands, eyes, and tools so it can actually do the work.
LLMS -> TOKENS -> EMBEDDINGS
How does an LLM work? (Story Version)
Imagine a company like OpenAI wanted to build an AI that can talk like a human.
So they did four things.
Step 1: They made the AI read almost the entire internet
They collected billions of books, websites, Wikipedia articles, research papers and conversations.
The AI didn't memorize everything.
Instead, it learned patterns.
For example it learned:
Good morning → How are you?
India → New Delhi
2 + 2 → 4
Dog → Animal
Just like a child learns language by hearing people talk.
An LLM is simply a model that has learned language patterns from huge amounts of text.
Step 2: The AI cannot read sentences directly
Suppose you type
I love pizza.
The AI doesn't read the whole sentence at once.
It first cuts it into small pieces.
"I"
" love"
" pizza"
"."
These pieces are called tokens.
Think of cutting a pizza.
🍕 Whole Pizza
↓
🍕 Slice 🍕 Slice 🍕 Slice 🍕 Slice
The AI eats one slice at a time.
Not the whole pizza.
Tokenization is simply breaking text into small pieces so the AI can process it.
Step 3: Computers don't understand English
The computer looks at
Dog
and says
"I have no idea what Dog means."
Because computers only understand numbers.
So OpenAI converts every token into numbers.
Dog
↓
[0.28, 0.94, -0.13, ...]
These numbers are called embeddings.
Think of giving every word an ID card.
Dog → ID 1023
Cat → ID 1024
Pizza → ID 8421
But it's smarter than just an ID.
The numbers also capture the meaning.
Words with similar meanings get similar embeddings.
Dog 🐶
Puppy 🐕
Wolf 🐺
are close together.
While
Dog 🐶
🚗 Car
🍕 Pizza
are far apart.
Embeddings convert words into numbers while preserving their meaning.
Step 4: The AI predicts the next word 🔮
Now the AI has numbers instead of words.
Suppose it sees
I live in
It thinks
Mumbai?
Delhi?
India?
London?
Based on everything it learned, it predicts the most likely next token.
I live in India.
Then it predicts the next one.
I live in India and...
Then another.
I live in India and I...
It repeats this process one token at a time until the answer is complete.
An LLM doesn't think like humans. It predicts the most likely next token over and over again.
Complete Flow
You type
"I love pizza."
│
▼
Tokenization
│
"I" " love" " pizza" "."
│
▼
Embeddings
│
Numbers representing meaning
│
▼
LLM processes the numbers
│
Predicts the next token
│
Predicts the next token
│
Predicts the next token
▼
Converts tokens back into words
▼
Final answer