The BERT Model in Google Search and Modern SEO

The BERT Model in Google Search and Modern SEO

The BERT model (Bidirectional Encoder Representations from Transformers) is an encoder-only language model introduced by Google AI researchers on October 31, 2018, as an open-source solution under the Apache 2.0 license. Thanks to bidirectional text analysis, Google more accurately interprets the meaning of queries where context is determined by minor prepositions rather than nouns alone.

For SEO, the practical takeaway is clear: Google BERT evaluates whether content matches search intent rather than whether it contains exact keyword matches. In the first part of this article, we cover the architecture and training of the 2018 model; in the second, what replaces it today: the ModernBERT family, the Polish model from the Gaia AI Factory project, and the current role of classic BERT in Google ranking systems.

How does the BERT model and bidirectional text analysis work?

BERT is an encoder-only NLP model that uses a self-attention mechanism to analyze both the left-hand and right-hand context of every word simultaneously. There is no causal masking in its attention layers, enabling full bidirectional attention. The BERT architecture consists of a tokenizer, an embedding layer, transformer encoder blocks, and a task head. Token positions are encoded using absolute positional embeddings. The number of attention heads is determined by the formula H/64, because the query, key, and value vectors each have 64 dimensions, and the feed-forward layer has a size of 4H.

1. Word masking and next sentence prediction

During pre-training, the model learns natural language from raw text without labels. In Masked Language Modeling (MLM), 15% of the input tokens are randomly selected. Of these, 80% are replaced with the [MASK] token, 10% with a random word, and 10% remain unchanged. This prevents the model from simply learning to identify the mask token, as it never knows which token is "suspicious." Next Sentence Prediction (NSP) is a binary classification task: whether sentence B naturally follows sentence A. The training corpus consisted of English Wikipedia (about 2.5 billion words) and BookCorpus (about 800 million words), totaling approximately 16 GB of text.

2. Fine-tuning the base model for specific tasks

The second stage is transfer learning. A pre-trained language model can be utilized in two ways. In fine-tuning, the task head is replaced with a new module, such as a classifier, and the weights are fine-tuned on a small set of labeled data. An alternative approach is a frozen feature extractor, where a frozen encoder provides representations to a separate model. Google's official repository provides a TensorFlow implementation.

How did Google implement the BERT model in its search engine?

Rolled out to production in 2019, BERT began operating in Google as a semantic re-ranker: it reads the relationships between function words and keywords, allowing it to recognize search intent more accurately.

Four stages of query interpretation by the search engine

  1. WordPiece tokenization. The query is split into units from a 30,000-token vocabulary. A [CLS] token (classification representation) is added to the beginning of the sequence, and [SEP] separates sentences.
  2. Vector summation. The embedding layer sums the token, position, and segment embeddings together.
  3. Bidirectional attention. Successive encoder layers weigh each token against all other tokens on both sides.
  4. Re-ranking and response. The representations are used to re-evaluate how well results match search intent and for extractive question answering, pinpointing the specific text snippet containing the answer. The same model type also handles named entity recognition and text classification.

The impact of prepositions and function words on search intent

Function words alter the relationships between concepts, even if they do not carry topical meaning on their own. Hypothetical queries like "ticket from Krakow to Berlin" and "ticket from Berlin to Krakow" share the same nouns but differ in direction. A bidirectional model accounts for context on both sides of a preposition, allowing it to distinguish between such variations. Furthermore, WordPiece tokenization splits rare words into subwords, ensuring that even unusual word forms receive meaningful representations.

Differences between RankBrain and BERT algorithms

Unlike RankBrain's conceptual matching of topics, BERT analyzes contextual relationships between all words in a query simultaneously and in real time. Among other functions, it serves as a second-pass filter (re-ranker) in search rankings. However, it does not replace other ranking signals, such as links or technical factors, which is why semantic writing complements rather than replaces broader SEO.

Infographic: four stages of query interpretation by the BERT model in Google Search

