Chapter 9

Embeddings in Language

Embedding matrices, distributional intuition, co-occurrence, word2vec context, learned similarity, nearest neighbors, analogies, polysemy, and static versus contextual representations.

What this chapter does

Embeddings connect token identities to learned vectors, but language soon exposes the limits of one fixed vector per token.

Lessons

Read these in order.

Start with the chapter introduction, then move through the topic lessons. The order is chosen so each page can reuse ideas from the pages before it.

  1. 01
    Introduction

    Token ids become learned vectors before entering neural language models.

  2. 02
    Embedding Matrix Review

    One trainable row per token id, selected by lookup.

  3. 03
    Distributional Intuition

    How similar contexts can shape related token vectors.

  4. 04
    Word2Vec as History

    A historical precursor showing prediction pressure can produce useful word geometry.

  5. 05
    Learned Similarity and Neighbors

    Reading nearest neighbors as clues about learned representation geometry.

  6. 06
    Polysemy and Context

    Why one static vector struggles with words that have multiple uses.

Before moving on

  • Explain how token embeddings are learned.
  • Inspect a small embedding table.
  • Explain why fixed token vectors are not enough for all language use.

Where this leads

  • Neural Language Models
  • Recurrent Neural Networks

Chapter progress