The core concepts behind modern LLMs, RAG pipelines, and production AI systems. Read in order if you’re new; jump to whichever concept your interview questions target.
| # | Concept | One-liner |
|---|---|---|
| 1 | Transformer Architecture | Encoder + Decoder blocks; replaces RNNs through parallelisation. |
| 2 | Self-Attention | Q.K.V matrices decide which tokens attend to which. |
| 3 | Multi-Head Attention | Multiple attention heads in parallel; each learns a different relationship. |
| 4 | Positional Encoding | Inject order into a parallel-only architecture (sinusoidal, learned, RoPE). |
| 5 | Tokenization | BPE / WordPiece / SentencePiece substrate that converts text to integer IDs. |
| 6 | Embeddings | Dense vectors where semantic similarity = geometric proximity. |
| 7 | Cosine vs L2 | Pick the angle metric for text similarity, the distance metric for magnitudes. |
| 8 | RAG | Retrieve -> Augment -> Generate; beats stale or proprietary knowledge alone. |
| 9 | Fine-Tuning vs RAG | Update weights vs inject data vs prompt. Pick by data stability and cost. |
| 10 | RLHF | Post-pretraining alignment with human preference signals. |
| 11 | Gradient Descent & Backprop | The chain-rule loop that trains every neural net. |
| 12 | LSTM vs Transformer | RNNs scale linearly; self-attention scales in parallel and gets long context. |
| 13 | Hallucinations & Defenses | Probabilistic next-token prediction requires layered defences. |
| 14 | Embedding Drift | New embedding model = new vector space = re-index required. |
| 15 | HNSW | Approximate nearest-neighbors graph that makes 10M-vector search ms-latency. |
tokens (ints)
|
v
+--------------------+ +--------------------+ +--------------------+
| Token + Positional| | Multi-Head | | LayerNorm + |
| Embedding | -> | Self-Attention | -> | FeedForward |
+--------------------+ +--------------------+ +--------------------+
|
v
(stack N times)
|
v
Next-token logits
|
v
Human feedback (RLHF)
The same backbone powers GPT-4, Llama, Claude, Mistral, Gemini — only the data and scale differ.
Tip: If asked “what changed in the last 5 years of AI?”, 80% of the answer is scale + attention + RLHF.