Increase one input coordinate to a linear layer by 11, keeping everything else fixed. The output changes by exactly one column of the weight matrix.

That column is sitting there in plain sight. But if you learned matrix multiplication as “take a row, take a column, multiply and add,” it is surprisingly easy to miss.

Once you see it, you can read off what each input contributes—and what changing a weight will do.

How one input changes both outputs

Take a layer with two inputs and two outputs:

W=(2−111),y=Wx=(2x1−x2x1+x2).(1)W=\begin{pmatrix}2&-1\\1&1\end{pmatrix}, \qquad y=Wx =\begin{pmatrix}2x_1-x_2\\x_1+x_2\end{pmatrix}. \tag{1}

The input values are x1,x2x_1,x_2; yy contains the outputs. Feed in x=(3,2)x=(3,2) and you get (4,5)(4,5).

Increase only x1x_1 by one. The input becomes (4,2)(4,2) and the output becomes (6,6)(6,6):

Δx=(10)⟹Δy=(21).(2)\Delta x=\begin{pmatrix}1\\0\end{pmatrix} \quad\Longrightarrow\quad \Delta y=\begin{pmatrix}2\\1\end{pmatrix}. \tag{2}

There is the first column: (2,1)(2,1). Increase x2x_2 instead, and the output changes by (−1,1)(-1,1), the second column.

The starting point doesn’t matter. In (1), every extra unit of x1x_1 adds 22 to the first output and 11 to the second, whatever values the inputs already have.

Building an output by combining columns

Start from zero and build the input (3,2)(3,2) one coordinate at a time. The output accumulates three copies of the first column and two of the second:

Wx=3(21)+2(−11)=(45).(3)Wx =3\begin{pmatrix}2\\1\end{pmatrix} +2\begin{pmatrix}-1\\1\end{pmatrix} =\begin{pmatrix}4\\5\end{pmatrix}. \tag{3}

The input supplies the coefficients; the matrix supplies the vectors being combined. Negative coefficients subtract; fractional ones take part of a column.

Draw xx as an arrow from the origin. The same recipe builds it from horizontal and vertical unit arrows:

e1=(10),e2=(01),x=x1e1+x2e2.(4)e_1=\begin{pmatrix}1\\0\end{pmatrix}, \qquad e_2=\begin{pmatrix}0\\1\end{pmatrix}, \qquad x=x_1e_1+x_2e_2. \tag{4}

These arrows form the standard basis of the plane: every vector has exactly one expression as their linear combination. They reach the whole plane (spanning), and neither direction is redundant (linear independence).

Multiplying by WW moves the two basis arrows to the two columns, keeping the recipe intact:

W(x1e1+x2e2)=x1We1+x2We2.(5)W(x_1e_1+x_2e_2)=x_1We_1+x_2We_2. \tag{5}

Preserving linear combinations is what makes this a linear map. For any vectors u,vu,v and real numbers a,ba,b, W(au+bv)=aWu+bWvW(au+bv)=aWu+bWv.

Our four weights specify just two destinations. Because every input is built from the same two basis arrows, linearity fixes the rest of the plane’s destinations too.

Hand-drawn vector sums: on the left, three horizontal units and two vertical units form x = (3,2). On the right, 3We₁ = (6,3) followed by 2We₂ = (−2,2) forms Wx = (4,5). Red arrows show the resultant vectors.
Left: input space. Right: output space.

What the rows and columns control

A layer with nn input coordinates and mm output coordinates works the same way. Its weight matrix has nn columns, each with mm entries. Calling those columns w1,…,wnw_1,\ldots,w_n, we have

y=Wx=∑j=1nxjwj.(6)y=Wx=\sum_{j=1}^{n}x_jw_j. \tag{6}

Change xjx_j by δ\delta and the output changes by δwj\delta w_j. One column gives the response across all mm outputs.

To calculate just one output, read across its row:

yi=∑j=1nWijxj.(7)y_i=\sum_{j=1}^{n}W_{ij}x_j. \tag{7}

Here WijW_{ij} is the weight in row ii, column jj. Rows collect inputs into an output; columns carry an input’s contribution to the outputs.

A bias bb in y=Wx+by=Wx+b shifts the output by a fixed amount. It leaves these responses unchanged. A nonlinear activation can change them, so this describes the computation before that activation.

What happens when a weight changes

Now let training change the top-left weight in (1) from 22 to 2+ε2+\varepsilon, leaving the others fixed. For a fixed input, the output changes by

Δy=(εx10).(8)\Delta y=\begin{pmatrix}\varepsilon x_1\\0\end{pmatrix}. \tag{8}

For x=(3,2)x=(3,2), the change is (3ε,0)(3\varepsilon,0). If x1=0x_1=0, it does nothing. The same weight edit has a different effect depending on the input passing through it.

Editing a whole column changes how one input coordinate contributes across the outputs. Geometrically, training moves the destinations of the basis arrows; each input still supplies its own combination coefficients.