0
0
Prompt Engineering / GenAIml~12 mins

System prompts and role setting in Prompt Engineering / GenAI - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - System prompts and role setting

This pipeline shows how system prompts and role settings guide a generative AI model to produce helpful and relevant responses. It starts with input text, applies system instructions, processes the input through the AI model, and outputs the final generated text.

Data Flow - 4 Stages
1User Input
1 text stringReceive user's question or request1 text string
"What is the weather today?"
2Apply System Prompt
1 text stringAdd system instructions and role setting to guide AI behavior1 combined prompt string
"You are a friendly assistant. Answer clearly. User: What is the weather today?"
3Model Processing
1 combined prompt stringAI model generates response based on prompt and role1 generated text string
"The weather today is sunny with a high of 25°C."
4Output Response
1 generated text stringSend generated text back to user1 text string
"The weather today is sunny with a high of 25°C."
Training Trace - Epoch by Epoch

Loss
2.5 |*****
2.0 |**** 
1.5 |***  
1.0 |**   
0.5 |*    
0.0 +-----
      1 2 3 4 5 Epochs
EpochLoss ↓Accuracy ↑Observation
12.50.30Model starts learning basic language patterns.
21.80.45Model improves understanding of prompt instructions.
31.20.60Model better follows role settings and generates relevant text.
40.80.75Model responses become clearer and more accurate.
50.50.85Model reliably produces helpful and role-consistent answers.
Prediction Trace - 3 Layers
Layer 1: Input Encoding
Layer 2: Context Understanding
Layer 3: Text Generation
Model Quiz - 3 Questions
Test your understanding
What is the main purpose of the system prompt in this pipeline?
ATo guide the AI's behavior and tone
BTo increase the size of the input data
CTo speed up the model training
DTo reduce the output length
Key Insight
System prompts and role settings help guide generative AI models to produce responses that match the desired style and content. Training improves the model's ability to understand and follow these instructions, resulting in clearer and more helpful answers.