How to Ensure Consistent Preprocessing for Online TF Predictions?
You need to develop a custom TensorFlow model that will be used for online predictions. The training data is stored in BigQuery You need to apply instance-level data transformations to the data for model training and serving. You want to use the same preprocessing routine during model training and serving. How should you configure the preprocessing routine?
Community Votes
100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
Tests the implementation of reproducible instance-level feature engineering; the common trap is selecting BigQuery or Vertex AI Pipelines, which cannot reliably enforce code parity during low-latency online serving.
This question evaluates best practices for unifying training and serving data transformations in Google Cloud ML workflows. Candidates should recognize that Apache Beam paired with TensorFlow Transform via Dataflow guarantees identical preprocessing logic for both phases.
Option C is often selected due to its focus on custom prediction routines, but it incorrectly shifts preprocessing responsibility to the client, risking inconsistency and unacceptable latency for real-time inference.
Community Discussion (6 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Combining Apache Beam with TensorFlow Transform (TFT) and running it on Dataflow creates a standardized preprocessing pipeline that outputs a serialized graph. This graph is automatically bundled with the trained TensorFlow model, ensuring that every instance-level transformation applied during training is executed identically during online serving. Google’s official ML architecture guidelines explicitly recommend this pattern to eliminate training-serving skew.Why the Other Options Are Wrong
Option A relies on BigQuery scripts, which are optimized for batch analytics rather than low-latency online inference and do not share executable code with the serving environment. Option B uses Vertex AI Pipelines for orchestration, but it does not inherently solve the problem of baking preprocessing logic into the serving runtime for individual requests. Option C suggests a custom prediction routine, but requiring clients or end-users to replicate the preprocessing logic introduces version drift, increases network overhead, and violates the principle of server-side consistency.Community Comment Notes
The community overwhelmingly supports Option D, citing official TensorFlow best practices that prioritize Dataflow and TFT for consistent instance-level transformations [1][2]. Multiple candidates reference the TFX documentation table recommending this exact stack to prevent training-serving skew [4]. Comments also highlight that shifting preprocessing to clients or relying on external SQL scripts breaks the unified code requirement emphasized in the prompt [3][5].Official Reference
Exam Strategy
When exam scenarios stress identical preprocessing for training and online serving, prioritize architectures that serialize the transformation graph alongside the model. Always rule out client-side preprocessing or external database queries for real-time inference, as they inherently introduce latency and version mismatch risks.
Related Analysis
Practice All PMLE Questions
Access 65 questions with complete answers and detailed explanations.
View Full PMLE Practice Test →