Practice
1. A model performs well offline but poorly online. What is the most likely cause of this discrepancy?
medium
Solution
Step 1: Analyze the difference between offline and online environments.
Offline evaluation uses historical data, while online evaluation deals with live data, which may have a different distribution.Step 2: Eliminate other potential causes.
The model is overfitting to the training data. is incorrect because overfitting would likely affect both offline and online performance. The model's hyperparameters are not optimized. is incorrect because hyperparameter optimization affects both environments. The offline evaluation used an incorrect metric. is incorrect because using an incorrect metric would not cause a discrepancy between environments.Final Answer:
Option A -> Option AQuick Check:
Different data distribution online. [OK]
Hint: Different data distribution online. [OK]
Common Mistakes:
2. A model trained on a dataset shows unexpected bias against a minority group. What is the most likely root cause?
medium
Solution
Step 1: Identify the symptom.
Bias against a minority group indicates potential data imbalance.Step 2: Analyze the options.
Imbalanced data (B) is a common cause of bias. Other options relate to model complexity or training dynamics, not bias directly.Final Answer:
Option A -> Option AQuick Check:
Imbalanced data often leads to bias. [OK]
Hint: Imbalanced data often leads to bias. [OK]
Common Mistakes:
3. You are designing a transformer model for a language translation task. Which normalization technique would you choose and why?
hard
Solution
Step 1: Consider the architecture of transformers.
Transformers process sequences and often use self-attention mechanisms, where Layer Normalization is more effective.Step 2: Evaluate the benefits of Layer Normalization.
Layer Normalization normalizes across features, which is beneficial for the attention mechanism in transformers.Final Answer:
Option A -> Option AQuick Check:
Layer Norm fits transformers' self-attention. [OK]
Hint: Layer Norm fits transformers' self-attention. [OK]
Common Mistakes:
4. You need to train a model with a learning rate that decreases over time. Which approach would best suit this requirement?
hard
Solution
Step 1: Identify the requirement.
The requirement is for a learning rate that decreases over time.Step 2: Match the requirement to the solution.
A learning rate scheduler with SGD allows for controlled decrease over time.Final Answer:
Option D -> Option DQuick Check:
Scheduler with SGD for decreasing lr. [check]
Hint: Scheduler with SGD for decreasing lr. [check]
Common Mistakes:
5. You are tasked with designing a recommendation system for a high-dimensional dataset. Which approach would best handle the curse of dimensionality while maintaining performance?
hard
Solution
Step 1: Identify the challenge of high dimensions.
Matrix factorization reduces dimensionality effectively.Step 2: Eliminate wrong options.
Implement a simple content-based filtering system. doesn't reduce dimensions. Apply a deep learning model with many hidden layers. may overfit due to high dimensions. Use a rule-based system to manually curate recommendations. is not scalable for large datasets.Final Answer:
Option B -> Option BQuick Check:
Matrix factorization reduces dimensions, aids recommendations. [OK]
Hint: Matrix factorization reduces dimensions, aids recommendations. [OK]
Common Mistakes:
