0
0
Prompt Engineering / GenAIml~12 mins

What Generative AI actually is in Prompt Engineering / GenAI - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - What Generative AI actually is

Generative AI creates new content like text, images, or music by learning patterns from existing data. It starts with input data, learns features, trains a model to generate similar outputs, and then produces new examples.

Data Flow - 5 Stages
1Data Collection
10000 samples x variable length textGather diverse text data from books, articles, and websites10000 samples x variable length text
"The sun rises in the east."
2Preprocessing
10000 samples x variable length textClean text, tokenize words, convert to numbers10000 samples x 50 tokens
[101, 2023, 2003, 1037, 2742, 102]
3Feature Engineering
10000 samples x 50 tokensCreate embeddings representing word meanings10000 samples x 50 tokens x 768 features
[[0.12, -0.05, ..., 0.33], [...], ...]
4Model Training
10000 samples x 50 tokens x 768 featuresTrain a neural network to predict next wordTrained model weights
Model learns to predict 'sun' after 'The'
5Generation
Seed text tokensUse trained model to generate new text tokensGenerated text sequence
"The sun rises in the morning and shines brightly."
Training Trace - Epoch by Epoch
Loss
2.5 |*****
2.0 |****
1.5 |***
1.0 |**
0.5 |*
    +------------
     1 2 3 4 5 Epochs
EpochLoss ↓Accuracy ↑Observation
12.50.30Model starts learning basic word patterns
21.80.45Model improves predicting next words
31.30.60Model captures grammar and simple context
41.00.70Model generates more coherent sentences
50.80.78Model produces fluent and relevant text
Prediction Trace - 5 Layers
Layer 1: Input Tokenization
Layer 2: Embedding Layer
Layer 3: Neural Network Layers
Layer 4: Softmax Activation
Layer 5: Word Selection
Model Quiz - 3 Questions
Test your understanding
What does the embedding layer do in Generative AI?
ACleans the input text
BGenerates the final text output
CTurns words into numbers representing their meaning
DSplits text into sentences
Key Insight
Generative AI learns patterns from data to create new content by predicting what comes next. It transforms raw input into meaningful features, trains a model to understand context, and then generates new, coherent outputs.