Generative AI training and extraction lets you:
- Use zero-shot and few-shot technology to get a high performing model with little to no training data using the foundation model.
- Use fine-tuning to further boost accuracy as you provide more and more training data.
Generative AI training methods
The training method you choose depends on the amount of documents you have available and the amount of effort available to put into training your model. There are three ways to train a generative AI model:
| Training method | Zero-shot | Few-shot | Fine-tuning |
|---|---|---|---|
| Accuracy | Medium | Medium-high | High |
| Effort | Low | Low | Medium |
| Recommended number of training documents | 0 | 5 to 10 | 10 to 50+ |
Custom extractor model versions
The following models are available for custom extractor. To change model versions, see Manage processor versions.
Versions 1.4, 1.5 and 1.5 Pro support confidence scores.
| Model version | Description | Release channel | ML processing in US/EU | Fine-tuning in US/EU | Release date |
|---|---|---|---|---|---|
pretrained-foundation-model-v1.5-2025-05-05 |
Production-ready candidate powered by Gemini 2.5 Flash LLM. Recommended for those who want to experiment with newer models. | Stable | Yes | US, EU | May 5, 2025 |
pretrained-foundation-model-v1.5-pro-2025-06-20 |
Production-ready model powered by the Gemini 2.5 Pro LLM. Supports a quota of up to 30 pages per minute for online process requests. This model has improved quality compared to v1.5, and may have a higher latency. | Stable | Yes | No | June 20, 2025 |
pretrained-foundation-model-v1.5.1-2025-08-07 |
Public preview model powered by the Gemini 2.5 Flash LLM. This model has the same features as v1.5, and has improved adaptive few-shot learning. | Release candidate | Yes | No | August 8, 2025 |
pretrained-foundation-model-v1.6-pro-2025-12-01 |
Preview model powered by the Gemini 3 Pro LLM. | Release candidate | Yes | No | December 1, 2025 |
pretrained-foundation-model-v1.6-2026-01-13 |
Preview model powered by the Gemini 3 Flash LLM. | Release candidate | Yes | No | January 13, 2026 |
pretrained-foundation-model-v3.5-2026-05-26 |
Preview model powered by the Gemini 3.5 Flash LLM. | Release candidate | Yes | No | May 26, 2026 |
To change the processor version in your project, review Managing processor versions.
To make a Quota Increase Request (QIR) for the default processor quota, follow the steps to request a quota adjustment.
Initial setup
If not done so already, enable billing and the Document AI APIs.
Build and evaluate a generative AI model
Create a processor and define fields you want to extract following best practices, which is important because it impacts extraction quality.
- Go to Workbench > Custom extractor > Create processor > Assign a name.

- Go to Get started > Create new field.

Import documents
- Import documents with auto-labeling and assign documents to the training and test set.
- For zero-shot, only the schema is required. To evaluate the accuracy of the model, only a testing set is needed.
- For few-shot, we recommend five training documents.
- The number of needed testing documents depend on the use case. Generally, more testing documents is better.
- Confirm or edit the labels in the document.
Train model:
- Select the Build, then Create new version.
- Enter a name and select Create.

Evaluation:
- Go to Evaluate & test, select the version you just trained, then select View full evaluation.

- You now see metrics such as f1, precision, and recall for the entire document and each field.
- Decide if performance meets your production goals. If it does not then reevaluate training and testing sets.
Set a new version as default:
- Navigate to Manage versions.
- Select to expand the options, and then select Set as default.

Your model is now deployed. Documents sent to this processor use your custom version. You can evaluate the model's performance to check if it requires further training.
Evaluation reference
The evaluation engine can do both exact match or fuzzy matching. For an exact match, the extracted value must exactly match the ground truth or is counted as a miss.
Fuzzy matching extractions that had slight differences such as capitalization differences still count as a match. This can be changed at the Evaluation screen.

Fine-tuning
With fine-tuning, you use hundreds or thousands of documents for your training.
Create a processor and define fields you want to extract following best practices, which is important because it impacts extraction quality.
Import documents with auto-labeling, and assign documents to the training and test set.
Confirm or edit the labels in the document.
Train model.
- Select the Build tab, and select Create New Version in the Fine-tuning box.

Try out the default training parameters or values provided. If the results are unsatisfactory, experiment with these advanced options:
Training steps (between 100 and 400): Controls how often the weights are optimized on a batch of data during the tuning.
- Too low indicates a risk that the training ends before convergence (under-fitting).
- Too high means the model might see the same batch of data multiple times during the training, which can lead to overfitting.
- Fewer steps leads to faster training time. Higher counts can help for documents with little template variation (and lower ones for those with more variation).
Learning rate multiplier (between 0.1 and 10): Controls how quickly the model parameters are optimized on the training data. It roughly corresponds to the size of each training step.
- Low rates mean small changes in the model weights at each training step. If too low, the model might not converge to a stable solution.
- High rates indicate large changes, and too high can mean the model steps over the optimal solution and converges instead to a suboptimal solution.
- Training time is not affected by the choice of learning rate.
Give a name, select the required base processor version, and select Create.

Evaluation: Go to Evaluate & test, then select the version you just trained and select View full evaluation.

- You now see metrics such as f1, precision, and recall for the entire document and each field.
- Decide if performance meets your production goals. If not, then further training documents might be required.
Set a new version as the default:
- Navigate to Manage versions.
- Select to expand the options, and select Set as default.

Your model is now deployed and documents sent to this processor now use your custom version. You want to evaluate the model's performance to check if it requires further training.
Auto-labeling with the foundation model
The foundation model can accurately extract fields for a variety of document types, but you can also provide additional training data to improve the accuracy of the model for specific document structures.
Document AI uses the label names you define and previous annotations to make it quicker and easier to label documents at scale with auto-labeling.
- When you've created a custom processor, go to the Get Started tab.
- Select Create New Field.
Give the label a descriptive, distinct name. Choose Extract for values directly from the document or Derive for values inferred by the system. This improves the foundation model's accuracy and performance.

For extraction accuracy and performance add a description (such as added context, insights, and prior knowledge for each entity) for the kinds of entities it should pick up.

Navigate to the Build tab, then select Import Documents.

Select the path of the documents and which set the documents should be imported into. Check the auto-labeling option and select the foundation model.
In the Build tab, select Manage Dataset.
When you see your imported documents, select one of them.

The predictions from the model are now shown highlighted in purple.
- Review each label predicted by the model, and verify it's correct.
If there are missing fields, add those as well.

When the document has been reviewed, select Mark as Labeled. The document is now ready to be used by the model.
Make sure the document is in either the testing or training set.
Three-level nesting
Custom Extractor now provides three levels of nesting. This feature provides better extraction for complex tables.
You can determine the model type using the following API calls: