0
0
Prompt Engineering / GenAIml~12 mins

Conversation management in Prompt Engineering / GenAI - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - Conversation management

Conversation management helps AI keep track of what was said before, so it can respond in a way that makes sense and feels natural.

Data Flow - 6 Stages
1User Input
1 conversation turn (text)Receive user message1 conversation turn (text)
"Hi, can you help me book a flight?"
2Context Update
Previous conversation history + current user messageAdd new message to conversation historyUpdated conversation history with 2 turns
["Hi, can you help me book a flight?", "Yes, I can help you."]
3Intent Recognition
Updated conversation historyDetect user intent from textIntent label (e.g., 'book_flight')
"book_flight"
4Slot Filling
User messageExtract key details (slots) like date, destinationSlots dictionary (e.g., {"destination": "Paris", "date": "2024-07-01"})
{"destination": "Paris", "date": "2024-07-01"}
5Dialogue Policy
Intent + Slots + Conversation historyDecide next action (ask question, confirm, provide info)Action command (e.g., "ask_for_date")
"ask_for_date"
6Response Generation
Action commandCreate text reply to userResponse text
"What date would you like to fly?"
Training Trace - Epoch by Epoch

Loss
1.0 |***************
0.8 |************   
0.6 |********      
0.4 |******        
0.2 |***           
0.0 +-------------
     1 2 3 4 5 Epochs
EpochLoss ↓Accuracy ↑Observation
10.850.60Model starts learning to recognize intents and slots.
20.650.75Better understanding of user intents and slot extraction.
30.500.82Dialogue policy improves, better action decisions.
40.400.88Response generation becomes more accurate and relevant.
50.350.91Model converges with good intent recognition and response quality.
Prediction Trace - 6 Layers
Layer 1: User Input
Layer 2: Context Update
Layer 3: Intent Recognition
Layer 4: Slot Filling
Layer 5: Dialogue Policy
Layer 6: Response Generation
Model Quiz - 3 Questions
Test your understanding
What is the main purpose of the 'Slot Filling' stage?
ATo update the conversation history
BTo extract important details like dates and places from user messages
CTo decide what the AI should say next
DTo generate the final text response
Key Insight
Conversation management models work by understanding user intent, extracting key details, and keeping track of the conversation to respond naturally and helpfully.