What are the differences between BERT variants and generative models?

Models in the BERT family are specialized encoders designed for text classification and extraction, whereas GPT models are decoders optimized for text generation. In the BERT vs. GPT comparison, the difference stems from their architecture. BERT is encoder-only with bidirectional attention, while GPT is decoder-only with causal attention. Consequently, an encoder does not natively generate extended, free-form text.

Model Scale Pre-training Task Deployment Specifics
BERT Base 110M parameters, 12 layers, H=768 MLM + NSP Starting point for fine-tuning
BERT Large 340M parameters, 24 layers, H=1024 MLM + NSP Higher computational cost
BERT Tiny 4M parameters, 2 layers, H=128 MLM + NSP Resource-constrained environments
DistilBERT 40% fewer parameters than BERT Base Knowledge distillation 60% faster inference, 97% of GLUE score (Sanh et al., 2019)
RoBERTa approx. 160 GB of text (10x more than BERT) MLM with dynamic masking, no NSP Longer, more intensive training
XLNet - Permutation modeling instead of masking Different approach to learning context

The choice often comes down to hardware constraints. DistilBERT, created through knowledge distillation, performs well in text classification and sentiment analysis under limited resources, though the reported speedup reflects results from the original paper rather than a guarantee across all hardware setups. The bert-base-cased and bert-base-uncased variants differ in case sensitivity and are available on Hugging Face under the google-bert organization.

For semantic similarity, do not rely solely on the raw CLS token embedding of an untuned BERT model - depending on the model, mean pooling across all tokens from the last hidden state or a dedicated model, such as Sentence-BERT, generally works much better.

Let's check your website's potential

Share your website and email - we'll get back to you with a real analysis, no strings attached.

Your data is used only to get back to you. See our Privacy Policy.

Great! We'll be in touch soon!

Something went wrong while submitting the form. Please try again.

Is the BERT model still relevant today?

The short answer is yes, but not in its original 2018 version. The encoder-only architecture itself remains the foundation of many of today's NLP systems, but the classic BERT has been succeeded by faster and more accurate models, primarily from the ModernBERT family. Large generative models such as GPT, Gemini, and Claude have taken over text generation tasks, but they have not replaced representation models - these do not generate text, but instead convert it into vectors (embeddings), making them many times faster and cheaper to run. This difference in cost determines where BERT-like models are applied in practice:

  • RAG systems. Before a large model answers a question based on company documents, a BERT-type encoder searches the database and selects the relevant passages.
  • Content classification and moderation. Categorizing support tickets, detecting spam, and sentiment analysis run in a single encoder pass, without the cost of text generation.
  • Named Entity Recognition (NER). Extracting proper names, monetary amounts, and dates from large volumes of documents, e.g., in banking or legal services.

Specialized embedding models based on the BERT architecture have been developed for such tasks, including the BGE, E5, and GTE families, optimized for modern semantic search and vector databases. Such encoders continue to play an important role in production applications alongside newer decoder-based approaches.

What replaced the classic 2018 BERT model?

The classic 2018 BERT has been replaced by its improved successors, primarily the ModernBERT family. The original model has two practical limitations: a narrow context window and slower performance on modern GPUs compared to encoders designed later.

ModernBERT as the direct successor to BERT

ModernBERT is a model released on December 19, 2024, by Answer.AI and LightOn, which funded the compute. It comes in two variants - base (149 million parameters) and large (395 million parameters) - with a context window extended to 8,192 tokens, which is sixteen times larger than the 512-token limit of most encoders, including the original BERT. The authors describe it as an improvement in speed and accuracy over BERT and comparable encoders: on variable-length data, ModernBERT runs up to four times faster than DeBERTaV3 and consumes less than one-fifth of its memory, and among base-sized models, it was the first to outperform DeBERTaV3 on the GLUE benchmark.

Polish language model within the Gaia AI Factory

