Choosing an LLM's size and architecture from quantitative evaluation metrics
When choosing an LLM for a GenAI application, engineers must balance quality metrics against cost, latency, and throughput requirements rather than picking the largest or newest model by default. Databricks recommends benchmarking candidate models on task-specific offline evaluation metrics using representative evaluation datasets before committing to production, and revisiting the choice as requirements or available models change.
1 · Learn the must-know
- Quantitative comparison should combine quality metrics (e.g., accuracy, F1, ROUGE/BLEU for summarization/translation, or LLM-judged relevance/correctness) with operational metrics like latency (time to first token, tokens/sec) and cost per token/request.
- Larger models generally yield higher quality on complex reasoning tasks but increase inference latency and cost, so the objective is to find the smallest/cheapest model that still meets the required quality bar for the specific task.
- Architecture choice matters: a general-purpose foundation model may need fine-tuning or a smaller specialized/instruction-tuned model may outperform a larger general model on a narrow task at lower cost.
- Mosaic AI Model Serving supports deploying and comparing multiple model endpoints (including external models, foundation models, and custom/fine-tuned models) so teams can run head-to-head evaluations under production-like conditions.
- MLflow Evaluate (mlflow.evaluate) can be used to run the same evaluation dataset and metric set across multiple candidate models/endpoints to produce comparable quantitative results before selecting a model.
- A common gotcha: optimizing purely for a single quality metric can be misleading—always evaluate against multiple metrics and real business constraints (cost, latency, context window, throughput) since the best-scoring model on one metric may be impractical to serve at scale.
2 · Check your understanding
A Generative AI Engineer is comparing two candidate LLMs for a customer support RAG application before selecting one for production. Using mlflow.evaluate() on a 500-question held-out set, a 7B-parameter model scores 0.81 on an LLM-judged answer correctness metric with a p90 latency of 400ms, while a 70B-parameter model scores 0.83 with a p90 latency of 2200ms. The application's SLA requires p90 latency under 800ms. Which model should the engineer select for production?
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
Ready for more? Take a weighted mock or try free practice questions.