
Weight Matrix and Matrix-Vector Multiplication
Stacking multiple neuron weight vectors into a weight matrix to evaluate multiple criteria on the same input vector simultaneously.
In Topics 1 and 2, we built an artificial neuron to answer a single question: "Will this movie be a hit?"
It took a script's feature vector , computed its linear score, and passed that score through an activation function to yield a single scalar output. In neural networks, this output is denoted by (short for activation):
Real-world problems are rarely that simple. In practice, systems must answer multiple questions from the exact same input data.
What if the movie studio wants to evaluate that same script from multiple angles? It might ask three distinct questions:
- Will this movie be a hit?
- Does this script have Oscar potential?
- Does this script have international appeal?
But what makes a commercial blockbuster isn't what wins Best Picture or what sells overseas. Each question evaluates the script's features differently.
To answer all three questions, we need three separate neurons evaluating the same script—each neuron equipped with its own set of weights, bias, and activation function.
Across this topic, we will see how each stage of the pipeline is computed when running multiple neurons in parallel—starting with how multiple sets of weights evaluate the same script:

One Script, Three Weight Vectors
In Topics 1 and 2, we represented our script, 'Die Hard in Space', as a 4-dimensional feature vector across [Action, Romance, Comedy, Sci-Fi]:
To evaluate all three questions, the studio defines three separate weight vectors—each reflecting what it believes different stakeholders value in a script:
To evaluate the script against each criterion, we calculate three independent dot products (with weights shown in bold):
Each dot product produces a single raw score based on the respective preferences. Hit: +9.5, Oscar: -4.5, International: +9.0.
From Weight Vectors to the Weight Matrix ()
Look at the bold numbers in the three dot product calculations above. Each line is just one of our original weight vectors laid flat on its side.
In linear algebra, flipping the axes is called the transpose, denoted by a superscript . Transposing our vertical weight vectors turns them into horizontal row vectors ().
When we stack these rows into a single grid, we get the Weight Matrix ():

A matrix is a grid of numbers organized into rows and columns. When it comes to AI, it is simply multiple vectors bundled together: if a vector is an ordered list of numbers, a matrix is a stack of vectors that share the exact same dimension.
Notice the structure of our Weight Matrix:
- Each row is the weight vector of one neuron (one evaluation question).
- Each column corresponds to one script feature (
[Action, Romance, Comedy, Sci-Fi]).
Because Position is Identity, the columns of the weight matrix strictly match the rows of the script vector: column 1: Action, column 2: Romance, column 3: Comedy, and column 4: Sci-Fi.
Because we have 3 neurons evaluating 4 features, the Weight Matrix has 3 rows and 4 columns (shape ).
NOTE: The Weight Matrix Rules
- Notation Rule: Matrices use uppercase letters (capital ); vectors use lowercase ().
- Shape Rule: In any neural network layer: Rows = number of neurons, Columns = number of inputs.
Matrix-Vector Multiplication ()
To evaluate our script across all three neurons at once, we multiply the Weight Matrix by the input vector .
Matrix-vector multiplication follows one universal mechanical rule: Row Column.
Each row in the matrix performs a dot product against the column vector: multiplying matching positions and adding them up:
Look at the arithmetic inside that calculation: matrix-vector multiplication is computing those exact three dot products simultaneously.
A matrix does not change the math. It is simply a clean, structured way to evaluate multiple vectors at once.
NOTE: The Dimension Matching Rule
For matrix multiplication to work, the number of columns in the matrix must equal the number of rows in the vector:
- The Inner Match (Pairs align): Each row in has 4 weights, matching the 4 features in . Because the inner dimensions match, every weight has an exact partner to multiply.
- The Outer Shape (Why we flip): We transpose the 3 weight vectors into horizontal rows so they produce a 3-dimensional output vector—one answer for each question:
Look at what the three raw scores suggest about the script:
- (Hit): High commercial appeal. Heavy Action and Sci-Fi produce a strong positive score, matching our single-neuron result from Topic 1.
- (Oscar): Critical failure. Academy voters penalize explosive spectacle, dragging the Oscar score deep into negative territory.
- (International): Strong overseas appeal. Visual action and sci-fi spectacle translate across languages and cultural barriers without needing dialogue translation.
One matrix multiplication evaluated the script from three completely different creative perspectives at the same time.
Evaluating 'The Notebook 2'
Now we evaluate our second script, 'The Notebook 2', using the exact same Weight Matrix :
Multiplying by this input vector:
Look at what the three raw scores suggest about this script:
- (Hit): Low commercial appeal. A romance feature with slight comedy does not match audience preference for action.
- (Oscar): High critical appeal. Academy voters reward romance and comedy, resulting in a positive score.
- (International): Weak overseas draw. Dialogue-heavy romance does not travel as easily into foreign markets without action or sci-fi spectacle.
Why Neural Networks Use Matrices
Matrix multiplication is the foundational operation of modern AI for two reasons:
- Multiple Criteria on the Same Data: The input features () never change. The matrix simply evaluates those same features against different criteria at the same time.
- Hardware Parallelism: Because each row calculation is completely independent of the others, modern hardware (like GPUs) calculates every row in parallel. Evaluating three neurons—or 3,000 neurons—takes virtually the same computational time as evaluating one.