Machine learning on graphs
Embeddings, GNNs, sampling and link prediction — modelling data whose structure is the signal.
Most machine learning assumes your rows are independent. Graph machine learning is what you do when they are not — when the interesting thing about a record is not its own columns but who it is connected to, and who they are connected to. A payment is unremarkable; a payment between two accounts that share a device fingerprint with four others is not. Flattening that into a feature table destroys exactly the signal you came for, because the useful structure lives two and three hops out and there is no column for it.
These pages work from the structure inward. Each one is built on a graph small enough to draw and arithmetic small enough to redo by hand, because the algorithms here are short and the intuitions people carry about them are frequently wrong in a specific, checkable way. Where a published paper defines a parameter, the parameter is named and the paper is linked. Where a method has a failure mode that a demo will never show you — a bipartite graph where every common-neighbour score is zero, a random walk that never converges, a pooling layer that cannot tell a molecule from two copies of it — that failure mode is the point of the page, not a footnote.
Link Prediction in a Graph, Explained
How neighbourhood-overlap scores rank missing edges, worked by hand on an eight-edge graph, and why the obvious evaluation metric lies.
9 min read
Node Embeddings: node2vec and DeepWalk Explained
The random-walk-then-skip-gram pipeline worked end to end, including the exact p and q transition probabilities on a five-node example.
10 min read
Graph Classification With Graph Neural Networks
How a GNN turns a variable-size graph into one label, why the pooling choice decides what the model can distinguish, and where the whole approach hits a proven ceiling.
10 min read
Detecting Fraud Rings With Graph Analysis
How shared attributes turn independent-looking accounts into a dense subgraph, with the projection and density calculation worked on six accounts.
10 min read
Recommendation Systems Built on Graph Embeddings
What treating the interaction matrix as a bipartite graph adds over classical collaborative filtering, worked on a three-user example, plus the propagation rule LightGCN actually uses.
10 min read
Detecting Bot Networks With Graph Analysis
The full detection pipeline — building a co-activity graph, layering behavioural signals on topology, and the base-rate arithmetic that decides whether it is usable.
10 min read
Knowledge Graph Embeddings: TransE and How Entities Become Vectors
How a relation becomes a translation vector, with the scoring function, the ranking loss and a gradient step worked on a two-dimensional triple.
10 min read
Graph Attention Networks Explained
What GAT computes that a graph convolution cannot, with the attention coefficients for one node's neighbourhood calculated end to end.
9 min read
Supply Chain Risk Mapped as a Network
How to find a single point of failure in a supplier network, with degree, betweenness and articulation points computed on the same seven-node graph — and why they disagree.
10 min read
Citation Network Analysis Explained
Why citation counts and network centrality rank papers differently, derived exactly on a nine-node network where the two orderings invert.
10 min read
Random Walk Algorithms on Graphs, Explained
The transition matrix, the stationary distribution and the two conditions it needs — with a worked five-node graph that satisfies one of them and not the other.
10 min read
Graph-Based Anomaly Detection for Transaction Networks
How a transaction pattern that is unremarkable at every individual account becomes obvious once you score the subgraph it forms.
9 min read
Scaling a GNN to a Billion-Node Graph
Derives the memory a billion-node graph actually needs from its node count, feature dimension and sampling fan-out, and shows which number is the wall.
10 min read
Temporal Graph Networks: Modelling a Graph That Changes Over Time
The architecture for graphs where edges appear and disappear, and why a per-node memory vector is what makes it work.
10 min read
Heterogeneous Graphs: When Nodes and Edges Are Not All One Type
Why a single GNN layer cannot aggregate over two node types and two edge types at once, and what the standard architectures do instead.
10 min read
Graph Sampling Strategies for Graphs Too Large to Fit in Memory
Neighbour sampling and subgraph sampling produce different memory curves and different biases; this works both and says when each one is wrong.
10 min read
Detecting Cycles and Loops in a Dependency Graph
A depth-first cycle detector that reports the actual cycle path, why the obvious visited-set version is wrong, and what to use when there are many cycles.
9 min read
Measuring Graph Density and What It Predicts About a Network
How density is computed, why it is nearly useless for comparing graphs of different sizes, and what to report instead.
9 min read
Cold-Start Link Prediction for a New Node With No Edges
Every topological link-prediction score is identically zero for a node with no edges; here is what replaces it and how to evaluate it honestly.
10 min read
Building a Graph From Tabular Relationship Data
Turning foreign-key tables into an edge list and a feature matrix, including the id remapping that every graph library requires and no CSV has.
10 min read
Why a Graph Neural Network Gets Worse With More Layers
Oversmoothing, derived from a four-node graph where the node features converge to a single value, plus the mitigations that actually work.
11 min read
What Training a GNN on a Real-World Graph Actually Costs
Derives the compute, the data movement and the GPU-hour bill for one training run from a stated graph size, epoch count and hourly price.
11 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models