A Polish equivalent of ModernBERT was developed as part of the Gaia AI Factory, a Polish center for the development of trusted artificial intelligence funded by the EuroHPC JU, the EU's Digital Europe program, and the Polish government. The model was built by the AI LAB team at the National Information Processing Institute (OPI PIB) led by Dr. Marek Kozlowski, from data preparation to a new pre-training procedure, with computations performed on the PLGrid infrastructure at the AGH Cyfronet Academic Computer Centre. The model was trained on a specially prepared corpus of 44.5 billion Polish tokens and released in four variants: base and large, each available with a 512- and 8,000-token window. Moreover, the models can run on standard CPUs, without requiring a GPU.

What is BERT's role in Google's ranking systems today?

In Google's guide, the name BERT refers to an internal search ranking component introduced to Google in 2019 - not necessarily identical to the unmodified 2018 model described in the first part of this article, as Google does not disclose whether or how this system has been updated since then. According to Google's current guide to ranking systems (as of December 2025), it still belongs to the core ranking systems alongside RankBrain. Contrary to what some commentaries suggest, MUM is not currently used for general ranking - it only supports selected search features, such as featured snippets. The rules for writing for BERT covered in the next section of this article therefore remain relevant and fit into the broader concept of AI SEO, which means optimizing visibility in responses generated by models like ChatGPT or Gemini.

Infographic: rules for writing paragraphs for the BERT model - 512 token limit and comparison of poor and good examples

How to Create Content Tailored to Google's Language Algorithms?

Instead of repeating keywords, write self-contained, comprehensive answers that can be evaluated independently. The classic 2018 BERT model processed an input of up to 512 tokens, including the [CLS] and [SEP] tokens. Writing in a modular structure, with clear, semantically self-contained paragraphs, is a proven editorial practice - however, Google does not publish data confirming a direct link between this type of structure and ranking in BERT.

Rules for Splitting Paragraphs for Context Window Limits

Extractive question answering points to an existing snippet of text, so in passage ranking, the section that answers the headline question right in the first sentence wins. Subsequent sentences add conditions, numbers, and exceptions. Splitting rules:

  1. One question, one section. If a section answers two questions, separate it with a new heading.
  2. Watch the token limit. Words are split into WordPiece sub-units, so there are more tokens than words. When a section approaches the 512-token window, split it.
  3. Remove context dependency. If a paragraph cannot be understood without the preceding one ("this solution", "the above"), replace the pronoun with the full subject or merge it with the preceding paragraph.
  4. Do not split artificially. A section with a single question and a complete answer in a short paragraph should stay intact.

Building Topical Authority and Terminological Precision

Use one term for a specific concept and define it upon first use. Embeddings depend on the surrounding context, so the real issue is an ambiguous term used without context - not using synonyms themselves, which, for a broader topic, help match content to different query phrasings. You achieve topic coverage with dedicated sections covering related sub-questions, rather than by repeating the same phrase.

You can quickly check the semantic consistency of your text: convert blocks into vectors using Sentence-BERT or mean pooling and compare their similarity.

Sources:

https://en.wikipedia.org/wiki/BERT_(language_model)

https://research.google/pubs/bert-pre-training-of-deep-bidirectional-transformers-for-language-understanding/

https://blog.google/products-and-platforms/products/search/search-language-understanding-bert/

https://developers.google.com/search/docs/appearance/ranking-systems-guide?hl=pl

https://research.google/blog/open-sourcing-bert-state-of-the-art-pre-training-for-natural-language-processing/

Let us take the first step

What could grow
in your company?

Sales in your store? Number of enquiries? Presence on a new market? Tell us about your goal.

Not ready to talk yet?

Free visibility analysis

Once we receive your enquiry, we will get back to you to learn your needs and check whether our way of working fits them.

Let's talk about working together.

Roma Dumińska will reply.

Roma Dumińska

Your data is used only to get back to you. See our Privacy Policy.

Success! We'll be in touch soon :)

Oops! Something went wrong, please try again.