Introduction To Generative AI
Generative AI is a type of artificial intelligence that can create new content, such as text, images, and music. It is different from traditional AI, which is used to analyze data and make predictions.
Traditional AI vs Generative AI:
Traditional AI also known as narrow or weak AI, is designed to perform a specific task. It's like a skilled worker who is trained to do one job very well. It uses rules-based-systems, decision trees, and machine learning algorithms to make decisions. How it works:
Input Data -> Processing(Rules, Decision Trees) -> Output(Prediction, Classification)
Simple example is Email Spam Filter which is trained on dataset of emails to learn patterns and characteristics of spam emails. Limitations: Not very good to handle complex, dynamic or uncertain situations Requires a lot of data to train and can be biased if data is incomplete or inaccurate Not creative or innovative as it's limited to rules and patters its trained on.
Generative AI: It is a type of AI that can generate new, original content, such as images, music, or text. It's like a creative artist who can come up with new ideas and concepts. Uses Neural Networks and Deep Learning Algorithms to learn patterns and relationships in data. How it works:
Input Data -> Encoder(Neural Network) -> Latent Space (Vector Representation) -> Decoder (Neural Network) -> Output (Generated Content)
A great example of generative AI is a language model like ChatGPT. It's trained on a massive dataset of text to learn the patterns and relationships between words, phrases, and sentences. When you ask it a question or provide a prompt, it generates a response based on its understanding of the context and the patterns it's learned. Advantages: It can handle complex, dynamic, or uncertain situations more effectively. It can generate new, original content, such as images, music, or text. It can learn from incomplete or inaccurate data and still produce good results.
| Traditional AI | Generative AI |
|---|---|
| Siri or Google Assistant | Chatbots |
| Facebooks Face Recognition | Language Translation (Google Translate) |
| Netflix's movie recommendations | Art Generation Tools (DallE, midjourney) |
Why GenAI Now ?

-
Data Explosion:
- We have unprecendented volumes of digital data, which serves as training material for GenAI models.
- Sources like Social Media(Twitter, Redit), Books, Research Papers, YouTube, WikiPedia, Open Source Code (GitHub), etc
- A stat says that GPT-4 was trained on trillions of tokens from diverse domains
- It's like teaching a student who has read every book in a massive library, watched every TED talk, and browsed the internet
-
Compute Power:
-
Hardware Evolution: High-performance GPUs (NVIDIA A100, H100), TPUs (by Google), and AI-specific chips can handle the vast computations needed to train large models.
-
Cloud Scalability: Services like AWS, Azure, GCP let researchers and startups access this compute power without owning it.
-
Impact: What used to take months of processing can now be done in days or hours.
-
🔧 Think of it like giving AI a supercharged brain and a 10,000-core processor.
- Transformer Architecture:
- Introduced in paper Attention is All You Need in 2017
- Replaced older models like RNNs and LSTMs for sequence understanding
- Key idea is to use self-attention to focus on relevant parts of input while processing (like how you pay attention to key sentenes when reading)
- Results:
- BERT (Google)
- GPT (OpenAI)
- PaLM (Google)
- Gemini (Google DeepMind)
What are Foundation Models

-> AI -> Machine Learning (Developing algorithms which allows computers to learn from data and make predictions). Here we have supervised learning where models are trained on known data and unsupervised learning where models find patterns in data with predefined labels and reinforcement learning which is a feedback based learning.
-> AI -> Machine Learning -> Deep Learning. It focuses on Artificial Neural Networks with multiple layers. Not all machine learning is deep learning.
-> AI -> Machine Learning -> Deep Learning -> Foundation Models. These are large neural networks trained on huge amount of data and act as a base foundation for applications. These models can be from image recognition to language translation to content generation.
-> AI -> Machine Learning -> Deep Learning -> Foundation Models -> LLM. These are specific type of foundation models which are centred around processing and generating human like text. Based on the use case, they can be trained to produce data like Video, Audio and Image etc.
High Level Architecture:

Architecture Behind Foundation Models
Transformer architecture is the backbone behind the Foundation Models
-> Transformer is a neural network architecture designed to handle sequential data like language, code, images without relying on RNNs. It uses self- attention mechanism to weigh the importance of different words or tokens in a sentence or sequence.
What is Self-Attention Mechanism:
It basically allows model to dynamically focus on different parts of the input, regardless of position. For eg, The cat sat on the mat, and it was soft. The word "it" needs to refer to mat, not the cat. With self-attention, the model can learn which word it refers to based on context - rather than by fixed position like in older RNN models.
Encoder-Decoder vs Decoder-only

These are basically the model designs used in foundation models especially language models.
Encoder-Decoder (Gemini, Google Translate)
- Used for tasks that involve input -> output transformation like:
- Translation: English -> Hindi
- Summarization: Long Paragraph -> Summary
- Q&A: Question -> Answer
- How it works:
- Encoder takes input text, converts to vectore embeddings and understands context deeply
- Decoder uses vectors from encoders to generate final anaswer token by token
Decoder-Only (GPT-3, GPT-4, LLaMA, ChatGPT)
- Used for text generation from scratch where only prompt is given
- How it works:
- Only a Decoder is used
- It takes a prompt (e.g., “Once upon a time”) and predicts the next word based on what it has seen before.
- It keeps generating one token at a time
| Feature | Encoder-Decoder | Decoder-Only |
|---|---|---|
| Structure | Two Parts: Encoder + Decoder | Only Decoder |
| Use Case | Translation, Summarization, Q&A | Chat, Story Writing, Code Generation |
| Data Flow | Input -> Embedding -> Output | Prompt -> Output |
| Eg | Gemini, FLAN-T5 | GPT, LLaMA |
Pretraining and Fine-Tuning
Pretraining is where models are trained using self-supervised learning - no labels, just predicting what comes next or what's missing. There are 2 key objectives :
Next Token Prediction

