Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 13 min read Deep dive easyNovice

Introduction to Graph Machine Learning

Graphs (nodes linked by edges) underpin tasks from molecule generation to recommendation, and learning on them requires permutation-invariant/equivariant models because shuffling an adjacency matrix or edge list yields the same graph. The survey moves from pre-neural engineered features (centrality, clustering coefficient, graphlets, Katz index) and walk-based embeddings like Node2Vec to Graph Neural Networks built on message passing, comparing aggregation schemes in GCN, GAT, GraphSAGE and GIN. It explains the oversmoothing problem that limits GNN depth, with mitigations such as fewer layers, skip connections and non-message-passing layers, then reviews Graph Transformers like SAN, GRPE and Graphormer that adapt attention and positional encodings to graphs.

Assumes: neural network basicslinear algebra basicsTransformer attention

Related posts

  • Graph Classification with Transformers

    Hugging Face mediumAdept

    Graph classification with Hugging Face Transformers uses Microsoft's Graphormer, fine-tuned on the ogbg-molhiv dataset from the Open Graph Benchmark. The walkthrough covers loading graph datasets from the Hub, the expected jsonl graph format (edge_index, num_nodes, y, node_feat, edge_attr), and Graphormer preprocessing that computes degree and shortest-path features, either upfront or on the fly in the data collator for large graphs. It then loads a pretrained checkpoint with a new classification head and trains it with Trainer and GraphormerDataCollator. Batch size and gradient accumulation need tuning to avoid OOMs, and 20 epochs take about a day on a CPU. A reader comment notes the module has since moved under transformers.models.deprecated.

  • Exploring the Potential of Graph Neural Networks to Transform Recommendations at Zalando

    Zalando Engineering hardMaster

    Zalando trained a GraphSAGE-based graph neural network on a bipartite user–content graph (view and click links) to learn user and content embeddings via click link prediction, then fed those embeddings as extra features into its existing tabular CTR model for the Homepage. Running the GNN end to end was avoided because of graph data generation, neighbor-aware inference and scalability costs; the embedding approach fits current infrastructure, can be retrained daily and helps with cold-start content via view links. Training used PyTorch Geometric with disjoint subgraph mini-batching and separate message-passing and supervision links to prevent leakage. The offline experiment improved ROC-AUC by 0.6 percentage points, with production validation and further tuning still to come.

  • Exploring Hierarchical Interest Representation For Meta Ads Deep Funnel Optimization

    Meta Engineering hardMaster

    Hierarchical Interest Representation is an upstream representation layer for Meta Ads. It learns unified embeddings for users, ads, advertisers and products over a typed, time-decayed heterogeneous engagement graph spanning billions of interactions. A graph transformer injects structural signals such as node-type transitions and shortest-path distance as attention biases, computed on the fly with FlexAttention over packed block-masked subgraphs. It is trained with self-supervised teacher-student cross-view distillation using Sinkhorn-Knopp balancing plus a supervised engagement-prediction objective, with LLM-processed multimodal content enriching sparse nodes. Pipelined data loading from the online graph engine gave a 30x training speedup, strict temporal cutoffs prevent leakage, and embeddings are quantized into Bag-of-Meaning tokens for inverted-index retrieval and use in GEM, Andromeda and ranking models.

  • ​Sequential Attention: Making AI models leaner and faster without sacrificing accuracy

    Google Research hardMaster

    Sequential Attention is a greedy subset-selection algorithm that runs inside a single training run. It uses softmax attention scores over unselected candidates (features, embedding chunks, weight blocks) to add the most informative one at each step, and recomputes scores so the ranking reflects marginal gain and avoids redundant picks. For feature selection it matches or beats baselines on proteomics, image and activity-recognition benchmarks, and on linear regression it is provably equivalent to Orthogonal Matching Pursuit. SequentialAttention++ combines differentiable pruning with combinatorial search to produce block-sparse weights that run efficiently on GPUs and TPUs, with compression gains on ImageNet. Planned uses include recommender embedding optimization and structured LLM pruning.

  • Supercharging transformer residual connections

    Google Research hardMaster

    DeepCrossAttention (DCA) replaces the fixed point-wise summation of transformer residual connections with learned, per-token routing over all preceding layer outputs. It does this through dynamic layer-mixing weights and depth-wise cross-attention with split Q/K/V, which prevents early-layer features from being diluted. On LM1B and C4, DCA matched standard transformers in up to 5x fewer training steps and hit sub-14 LM1B perplexity with 30 layers instead of 42, while adding under 0.2% parameters. It can also be retrofitted onto pre-trained models, and the post places it alongside related techniques such as attention residuals, hyper-connections and manifold-constrained hyper-connections.

The quest for software engineering knowledge.

Look:
Layout: