Skip to content

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.

Updated 24 Oct 2026· 2 min read

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

Where LinkBERT shows up on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →