AI Dictionary of Terms

Weights

The numerical values inside a neural network that determine the strength of the connections between neurons — the actual “knowledge” the model learns and stores during the training process.

The Simple Version

Imagine a giant sound mixing board with thousands of knobs. Each knob controls how much of a specific sound (like bass, treble, or vocals) gets through.

When a sound engineer mixes a song, they turn the knobs until the music sounds perfect. In an AI model, the weights are those knobs. During training, the AI automatically turns millions or billions of these “knobs” to the perfect positions so that it can accurately recognize patterns, translate languages, or generate text. The final position of every single knob is the model’s “memory.”

Detailed Explanation

In the context of neural networks, weights are the numerical values that define the model’s behavior. They are the primary component of a model’s parameters (along with biases).

How Weights Work:

  1. Initialization: When a model is created, its weights are set to random numbers. At this stage, the model knows nothing and outputs garbage.
  2. Training: As the model processes data, an algorithm (like Gradient Descent) calculates how wrong the model’s predictions are. It then slightly adjusts every single weight to make the next prediction a little bit better.
  3. Convergence: After seeing millions of examples, the weights settle into a configuration that accurately maps inputs to outputs.

Weights vs. Parameters: While often used interchangeably, there is a slight technical difference:

Scale of Weights:

Key Characteristics

Business Context

The number of weights is often used as a proxy for a model’s capability and cost:

Strategic Implications:

Real-World Analogy

A musician’s muscle memory. When a pianist learns a song, they don’t memorize every single note consciously. Their fingers “learn” the movements through practice. The muscle memory is like the weights — it’s the physical embodiment of the learned skill.

Code Example

# Inspecting weights in a PyTorch model
import torch
import torch.nn as nn

# Define a tiny neural network
class TinyNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(2, 3) # 2 inputs, 3 neurons
        self.fc2 = nn.Linear(3, 1) # 3 inputs, 1 output

    def forward(self, x):
        x = torch.relu(self.fc1(x))
        return self.fc2(x)

model = TinyNet()

# Count total parameters (weights + biases)
total_params = sum(p.numel() for p in model.parameters())
print(f"Total parameters: {total_params}")

# Look at the actual weight values (the "learned knowledge")
for name, param in model.named_parameters():
    if "weight" in name:
        print(f"{name} shape: {param.data.shape}")
        print(f"{name} values:\n{param.data}\n")

Common Misconceptions

Sources & Further Reading