What are Generative AI Tables?
Generative AI is a subfield of artificial intelligence that trains AI models to create new content, such as realistic text, forecasts, images, and more, by learning patterns from existing data. MindsDB revolutionizes machine learning within enterprise databases by introducing the concept of Generative AI tables. These essentially represent AI models as virtual database tables, capable of producing realistic outputs given certain inputs.Creating a Generative AI-Table
We can for example create an OpenAI model that will generate a response given some prompt_template instructions written in plain English.Difference between AI Tables and Standard Tables
To understand the difference, we can go over a much simpler example, here we will see how traditional database tables are designed to give you a deterministic response given some input, and Generative AI Tables are designed to generate an approximate response given some input. Let’s consider the followingincome_table table that stores the income and debt values.
income_table table is as
follows:
Querying the income table to get the debt value for a particular income
value results in the following:
But what happens when querying the table for an income value that is not
present there?
WHERE clause condition is not fulfilled for any of the rows, no
value is returned.
When a table doesn’t have an exact match, the query returns an empty set or null
value. This is where the AI Tables come into play!
Let’s create a debt_model model that allows us to approximate the debt value
for any income value. We train the debt_model model using the data from the
income_table table.
CREATE MODEL statement. On execution of this statement, the predictive model works in the background, automatically creating a vector representation of the data that can be visualized as follows:
Let’s now look for the debt value of some random income value. To get the approximated debt value, we query the mindsdb.debt_model model instead of the income_table table.
