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 your data sources.
- Enhances the trustworthiness and applicability of the generated content by providing citations and confidence scores.
In Vertex AI, you can ground supported model output in two ways:
For language support, see Supported languages for prompts.
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 in your prompt what's the weather forecast. Because the internet provides access to existing and new information, a grounded prompt can give you nuanced and specific prompt responses, with little error and cited sources.
Grounding with Search supports dynamic retrieval that gives you the option to generate grounded results with Search only when necessary. Therefore, the dynamic retrieval configuration evaluates whether a prompt requires knowledge about recent events and enables grounding with Search. For more information, see Dynamic retrieval.
Here's an example comparing a non-grounded prompt response and a grounded response:
Ungrounded Gemini | Grounding with 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,500 in catch-up contributions. |
- To use grounding with Search, see Ground to public data using Search.
When you use grounding with Search, and you receive Search suggestions in your response, you must display Search suggestions in production and in your applications. See Search suggestions for requirements when using grounding with Search.
This following diagram explains how using grounding with Search works for the Gemini API:
Ground to your data
You can ground language models to your text data using Vertex AI Search as a data store. To refine the model output with Vertex AI Search, you can integrate your data, regardless of format.
For more information on how to ground your data, see Ground with your data.
Supported data types
Data type | Description |
---|---|
Website | Directly use content from your website. You must create a website data store, and enable the following: |
Document and file formats | Supported document types include PDF, HTML, TXT, DOCX, and PPTX files. CSV is available for FAQ. |
Example
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 citations to your relevant data sources.
Here's an example comparing a non-grounded prompt response and a grounded response:
Non-grounded 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.[1] Grounding source: 1. Employee handbook.pdf |
What's next
- To learn more about how to ground Gemini models to your data, see Ground to your data.
- To learn more about responsible AI best practices and Vertex AI's
safety filters, see Responsible AI.