Track 06 · LLM Internals
6.1 Transformer Basics
55 topics in 7 parts. Use it as a checklist before an interview, or as a map of what to learn next.
- CCritical
- HHigh
- MMedium
- NNew 2026
01Text Preprocessing7 topics
- Tokenization: word, subword (BPE), characterC
- Stemming (Porter/Snowball) vs LemmatizationH
- Stop-word removal and its trade-offsH
- POS tagging (Part-of-Speech)H
- Named Entity Recognition (NER)C
- Text normalization: lowercasing, unicodeH
- Regular expressions for text cleaningH
02Embeddings & Representations10 topics
- Bag of Words (BoW) and TF-IDFH
- Word2Vec: CBOW and Skip-gramH
- GloVe: global co-occurrence statisticsM
- FastText: subword embeddings for OOV wordsM
- Sentence embeddings: SBERT, E5, BGE-M3, OpenAI text-embedding-3C
- Contextual embeddings: BERT, RoBERTaC
- MTEB benchmark: compare embedding models across 56 datasets — gold standardH
- Matryoshka embeddings: variable dimensions, trade quality for speedN
- Dense vs sparse embeddings (SPLADE): semantic vs keywordH
- Embedding similarity: cosine, dot productC
03Core NLP Tasks7 topics
- Text classification: fine-tuning BERT/DistilBERTC
- Sentiment analysis: lexicon vs ML approachesC
- Machine translation: seq2seq, attentionH
- Summarization: extractive (TextRank) vs abstractiveH
- Question Answering: extractive SQuAD formatH
- Information extraction: relation, coreferenceM
- Topic modeling: LDA, NMF, BERTopicM
04Evaluation & Metrics7 topics
- BLEU: n-gram precision for translationH
- ROUGE: recall-based for summarizationH
- METEOR: semantic matching metricM
- Perplexity: language model qualityH
- F1, Precision, Recall for classification/NERC
- BERTScore: contextual semantic similarityH
- Human evaluation frameworks & inter-annotator agreementM
05Transformer Architecture Deep Dive10 topics
- Input tokenizer → Embedding layer → Transformer blocks → Attention → Output decoderC
- Self-attention: Q, K, V matrices and dot-productC
- Scaled dot-product attention: softmax(QKᵀ/√d_k)·VC
- Why scale by √d_k: large d_k → large dot products → softmax saturates → near-zero gradientsH
- Multi-head attention: parallel subspacesC
- Positional encoding: sinusoidal vs RoPE vs ALiBiH
- Feed-forward layers and GLU variants (SiLU, GeLU)H
- Layer normalization: pre-norm vs post-normH
- Residual connections and gradient flowH
- Encoder-only (BERT) vs Decoder-only (GPT) vs Enc-Dec (T5)C
06Tokenization7 topics
- BPE (Byte Pair Encoding): merge most-frequent pairs — used in GPTH
- WordPiece: BERT's subword tokenizer — maximize likelihoodH
- SentencePiece: language-agnostic, treats spaces as charactersM
- Tiktoken: OpenAI's fast tokenizer (cl100k_base, o200k)H
- 1 token ≈ 4 chars ≈ 0.75 words — affects cost and context limitsC
- Non-English tokenizes less efficiently (2-4× more tokens)H
- Special tokens: [CLS], [SEP], <|endoftext|>, <|im_start|>M
07Inference Decoding Parameters7 topics
- Temperature: divide logits before softmax — T=0 greedy, T=1 standardC
- Top-k: keep only k highest probability tokens, sample from thoseC
- Top-p (nucleus): smallest set summing to p% probability — adaptiveC
- Beam search: k candidates in parallel, best cumulative log-probH
- Greedy decoding (T=0): best for JSON, structured output, factual QAH
- High temperature (1.2-1.5): creative writing, brainstorming, diverse outputH
- Repetition penalty: reduce probability of already-generated tokensM
Practise it
Knowing it is half.
Saying it is the rest.
Run a realistic voice interview with an AI panel in the Interview Room, then read a scored report on every answer.