LLM Foundations & Fine-Tuning
Tokenization, attention mechanics, structured outputs, reasoning models, LoRA & quantization.
Subword BPE/tiktoken encoding maps text into integer IDs; explains character-counting & arithmetic quirks.
Decoder-only causal stack of Pre-Norm RMSNorm, Multi-Head/GQA Attention, and SwiGLU MLP blocks.
Softmax(QK^T / sqrt(d_k))V scales dot products by sqrt(d_k) to prevent softmax saturation & vanishing gradients.
Effective usable context vs advertised max window; long prompts suffer "lost in the middle" attention decay.
Caches past Key/Value tensors during autoregressive decode so O(N^2) work drops to O(N) per step.
Temperature scales logits before softmax; top-p (nucleus) truncates cumulative probability mass.
Top-priority instruction hierarchy defining persona, XML boundaries, schemas, and negative constraints.
3-5 diverse edge-case input/output examples activate in-context patterns and cut schema errors by >90%.
Emitting intermediate reasoning tokens allocates inference-time compute before committing to final tokens.
Test-time compute models (o-series, DeepSeek-R1, Claude thinking) trained via RL on verifiable reasoning.
Constrained decoding (JSON Schema / CFG / Pydantic) guarantees 100% syntactically valid payloads.
Reuses KV states of identical long system prefixes and tool schemas for 50-90% input cost & TTFT savings.
Asymmetric 3x-6x output-to-input token cost dictates concise responses, routing, and context trimming.
Fluent fabrication caused by parametric memory guessing, weak retrieval, or missing abstention rules.
Native vision, audio, and PDF page embeddings allow VLMs to read charts/tables without brittle OCR.
Freezes base weights W0 and trains low-rank B*A (B=0 init), mergeable for zero inference latency.
4-bit NormalFloat (NF4) base weights + double quantization + paged optimizers fit 70B tuning on 48GB GPU.
FP8, AWQ, GPTQ, and GGUF shrink weight memory 2x-4x so memory-bandwidth-bound decode runs faster.
Trains fast 3B-8B student models on verified frontier teacher reasoning traces and synthetic pairs.
Trade-off between frontier capability/zero-ops APIs and VPC data sovereignty + TCO crossover at scale.