Prepare and test your skills
Prepare and test your skills
Data quality and data accessibility decide whether generative AI is accurate, affordable, and trustworthy. Data quality means data is complete, consistent, and relevant, while data accessibility means AI services can reach that data in a usable format, at an acceptable cost, and with enough availability. In Google Cloud, both depend on infrastructure for compute, storage, and networking, because slow or poorly placed storage raises cost and slows training and inference.
Data accessibility in BigQuery (opens in a new tab) means placing data where AI services can use it without extra copying or reformatting. BigQuery ML brings machine learning to the data, so teams can train, evaluate, and run inference with SQL tools instead of moving data to another system. This approach speeds model development and lets more teams use machine learning. BigQuery AI extends this with predictive machine learning, inference against large language models (LLMs) such as Gemini, embeddings and vector search, built-in agents, data pipelines, and agent tools.
Availability also controls accessibility. Some BigQuery AI features may not be available when using reservations created with certain BigQuery editions, so edition and reservation choices determine which AI capabilities can reach stored data. Users can work with BigQuery ML through the Google Cloud console, the bq command-line tool, the REST API, or Colab Enterprise notebooks. Infrastructure must still match each stage of the machine learning lifecycle, since training and inference need different compute, storage, and networking resources.
Completeness, consistency, and relevance are the three dimensions of data quality that protect model integrity. Completeness means a dataset contains every record and field a task requires, with no missing prompts, variables, or responses. Consistency means data follows the same format, structure, and location rules through the whole pipeline. Relevance means the data measures what the model is actually judged on, so scores reflect the behavior that matters.
The Gen AI evaluation service shows how these dimensions work together. It accepts datasets in CSV or JSONL format with a limit of 200 rows, and each evaluation must include at least one metric that scores candidate responses. Location consistency is enforced by data residency rules, where an AML AI instance stays in one region and all input and output data must remain in the same region and project. Format and access also matter: data in another format must be converted first, and the workflow needs identity and access management roles plus a Cloud Storage bucket for results.
The repeatable evaluation workflow runs in a fixed order:
Exam tip: BigQuery ML brings ML to the data instead of requiring data movement, which keeps data accessible when it already lives in BigQuery.
Ready data lowers operational cost and expands what AI teams can build. Ready data means organizational data is complete, consistent, relevant, available, and stored in a format AI systems can use. When data is ready, teams build generative AI faster, spend less on processing, and get outputs they can trust. BigQuery AI functions accept natural language inputs and work with structured and unstructured data, including text, documents, and images, and they can generate structured output or embeddings for search and clustering.
Cost and availability shape which AI function category is practical:
| Function category | Control and cost behavior | Common use |
|---|---|---|
| General-purpose AI functions | Full control over model, prompt, and parameters | Custom analysis and generation |
| Managed AI functions | Streamlined syntax; optimized for cost and quality; BigQuery chooses a model | Routine filtering, rating, classification, and aggregation |
| Task-specific functions | Use Cloud AI APIs | Natural language processing, translation, document processing, audio transcription, computer vision |
Managed functions include AI.IF, AI.SCORE, AI.CLASSIFY, and AI.AGG, while general-purpose functions include AI.GENERATE and embedding functions. For large datasets, optimized mode for AI.IF and AI.CLASSIFY trains a lightweight distilled model on a sample and uses it for most rows, which avoids calling a large language model for every row. The AI.COUNT_TOKENS utility estimates tokens before running a query, so cost is known in advance. Reliable outputs also depend on retrieval-augmented generation (RAG), which references trusted and current sources, and on protecting sensitive data with classification, tokenization, VPC Service Controls, and customer controls for support access and encryption.
Structured and unstructured data differ in organization, storage, and AI use. Structured data is organized in fixed rows, columns, and values, while unstructured data has no fixed schema and carries meaning through language, pixels, sound, or motion. Generative AI primarily learns from and creates unstructured data, while structured data grounds answers in facts and drives analysis with traditional AI.
Structured and unstructured data serve different AI tasks because their organization is different. Structured data includes sales figures, house features with location, purchase history, and customer attributes stored in tables. Unstructured data includes text documents, emails, social posts, product reviews, images, video, audio, call transcripts, and contracts. In Google Cloud, BigQuery manages large tabular datasets for analysis, while Cloud Storage stores diverse objects such as generated audio, video, and text for serving.
| Data type | Organization | Typical AI use |
|---|---|---|
| Structured data | Tables with defined fields, such as tabular purchase and sales records | Classification, regression, forecasting, and segmentation with traditional AI |
| Unstructured data | Free-form text, images, video, and audio across multiple modalities | Training foundation models, summarization, content generation, chat, and transcription with generative AI |
Real-world tasks show the split clearly. Filtering email as spam or not spam, predicting house prices, forecasting sales and demand, and grouping customers into segments are structured-data tasks. Summarizing reports, generating product images from text prompts, captioning video, creating synthetic voice-overs, and answering questions over a knowledge base are unstructured-data tasks. Embeddings support generative AI by mapping data into a continuous vector space where closer distance means similar meaning, which helps models understand context and visual similarity.
Grounding is the process of connecting a model's output to verifiable sources such as internal documentation, project data, and communication records. Grounding improves accuracy and reduces hallucinations, where a model generates content that is not factual. A common form of grounding is retrieval-augmented generation (RAG), in which a user query is converted to an embedding, compared by similarity search to document embeddings in a knowledge base, and the most relevant documents are retrieved to enhance the response.
A five-step process flow showing a user query turned into an embedding, matched by similarity search to document embeddings in a knowledge base, with retrieved trusted documents added to Gemini to produce a grounded answer.
Structured data also guides generative AI when traditional AI output becomes part of the prompt. In this pattern, data flows from the traditional model to the generative model, so predictions become conversational insights. Traditional predictive AI forecasts customer churn probability from historical data, then a chatbot lets sales teams explore those predictions in natural language and generate dashboards by conversation. Together, structured variety provides the factual base for forecasting and grounding, while unstructured variety provides context and creative range for generation.
A personalized marketing workflow shows how the parts connect in order from data stores (opens in a new tab) to delivery:
Exam tip: BigQuery is the home for structured datasets such as transaction logs and inventory lists, while Cloud Storage is the home for unstructured media such as social media sentiment and video archives.
Business examples map directly to storage choices and to structured and unstructured data (opens in a new tab) import limits. Structured examples include customer transaction logs, inventory lists, hotel availability records, and audit logs, where each record follows the same named fields. Unstructured examples include social media sentiment, video archives, scanned PDFs, presentations, and free-form documents, where meaning comes from file content. Structured data belongs in BigQuery tables, while unstructured files belong in Cloud Storage buckets with optional metadata in BigQuery or Google Drive.
| Dimension | Structured data | Unstructured data |
|---|---|---|
| Schema | Predefined; every record follows the same fields and types | No fixed schema; content defines meaning |
| Common formats | SQL tables, JSON Lines, NDJSON | TXT, JSON, Markdown, PDF, HTML, DOCX, PPTX, XLSX, XLSM |
| Storage | Relational databases, BigQuery tables, Cloud Storage for JSON Lines or NDJSON | Cloud Storage buckets, Google Drive |
| Import limits | Files under 2 GB, rows under 1 MB, up to 1,000 files per request | Files under 200 MB, up to 100,000 files at a time |
Document databases add a third option for flexible data. Firestore in Datastore mode is a NoSQL database that stores data as entities rather than rows and is schemaless, so entities of the same kind can have different properties. Datastore queries are served by indexes and scale with the size of the result set, not the dataset, and Datastore does not support joins, inequality filtering on multiple properties, or filtering based on subquery results. For object storage, the Cloud Storage class is chosen by access frequency: Standard for frequently accessed data, Nearline for data stored at least 30 days, Coldline for at least 90 days, Archive for at least 365 days, and Autoclass when access patterns vary. Data reaches Google Cloud through Storage Transfer Service for online transfers, Transfer Appliance for offline transfers, or direct upload, and prepare data (opens in a new tab) guidance covers layout parsing, OCR, and chunking for RAG.
Labeled data and unlabeled data are two data paradigms that differ in composition and in the learning method they support. Labeled data includes specific ground-truth annotations or tags that state the correct answer, while unlabeled data consists of raw information that lacks explicit descriptors. Labeled data supports supervised learning, while unlabeled data supports self-supervised learning.
How labeled data supports supervised learning is by giving the model correct outcomes to train on and to be tested against. In a classification task, each item might be tagged as positive or negative, and a confusion matrix compares model predictions against those ground-truth labels using true positives, true negatives, false positives, and false negatives. For any slice of data, the labeled negatives equal true negatives plus false positives, and the labeled positives equal false negatives plus true positives. Comparing confusion matrices between slices can reveal bias, such as better recall for one group than another.
Unlabeled data supports self-supervised learning by letting a model learn patterns, structure, and relationships on its own. Unlabeled data includes text, images, transcripts, or sensor data as collected, without labels saying what is correct. The trade between the two is guidance versus scale, as shown below.
| Data type | Composition | Learning paradigm | Role in model development |
|---|---|---|---|
| Labeled data | Specific ground-truth annotations or tags | Supervised learning | Provides correct outcomes for training and evaluation; predictions are checked against labels |
| Unlabeled data | Raw information lacking explicit descriptors | Self-supervised learning | Supports learning general patterns without labeled outcomes |
Models that assign labels can often be improved by fixing the labeled dataset:
Business trade-offs for data selection balance human cost against scale and speed. The cost of labeled data comes from people reading source material and assigning the correct answer, which is slow, expensive, and subjective. Validating a summarization model once required humans to read transcripts and grade summaries by hand. Labels must also stay consistent, because inconsistent labels lower precision and recall, and classes with too few examples cannot be predicted confidently.
The scale of unlabeled data comes from normal operations producing new content every day. Agent Assist Storage holds actual conversation traffic that can be sampled by date range and sample size, with no labeling step first. Automated evaluation can then use LLM-based judges to score accuracy, adherence, and completeness across hundreds of conversations in about 20 to 30 minutes. That volume replaces slow spreadsheet-based quality assurance and makes it practical to test a new model version quickly. Choosing a data source therefore trades realism against curation, where live production traffic shows what users actually say and a curated dataset tests specific cases on purpose.
Running an automated evaluation for generative AI or traditional AI (opens in a new tab) follows an ordered workflow from setup to comparison:
Exam tip: Low precision and recall usually mean the model needs more or better-labeled training data, while perfect precision and recall usually mean the test data is too easy.
Foundation model (opens in a new tab) development uses unlabeled data for breadth and labeled data for precision. Massive unlabeled datasets support initial pre-training, where the model learns general language and world patterns from volume and variety. Because no labeling step is required, these datasets can be very large and diverse, which helps the model generalize to many tasks. The limit is that unlabeled data alone does not tell the model which answer is correct for a specific business task.
Smaller, high-quality labeled datasets support fine-tuning and Reinforcement Learning from Human Feedback (RLHF), where human answers and preferences align the model to a specific task. Fine-tuning adapts a pre-trained foundation model to tasks such as classification or detection, while RLHF adds human-provided labels and preferences to align outputs with human expectations. In this stage quality matters more than size, because inconsistent labels directly lower precision and recall. Using evaluation to guide iteration means using labeled ground truth to find weaknesses, then adding or correcting labeled examples, retraining, and comparing metrics between the old and new models to confirm real improvement and to evaluate and define the business use case (opens in a new tab).
Continue with this study guide: Identifying the differences between labeled and unlabeled data
Structured data is organized in fixed rows, columns and values and is used for classification, regression, forecasting and segmentation with traditional AI, while unstructured data has no fixed schema and carries meaning through language, pixels, sound or motion and is used for training foundation models, summarization, content generation, chat and transcription with generative AI. In Google Cloud, BigQuery manages large tabular datasets for analysis while Cloud Storage stores diverse objects such as generated audio, video and text for serving.
BigQuery ML brings machine learning to the data so teams can train, evaluate and run inference with SQL tools instead of moving data to another system. This approach speeds model development and lets more teams use machine learning, and users can work with it through the Google Cloud console, the bq command-line tool, the REST API, or Colab Enterprise notebooks.
Completeness means a dataset contains every record and field a task requires with no missing prompts, variables or responses, consistency means data follows the same format, structure and location rules through the whole pipeline, and relevance means the data measures what the model is actually judged on so scores reflect the behavior that matters. Together these three dimensions protect model integrity.
Labeled data includes specific ground-truth annotations or tags that state the correct answer and supports supervised learning for training and evaluation, while unlabeled data consists of raw information that lacks explicit descriptors and supports self-supervised learning of general patterns. Massive unlabeled datasets support initial pre-training of foundation models for breadth, while smaller high-quality labeled datasets support fine-tuning and Reinforcement Learning from Human Feedback (RLHF) for precision and alignment to a specific task.
Last updated