Masked Language Modeling

RLHF (Reinforcement Learning with Human Feedback)
(Explain how i am planning to use this in PromptOS) -> Even after pretraining + fine-tuning , models may lack alignment. RHLF helps to train models to behave like human assistants -> Steps:
- Human annotators rank output from model
- A reward model is trained from this feedback
- Model is further fine tuned via Reinforcement Learning. In reality, it is currently used in ChatGPT, Claude, Gemini for improved dialogue safety, tone, etc.
Emerging Techniques (LoRa, RAG)
LoRa is Low Rank Adaptation of Large Language Models which is a popular and lightweight training technique that significantly reduces the number of trainable parameters. It works by inserting a smaller number of new weights into the model and only these are trained. This makes training with LoRA much faster, memory-efficient, and produces smaller model weights (a few hundred MBs), which are easier to store and share. Explain Flux Lora with demo
Key Capabilities of Foundation Models
-> FM are not just about generating text. They are moving from single-purpose to general-purpose, multimodal assistants that understand and generate across domains.
Language Generation
- Generating fluent, coherent, and context aware human like text - from essays to poetry.
- Based on next-token prediction
- Uses decoder-only transformers
- Predicts word by word with learned probabilities
Translation and Summarization
- Handled by encoder-decoder models like T5, mBART.
- For translation: Encoder understands source language → Decoder generates in target language.
- For summarization: Long input is compressed and regenerated as a short summary.
Conversational AI
- Natural language interaction with users in the form of chats, voice assistants, and Q&A.
- Built using decoder-only models (GPT-style) fine-tuned with RLHF for alignment and safety.
- Maintains context and memory (chat history window).
- Often integrated with tools/plugins/RAG for real-time or grounded answers.
Image Captioning and Generation
- Captioning: Describing what’s in an image.
- Generation: Creating new images from text.
- Uses Vision + Language Transformers
- Image encoding via CNN -> Text decoder
- Text to image via DALL-E, Stable Diffusion
Code Generation
- Writing or completing code from natural language instructions or partially written code.
-
- Trained on large-scale code datasets (GitHub, Stack Overflow)
-
- Uses decoder-only LLMs (e.g., Codex, Code LLaMA, Gemini Pro 1.5)
-
- Includes multi-line understanding and syntax/context awareness
Multimodal Integration (Vision + Language + Audio)
- Ability to process and understand multiple forms of input — images, text, audio, video — together.
-
- Powered by Multimodal Transformers (e.g., Gemini, GPT-4o, Sora, Flamingo).
-
- Combines different encoders (for text, vision, audio) and joint attention layers.
-
- Often uses fusion techniques like early-fusion or late-fusion depending on task. (Create a sora video to present in front of them along with a prompt)
Applications of Foundation Models
Education
- Me personally using NoteBook LM for my end sem preparation
- Research Paper Summarization using Perplexity
- Lecture Content Generation
Business Automation
- Automating email, reports, customer responses
- AI copilots in tools (Excel, MS Teams, Gmail)
- eg Notion AI
Customer Support
- Tell what scogo ai has done. Its the best example
Creative Arts & Media
- Generating art, music, film scenes, or marketing content
-
- DALL·E: Creating illustrations for books
-
- Sora (OpenAI): Making short videos from text
-
- Midjourney: Magazine covers and fashion designs
Software Development & Engineering
- Debugging is easier
- Explaining legacy codebases in human language
-
- GitHub Copilot suggests real-time code
-
- Gemini generates scripts for automation
Risks and Ethical Concerns
🛑 Major Risks
| Risk | Explanation | Example |
|---|---|---|
| ⚖️ Bias & Fairness | Models reflect biases in their training data | Discriminatory job descriptions, sexist translations |
| 🤥 Hallucinations | Confidently generates false information | Fabricated citations in research or legal text |
| 🔐 Privacy & Data Leakage | Model may memorize and regurgitate private data | AI accidentally revealing sensitive patient data |
| 💣 Misinformation & Deepfakes | Used to spread fake news, images, or videos | Fake political videos via Sora or DALL·E |
| 🎣 Prompt Injection / Jailbreaking | Users can trick the model into unsafe behaviors | Bypassing filters to get harmful responses |
| 📉 Over-reliance | Users may blindly trust AI without verification | Students using ChatGPT to write entire assignments |
Hands-on Demos / Tools (Throughout the session will be given)
Future of Foundation Models
Agentic AI (Autonomous AI Agents)
- Models that take actions, plan tasks, and act on your behalf
- https://jules.google/
- AutoGPT: Plans a task and executes it step-by-step
Continual Learning / AutoML
- Models that improve over time or adapt to new data without retraining from scratch.
- Google’s Gemini 1.5 supports longer memory & contextual learning
- Fine-tuned ChatGPTs that evolve with usage
⚔️ Open Source vs Proprietary Models
| Criteria | Open Source (e.g., LLaMA, Mistral) | Proprietary (e.g., GPT-4, Gemini) |
|---|---|---|
| ✅ Transparency | Full access to weights | Closed black-box |
| ⚙️ Customization | Fine-tune and self-host | Limited options |
| 🔐 Data Privacy | Fully local options possible | Depends on cloud vendor |
| ⚡ Performance | Needs infra investment | High-performance out-of-box |
| 💡 Examples | Open LLaMA, Mistral, Falcon | GPT-4, Claude, Gemini |