Skip to content

Picking the best model for a task from experiment metrics

Selecting the best model for a generative AI application requires comparing candidate models (or prompt/model combinations) against task-appropriate metrics logged during experimentation, rather than relying on a single default measure like accuracy. MLflow's tracking and evaluation capabilities let engineers log parameters, metrics, and outputs for each run so models can be compared side-by-side before choosing one for deployment.

1 · Learn the must-know

  • Metric choice must match task type: use ROUGE/BLEU or LLM-judged relevance/coherence for summarization and generation tasks, and toxicity/answer relevance/groundedness metrics for RAG and chat use cases rather than generic classification metrics.
  • MLflow LLM evaluation (mlflow.evaluate) can compute both heuristic metrics (e.g., ROUGE, exact match, token count) and LLM-as-a-judge metrics (e.g., answer correctness, relevance, faithfulness) in a single run, logged alongside latency and cost.
  • Latency and cost per token/request are critical practical metrics for model selection in production, not just quality scores, since a marginally better-quality model may be unacceptable if it is too slow or expensive.
  • Comparing runs in the MLflow Experiment UI (or via the API) allows side-by-side inspection of metrics, parameters, and sample outputs across multiple models or prompt versions to make an evidence-based selection.
  • A model that scores well on one metric (e.g., fluency) may score poorly on another (e.g., faithfulness/groundedness), so the best model choice depends on weighting the metrics most aligned with business/task requirements, not picking the top score on any single metric.
  • Guardrail and safety metrics (e.g., toxicity, PII detection) should be evaluated alongside quality metrics, since a high-quality but unsafe output disqualifies a model regardless of other scores.

2 · Check your understanding

Check this objectiveFree · always available

A Generative AI Engineer runs an MLflow experiment comparing three candidate LLMs for a customer support summarization endpoint. The experiment logs rouge1, latency_p90_ms, and cost_per_1k_tokens for each run. The service level agreement requires p90 latency under 800 ms. Model A logs rouge1 0.42 and latency_p90_ms 650. Model B logs rouge1 0.51 and latency_p90_ms 1200. Model C logs rouge1 0.39 and latency_p90_ms 500. Which model should the engineer select?

Your objective map0 tried · 0 answered correctly · 56 untouched

What you have tried across Databricks GenAI Engineer's objectives, not a readiness score.

Design Applications10.71% of the exam*0 of 6 tried
Data Preparation14.29% of the exam*0 of 8 tried
Application Development23.21% of the exam*0 of 13 tried
Assembling and Deploying Applications26.79% of the exam*0 of 15 tried
Governance7.14% of the exam*0 of 4 tried
Evaluation and Monitoring17.86% of the exam*0 of 10 tried

* Our estimate. Databricks publishes no section weights.

3 · Keep going