Notes

ELMo

Before 2018, a word arrived at your model as one fixed vector no matter what sentence it sat in. ELMo — Embeddings from Language Models — was the first widely adopted system to drop that assumption and compute a word's representation from the sentence around it.

How it works
ELMo trains a two-layer bidirectional LSTM as a language model over a large corpus, one direction predicting the next word and the other the previous one. A token's representation is then a learned weighted sum of that stack's internal states, which has three practical consequences:

  • The character-level convolutional input means every word gets a vector, including misspellings and words never seen in training.
  • Lower layers carry more syntax and upper layers more word sense; each task learns its own mixing weights, so a tagger and a question-answering model draw different blends from the same frozen ELMo.
  • The language model stays frozen and its output is fed into an existing task model, rather than the whole network being fine-tuned as BERT later did.

What it changed
Dropping ELMo into existing architectures lifted six benchmarks at once, including SQuAD question answering, entity recognition and sentiment classification — gains large enough that contextual input became standard within a year. Transformer encoders then displaced it, because attention trains in parallel where a recurrent stack cannot.

Why it matters
ELMo is where the default shifted from “look the word up” to “read the sentence”. What you would deploy today is a transformer, but the argument underneath it — representation should depend on context, and a pretrained language model transfers — was won here.

ELMo (Embeddings from Language Models) produces contextual embeddings from a bidirectional LSTM language model: each token's vector is a learned weighted combination of the model's internal layers, so the same word receives different vectors in different sentences. Its character-based input handles unseen words. Released in 2018, it is the result that made pretrained contextual representations standard practice before transformer encoders replaced it.

Read these two lines: “the pitcher threw hard” and “fill the pitcher with water”. You never confuse the two pitchers, because you take in the whole sentence before settling on a meaning.

Software used to skip that step. Each word had one fixed set of numbers attached to it, with every meaning mashed together. ELMo was the system that changed the habit: it reads the sentence first, then works out numbers for each word based on its neighbours. Search, question answering and name-spotting all improved noticeably the moment it was plugged in. Newer systems do the same thing better, but ELMo is where reading in context became normal.