ELMo, short for Embeddings from Language Models, is a method that represents each word with a vector computed from the whole sentence it appears in, using the internal states of a deep bidirectional language model. The same word therefore gets a different vector in different contexts, which helps with words that have more than one meaning.
This page is for data scientists, NLP engineers and technology leaders who want a clear definition of ELMo. It covers how the representations are produced, how they differ from static word embeddings and from BERT, where they are used, and how they relate to AI agents.
The ELMo paper, titled Deep contextualized word representations and written by Matthew Peters and colleagues, introduces word vectors that are learned functions of the internal states of a deep bidirectional language model (biLM) pre-trained on a large text corpus.
The representations capture characteristics of word use, such as syntax and semantics, and how those uses change across contexts. That addresses polysemy, where one word has several meanings. The authors report that adding these representations to existing models significantly improved results on six NLP problems, including question answering, textual entailment and sentiment analysis.
In a traditional word embedding, each word has one fixed vector. In ELMo, the vector assigned to a token is a function of the whole sentence in which the word is used. The same word can therefore receive different vectors in different sentences.
The paper argues that exposing the deep internal layers of the pre-trained network is crucial, because it lets downstream models combine different types of semi-supervision signals. In practice, a task model takes the ELMo vectors as additional input features alongside its usual word inputs.
| Approach | Vector for a word | How it is used |
|---|---|---|
| Static word embeddings | One fixed vector per word, whatever the context | Looked up as input to a task model |
| ELMo | A function of the whole sentence, from a deep bidirectional language model | Added to an existing task model as features |
| BERT | Contextual representations from Transformer encoders | The pre-trained model itself is fine-tuned for each task |
ELMo and BERT both produce context-dependent representations. See our glossary pages on BERT and universal language model fine-tuning for the related approaches.
The paper reports gains on question answering, textual entailment and sentiment analysis, among six NLP problems. Because ELMo plugs into an existing model as extra features, a working system can be extended without being redesigned.
Agents that read language need representations that reflect meaning in context, so that a word such as bank is understood from the sentence around it. Contextual embeddings such as ELMo are one way to supply that. For teams building and running agents, ElixirClaw is XenonStack's AI agents computing platform.
To map one decision your agents make from language input, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.
ELMo stands for Embeddings from Language Models. It produces context-aware word representations from a deep bidirectional language model.
A traditional embedding gives each word one fixed vector. ELMo assigns a vector that is a function of the whole sentence, so the same word can have different vectors in different contexts.
It helps with polysemy, where a word has several meanings, because its representation changes with the context in which the word is used.
The paper reports improvements on six NLP problems, including question answering, textual entailment and sentiment analysis.
ELMo adds context-aware vectors from a bidirectional language model to an existing task model. BERT is built from Transformer encoders and is itself fine-tuned for each task.