Natural Language Processing · 免费预览
大作业:一个小型语言模型
从零开始训练一个字节对编码分词器,基于其子词统计 n-gram 模型,在留出数据上针对不同平滑方案评估困惑度,并从中采样。
1. Capstone: A Mini Language Model
Capstone: A Mini Language Model
2. A tokenizer from scratch
A tokenizer from scratch
3. Counts, smoothing, perplexity
Counts, smoothing, perplexity
4. Reading the sample, bridging to the network
Reading the sample, bridging to the network
5. Choosing the first merge
Byte-pair encoding trains on a corpus whose words are split into characters. After eight merge steps the vocabulary contains pieces like er and ing. What decides the very first merge?
6. Counting the subword vocabulary
A tokenizer starts from distinct symbols, characters plus the word-end marker. After merge steps, each adding exactly one new symbol to the vocabulary, how many distinct subword symbols exist?
7. Smoothing one bigram
In a subword model with vocabulary size , the token ferry occurs times and the pair the ferry occurs times. With add-k smoothing at , what is , to three decimal places?
8. Why the trigram survived held-out text
In the capstone, the raw trigram counts are far sparser than the bigram counts, yet the trigram system posts the lower held-out perplexity. What property produced that result?
9. Where ferring came from
A sample from the capstone model contains the strings ferring and hourossing, words that never appear in the training corpus. What does their presence demonstrate about the setup?