PROMPT ENGINEERING
DAY 2
What is Generative AI ?
Generative AI is a type of artificial intelligence that can create new content—like text, images,
music, or code. It learns patterns from data and uses prompts to generate fresh, human-like
results. It’s like creativity powered by machines.
Architecture Of Generative AI :
Generative AI architecture is built using neural networks, especially transformers. It has layers
that understand input, process patterns, and generate new content. Models like GPT use
encoder-decoder or decoder-only setups to predict and create human-like text, code, or images.
AI Models :
● GPT-4 / GPT-4o (OpenAI) – Great for text, coding, and reasoning tasks
● DALL·E (OpenAI) – Generates images from text prompts
● Gemini 1.5 (Google DeepMind) – Multimodal model for text, code, images
● Claude 3 (Anthropic) – Strong in safe and long-form conversations
● LLaMA 3 (Meta)– Open-source model, used in research and custom apps
Large Language Models :
Introduction :
Large Language Models (LLMs) are advanced AI systems trained on massive amounts of text
data to understand and generate human-like language. They use deep learning, especially
transformer architecture, to recognize patterns in text and respond intelligently to prompts.
Models like GPT-4, Gemini, Claude, and LLaMA can perform tasks like writing, summarizing,
translating, coding, and answering questions. LLMs are used in chatbots, virtual assistants,
content creation, education, and many more fields, making human-AI interaction natural, fast,
and useful.
LLM Architecture :
Transformers are the building blocks of LLMs. They use attention to understand the relationship
between words, no matter their position. Unlike old models, transformers read input all at once,
making them faster and better at understanding context.
Key Components of Transformer Architecture:
Encoder & Decoder – Encodes input, decodes output (LLMs often use decoder-only)
Self-Attention – Helps the model focus on important words in context
Multi-Head Attention – Looks at input from multiple angles at once
Stacked Layers – Multiple layers help build deep understanding
Residual Connections – Pass info directly across layers for better learning
Real World Applications :
● Chatbots & Virtual Assistants – Like ChatGPT, Siri, or Alexa
● Text Summarization – Condensing long documents, articles, or emails
● Content Creation – Writing blogs, stories, social media posts
● Language Translation – Converting text from one language to another
● Education – Tutoring, quiz generation, explaining concepts
● Healthcare – Drafting reports, summarizing patient notes
● Coding Help – Generating code, debugging, explaining algorithms
● Search Enhancement – Making search results more relevant and smart
● Sentiment Analysis – Understanding emotions or opinions in text
● Legal & Business Docs – Drafting, reviewing, or summarizing contracts
Limitation Of LLM :
● Hallucination – May generate false or made-up information
● No true understanding – LLMs mimic patterns, not human thinking
● Outdated knowledge – Limited to training data; may miss recent events
● Biased outputs – Can reflect harmful or unfair biases from training data
● Context limits – Struggles with very long or deeply complex conversations
● Dependency on prompts – Poor prompts = poor results
● Privacy concerns – May unintentionally expose sensitive data
● Costly to run – Needs high computing power and energy
● Lacks common sense – Can make basic logic or factual errors
● Needs fine-tuning – Not perfect out-of-the-box for all tasks