Skip to content

Course Pass 3: Tokens and data

corpus pipeline v1 with ledger and decontamination, BPE, WordPiece, and Unigram in Python, BPE in Rust, n-gram/NPLM/word2vec run through {tinyllm}; the engine keeps serving the bigram. About 7.5 weeks at 10 to 12 hours a week.

Part of: the course. Needs: Pass 2.

Gate: MS-P3 = MS-L1 + MS-corpus + MS-L2.

Stages, chapter links, and check columns are in path.tsv. Use practice/bin/ol learn course-p03-p03-tokens-and-data to see progress.

Generated from path.tsv. Track progress locally with practice/bin/ol learn.

StageReadDone when
1Injective, surjective, bijective; the GPT-2 byte map
Injective, surjective, bijective; the GPT-2 byte map
Your implementation of M05.2 passes its course checks.
2Trees and tries, longest-prefix match
Trees and tries, longest-prefix match
Your implementation of M06.2 passes its course checks.
3Solve set: trees, birthday bounds, Jaccard/MinHash/LSH S-curve, Bloom FP rate, recurrences
Solve set: trees, birthday bounds, Jaccard/MinHash/LSH S-curve, Bloom FP rate, recurrences
You complete the S-M06b solve set and its check passes.
4Perplexity, bits per byte, NLL accumulator
Perplexity, bits per byte, NLL accumulator
Your implementation of M11.2 passes its course checks.
5Categorical sampling: inverse CDF, Gumbel-max, alias method
Categorical sampling: inverse CDF, Gumbel-max, alias method
Your implementation of M07.1 passes its course checks.
6MLE, Laplace, absolute discounting
MLE, Laplace, absolute discounting
Your implementation of M07.2 passes its course checks.
7Solve set: joint and covariance, MLE
Solve set: joint and covariance, MLE
You complete the S-M07b solve set and its check passes.
8Tokenizer protocol, char tokenizer
Tokenizer protocol, char tokenizer
Your implementation of L1.1 passes its course checks.
9Byte-level BPE (GPT-2 compatible): pre-tokenizer, trainer, HF loader
Byte-level BPE (GPT-2 compatible): pre-tokenizer, trainer, HF loader
Your implementation of L1.2 passes its course checks.
10WordPiece (BERT basic tokenizer + greedy longest match)
WordPiece (BERT basic tokenizer + greedy longest match)
Your implementation of L1.3 passes its course checks.
11Unigram LM tokenizer (EM, Viterbi, subword sampling)
Unigram LM tokenizer (EM, Viterbi, subword sampling)
Your implementation of L1.4 passes its course checks.
12Tokenizer metrics
Tokenizer metrics
Your implementation of L1.6 passes its course checks.
13Robin Hood hash map with backward-shift deletion
Robin Hood hash map with backward-shift deletion
Your implementation of ds.05 passes its course checks.
14Binary heap with lazy deletion
Binary heap with lazy deletion
Your implementation of ds.06 passes its course checks.
15Rust fast BPE (tl-tok), byte tokenizer, streaming decoder
Rust fast BPE (tl-tok), byte tokenizer, streaming decoder
Your implementation of L1.5 passes its course checks.
16Property-based tests (R4) with Hypothesis, proptest, rapid, and ol_prop.h
Property-based tests (R4) with Hypothesis, proptest, rapid, and olprop.h
Your implementation of craft.04 passes its course checks.
17Milestone L1
Pass 3 milestones
The MS-L1 gate passes for your system.
18Data licensing and the ledger
Data licensing and the ledger
Your implementation of ethics.01 passes its course checks.
19Privacy and PII policy
Privacy and PII policy
Your implementation of ethics.02 passes its course checks.
20Bloom filter
Bloom filter
Your implementation of ds.08 passes its course checks.
21Python asyncio: event loop, tasks, cancellation, bounded concurrency
Python asyncio: event loop, tasks, cancellation, bounded concurrency
Your implementation of lang.08 passes its course checks.
22Async fetch with resume, checksums, license capture
Async fetch with resume, checksums, license capture
Your implementation of data.01 passes its course checks.
23Extract, normalize, quality filters (generator stages)
Extract, normalize, quality filters (generator stages)
Your implementation of data.02 passes its course checks.
24Exact dedup: paragraph hashes, Bloom screen, sort-merge confirm
Exact dedup: paragraph hashes, Bloom screen, sort-merge confirm
Your implementation of data.03 passes its course checks.
25Near-duplicate dedup: MinHash, LSH, union-find, and decontamination
Near-duplicate dedup: MinHash, LSH, union-find, and decontamination
Your implementation of data.04 passes its course checks.
26PII scrub with typed placeholders and audit spans
PII scrub with typed placeholders and audit spans
Your implementation of data.05 passes its course checks.
27Parquet shards, manifest, and the document-hash split
Parquet shards, manifest, and the document-hash split
Your implementation of data.06 passes its course checks.
28Tokenize and pack to llm.c .bin
Tokenize and pack to llm.c .bin
Your implementation of data.07 passes its course checks.
29Licensing ledger verification and the datasheet
Licensing ledger verification and the datasheet
Your implementation of data.08 passes its course checks.
30Milestone corpus
Pass 3 milestones
The MS-corpus gate passes for your system.
31SVD, Eckart-Young low rank, and least squares
SVD, Eckart-Young low rank, and least squares
Your implementation of M03.5 passes its course checks.
32Inner products, projections, cosine similarity, and top-k
Inner products, projections, cosine similarity, and top-k
Your implementation of M03.6 passes its course checks.
33Linear algebra problem set, part b: inner products, SVD and low rank, matmul accounting and the roofline
Linear algebra problem set, part b: inner products, SVD and low rank, matmul accounting and the roofline
You complete the S-M03b solve set and its check passes.
34Mutual information, PMI, and PPMI
Mutual information, PMI, and PPMI
Your implementation of M11.4 passes its course checks.
35Information theory problem set, part b: coding and Huffman, mutual information, maximum entropy, rate-distortion
Information theory problem set, part b: coding and Huffman, mutual information, maximum entropy, rate-distortion
You complete the S-M11b solve set and its check passes.
36n-gram language model with interpolated modified Kneser-Ney
n-gram language model with interpolated modified Kneser-Ney
Your implementation of L2.1 passes its course checks.
37Bengio’s neural probabilistic language model
Bengio’s neural probabilistic language model
Your implementation of L2.2 passes its course checks.
38word2vec skip-gram with negative sampling, and the PPMI-SVD baseline
word2vec skip-gram with negative sampling, and the PPMI-SVD baseline
Your implementation of L2.3 passes its course checks.
39Milestone L2
Pass 3 milestones
The MS-L2 gate passes for your system.
40Milestone P3
Pass 3 milestones
The MS-P3 gate passes for your system.