Evaluation

Evaluation on Google Cloud is the practice of measuring generative AI model, prompt, RAG, multimodal, structured-output, and agent behavior using Vertex AI Gen AI Evaluation, custom metrics, autoraters, experiments, and scalable batch workflows. It combines model-based, computation-based, rubric-based, pairwise, trajectory, and task-specific metrics to compare systems and inspect failures before production use.

Synthesized across 77 notebooks. See the source pages under Notebooks below for line-level grounding.

Google Cloud evaluation workflows center on Vertex AI Gen AI Evaluation SDK and Service, where engineers prepare datasets, run or import model responses, define metrics, and inspect both aggregate scores and row-level explanations. The notebooks repeatedly emphasize controlled comparisons: use the same dataset, prompt template, metrics, project, and region when comparing models, prompts, RAG answer sets, or third-party systems.

Evaluation spans more than text quality. The material covers RAG groundedness and retrieval quality, structured JSON extraction, translation metrics, image and video Gecko-style rubric validation, tool-use evaluation, multi-turn agent simulation, agent trajectory metrics, and anomaly detection with traces, embeddings, BigQuery, and Vector Search.

The recurring engineering pattern is to start small, make outputs and schemas explicit, collect detailed traces or row-level results, then scale with Cloud Storage, BigQuery, Batch Prediction, Dataflow, or persisted evaluation runs. Demos often use small datasets, but several notebooks recommend around 100 examples for more reliable aggregate metrics.

Canonical workflow

  1. Enable the Vertex AI API, authenticate, configure PROJECT_ID, LOCATION, and any required Cloud Storage or BigQuery destinations.
  2. Create an evaluation dataset with the required columns for the task, such as prompt, response, reference, context, tool calls, predicted_trajectory, reference_trajectory, or multimodal file_data URIs.
  3. Generate responses with a target model or agent, or bring precomputed responses when using BYOD evaluation, batch evaluation, or unsupported direct multimodal inference paths.
  4. Define the evaluation metrics: predefined pointwise, pairwise, rubric, translation, groundedness, safety, trajectory, tool-use, computation-based, or CustomMetric metrics with explicit criteria and rubrics.
  5. Run EvalTask, Gen AI Evaluation Service, batch_evaluate, Batch Prediction, Agent Evaluation, or a pipeline workflow depending on scale and artifact requirements.
  6. Inspect summary metrics, row-level metrics, explanations, raw autorater output, parsed custom outputs, generated rubrics, and failed or mismatched cases.
  7. Compare runs under consistent experiments, prompt templates, datasets, and metrics; tune prompts, models, thresholds, rubrics, or agent logic based on evidence.
  8. Persist or retrieve results when needed, poll long-running jobs to terminal state, and clean up experiments, remote agents, buckets, pipeline jobs, and TensorBoard-backed runs when finished.

Best practices

See Evaluation - Best Practices for the full distilled guide.

  • Use a fixed dataset, metric set, prompt template, and experiment structure when comparing models, prompts, RAG outputs, or third-party systems.
  • Initialize Vertex AI with explicit project and location values, preferably with GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_REGION fallbacks.
  • Keep evaluation datasets structured and task-specific, with columns such as prompt, response, reference, context, instruction, intermediate_events, predicted_trajectory, and reference_trajectory as required.
  • Run inference before evaluation when agent or model evaluation needs generated response columns, intermediate events, traces, or tool-call outputs.
  • Define clear metric criteria and rating rubrics before running model-based or custom evaluations, and inspect MetricPromptTemplateExamples before customizing templates.
  • Request structured JSON from autoraters and classifiers with response_mime_type, response_schema, or strict output formats, then parse and validate results explicitly.

Key models & APIs

  • Vertex AI Gen AI Evaluation Service, Vertex AI Gen AI Evaluation SDK, Vertex AI EvalTask, Vertex AI Agent Engine, Vertex AI Agent Evaluation, Vertex AI Batch Prediction API, Vertex AI Pipelines, Dataflow ML, BigQuery, Cloud Storage JSONL evaluation inputs and outputs, Vector Search, Google Gen AI SDK, google-cloud-aiplatform[evaluation], CustomMetric, PointwiseMetric, PairwiseMetric, CustomOutputConfig, MetricPromptTemplateExamples, FunctionDeclaration and tool-call evaluation metrics, Gecko-style image and video rubric evaluation, gemini-2.5-flash, gemini-2.5-pro, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-embedding-001, text-embedding-004, text-bison@001, gemini-3.5-flash, gemini-3.1-pro-preview, meta/llama-3.1-8b-instruct-maas, meta/llama-3.1-70b-instruct-maas, claude-3-5-sonnet@20240620, gpt-5-mini, gpt-4o, deepseek-ai/deepseek-r1-0528-maas

Notebooks (77)

Embeddings & Vector Search (2)

Gemini (65)

Open Models (6)

Vertex AI Search (3)

Tools (1)


Part of the Generative AI Google Brain · Evaluation - Best Practices