In a key-value memory network, what is the main step used to retrieve the correct value from memory?
Think about how the network finds the right information based on the input.
The key-value memory network compares the input query to stored keys to find the closest match, then returns the associated value.
What is the output of the following code that calculates attention weights over memory keys?
import numpy as np query = np.array([1, 0]) keys = np.array([[1, 0], [0, 1], [1, 1]]) scores = keys @ query weights = np.exp(scores) / np.sum(np.exp(scores)) print(weights)
Check how the dot product scores are computed and then converted to probabilities.
The scores are dot products of keys and query: [1, 0, 1]. Applying softmax gives the weights shown.
When increasing the size of an external memory in a retrieval model, which effect is most likely to occur if the memory size is too large without proper regularization?
Think about how too much information can confuse retrieval.
Too large memory without constraints can cause the model to retrieve noisy or irrelevant data, hurting accuracy.
What error will the following code raise when trying to retrieve a value from memory?
memory = {'apple': 'fruit', 'carrot': 'vegetable'}
query = 'banana'
value = memory[query]
print(value)What happens if you try to access a dictionary key that does not exist?
Accessing a missing key in a dictionary raises a KeyError in Python.
Which model architecture is best suited for retrieving relevant long-term context in a dialogue system with very large memory?
Consider models designed to read and write to external memory with flexible addressing.
DNCs use content-based addressing to read/write from large external memory, making them ideal for long-term context retrieval.