Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 12

The Building Blocks of AI: Data, Features, and Parameters

Recommended resources

Introduction

Welcome to the first lesson of Module 3. In our last session, we concluded our exploration of AI mechanics by analyzing real-world applications and their societal impacts. We saw how AI systems used in criminal justice (like the COMPAS algorithm) and healthcare can perpetuate bias and create profound legal and ethical challenges. This raised a critical question: how do these systems technically develop such problematic behaviors?

Today, we answer that question. This lesson is dedicated to demystifying the technical origins of an AI's behavior. Our learning outcome is to explain how training data, features, and model parameters determine AI behavior and performance.

We will dissect the three core components that shape any machine learning model. Understanding this technical foundation is not just an academic exercise; it is essential for anyone in AI governance. To regulate AI effectively, you must first understand precisely how an AI's decisions are formed, as this is where legal risks originate.


The Trinity of AI Behavior: Data, Features, and Parameters

At its heart, a trained AI model is a complex mathematical function that takes an input and produces an output (a prediction or decision). Its specific behavior is not manually programmed but is instead shaped by a powerful interplay of three elements:

  1. Training Data: The vast collection of examples—images, text, or structured data—that the model learns from. It's the "textbook" for the AI.
  2. Features: The specific, measurable characteristics of the data that the model is instructed to consider. These are the "key concepts" extracted from the textbook. For example, in an image of a cat, features could be pixel values, edge shapes, or textures.
  3. Model Parameters: The internal variables of the model, primarily weights and biases, that are adjusted during training. This is the "knowledge" the model internalizes after studying the features in its training data.

Let's explore each of these components and see how they are inextricably linked.


1. Model Parameters: The Internal 'Wiring' of the AI

The direct determinants of a model's behavior are its parameters. In a neural network, these are the weights and biases associated with each connection between neurons. Think of them as thousands, millions, or even trillions of "dials" or "knobs" that are tuned during training. The final setting of these dials defines exactly how the model will respond to any new input.

To visualize this, let's watch a segment from the excellent 3Blue1Brown series on neural networks. This clip explains how weights and biases function as the core parameters that allow a network to recognize patterns.

But what is a neural network? | Deep learning chapter 1

This video from 3Blue1Brown, titled 'But what is a neural network?', provides a clear, intuitive explanation of a neural network's core parameters.

Watch the segment from 08:30 to 13:26. Focus on how the narrator describes 'weights' and 'biases' as the adjustable parameters that determine what pattern a neuron picks up on. Notice the statement that the entire network can have thousands of these 'knobs and dials' to tweak.

As the video explains, each neuron's output is calculated from a weighted sum of the inputs from the previous layer, plus a bias.

  • Weights: Determine the strength and sign (positive/excitatory or negative/inhibitory) of the connection between neurons. A higher weight means the input from one neuron has more influence on the next.
  • Biases: Act as an offset, making it easier or harder for a neuron to activate. It allows the neuron to fire even if all its inputs are zero.

The collection of all weights and biases in a network constitutes its model parameters. For a formal definition and a look at the underlying mathematics, the following article is very helpful.

What are Model Parameters? Complete Guide to AI ...

The article 'What are Model Parameters?' from ArticSledge provides a concise yet detailed breakdown of what parameters are and their role in a model.

Read the following sections: '1. What Are Model Parameters? Core Definition' '2. The Mathematics Behind Parameters' '3. Types of Model Parameters' Focus on understanding that parameters are the learned variables that ultimately encode the model's 'knowledge' and define its predictive function.

From a practical programming perspective, when you use a library like Scikit-learn (which you may encounter in your Python work), these parameters are accessible attributes of the trained model object, often named coefs_ (for weights) and intercepts_ (for biases), as noted in its documentation (LINK).

So, if parameters define the model's behavior, where do their specific values come from?


2. The Training Process: How Data Shapes Parameters

Model parameters are not set by hand. They are learned automatically from training data through a process of optimization. This process, often called the "training loop," is the heart of machine learning.

The core idea is:

  1. Start with random parameter values.
  2. Show the model a batch of training data and have it make predictions (this is the forward pass).
  3. Compare the model's predictions to the true labels using a loss function, which calculates a single number representing the model's error or "lousiness."
  4. Use an algorithm to calculate how each parameter contributed to that error. This process is called backpropagation.
  5. Slightly adjust all parameters in the direction that will decrease the error. This update step is typically done using an optimizer like gradient descent.
  6. Repeat this process millions of times with all the training data.

This next video brilliantly visualizes how training data, the cost function, and gradient descent work together to shape the model's parameters.

Gradient descent, how neural networks learn | Deep Learning Chapter 2

In 'Gradient descent, how neural networks learn', 3Blue1Brown illustrates the learning process itself.

Please watch these key segments: 01:44 - 02:31: Note the explicit link made between the 'training data' (labeled images) and the goal of adjusting the model's parameters. 03:31 - 05:09: Grasp the concept of the 'cost function' or 'loss function'. It is the crucial metric that quantifies how well the current parameter settings perform on the training data. 05:09 - 08:58: This is the core of the learning mechanism. Understand 'gradient descent' as an algorithm that finds the parameter values that result in the lowest possible error on the training data. The direction of change is dictated by the data itself.

