# BERT

> Canonical: https://skillalmanac.com/glossary/bert | Last verified: 2026-11-25 | Index status: index-eligible

BERT, short for Bidirectional Encoder Representations from Transformers, is a language model pretrained on unlabeled text that reads context on both sides of a word, then adapted to tasks such as question answering.

Also called: BERT model, BERT NLP, BERT transformer, Bidirectional Encoder Representations from Transformers.

## In plain language

BERT is a language model that learns by filling in blanks. During training, some words in a sentence are hidden and the model has to guess them from the words on both sides. That teaches it a lot about how language fits together. Afterwards, people adapt the pretrained model to a specific job, such as answering questions or sorting text into categories, by adding a small final layer and training a little more. BERT's paper describes it as a model for understanding tasks such as question answering and language inference, fine-tuned with one added output layer.

## Technical definition

BERT was introduced by Devlin, Chang, Lee and Toutanova (arXiv 1810.04805). The paper's abstract says it pre-trains deep bidirectional representations from unlabeled text by conditioning on both left and right context in all layers, and that the pre-trained model can be fine-tuned with one additional output layer for tasks such as question answering and language inference. Hugging Face's documentation describes it as a bidirectional transformer pretrained to predict masked tokens in a sentence and to predict whether one sentence follows another.

## How it shows up when you use agents

BERT is not what runs inside Claude Code, Codex or Cursor. Those tools call a large generative model. BERT appears when an agent builds a feature that labels or scores text, such as sorting support tickets or answering questions from a passage, since its paper reports fine-tuning for tasks like question answering and language inference. Hugging Face's documentation says the original BERT checkpoints are published in a collection on the Hub.

What breaks when it is misunderstood: people ask a BERT checkpoint to chat or write, and get nothing useful, because it was pretrained to predict masked tokens rather than continue text. Others use a checkpoint straight from the hub as a finished classifier, when the paper's approach is to add an output layer and [fine-tune](/glossary/fine-tuning) on labelled examples for the task. The next action is to check the model card for what the checkpoint was trained to do, then test it on a sample of your own text.

For background, BERT is built on the [transformer](/glossary/transformer) architecture and is one of the best-known examples of [pretraining](/glossary/pretraining) followed by adaptation. See also [natural language processing](/glossary/natural-language-processing).

## Common confusions

- **BERT versus GPT.** Both are transformer-based, but BERT is described as a bidirectional model that conditions on left and right context, while [GPT](/glossary/gpt)-style chat models generate text one token at a time. See [Encoder-decoder](/glossary/encoder-decoder) for the wider family of designs.
- **BERT versus a chatbot.** BERT was introduced for language understanding tasks such as question answering and language inference. A chatbot is a product built on a generative model.
- **Pretrained versus fine-tuned.** The pretrained model learned from unlabeled text. The paper says one additional output layer is enough to fine-tune it for a task.
- **BERT versus word embeddings.** Both turn words into numbers, but BERT is a full pretrained network with bidirectional context in all layers, not a lookup of one vector per word. See [Word embedding](/glossary/word-embedding).

## Worked examples in this catalogue

### [hf-cli](https://skillalmanac.com/skills/huggingface/hf-cli)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A command-line tool for the Hugging Face Hub, listed in this catalogue without a description.

Why it exercises the concept: Hugging Face's documentation says the original BERT checkpoints are published on the Hub, so a command-line tool for the Hub is one way an agent could fetch one. The catalogue gives no description of the skill, so read its page first.

### [What Is an LLM? The Facts Agent Users Need](https://skillalmanac.com/learn/what-is-an-llm-for-agent-users)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The current guide contrasts the original Transformer decoder’s autoregressive generation with BERT’s masked pretraining, and distinguishes runtime context from learned parameters.

Why it exercises the concept: It is a contrast case. Chat models of this kind generate text a token at a time, while BERT is trained to fill in masked tokens using context on both sides.

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill's catalogue line says it builds and validates an eval dataset for any LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: Adapting BERT to a task, as its paper describes, adds one output layer and fine-tunes. This skill is about eval data for LLM features, so it applies to the checking half by analogy, not as a BERT tool.

## Related terms

- [Transformer](https://skillalmanac.com/glossary/transformer.md)
- [Natural language processing (NLP)](https://skillalmanac.com/glossary/natural-language-processing.md)
- [Pretraining](https://skillalmanac.com/glossary/pretraining.md)
- [Fine-tuning](https://skillalmanac.com/glossary/fine-tuning.md)
- [Encoder-decoder](https://skillalmanac.com/glossary/encoder-decoder.md)
- [Word embedding](https://skillalmanac.com/glossary/word-embedding.md)

## Sources

- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805), arXiv (Devlin et al.) (accessed 2026-11-24)
- [BERT](https://huggingface.co/docs/transformers/model_doc/bert), Hugging Face (Transformers documentation) (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
