Suppose a human pose estimation model outputs the coordinates of a shoulder, elbow, and wrist. Storing those coordinates as a list tells us where each joint is. Adding the information that the shoulder connects to the elbow, and the elbow connects to the wrist also represents the structure of the body. Even with the same coordinate list, the model now has different information available to it.
This difference is the starting point for studying graph neural networks (GNNs). What can we compute when the input contains both the features of objects and the relationships between them? In this installment, we define a graph, read the examples in the original lecture, and check that two graphs differing only in their connections can produce different numerical results. We will derive the graph convolutional network (GCN) after establishing this foundation.
Our question: When the features of individual objects are insufficient, what information do their connections add?
The main source is pages 21–32 of the first Stanford CS224W Fall 2026 lecture PDF. We also use the manual English captions of Stanford Online’s 2021 Lecture 1.1. The video intervals below identify statements verified in the 2021 captions; their connection to the 2026 slides is conceptual. In particular, pages 26–27, which introduce databases and RelBench, are read separately as 2026 material.
#PDF page 21 — Studying objects together with their relationships
Here the lecture moves beyond course administration and starts examining why we use graphs. A graph in this context is a data structure that stores objects and their connections, rather than a bar chart displaying numerical values.
There is no need to turn every dataset into dots and lines from the outset. First decide what you want to predict, then ask whether information about other objects is needed to make that judgment. Purchase behavior that cannot be explained by a product’s price alone may involve users and their purchase histories. A pose that cannot be identified from one joint’s coordinates alone may involve the structure linking other joints. Choosing which relationships to include is the first modeling decision.
#PDF page 22 — What does a graph represent?
In the 2021 lecture captions at 00:28–01:21, the instructor moves from considering objects individually to including the connections between them in the data. A short phrase from the captions captures this perspective:
“we really think of it in terms of networks”
This statement appears in the caption segment at 00:44–00:50. Let us now express that perspective with notation. At its most basic, a graph consists of two sets.
- is the set of nodes. A person, a joint, an atom in a molecule, or a database record can be a node.
- is the set of edges. We record a connection when two objects have a relationship that we want to represent.
Nodes can also have features. If we write the features of node as , then is the number of components in the feature vector. For a joint node, possible features include coordinates, joint type, and detection confidence. The task and observation conditions determine which components to use.
Features and connections answer different questions. Features describe the state of an object; edges describe which other objects it is related to, and how. Node identifiers such as 1, 2, and 3 are names used for storage. Whether a particular identifier has physical meaning is a separate decision.
Our supplementary textbook, Hamilton’s Graph Representation Learning, Sections 1.1 and 1.1.2, also distinguishes connectivity from feature information. Keeping that distinction makes it easier to understand why we will later use an adjacency matrix and a feature matrix as separate inputs.
#PDF page 23 — Reading real networks as graphs
Although the pictures may all look like dots and lines, their nodes and edges have different meanings. A computer network can represent devices and communication links; a subway network can represent stations and track connections; a food web can represent organisms and feeding relationships. In an event graph or a disease pathway, the meaning of nodes and connections must come from the definitions used in that field.
For example, an edge between two subway stations need not mean that they are geographically close. Nearby stations may have no direct track connection, and different pairs of neighboring stations may have different travel times. This motivates storing whether a connection exists and what properties it has separately. Recording travel time as an edge weight is one example.
An edge alone does not establish causation. A physical connection, an observed interaction, and statistical similarity are different relationships. We need to state which meaning the edges of our graph carry before we can interpret the model’s output.
The 2021 lecture captions at 01:21–03:18 explain how choosing entities and relationships produces graph representations across communication, society, molecules, scenes, and code. The next two slides broaden this range of examples.
#PDF page 24 — The direction and type of a relationship matter
In a citation network, it matters that paper A cites paper B in that direction. In a transaction graph, removing who sent something to whom can discard information needed for the original question. By contrast, the three-node example we calculate later in this installment uses only undirected connections.
Saying that we have represented something as a graph therefore includes at least the following choices.
| Choice | Representations that can differ for the same data | Implication for prediction |
|---|---|---|
| Unit of a node | One person / one account / one message | What counts as a single object? |
| Meaning of an edge | Friendship / sending a message / membership in the same group | What information is passed through neighbors? |
| Direction | A to B / an undirected A–B connection | Which direction of information or influence is preserved? |
| Time window | One instant / the past week / a sequence of events | Relationships from which times are included in the input? |
This table is the author’s comparison of modeling choices. Use it to check what a representation preserves and what it leaves out before feeding the different networks in the slide into the same algorithm. A graph represents selected relationships in the world.
#PDF page 25 — Structure can be observed or constructed for a purpose
For a molecule, we can use atoms as nodes and bonds as edges. For a three-dimensional shape, we can choose points or mesh vertices as nodes. For code, different graphs result depending on whether we represent syntax, execution flow, or data dependencies. In knowledge graphs and regulatory networks, the types and directions of connections are also part of the description.
The scene graph at the upper right connects a Sun, Wheel, and Cart to components such as circles, lines, and filled squares. It shows how a computer graphics scene is assembled from parts and how those parts are shared. The dolphin at the lower right is an example of representing a shape with a triangular mesh. Both help construct a visual scene or shape, but their connections express different relationships.
Let us extend this to another use of scene graphs in computer vision. After detecting a person and a cup in an image, we can represent the relationship that the person is holding the cup. This person–cup example is the author’s supplement; it is not the example drawn on the slide. Both uses add relationships to an object list to describe a scene. If another model estimates those relationships, the edges can also contain errors and uncertainty.
The same principle applies to pose data. A graph based on anatomical connections and a graph that connects spatially close joints embody different assumptions. A wrist approaching another person’s elbow does not mean that the two joints are connected by the same bone. Remember that deciding which relationships the learning task needs is part of the graph model.
#PDF page 26 — Database tables are connected too
On the left are tables concerning customers, orders, and products. In the middle is a schema linking accounts, transactions, and other records. On the right is a schema linking patients, admissions, and related records. The boxes in this diagram show table structures rather than individual graph nodes. We should distinguish this schema-level picture from a graph in which individual records become nodes.
A row in a customer table contains customer features, and a row in a product table contains product features. Order or sales records connect the two. To use information spread across several tables, we need to know which rows refer to which other rows. This is why relationships used for database joins can also be useful from a graph perspective.
Here is a small example to help read the original slide.
| Record type | Example features | Objects it can connect to |
|---|---|---|
| User U1 | Signup time, region | U1’s sales or order records |
| Sale S1 | Quantity, transaction time | User U1 and product P1 |
| Product P1 | Product category, price | Sales records containing P1 |
In this structure, reading only a user’s features differs from also reading information about the transactions and products connected to that user. For a prediction made at a particular time, only records and relationships available at that prediction time may enter the input. Connecting later transactions in advance would introduce future information. This is an evaluation condition we need when applying the example.
#PDF page 27 — Turning relationships between tables into learning inputs
This slide connects users, sales, and products while keeping their different types. Multiple sales can occur between one user and one product, so representing each sales record as a node, as in the preceding example, is one possible choice. Where we store transaction times and quantities changes the graph’s construction.
We will return to representations with different node or relation types when studying heterogeneous graphs. For now, the key point is that users and products do not acquire the same meaning merely because we encode them as vectors of equal length. The input types and the meanings of their relationships must remain part of the model design.
The official RelBench website, linked by the original slide, is a starting point for exploring learning tasks on relational databases. Pages 26–27 are examples from the 2026 slides; we do not present them as statements from the 2021 lecture linked earlier. Later installments will examine the construction and evaluation of relational deep learning datasets in detail.
#PDF page 28 — Calculating what information relationships add
The 2021 lecture captions at 03:18–05:48 introduce observed networks and graphs constructed by defining relationships, then ask what information that structure adds to prediction. The 2026 slide likewise motivates learning by explicitly modeling relationships.
Whether predictive performance actually improves depends on the chosen relationships, objective, data, and evaluation conditions. At this stage, let us check a smaller question: If node features stay the same, can changing only the connections change a computation’s result? The example below is the author’s own calculation, not a paper’s benchmark result.
#Fix the assumptions first
There are three nodes, , and each node has a single real-valued feature. Set every feature value to 1.
We use undirected, unweighted graphs and add no self-loops, which would connect a node to itself. The first graph is the path 1–2–3. The second adds a 1–3 connection to form a triangle.
First apply the same function independently to each node. Its input is 1 at every node in both graphs.
This function receives neither node identifiers nor connections. It therefore has no basis for distinguishing the two graphs. The same function applied to the same input produces the same output.
Now sum the features of each node’s neighbors. denotes, in graph , the set of neighbors directly connected to node .
Here is the single real number we have computed. This is a simple example of aggregation: collecting information held by other nodes. It is not yet the full equation of a GCN layer.
| Node | Neighbors in the path | Path calculation | Neighbors in the triangle | Triangle calculation |
|---|---|---|---|---|
| 1 | 2 | 1 | 2, 3 | 1 + 1 = 2 |
| 2 | 1, 3 | 1 + 1 = 2 | 1, 3 | 1 + 1 = 2 |
| 3 | 2 | 1 | 1, 2 | 1 + 1 = 2 |
With nodes ordered as 1, 2, and 3, the results are:
To obtain a value representing the whole graph, sum these three results again. An operation that combines node-level results at graph level in this way is called a readout.
Because every feature equals 1, in this example equals the number of neighbors, or the node’s degree. Each undirected edge is counted once at each endpoint, so also holds. The path’s two edges give 4; the triangle’s three edges give 6. Two different ways of counting confirm the same result.
#The aggregation rule changes which information is preserved
Now use mean aggregation: divide the sum by the number of neighbors. There are no isolated nodes in this example, so the denominator is never zero.
Every neighbor has feature value 1, so the mean is 1 whether there is one neighbor or two.
Under these assumptions, summation preserves the difference in neighbor counts, while averaging removes it. This does not establish that summation is better for every task. Averaging can be useful for reducing the effect of neighborhood size, whereas a sum can grow in magnitude with node degree. The information we preserve needs to suit the objective.
Nor can summation distinguish every graph. Consider a cycle of six nodes and two disconnected triangles, with all features again equal to 1. Every node has two neighbors in both cases. The single aggregation step above returns 2 at every node and a graph-level sum of 12. Different graph structures do not guarantee that the chosen computation will expose their difference.
The calculation establishes two specific points: connections can provide information absent from the feature list, and a computation can preserve or discard some of that information. Extending this question to learnable functions and multiple layers will be central to our study of GNNs.
#PDF page 29 — What regularity do images and sequences provide?
Image pixels have row and column coordinates. Once boundary handling is defined, the same rule identifies the positions above, below, to the left, and to the right of each pixel. A convolutional neural network (CNN) exploits this regularity by applying a small filter at multiple positions.
Sentences and time signals have a before-and-after order. Changing that order can change meaning or temporal relationships, so a model needs a way to use it. The slide’s comparison of CNNs and RNNs is a starting point for understanding these input structures. It need not be read as a restriction on the kinds of data that all present-day models can process.
The 2021 lecture captions at 05:48–07:39 contrast the regularity of sequences and grids with general graphs, motivating models that handle changes in size, connectivity, and node order.
#PDF page 30 — Is there a consistent rule for locating neighboring information?
This slide repeats the preceding comparison in a different arrangement. The key is how we identify neighbors when applying the same operation at different locations, rather than whether the data looks like an image. For an image, fixed coordinate offsets provide a reference. For a sequence, relative positions before and after an element provide one.
In a general graph, one node may have two neighbors while another has ten. The coordinates used to draw a graph on a screen are not necessarily meaningful input coordinates. If a prediction changes merely because we rearrange the nodes for a clearer drawing, we should check whether the model is using the visualization layout instead of the relationships.
Conversely, graphs of joints, point clouds, or molecules can have actual coordinates as features. In those cases, we can process coordinates alongside connectivity. Whether a graph has coordinates and whether the order of stored nodes is meaningful are separate questions.
#PDF page 31 — Three challenges in graph learning
#First, the number of nodes and neighbors can vary
To process a graph of three nodes and one of thousands of nodes with the same model, we need operations that remain defined as the size changes. The sum used earlier can be computed for any number of neighbors. We also saw that its magnitude depends on that number. Handling variable size and retaining useful information are problems we need to solve together.
Read the slide’s statement about spatial locality as a comparison: a common coordinate system and direction-specific neighbors are not guaranteed as they are on a grid. Graphs do have neighbors defined by edges, and geometric graphs may have actual coordinates. Message passing will use precisely these neighborhood relationships.
#Second, the order in which nodes are listed can change
For the preceding path graph, storing nodes in the order 1, 2, and 3 gave the neighbor sums . If we preserve the nodes and connections but change only the storage order to 3, 1, and 2, the output should follow that order and become . Node 2 is still in the middle of the path.
For node-level outputs, reordering the output in the same way as the input is reordered is called permutation equivariance. When a model returns one value for the entire graph, that value should remain unchanged under a change in storage order; this is permutation invariance. The path graph’s sum of 4 stays the same after reordering.
Why does a neighbor sum have these properties? If we move the actual neighborhoods and features together when relabeling the nodes, the values to be added do not change. Only their addition order changes, leaving the result unchanged. This explains equivariance and invariance in this simple example. In the next installment, we will verify the same idea by reordering an adjacency matrix and a feature matrix together.
#Third, connections and features can change over time
Communication links may appear and disappear, and people’s changing positions or poses may change a graph’s edges or features. A node can also carry numerical, textual, and image features together. We therefore need to decide which information describes an observation at one instant and which represents a record spanning several times.
The graphs calculated in this installment are fixed in time. When we move to temporal graphs, we will additionally define observation times, prediction times, and the time window used to construct neighborhoods. A calculation on a static example does not by itself guarantee accuracy in temporal prediction.
#PDF page 32 — From this question to different graph models
The original slide asks how we can build neural networks for data with different input structures. Starting from our calculation makes the next choices concrete. We need to decide what information neighbors send, how multiple messages are combined, how they are combined with a node’s own features, how many times the operation is repeated, and what is finally predicted.
GNN broadly refers to neural network families that handle graph inputs. Depending on context, GCN may refer to a family of graph convolutional models or to one particular model. This series will explicitly identify the Kipf–Welling GCN when discussing that model. Our neighbor-sum example is a basic computation without learned weights, normalization, or nonlinear activation.
#Supplementary original figure — Extensions shown in Annual Reviews Figure 1
This comparison appears in Graph Artificial Intelligence in Medicine. Although the review concerns medical applications, we use the figure here to distinguish graph-model inputs and information flow. The attribution and the crop of the original figure region are identified under the paper’s CC BY 4.0 license.
| Panel | What to look for | Question connected to this installment |
|---|---|---|
| a · Message passing | Neighbor messages directed toward a central node | What neighboring information should we aggregate? |
| b · Graph transformer | Graph and positional encodings combined as model inputs | How should connectivity be conveyed to attention? |
| c · Temporal graph | Graphs at different times | How should changing relationships be processed? |
| d · Hypergraph | A relationship enclosing several nodes together | Are pairwise connections sufficient? |
| e · Subgraph | A selected group of nodes and edges | Is the prediction unit a structure larger than one node? |
For now, connecting panel a to the preceding neighbor-sum calculation is sufficient. The small rectangles in the original figure represent vectors; the arrows toward the center represent message transmission. Our example simplifies each vector to a single real number and each message to a neighbor’s feature value. Later units will examine the other panels with specific definitions and original papers.
#Next step — Writing a problem as a graph
Our starting point is to think about features and connections separately. Even with all node features fixed at 1, the path and triangle produced different neighbor sums. Averaging removed that difference. Both the decision to include connectivity in the input and the decision about how to compute with it matter.
The next installment, “How should we represent nodes, edges, directions, and features?”, is planned and will cover pages 33–39 of the same lecture PDF. We will express the graphs used here as an adjacency matrix and a feature matrix , then calculate how both matrices must change when the node order changes.
Before moving on, answer the following three questions using your own example.
- In my problem, exactly what does one node represent, and what relationship does one edge mean?
- If I keep the features fixed and change the connections, is there a reason the value to be predicted should also change?
- Are the connections actually observed, or constructed by a rule or model? Is this information available at prediction time?
#Original sources and further reading
- Main lecture: Stanford CS224W, Fall 2026 L1. This article displays all twelve slides on PDF pages 21–32 in order. Printed slide numbers 21–31 begin on PDF page 22. We follow the slide-use and attribution guidance on page 1 and retain the individual image credits within the original slides.
- Lecture explanation: Stanford Online, CS224W 2021 Lecture 1.1 — Why Graphs. We read the relevant manual English captions. The times refer to caption boundaries, not to video-frame positions corresponding to the 2026 PDF.
- Supplementary definitions: Hamilton, Graph Representation Learning, 2020 public draft, Sections 1.1–1.1.2, printed pages 2–3 / PDF pages 10–11.
- Structural comparison: Johnson et al., Graph Artificial Intelligence in Medicine, Annual Review of Biomedical Data Science 7, 345–368, 2024. The material used here is Figure 1 and its related explanation.
- Reproducing the calculation: Verification code for the three-node example, permutations, and the counterexample. The computational examples were constructed by the author.