Practice
Solution
Step 1: Understand the role of validation set
The validation set is used to tune hyperparameters and prevent overfitting to the test set.Step 2: Eliminate wrong options
To provide more data for training the model. is incorrect because the validation set is not used for training. To reduce the computational cost of training. is incorrect as validation increases computational cost. To increase the accuracy of the model. is incorrect because validation itself doesn't increase accuracy.Final Answer:
Option A -> Option AQuick Check:
Validation prevents overfitting to test set. [OK]
Solution
Step 1: Identify the method using a probabilistic model.
SentencePiece uses a probabilistic model to tokenize sentences.Step 2: Eliminate wrong options.
BPE and WordPiece do not use probabilistic models; character-level tokenization is too granular.Final Answer:
Option A -> Option AQuick Check:
SentencePiece uses probabilities. [OK]
import torch
Q = torch.rand(2, 3, 4)
K = torch.rand(2, 4, 4)
V = torch.rand(2, 4, 5)
output = torch.matmul(torch.matmul(Q, K.transpose(-2, -1)), V)Solution
Step 1: Analyze matrix multiplications
The first multiplicationtorch.matmul(Q, K.transpose(-2, -1))results in a shape of (2, 3, 4). The second multiplication with V results in (2, 3, 5).Step 2: Eliminate wrong options
(2, 4, 5) is incorrect because it assumes incorrect dimensions for Q. (2, 3, 4) is incorrect because it doesn't account for the final multiplication with V. (2, 5, 5) is incorrect because it assumes incorrect dimensions for the final output.Final Answer:
Option D -> Option DQuick Check:
Check matrix dimensions after each multiplication. [OK]
Solution
Step 1: Identify the need for integration
A hybrid system allows for leveraging the strengths of both historical and real-time data.Step 2: Evaluate the options
Use a batch processing system to handle both data types simultaneously. does not effectively integrate real-time updates. Train separate models for historical and real-time data and average their predictions. may lead to inconsistent predictions. Rely solely on real-time data for predictions to ensure up-to-date results. ignores valuable historical data.Final Answer:
Option A -> Option AQuick Check:
Hybrid systems leverage both data types effectively. [OK]
Solution
Step 1: Apply the No Free Lunch Theorem
The theorem suggests no single model is best for all scenarios, so testing is essential.Step 2: Eliminate wrong options
Use the same model that worked for the previous user base. is incorrect because past success doesn't guarantee future performance. Increase the model complexity to handle diverse user preferences. is incorrect because complexity doesn't ensure better results. Rely on collaborative filtering as it works well for recommendations. is incorrect because collaborative filtering isn't universally optimal.Final Answer:
Option C -> Option CQuick Check:
Test models with new data. [OK]
