Disclaimer: This is not an official Google product.
FeedGen works best for up to 30k items. Looking to scale further? Onboard with Product Studio API alpha (reach out to [email protected]) or consider processing your feed in BigQuery.
Overview • Get started • What it solves • How it works • How to Contribute • Community Spotlight
gemini-1.5-pro
and gemini-1.5-flash
structured_title
and structured_description
when importing FeedGen's output into Merchant Center instead of title
and description
respectively. Refer to these instructions for details.gemini-1.5-pro-preview-0409
. Please note that the model name may (breakingly) change in the future.gemini-1.0-pro
and gemini-1.0-pro-vision
gemini-pro
and gemini-pro-vision
)gemini-pro-vision
)v1
and switched to JS/TS on main
FeedGen is an open-source tool that uses Google Cloud's state-of-the-art Large Language Models (LLMs) to improve product titles, generate more comprehensive descriptions, and fill missing attributes in product feeds. It helps merchants and advertisers surface and fix quality issues in their feeds using Generative AI in a simple and configurable way.
The tool relies on GCP's Vertex AI API to provide both zero-shot and few-shot inference capabilities on GCP's foundational LLMs. With few-shot prompting, you use the best 3-10 samples from your own Shopping feed to customise the model's responses towards your own data, thus achieving higher quality and more consistent output. This can be optimised further by fine-tuning the foundational models with your own proprietary data. Find out how to fine-tune models with Vertex AI, along with the benefits of doing so, at this guide.
Note: Please check if your target feed language is one of the Vertex AI supported languages before using FeedGen, and reach out to your Google Cloud or Account representatives if not.
To get started with FeedGen:
Getting Started
worksheetOptimising Shopping feeds is a goal for every advertiser working with Google Merchant Center (MC) in order to improve query matching, increase coverage, and ultimately click-through rates (CTR). However, it is cumbersome to sift through product disapprovals in MC or manually fix quality issues.
FeedGen tackles this using Generative AI - allowing users to surface and fix quality issues, and fill attribute gaps in their feeds, in an automated fashion.
FeedGen is an Apps Script based application that runs as an HTML sidebar (see HtmlService for details) in Google Sheets. The associated Google Sheets spreadsheet template is where all the magic happens; it holds the input feed that needs optimisation, along with specific configuration values that control how content is generated. The spreadsheet is also used for both (optional) human validation and setting up a supplemental feed in Google Merchant Center (MC).
Generative Language in Vertex AI, and in general, is a nascent feature / technology. We highly recommend manually reviewing and verifying the generated titles and descriptions. FeedGen helps users expedite this process by providing a score for both titles and descriptions (along with detailed components) that represents how "good" the generated content is, along with a Sheets-native way for bulk-approving generated content via data filters.
First, make a copy of the template spreadsheet and follow the instructions defined in the Getting Started section. The first step is to authenticate yourself to the Apps Script environment via the Initialise button as shown below.
Afterwards, navigate to the Config worksheet to configure feed settings, Vertex AI API settings (including an estimation of the costs that will be incurred), and settings to control the content generation.
Description generation works by taking the prompt prefix given in the Config sheet, appending a row of data from Input and sending the result as a prompt to the LLM. This gives you great flexibility in shaping the wording, style and other requirements you might have. All data from Input Feed will be provided as part of the prompt.
If a web page link is provided in the input feed, you may also check the
Use Landing Page Information
checkbox to load and pass sanitised content of
the product's web page into the prompt. All span
and p
tags are extracted
from the fetched HTML content and concatenated together to form an additional
paragraph of information that is passed to the LLM in the prompt, along with
dedicated instructions on how to use this additional information. JSON web
responses will be used as-is without additional parsing. Furthermore, fetched
web page information is cached using Apps Script's
CacheService for a
period of 60 seconds in order to avoid refetching and reparsing the content for
the generation of titles (which is a separate call to the Vertex AI API).
Optional: You can also provide examples of descriptions in the Few-shot examples section (see below). Those will be appended to the prompt prefix as well and inform the model of how good descriptions look like.
The result is directly output as Generated Description
Since LLMs have a tendency to hallucinate, there is an option to ask the model (in follow-up instructions within the same prompt) if the generated description meets your criteria. The model evaluates the description it just generated and responds with a numerical score as well as reasoning. Example validation criteria and scoring are provided to give some hints on how to instruct the model to evaluate descriptions - e.g. it includes criteria as well as example score values.
Titles use few-shot prompting; a technique where one would select samples from their own input feed as shown below to customise the model's responses towards their data. To help with this process, FeedGen provides a utility Google Sheets formula:
=FEEDGEN_CREATE_CONTEXT_JSON('Input Feed'!A2)
Which can be used to fill up the “Context” information field in the few-shot prompt examples table by dragging it down, just as for other Sheets formulas. This "Context" represents the entire row of data from the input feed for this item, and it will be sent as part of the prompt to the Vertex AI API.
Afterwards, you must manually fill in the remaining columns of the few-shot prompt examples table, which define the expected output by the LLM. These examples are very important as they provide the basis upon which the LLM will learn how it should generate content for the rest of the input feed. The best examples to pick are products where:
We would recommend adding at least one example per unique category within your feed, especially if the ideal title composition would differ.
FeedGen defaults to using attributes from the input feed instead of generated
attribute values for composing the title, to avoid LLM hallucinations and ensure
consistency. For example, the value Blue
from the input feed attribute
Color for a specific feed item will be used for its corresponding title
instead of, say, a generated value Navy
. This behaviour can be overridden with
the Prefer Generated Values
checkbox in the Advanced Settings section of
the Title Prompt Settings, and is useful whenever the input feed itself
contains erroneous or poor quality data.
Within this same section you can also specify a list of safe words that can be
output in generated titles even if they did not exist beforehand in your feed.
For example, you can add the word "Size" to this list if you would like to
prefix all values of the Size
attribute with it (i.e. "Size M" instead of "M").
Finally, you can also specify whether you would like the LLM to generate titles
for you using the Use LLM-generated Titles
checkbox. This allows the LLM
to inspect the generated attribute values and select which ones to concatenate
together - avoiding duplicates - instead of the default logic where all
attribute values will be stitched together. This feature should work better with
Gemini models than PaLM 2, as Gemini models have better reasoning capabilities
that allow them to better strick to prompt instructions over PaLM 2 models.
Furthermore, LLM-generated titles allow you to specify the desired length for
titles in the prompt (max 150 characters for Merchant Center), which was not
possible previously.
Like descriptions, you may also choose to load information from the provided web
page link and pass it to the LLM for the generation of higher quality titles.
This can be done via the Use Landing Page Information
checkbox, and when
checked, all features extracted from the web page data will be listed under a
new attribute called Website Features. New
words that were not covered by existing attributes will then be added to the
generated title.
Now you are done with the configuration and ready to optimise your feed. Use the top navigation menu to launch the FeedGen sidebar and start generating and validating content in the Generated Content Validation worksheet.
You would typically work within this view to understand, approve and/or regenerate content for each feed item as follows:
Once you have completed all the necessary approvals and are satisfied with the output, click Export to Output Feed to transfer all approved feed items to the Output Feed worksheet.
The last step is to connect the spreadsheet to MC as a supplemental feed, this can be done as described by this Help Center article for standard MC accounts, and this Help Center article for multi-client accounts (MCA).
Notice that there is a att-p-feedgen column in the output feed. This column name is completely flexible and can be changed directly in the output worksheet. It adds a custom attribute to the supplemental feed for reporting and performance measurement purposes.
As Gemini (gemini-pro-vision
) is a multimodal model, we are able to
additionally examine product images and use them to generate higher quality
titles and descriptions. This is done by adding additional instructions to the
existing title and description generation prompts for extracting visible
product features from the provided image.
For titles, extracted features are used in 2 ways:
For descriptions, extracted features are used by the model to generate a more comprehensive description that highlights the visual aspects of the product. This is particularly relevant for domains where visual appeal is paramount; where the product's key details are visually conveyed rather than in a structured text format within the feed. This includes fashion, home decor and furniture, and perfumery and jewelry to name a few.
Finally, it is important to note the following restrictions (this information is valid during the Public Preview of Gemini):
Image Link
column of the Input Feed worksheet. GCS URIs are passed
as-is to Gemini (as they are supported by the model itself), while web images
are first downloaded and provided inline as part of the input to the model.image/png
and image/jpeg
MIME types are
supported.Descriptions with a score below Min. Evaluation Approval Score
will not be
pre-approved. You can re-generate those by filtering on Description Score
and removing the Status value in the Generation Validation tab.
FeedGen provides a score for generated titles between -1 and 1 that acts as a quality indicator. Positive scores indicate varying degrees of good quality, while negative scores represent uncertainty over the generated content. Like descriptions, you may specify a minimum score (defaults to 0) that you would like FeedGen to pre-approve.
Let's take a closer look with some fictitous examples to better understand the scoring for titles:
Let's look at another example for the same product:
<Brand> <Gender> <Category> <Product Type>
<Brand> <Gender> <Category> <Product Type> <Size>
Product Type
attribute changed in a worse way, hence the
negative score.FeedGen is conservative in its scoring; it will assign a score of -0.5 whenever any words get removed, even if those words were promotional phrases such as
get yours now
orwhile stocks last
, which should not be part of titles as per the Best Practices outlined by Merchant Center (MC).
Alright, so what makes a good title? Let's look at another example:
Finally, what's the ideal case? Let's take a look at one last example:
So in summary, the scoring systems works as follows:
Are there hallucinations? | Have we removed any words? | No change at all? | Have we optimised the title? | Did we fill in missing gaps or extract new attributes? |
---|---|---|---|---|
-1 | -0.5 | 0 | Add 0.5 | Add 0.5 |
FeedGen also applies some basic MC compliance checks, such as titles and
descriptions must not be longer than 150 and 5000 characters, respectively. If
the generated content fails these checks, the value
Failed compliance checks
will be output in the Status column. As
mentioned above, FeedGen will attempt to regenerate Failed
items first
whenever the Generate button is clicked.
FeedGen does not just fill gaps in your feed, but might also create completely new attributes that were not provided in the Input Feed. This is controllable via the few-shot prompting examples in the Config sheet; by providing "new" attributes that do not exist in the input within those examples, FeedGen will attempt to extract values for those new attributes from other values in the input feed. Let's take a look at an example:
Original Title | Product Attributes in Original Title | Product Attributes in Generated Title | Generated Attribute Values |
---|---|---|---|
ASICS Women's Performance Running Capri Tight | Brand, Gender, Product Type | Brand, Gender, Product Type, Fit | ASICS, Women's Performance, Running Capri, Tight |
Notice here how the Fit attribute was extracted out of Product Type.
FeedGen would now attempt to do the same for all other products in the feed,
so for example it will extract the value Relaxed
as Fit from the title
Agave Men's Jeans Waterman Relaxed
. If you do not want those attributes to be
created, make sure you only use attributes that exist in the input feed for your
few-shot prompting examples. Furthermore, those completely new feed attributes
will be prefixed with feedgen- in the Output Feed (e.g. feedgen-Fit) and
will be sorted to the end of the sheet to make it easier for you to locate and
delete should you not want to use them.
We recommend the following patterns for titles according to your business domain:
Domain | Recommended title structure | Example |
---|---|---|
Apparel | Brand + Gender + Product Type + Attributes (Color, Size, Material) | Ann Taylor Women’s Sweater, Black (Size 6) |
Consumable | Brand + Product Type + Attributes (Weight, Count) | TwinLab Mega CoQ10, 50 mg, 60 caps |
Hard Goods | Brand + Product + Attributes (Size, Weight, Quantity) | Frontgate Wicker Patio Chair Set, Brown, 4-Piece |
Electronics | Brand + Attribute + Product Type | Samsung 88” Smart LED TV with 4K 3D Curved Screen |
Books | Title + Type + Format (Hardcover, eBook) + Author | 1,000 Italian Recipe Cookbook, Hardcover by Michele Scicolone |
You can rely on these patterns to generate the few-shot prompting examples
defined in the FeedGen Config
worksheet, which will accordingly steer the
values generated by the model.
We also suggest the following:
Please refer to the Vertex AI Pricing and Quotas and Limits guides for more information.
As of April 9, 2024 and as per the updated Merchant Center product data specification, users need to disclose whether generative AI was used to curate the text content for titles and descriptions.
The main challenge with this is that users cannot send both title
and structured_title
, or description
and structured_description
in the same feed, as the original column values will always trump the structured_
variants.
Therefore, users need to perform an additional series of steps after exporting the approved generations into FeedGen's Output Feed tab:
title
and description
columns in the Output Feed tab of FeedGen to structured_title
and structured_description
, respectively.trained_algorithmic_media:
to all generated content.
We will be automating Steps #3 and #4 for you soon - stay tuned!
Credits to Glen Wilson and the team at Solutions-8 for the details and images.
Beyond the information outlined in our Contributing Guide, you would need to follow these additional steps to build FeedGen locally:
npm install
.npx @google/aside init
and click through the prompts.
Script ID
associated with your target Google Sheets
spreadsheet. You can find out this value by clicking on
Extensions > Apps Script
in the top navigation menu of your target sheet,
then navigating to Project Settings
(the gear icon) in the resulting
Apps Script view.npm run deploy
to build, test and deploy (via
clasp) all code to the target spreadsheet
/ Apps Script project.