Google Professional Machine Learning Engineer Question 352
Select 3Google Cloud PlatformYou are designing a machine learning model to predict user churn for a subscription service. During training, the model demonstrates high accuracy, but inference latency during serving is too high for the production environment. Which actions should you take to optimize the model for production serving while maintaining acceptable accuracy?
- A
Use model quantization to reduce the precision of numerical computations.
- B
Increase the batch size during inference to improve throughput.
- C
Replace the model with a simpler architecture that has fewer parameters.
- D
Add additional layers to the model to improve its representational capacity.
- E
Use pruning techniques to remove less important connections in the model.
Show answer and explanation
Correct answers: A, C, E
Explanation
Optimizing ML models for production serving involves balancing computational efficiency and accuracy. Techniques like quantization and pruning reduce the computational overhead while maintaining model performance. Simplifying the architecture can also help achieve faster inference, though it may slightly impact accuracy. Increasing batch size only impacts throughput, not individual request latency, and adding layers increases complexity, which is counterproductive.
- A. Correct.
Model quantization reduces the precision of the weights and activations (e.g., from 32-bit floating point to 8-bit integers), which can significantly reduce inference time and memory usage with minimal impact on accuracy.
- B. Incorrect.
Increasing the batch size during inference may improve throughput but does not directly address the issue of high latency per individual request, which is critical in real-time production environments.
- C. Correct.
Simplifying the model architecture (e.g., using fewer layers or smaller hidden units) reduces computational complexity, which can lower inference latency at the cost of some accuracy.
- D. Incorrect.
Adding additional layers increases the complexity of the model, which would likely increase inference latency and is not a viable solution for optimizing production serving.
- E. Correct.
Pruning removes less important weights or connections in the model, reducing its size and computational requirements while maintaining accuracy, making it a suitable optimization technique for production.