How neural network components communicate through a shared vector space
Suppose several components of a network contribute to the same vector. One component changes it, another adds its own contribution, and a later component uses the result. There is only one list of numbers. How can the components do different things without every change affecting every reader?
The answer depends on the directions each component can write along and the directions each reader responds to. Two components can change every coordinate of the same vector while having quite different effects on a later computation.
We will make this visible with a shared three-dimensional space, two writers, and one reader. The actors are small matrix operations with hand-chosen weights. Their simplicity lets us inspect the geometry directly before connecting it to neural networks.
The linear algebra article explains row space, column space, and null space. Feature detectors: how neurons read and write builds an individual read-and-write operation. Here we bring several actors into the same space and ask what their interactions allow.
One shared vector, several actors
Let the shared vector be . It starts at zero. Actor A supplies a two-number result , and actor B supplies another two-number result . Each actor has a matrix that turns its result into a contribution to the shared space:
Both and have shape . We add the contributions, then let actor C read the result:
Here is C’s reading direction. C returns one number. In the demonstration, sliders supply A’s and B’s results so we can vary their contributions independently. We are isolating how they communicate through the shared vector; we have not yet specified a task that computes those results.
There is no A field and B field inside . Once added, the contributions occupy the same three coordinates. Keeping separate arrows in a diagram is our bookkeeping, not extra storage inside the vector.
Two writers with different planes
Choose three mutually perpendicular unit vectors, , , and . Think of and as directions along a tabletop, and as its normal. These directions need not coincide with the coordinate axes.
Give A the output matrix
For a two-number result , A writes
Whatever numbers A produces, its contribution lies in . This plane is A’s write subspace: the column space of its output matrix.
Now give B a different matrix of exactly the same shape:
B writes in . Both writers can move along , but only A can supply the component, and only B can supply the component in this configuration.
The matrix shapes limit each writer to at most two independent directions. The matrix values determine which two directions. Nothing about having two inputs automatically assigns A and B different planes.
The explorer uses these exact directions:
Each direction has nonzero entries in all three coordinates. Writing along just one of them already changes every coordinate. Yet their dot products with one another are zero. Coordinate overlap does not imply that every reader responds to every contribution.
A reader can ignore an entire writer
Let C read along . Since and ,
A can change the shared vector, including all three coordinates, without changing C’s answer. Every contribution A can make lies in the null space of C’s reading matrix .
This is a statement about all possible results from A, not just one contribution that happens to have no effect. C is insensitive to A’s whole write plane.
Try it before moving on:
- Keep the reference configuration: all four writer coefficients are , B’s plane angle is , and C reads along . Record it with .
- Write a prediction, then change only from to . Record that view too. Compare the coordinates of and C’s answer.
- Explain which dot product accounts for the result. Then restore the reference and change only from to . At this angle, .
The figure shows two plane patches, the individual contributions, their sum, and C’s reading direction. changes only the camera. restores the four coefficients, plane angle, reader, and camera; it keeps your written prediction and records.
In the first comparison, changing changes by , but C’s answer remains . In the second, changing changes by and raises C’s answer to . The shared vector changed in both cases; the reader distinguishes them by direction.
A shared direction allows reinforcement and cancellation
The two write planes intersect along a line:
A’s and B’s contributions along that line combine into . At the reference settings, they reinforce: the coefficient of is .
Restore the reference and select using . Predict what will happen when you change only from to . Record the two views.
Now the shared contribution cancels:
C’s readout along falls from to , while the and contributions remain. If C instead reads along , this cancellation has no effect on its answer.
That distinction matters: cancelling a component of the shared vector and changing a particular reader’s answer are different questions. We have to specify which reader observes the change.
The total along also carries no record of its source. From that total alone, a reader cannot distinguish from . Other information could distinguish the actors, but addition has not preserved their individual coefficients here.
Interaction does not require an exact shared direction
We can rotate B’s plane around the shared line . Replace its second column with
At , and we have our original configuration. At , and B’s plane coincides with A’s. Between those endpoints, the writers share exactly the line through .
Keep C reading along . Its response to B is now
Restore the reference, record it, then change only to . B’s two coefficients stay fixed. C reads approximately from B, rather than .
At this angle, C’s read line and B’s write plane share no nonzero vector. To produce a vector along , a combination of and would have to eliminate both its and components. That forces both coefficients to zero.
Nevertheless, C responds to B because . A direction can have a nonzero projection onto a reader without lying along that reader’s line.
This gives us two precise questions to ask about subspaces:
- Intersection: which exact directions can both contain?
- Sensitivity: does a direction one actor writes have a nonzero dot product with a direction the other reads?
Exact intersection explains the shared direction where A and B can cancel each other. Sensitivity explains why C can detect B even without an intersection between its read line and B’s write plane.
A matrix product describes the possible interaction
For a reader with several outputs, replace with a reading matrix . The contribution of A to its reading is
The product connects two actors through the shared space. Each entry measures how one reading row responds to one writing column.
In our original configuration, C reads along , so
C ignores both of A’s channels and responds only to B’s second channel. Switching C’s reading direction to gives
The write planes have not changed. The reader now responds to the direction both writers share.
If , A’s entire write subspace lies in . A cannot affect this linear reading through its direct contribution. If the product is nonzero, some possible results from A affect C. A particular result can still have zero effect, and the computations producing A’s results may restrict which possibilities actually occur.
That is why geometry establishes a possible interaction, while understanding a working network also requires examining the activations it produces.
Design an interaction yourself
Use the explorer to build a configuration where changing B’s second coefficient changes C’s answer, but changing either of A’s coefficients does not. Choose an angle other than and write down your prediction before trying it.
Record a reference and one comparison for each changed coefficient. Keep the reader, angle, and other coefficients fixed within each comparison. Explain your results using and .
As a separate test, make the two write planes coincide by setting the angle to . Can a linear reader ignore every possible contribution from A while still responding to some contribution from B?
Check the geometric reasoning
For the first task, choose C’s direction as and any angle strictly between and . Then and . Varying B’s second coefficient changes the answer; varying either of A’s does not.
For the second task, no such linear reader exists. With identical write subspaces, a reader that annihilates every vector A can write also annihilates every vector B can write. A reader could distinguish restricted sets of actual outputs under additional assumptions, but it cannot distinguish the actors’ full capabilities in this configuration.
Where the actors appear in a neural network
A neural-network component can read from a shared representation, compute a result, and map that result back into the shared space. Its input matrix supplies the reading rows; its output matrix supplies the writing columns. These matrices can have different orientations, so what a component reads need not be what it writes.
In our example, sliders supplied the writers’ results. In a network, earlier computations supply them. The distinction between A’s possible write plane and its actual contribution remains: the matrix specifies what is reachable, while the current result selects a vector within it. Our planes were deliberately chosen; learned matrices can be aligned, distinct, redundant, or rank deficient. Matrix shape alone guarantees none of those arrangements.
Attention heads provide a larger instance of this geometry. A head’s output projection maps its result into a subspace of the residual stream, and later components read the updated stream through their own projections.
For example, take a model with a 768-dimensional stream and 12 heads, each producing a 64-dimensional result. Each head has a write map . Its contribution has 768 coordinates, but lies in the column space of that matrix, whose dimension is at most 64. Mapping back to the stream’s width does not make every direction reachable.
The heads take the place of our writers A and B: each output matrix restricts the directions its actor can write. A later reader takes the place of C. The bypass carries the original vector into the addition. This view shows the attention update at one receiving position in a pre-norm block; source-position inputs, biases, and dropout are omitted.
In our column-vector notation, a head writes , and a later linear reader sees . This is the same writer-to-reader product we inspected in three dimensions. The per-head matrices can be stored as blocks of one combined output projection; separate boxes show their mathematical contributions.
A Mathematical Framework for Transformer Circuits develops this communication view and the products connecting reading and writing matrices. Actual attention also includes token routing and nonlinear operations, and normalization can change the effective response to an update; our fixed linear readers isolate one part of that computation.
The residual-network article explains how updates accumulate and why skip connections matter for training. The attention-head article explains how a head computes its result. The question to carry into either is geometric: where can this component write, and which later readers are sensitive to those directions?