Courseiva
Model Development →hardMultiple Choice

Databricks-ML-Pro Model Development Practice Question

An ML engineer is using MLflow to track a deep learning experiment with PyTorch on Databricks. They want to capture the model's architecture, optimizer state, and training metrics, and later reproduce the exact training run. They call `mlflow.pytorch.autolog()` before training. After several epochs, they notice that metrics are logged but the model signature is missing, and the logged model cannot be loaded for inference without specifying the input example. What should they do to ensure the model is properly logged with a signature?

⚠ Common exam trap

The trap here is believing that autologging automatically captures the model signature for PyTorch, when it often requires an explicit input example.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Explicitly log the model using `mlflow.pytorch.log_model()` with the `signature` argument, computed from a sample input using `mlflow.models.infer_signature()`.

Autologging for PyTorch does not automatically infer a model signature unless an input example is provided. To ensure a signature, explicitly log the model with mlflow.pytorch.log_model and pass a signature generated by mlflow.models.infer_signature using sample input. This enables proper model loading and inference without manual input specification.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Explicitly log the model using `mlflow.pytorch.log_model()` with the `signature` argument, computed from a sample input using `mlflow.models.infer_signature()`.

    Why this is correct

    Autologging for PyTorch may not infer a signature unless an input example is provided. To guarantee a signature, you must explicitly log the model with mlflow.pytorch.log_model and pass a signature created via mlflow.models.infer_signature using a representative input sample. This ensures the model can be loaded for inference without manual input specification and enables validation.

  • ✗

    Use `mlflow.pytorch.save_model()` instead of `log_model()` to automatically include a signature.

    Why it's wrong here

    `save_model` saves the model to a local path but does not log it to the MLflow tracking server, nor does it automatically infer a signature. It requires manual specification of the signature if needed. Using save_model would not address the missing signature in the tracked run and would complicate reproducibility. The correct approach is to log the model with an explicit signature.

  • ✗

    Provide an input example to `mlflow.pytorch.autolog()` via the `log_every_n_step` parameter.

    Why it's wrong here

    log_every_n_step controls logging frequency, not signature inference. It does not provide an input example. Without an input example, autolog cannot infer the signature. The parameter name is also misleading; the correct way to supply an example is through the `input_example` argument in `mlflow.pytorch.log_model` or by using autolog's `log_models` with an example, but autolog does not accept an input example directly in that manner.

  • ✗

    Set the environment variable `MLFLOW_LOG_MODEL_SIGNATURE` to `true` before training.

    Why it's wrong here

    There is no such environment variable in MLflow. Signature logging is controlled programmatically, not via environment variables. Autologging may log a signature if an input example is provided during model logging, but there is no global switch. Relying on a non-existent variable would not solve the missing signature issue.

About these practice questions

This Databricks-ML-Pro question is part of Courseiva's 300-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Databricks exam blueprint

This Databricks-ML-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Pro exam.