The entire process is a feedback loop where the training data guides the iterative refinement of the model's parameters. The image below provides a fantastic summary of this cycle.

Neural Network: Forward and Backward Propagation
This diagram illustrates the training loop. During the **forward pass** (left to right), input data flows through the network to produce a prediction. This prediction is compared to the true value to calculate a **loss score**. During **backpropagation** (right to left), the optimizer uses this loss to calculate adjustments for the model's parameters (weights), effectively 'learning' from the error.

The takeaway is simple but profound: the final values of a model's parameters are a direct function of the data it was trained on.


3. Features: The Lens Through Which the Model Sees Data

A model doesn't just ingest raw data; it processes specific features of that data. In simple cases, like the digit recognition example, the features might be the raw pixel values. However, the power of deep learning comes from its ability to learn a hierarchy of features.

Let's revisit the first video to see this concept in action.

But what is a neural network? | Deep learning chapter 1

Let's re-examine a clip from 'But what is a neural network?' to understand how models learn hierarchical features.

Rewatch the segment from 05:36 to 08:30. Notice the explanation that the network learns to recognize a '9' not as a whole, but by first identifying small edge features, then combining them into loop and line features, and finally combining those into the digit feature. The parameters are tuned to detect this hierarchy.

In many real-world applications, especially outside of image or text processing, features are explicitly selected by the data scientists building the model. This process, called feature engineering, is a critical step that has massive implications for performance and fairness.

Consider the COMPAS algorithm from our previous lesson. The data scientists chose features like 'age', 'sex', and 'number of prior arrests' from the raw criminal history data. The model's parameters were then trained to find correlations between these specific features and the likelihood of re-offending. If 'number of prior arrests' is itself a result of biased policing, including it as a feature directly injects that societal bias into the model's learning process.


Synthesis: The Chain of Determinism

We can now see the full chain of how an AI's behavior is determined:

  1. We start with Training Data, which contains inherent patterns, correlations, and, potentially, societal biases.
  2. We (or the model itself) extract Features from this data. This choice of features acts as a lens, focusing the model's attention on certain aspects of the data while ignoring others.
  3. Through the training process (e.g., gradient descent), the model adjusts its internal Parameters (weights and biases) to minimize its prediction error on the features of the training data.
  4. The final, trained set of parameters is the model's decision-making logic. It represents the learned patterns, and it dictates the model's behavior and performance on all future data.

This trained logic results in a decision boundary—an implicit rule the model uses to classify new data. The image below visualizes this. The complex, curved line separating the two groups of points is the model's behavior, and that line is defined entirely by the parameters learned from the training data.

Neural Network Decision Boundary for 'Moons' Dataset
A visualization of a neural network's learned behavior. The non-linear boundary separating the two colored regions is the model's classification rule. This boundary is a direct graphical representation of the function defined by the model's final parameters, which were learned from the features of the training data points.
Test your understanding!

An AI model is developed to predict credit risk. It is trained on historical loan data from a single bank. The data shows that individuals from a specific neighborhood have a higher default rate, partly due to historical economic disadvantages in that area. The model uses 'zip code' as one of its input features.

After training, the model consistently assigns higher risk scores to applicants from that neighborhood, even to those with good individual financial standing.

Based on today's lesson, explain how training data, features, and model parameters all contributed to this biased outcome.

Show answer
  • Training Data: The historical data is the source of the bias. It reflects a real-world correlation between a neighborhood (zip code) and default rates, which stems from systemic issues, not just individual creditworthiness. The model learns this correlation because it's present in the data.
  • Features: The choice to include 'zip code' as a feature gives the model a direct way to learn this problematic correlation. 'Zip code' acts as a proxy for socioeconomic status and potentially race. If zip code were excluded, the model would have to rely on more direct financial features, potentially reducing the group-level bias.
  • Model Parameters: During training (via gradient descent), the model's parameters (weights) associated with the 'zip code' feature are adjusted to help minimize prediction error on the training set. A large negative weight will likely be learned for the zip code corresponding to the disadvantaged neighborhood, causing the model to increase the risk score whenever it sees that zip code, thus encoding and automating the historical bias.

Conclusion

Today we have traced the path from data to decision. We've established that an AI's behavior is not magical or arbitrary; it is the deterministic outcome of a learning process guided by data.

Key Takeaways:

  • An AI model's behavior is defined by its internal parameters (weights and biases).
  • These parameters are learned automatically from training data through an optimization process (like gradient descent) that aims to minimize prediction error.
  • The model learns patterns based on the specific features it is given from the data. The choice of features can be a critical point where bias is introduced.
  • This interconnected system—Data → Features → Parameters → Behavior—is the technical pathway through which societal biases become encoded in algorithms and where legal risks are created.

Preview of the Next Lesson:

Now that we have a firm grasp of this fundamental mechanism, our next lesson will perform a deep dive into its most critical and legally relevant consequence: bias. We will move beyond simply saying "bias exists" to systematically identifying the different sources of bias in datasets and explaining how they propagate through the machine learning lifecycle we've outlined today.