Choose a natural language processing function

This document provides a comparison of the natural language processing functionsavailable in BigQuery ML, which areAI.GENERATE_TEXT,ML.TRANSLATE,andML.UNDERSTAND_TEXT.You can use the information in this document to help you decide which functionto use in cases where the functions have overlapping capabilities.

At a high level, the difference between these functions is as follows:

  • AI.GENERATE_TEXT is a good choice for performing customized naturallanguage processing (NLP) tasks at a lower cost. This function offers morelanguage support, faster throughput, and model tuning capability, and alsoworks with multimodal models.
  • ML.TRANSLATE is a good choice for performing translation-specific NLPtasks where you need to support a high rate of queries per minute.
  • ML.UNDERSTAND_TEXT is a good choice for performing NLP tasksthat are supported by the Cloud Natural Language API.

Function comparison

Use the following table to compare theAI.GENERATE_TEXT,ML.TRANSLATE, andML.UNDERSTAND_TEXT functions:

AI.GENERATE_TEXTML.TRANSLATEML.UNDERSTAND_TEXT
Purpose

Perform any NLP task by passing a prompt to aGemini or partner model or to anopen model.

For example, to perform a question answering task, you could provide a prompt similar toCONCAT("What are the key concepts in the following article?: ", article_text).

Use theCloud Translation API to perform the following tasks:Use theCloud Natural Language API to perform the following tasks:
Billing

Incurs BigQuery ML charges for data processed. For more information, seeBigQuery ML pricing.

Incurs Vertex AI charges for calls to the model. If you are using a Gemini 2.0 or greater model, the call is billed at the batch API rate. For more information, seeCost of building and deploying AI models in Vertex AI.

Incurs BigQuery ML charges for data processed. For more information, seeBigQuery ML pricing.

Incurs charges for calls to the Cloud Translation API. For more information, seeCloud Translation API pricing.

Incurs BigQuery ML charges for data processed. For more information, seeBigQuery ML pricing.

Incurs charges for calls to the Cloud Natural Language API. For more information, seeCloud Natural Language API pricing.

Requests per minuteNot applicable for Gemini models. Between 25 and 60 for partner models. For more information, seeRequests per minute limits. 200. For more information, seeCloud AI service functions. 600. For more information, seeCloud AI service functions.
Tokens per minuteRanges from 8,192 to over 1 million, depending on the model used. No token limit. However,ML_TRANSLATE does have a30,000 bytes limit.100,000.
Input dataSupports both text and unstructured data from BigQuery standard tables and object tables.Supports text data from BigQuery standard tables.Supports text data from BigQuery standard tables.
Function outputOutput can vary for calls to the model, even with the same prompt.Produces the same output for a given task type for each successful call to the API. The output includes information about the input language.Produces the same output for a given task type for each successful call to the API. The output includes information about the magnitude of the sentiment for sentiment analysis tasks.
Data contextYou can provide data context as part of the prompt you submit.Not supported.Not supported.
Supervised tuningSupervised tuning is supported for some models.Not supported.Not supported.
Supported languagesSupport varies based on the LLM you choose.Supports Cloud Translation APIlanguages.Supports Cloud Natural Language APIlanguages.
Supported regionsSupported in all Generative AI for Vertex AIregions.Supported in theEU andUS multi-regions.Supported in theEU andUS multi-regions.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.