What is a Large Language Model?
A Large Language Model (LLM) is a type of AI model designed to understand and generate human language.
- Trained on massive datasets
- Can answer questions, write text, generate code, and hold conversations
- Example models: GPT, Gemini, Claude
At their core, LLMs are pattern-recognition systems, not thinking entities.
Neural Networks – The Brain Behind AI
LLMs are powered by Neural Networks:
- Inspired by the human brain
- Built from:
- Algorithms (rules)
- Nodes (neurons)
These networks learn by identifying patterns in data and forming connections.
Machine Learning – How AI Learns
Machine Learning allows systems to:
- Analyse data
- Detect patterns
- Predict outcomes
Flow:
Training Examples → Algorithm → Input Data → Prediction/Output
During training, the model builds a mathematical representation of relationships within data.
Transformers – The Key Breakthrough
A Transformer is a special type of neural network designed for language.
It works by:
- Analysing words in context
- Predicting what comes next
This is what makes LLMs powerful.
Tokens – How AI Sees Language
LLMs don’t see words—they see tokens.
Token Types:
- Word-level
- Subword-level
- Character-level
Key Concepts:
- Token ID → Unique number for each token
- Vocabulary → All possible tokens
Vectors & Embeddings
Tokens are converted into numbers:
- Vector = List of numbers
- Embedding = Mapping token → vector
Each dimension represents:
- Meaning
- Grammar
- Associations
- Synonyms
Training Process of LLMs
1. Pre-training
- Uses unstructured data
- Learns grammar, context, relationships
- Predicts next/missing words
2. Fine-tuning
- Uses labelled data
- Trains for specific tasks:
- Translation
- Sentiment analysis
How LLMs Generate Text
Flow:
Input → Tokens → Neural Network → Relationships → Predicted Token
- Output is generated word-by-word
- Based on probability of next token
Interacting with LLMs
1. GUI (Graphical Interface)
- Chat interfaces
- Simple and user-friendly
2. API (Application Programming Interface)
- Sends/receives data (JSON format)
- Used by developers
3. CLI (Command Line Interface)
- Terminal-based interaction
- Fast and flexible
AI Agents – Introduction
AI Agents are systems that:
- Act on your behalf
- Process inputs
- Make decisions
- Execute tasks
They can:
- Adapt
- Learn
- Communicate
- Work autonomously
