ML Models & Algorithms
LinkBERT
In shortA BERT-style language model pretrained with hyperlinks between documents. SEOs use its embeddings to find semantically related pages for internal linking.
LinkBERT is a language model from Stanford researchers (Yasunaga, Leskovec and Liang, 2022) that extends BERT by learning from the links between documents as well as the text inside them. It was pretrained on English Wikipedia with its hyperlink structure, so it has a sense of which documents relate to each other. In SEO it is used to find internal linking opportunities based on the meaning of pages rather than shared keywords.
How it works
Standard BERT pretraining shows the model one document at a time. LinkBERT also places a document next to a document it links to (or a random or neighbouring one) and adds a training task that asks the model to predict how the two segments relate. This teaches it knowledge that spans documents, which the authors found helpful for multi-hop reasoning and question answering.
For internal linking you use LinkBERT as an encoder:
- export your pages with URL, title and main content,
- generate an embedding for each page (LinkBERT-large produces 1,024-dimensional vectors) from the title, the content or both,
- calculate cosine similarity between every pair of pages, and
- review the most similar pairs that are not yet linked as candidate links.
How it’s used in SEO and marketing
- Programmatic internal link suggestions across a blog or resource library.
- Finding related-article candidates for “further reading” blocks.
- Spotting topical clusters and orphan pages that should connect to a hub.
- Complementing entity-based linking: entity analysis links pages that share a prominent entity, while LinkBERT links pages with related meaning even when they name different entities.
Example
In the Introduction to Machine Learning for SEO course, the internal linking practical first maps link opportunities from Google Natural Language API entities, then runs LinkBERT on the same articles as an alternative approach. Title-only embeddings are fast and good for high-level topical grouping; content embeddings are slower but catch deeper relationships. The two methods surface overlapping but different suggestions, which is why MLforSEO recommends validating both before implementing.
Limitations and things to watch
- LinkBERT’s pretraining data is Wikipedia, so niche commercial vocabulary may be represented less well than in newer embedding models.
- Inputs are limited to 512 tokens, so long pages are truncated or need chunking.
- High similarity does not mean a link is useful to readers. Check relevance, anchor text and the user journey.
- The large model is slow on CPU; use a GPU runtime in Colab for big sites.
- Cap the number of new links per target page so one page does not absorb every suggestion.
Learn it on MLforSEO
- ML-Powered Internal Linking Opportunity Discovery with LinkBERT
- 10 Ways to Automate Internal Linking with AI
- Internal Link Opportunities Quick Find (Google Sheets Template)
- The Introduction to Machine Learning for SEO course, with the practical on entity analysis for automated internal link opportunities
Where LinkBERT shows up on MLforSEO
Learn it in a course
Read about it on the blog
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…
