AI Hints
Home›Generative AI Tutorial›Data, Generalisation and Foundation Models
Generative AI · Lesson 7 of 77

Data Is Everything

Why the quality of the examples decides the quality of the AI.

⏱ 2 min read▶ Video at 19:34🎓 Free
Watch this lesson in the Generative AI courseWatch on YouTube ↗Full Generative AI course

There is a famous saying in computing. Garbage in, garbage out. For learning machines, it is even more true. A model is only as good as the data it learns from. In this lesson, you will learn where training data comes from, why it must be clean, and how bias sneaks in.

Data Is Everything
From the video: Data Is Everything
  • Garbage in, garbage out
  • Where does training data come from?
  • How bias sneaks in

Where training data comes from

So where does the data come from? For language models, from enormous collections of text. Books, articles, websites, encyclopaedias, forums, and computer code. For image models, from huge collections of pictures, each paired with a caption. For speech models, from many hours of recorded voices. The bigger and more varied the collection, the more the model can learn.

Books and articlescarefully written text
Websites and forumseveryday human language
Code repositoriesprograms and documentation
Pictures with captionsfor image models
Recorded speechfor voice models

Cleaning the data

But raw data is messy. Before training, teams clean it. They remove duplicates, because repeated text makes a model memorise. They filter out spam and low quality pages. They remove private details, and harmful content. Then they split the data into three parts. Most of it is for training. A smaller part is for checking progress, called validation. And a final part is kept locked away, for the final exam, called the test set.

  1. Collectgather huge amounts
  2. Cleanremove duplicates and junk
  3. Filterremove private and harmful content
  4. Splittrain, validate, test
The test set stays locked away
Cleaning the data
From the video: Cleaning the data

Train, validate, test

A typical split looks like this. About eighty percent for training, where the model learns. About ten percent for validation, where we check progress, and tune settings. And about ten percent for testing, a fair final exam, on data the model has never seen. Keeping the test set secret is the only honest way to know how well the model really works.

Training
80%
Validation
10%
Test
10%

How bias sneaks in

Now a serious point. A model learns whatever patterns the data contains, including unfair ones. If a hiring dataset mostly contains successful men, the model may learn to prefer men. If photos of doctors are mostly one group, the model may assume only that group are doctors. The machine is not prejudiced. It simply mirrors the data. So careful teams audit their data, and test models for fairness.

What goes wrong

  • Data over-represents some groups
  • Model copies old unfair patterns
  • Looks objective, but is not
  • Harms real people

What good teams do

  • Audit and balance the data
  • Test results for every group
  • Keep humans in the loop
  • Fix problems before release

Summary

Good. Data is the fuel of AI. It comes from books, websites, code, pictures, and speech. It must be cleaned, and split into training, validation, and test sets. And because models mirror their data, we must watch for bias. Next, a surprising problem, a model that learns too well.

Key takeaways
  • Data quality decides model quality
  • Train / validation / test split
  • Models mirror biases in the data
Next up: Overfitting and Generalisation — learning the lesson, not the answers