Grounding overview

In generative AI, grounding is the ability to connect model output to verifiable sources of information. If you provide models with access to specific data sources, then grounding tethers their output to these data and reduces the chances of inventing content. This is particularly important in situations where accuracy and reliability are significant.

Grounding provides the following benefits:

  • Reduces model hallucinations, which are instances where the model generates content that isn't factual.
  • Anchors model responses to specific information.
  • Enhances the trustworthiness and applicability of the generated content.

In Vertex AI, you can ground supported model output in two main ways:

Grounding with Google Search

When you use Grounding with Google Search, it links the Google model to the internet. Since non-grounded generative AI model responses are considered new content based on learned patterns, you won't get factual responses which are time specific, for example, asking what the weather forecast is in your prompt. Since the internet provides access to existing and new information, a grounded prompt can give you nuanced and specific prompt responses, with little error, and with its sources cited.

Here's an example comparing a non-grounded prompt response and a grounded response:

Ungrounded Gemini Grounding with Google Search
Prompt: What is the 401k contribution limit?
Response: For 2023, the annual contribution limit for 401(k) plans is $22,500, up from $20,500 in 2022. Catch-up contributions for individuals aged 50 and over will remain at $7,500.
Prompt: What is the 401k contribution limit?
Response: Here's the deal with 401(k) contribution limits in 2024: The basic limit for employee contributions is $23,000 for 2024. That's up from $22,500 in 2023. If you're 50 or older, you can also contribute an extra $7,000 in catch-up contributions [1]....,Grounding sources
  1. 401(k) Contribution Limits for 2023 vs. 2024 - Investopedia, …[]

When you use Grounding with Google Search, you have to display search entry points in production and in your apps. See Search entry points for requirements when using Grounding with Google Search.

This following diagram explains how using Grounding with Google Search works for the Gemini API: Grounding overview

Ground to your own data

You can ground language models to your own text data using Vertex AI Search as a datastore. With Vertex AI Search you integrate your own data, regardless of format, to refine the model output. Supported data types include:

  • Website data: Directly use content from your website.
  • Structured data: Use organized, queryable data, for example, BigQuery data.
  • Structured content (media): Integrate structured media content for rich results.
  • Structured content for third-party data sources: Seamlessly incorporate data from external sources.
  • Unstructured data: Utilize raw, unformatted data.

When you ground to your specific data the model can perform beyond its training data. By linking to designated data stores within Vertex AI Search, the grounded model can produce more accurate and relevant responses, and responses directly related to your use case.

Here's an example comparing a private non-grounded prompt response and a grounded response:

Ungrounded Gemini Private grounded Gemini
Prompt: What's my company's PTO policy?

Response: I can't definitively answer questions about your specific company's PTO policy. PTO policies are set by individual companies and can vary depending on your company's size, location and industry.
Prompt: What's my company's PTO policy?

Response: Your company has an unlimited PTO policy. Approval is still required: Your manager must approve or deny requests based on workload, coverage, and company needs.

What's next