0
0
Prompt Engineering / GenAIml~20 mins

Memory for conversation history in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Conversation Memory Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does short-term memory affect conversation flow in AI chatbots?

Imagine an AI chatbot that can only remember the last 2 messages in a conversation. What is the most likely effect on the chatbot's responses?

AThe chatbot will provide very detailed answers about the entire conversation history.
BThe chatbot might lose context from earlier messages, causing less coherent replies.
CThe chatbot will remember everything perfectly and never forget any detail.
DThe chatbot will ignore the last messages and only respond based on its training data.
Attempts:
2 left
💡 Hint

Think about how limited memory affects understanding of ongoing topics.

Predict Output
intermediate
2:00remaining
What is the output of this conversation memory update code?

Given this Python code simulating conversation memory updates, what is the final memory content?

Prompt Engineering / GenAI
memory = []

# User says hello
memory.append('User: Hello')

# Bot replies
memory.append('Bot: Hi! How can I help?')

# User asks a question
memory.append('User: What is AI?')

# Limit memory to last 2 messages
memory = memory[-2:]

print(memory)
A['Bot: Hi! How can I help?', 'User: What is AI?']
B['User: Hello']
C['User: Hello', 'Bot: Hi! How can I help?', 'User: What is AI?']
D['User: Hello', 'User: What is AI?']
Attempts:
2 left
💡 Hint

Remember the memory is limited to the last 2 messages.

Model Choice
advanced
2:00remaining
Which model architecture is best for long conversation memory?

You want to build a chatbot that remembers long conversations (hundreds of messages). Which model architecture is best suited for this?

AA recurrent neural network (RNN) with gated units like LSTM or GRU.
BA linear regression model.
CA convolutional neural network (CNN) designed for image data.
DA simple feedforward neural network without memory components.
Attempts:
2 left
💡 Hint

Think about models designed to handle sequences and remember past inputs.

Hyperparameter
advanced
2:00remaining
Which hyperparameter controls how much past conversation is remembered in a Transformer model?

In Transformer-based chatbots, which hyperparameter mainly controls the length of conversation history the model can attend to?

ANumber of attention heads
BLearning rate
CMaximum sequence length (context window size)
DBatch size
Attempts:
2 left
💡 Hint

Consider what limits the input size the model can process at once.

Metrics
expert
2:00remaining
Which metric best measures how well a chatbot remembers conversation history?

You want to evaluate if a chatbot correctly uses past conversation context in its replies. Which metric is most appropriate?

ATraining loss on next word prediction without conversation context
BPerplexity on isolated sentences without conversation history
CBLEU score comparing generated replies to reference replies ignoring context
DContextual coherence score measuring relevance of replies to previous messages
Attempts:
2 left
💡 Hint

Think about a metric that checks if replies fit the conversation flow.