Six atoms with the exact same six starting properties can still be six different molecules — a ring, a chain, a star, wired up differently. A model that only looked at atom features and ignored the bonds would predict the exact same thing for all three. Can message passing and attention, wired together, actually tell them apart?
Same six atoms, same six starting features, every time — only the bonds change. Watch the predicted property move as you switch structures. Nothing about any single atom changed; only who it's connected to did.
This capstone chains the last two chapters' rules into a single two-layer pipeline, then reduces the result to one number:
- — the atoms' initial input features, before either layer runs.
- — atom features after layer 1, the GCN (Graph Convolutional Network) neighborhood-mean update.
- — atom features after layer 2, the GAT (Graph Attention Network) attention update.
- — the model's final predicted whole-molecule property.
- — index ranging over every atom in the molecule, summed by the readout.
- Layer 1: GCN's plain neighborhood mean
Layer 1 is Chapter 2's plain neighborhood mean — every atom blends with its bonded neighbors, no weighting.
- Layer 2: GAT's attention, on top of layer 1
Layer 2 is last chapter's attention rule, applied on top of layer 1's output, not the raw features — so by the time attention runs, every value already carries a first hop of neighbor information.
- Readout: sum atom embeddings into one number
The final sum — a readout — is the simplest way to turn six per-atom numbers into one whole-molecule prediction: real molecular property predictors do exactly this, summing (or averaging) learned atom embeddings into a single graph-level output.
Three different numbers, from three different arrangements of the exact same six atoms. The ring's prediction is the highest of the three — every atom in the ring's 3-cycle (nodes 0, 1, 2) has at least two neighbors to draw on, where the chain's end atoms have only one.
Atom on the ring structure, through both layers:
- Layer 1 (GCN): mean over atom 0's neighborhood {0, 1, 2}
(self , neighbors with features ). The same mean rule for the rest of the ring:
- (self , neighbors with features )
- (self , neighbors with features )
- (self , neighbors with features )
- (self , neighbor with feature )
- (self , neighbor with feature )
These are needed next, since layer 2 attends over these values, not the raw ones.
- Layer 2 (GAT): attention over the same neighborhood, using layer 1's output
Scores for atom (neighbors , using layer 1's values):
Softmax (subtracting the max, ):
- (self)
- (atom )
- (atom )
Sum . Normalized weights:
Atom dominates, since it's the only neighbor layer 1 pushed higher than atom itself.
- Atom 0's final embedding
.
- The same two layers, for the ring's other five atoms
Running the identical GAT step (scores → softmax → weighted sum) over each atom's own layer-1 neighborhood:
- Atom (neighbors , self ): scores for (self, , , ); softmax weights ;
- Atom (neighbors , self ): the same self/neighbor values as atom (one neighbor at , one at ), so — identical to atom
- Atom (neighbors , self ): scores for (self, , , ); softmax weights ;
- Atom (neighbor only, self ): self and neighbor share the same value, so softmax gives equal weights and exactly
- Atom (neighbor only, self , neighbor ): scores ; softmax weights ;
Summing all six: — the ring's whole-molecule prediction.
- Same atoms, different bonds: the chain's prediction
Wiring the exact same six atoms into a chain () instead changes every neighborhood, so layer 1 gives different means:
Running the same layer-2 attention step on these values gives , summing to — lower than the ring's , purely because the chain's end atoms ( and ) have only one neighbor to draw on instead of two.
Find the bond structure, among the three candidates, that gives the highest predicted property.
Two layers, two different rules, one readout — and the atoms never had to change for the prediction to change. That's the entire reason this part exists: a molecule's properties depend on its bonds, not just its atoms, and a plain feedforward network fed only atom features has no way to see that at all. Real molecular GNNs — short for Graph Neural Networks — stack more layers, learn every weight instead of fixing them by hand, and use richer readouts — but the shape of the pipeline (message passing, then attention, then pooling to one number) is exactly what's here. Part XV turns to a different structural limitation entirely: what happens when the "neighbors" aren't a handful of bonded atoms, but every previous token in a sequence thousands of positions long.