Skip to content

Question Bank

Anurag Prasad edited this page Nov 8, 2026 · 3 revisions

Question Bank

209 module questions + 10 integrative problems. Every module ends with conceptual questions and collapsible answers. This page indexes them all, then adds integrative problems that cut across modules. Try to answer aloud before opening anything.

Integrative problems

P1. Why can a 100-layer pre-LN residual Transformer train, while a 100-layer plain sigmoid MLP cannot? (Modules 05, 09, 14)

In the sigmoid MLP the backward signal is multiplied at every layer by $\operatorname{diag}(\sigma')W^\top$ with $\sigma'\le\tfrac14$, so gradients shrink roughly like $0.25^{L}$ (times weight gains). In a residual block the Jacobian is $I+\partial F/\partial\mathbf{x}$, so an identity term carries the gradient unattenuated to every layer; pre-LN keeps that identity path free of normalisation, and ReLU/GELU, scaled initialisation and LayerNorm keep each branch's gain near one.

P2. Show that minimising cross-entropy, maximising likelihood and minimising KL are the same problem, and name three places this appears. (Module 03 and later)

With data distribution $p$ and model $q_\theta$: $H(p,q_\theta)=H(p)+D_{KL}(p\Vert q_\theta)$ and $H(p)$ is constant in $\theta$, so minimising cross-entropy minimises KL. The empirical cross-entropy is $-\frac1N\sum\ln q_\theta(x_i)$, the negative average log-likelihood. Examples: classification (softmax cross-entropy, Module 06), language-model pretraining (next-token loss, Module 23), and the reconstruction term of a VAE (Module 18).

P3. How are LoRA and the SVD related, and what does Eckart–Young say about the best possible low-rank update? (Modules 01, 22)

LoRA constrains the weight update to $\Delta W=BA$ with rank $\le r$. For a given target update $\Delta W^\star$, the best rank-$r$ approximation in Frobenius or spectral norm is its truncated SVD (Eckart–Young), with error $\sqrt{\sum_{i>r}\sigma_i^2}$. LoRA works when fine-tuning updates have rapidly decaying singular values; it learns $B,A$ by gradient descent rather than computing the SVD.

P4. Why does attention divide by $\sqrt{d_k}$, and how is that argument related to He/Xavier initialisation? (Modules 09, 14)

Both are variance-preservation arguments: a sum of $n$ independent unit-variance products has variance $n$. Initialisation sets $\operatorname{Var}(w)=1/n_{in}$ (or $2/n_{in}$ for ReLU) so layer outputs keep their scale; attention divides $\mathbf{q}^\top\mathbf{k}$ by $\sqrt{d_k}$ so the logits entering softmax keep unit variance and the softmax does not saturate.

P5. Compare VAEs, GANs and diffusion models on objective, training stability, sample quality, mode coverage and sampling speed. (Modules 18, 19, 20)

VAE: maximise an ELBO; stable; blurrier samples; good coverage; fast one-pass sampling. GAN: adversarial minimax (JS or Wasserstein); unstable, prone to mode collapse; very sharp samples; fast sampling. Diffusion: regress added noise (a weighted ELBO / denoising score matching); stable; high quality and good coverage; slow iterative sampling that is reduced by DDIM, distillation and latent diffusion.

P6. Explain double descent using conditioning. (Modules 01, 10)

For min-norm least squares with $p$ features and $n$ samples, the estimator involves the pseudo-inverse of the $n\times p$ design matrix; its variance scales like $\sigma^2\sum_i1/s_i^2$ over singular values $s_i$. Near $p=n$ the smallest singular value of a random design matrix approaches zero, so variance (and test error) spikes. For $p\gg n$ the singular values separate from zero again and the minimum-norm solution has low variance, so error falls.

P7. Estimate the training memory for a 7B-parameter model with AdamW in mixed precision, ignoring activations. (Modules 08, 23, 24)

Per parameter: bf16 weights (2 B) + bf16 gradients (2 B) + fp32 master weights (4 B) + Adam first moment (4 B) + second moment (4 B) $=16$ bytes. For $7\times10^9$ parameters that is $\approx112$ GB before activations, which is why sharded optimisers (ZeRO/FSDP), checkpointing and low-precision optimisers are used.

P8. Why is InfoNCE 'just a softmax classifier', and how does temperature change its behaviour? (Modules 05, 17)

Given an anchor and $N$ candidates, InfoNCE is the cross-entropy of a softmax over similarity scores whose target is the positive. Dividing similarities by a temperature $\tau$ scales the logits: small $\tau$ concentrates the gradient on the hardest negatives; large $\tau$ weights all negatives equally.

P9. Why are noise-prediction diffusion training and denoising autoencoders the same idea? (Modules 16, 20)

A denoising autoencoder trained with Gaussian corruption learns $r(\tilde{\mathbf{x}})-\tilde{\mathbf{x}}\approx\sigma^2\nabla\ln p(\tilde{\mathbf{x}})$, an estimate of the score. DDPM trains a network to predict the noise that was added, which is proportional to the score of the noised distribution, at many noise levels $t$; sampling then follows the learned score from noise to data.

P10. Show that a CNN and a Transformer are both message-passing networks. (Modules 11, 14, 21)

A convolution is message passing on a grid graph where each node aggregates its neighbours with position-specific (shared) weights. Self-attention is message passing on a complete graph where the aggregation weights are computed from content. Graph attention networks sit between the two: attention restricted to graph neighbours.

Index of module questions

  • Q1. Why does adding a bias vector $b\in\mathbb{R}^{d_{out}}$ to a $B\times d_{out}$ matrix work, and what would go wrong if it were shaped $(B,)$?
  • Q2. Dot product versus cosine similarity — when do you use which?
  • Q3. What is the difference between the order of a tensor and the rank of a matrix?
  • Q4. Why does PyTorch store nn.Linear weights as (out, in)?
  • Q5. How are singular values related to eigenvalues?
  • Q6. Why can every matrix have an SVD but not every matrix an eigendecomposition?
  • Q7. Why is low-rank adaptation (LoRA) plausible?
  • Q8. What does a positive semidefinite Hessian tell you about a critical point?
  • Q9. Why does a large condition number slow down gradient descent?
  • Q10. Is $AB=BA$? Why does it matter for network design?
  • Q1. Why does the negative gradient give the direction of steepest descent?
  • Q2. Why is reverse mode used for training and not forward mode?
  • Q3. What is a vector–Jacobian product and why never build the Jacobian?
  • Q4. Derive $\partial L/\partial W$ for $Y=XW$.
  • Q5. Why does ReLU not break backpropagation despite not being differentiable at 0?
  • Q6. What does the Hessian tell you that the gradient does not?
  • Q7. Why is the central difference more accurate than the forward difference?
  • Q8. Why must a gradient have the same shape as its parameter?
  • Q9. Why does activation memory dominate training memory, and how does checkpointing help?
  • Q10. How would you detect a wrong backward implementation?
  • Q1. Why is minimising cross-entropy equivalent to maximum likelihood?
  • Q2. Why does MSE correspond to Gaussian noise?
  • Q3. Prove that KL divergence is non-negative.
  • Q4. Why is KL asymmetric, and what is the practical effect?
  • Q5. What is the gradient of softmax cross-entropy with respect to the logits?
  • Q6. Are uncorrelated variables independent?
  • Q7. Why does Monte Carlo estimation work in very high dimensions?
  • Q8. Why is the unbiased variance estimator divided by $n-1$?
  • Q9. What does mutual information measure and why is it $\ge 0$?
  • Q10. A model assigns probability 0.01 to the true class. Compare MSE and cross-entropy gradients.
  • Q1. What is the role of the bias?
  • Q2. How do excitatory and inhibitory inputs map to weights?
  • Q3. Why can a single perceptron not compute XOR?
  • Q4. State the perceptron convergence theorem and its key assumption.
  • Q5. Why does the update rule move $\mathbf{w}$ toward $\mathbf{x}$ on a false negative?
  • Q6. Why is NAND significant?
  • Q7. What changes between the perceptron and logistic regression?
  • Q8. What happens if you run the perceptron on non-separable data?
  • Q1. Why can't a deep network of purely linear layers do better than one layer?
  • Q2. Why did ReLU help train deep networks?
  • Q3. What is the dying-ReLU problem and how do you mitigate it?
  • Q4. Why subtract the max logit in softmax?
  • Q5. State the universal approximation theorem and one thing it does not say.
  • Q6. Why is depth often better than width?
  • Q7. Which output activation and loss for multilabel classification?
  • Q8. How does GELU differ from ReLU conceptually?
  • Q9. Why is tanh usually preferred to sigmoid for hidden units in old-style networks?
  • Q1. Why not directly minimise the 0–1 loss?
  • Q2. When would you choose MAE or Huber over MSE?
  • Q3. Why is the generalisation gap non-negative on average?
  • Q4. Derive the stability condition for gradient descent on a 1-D quadratic.
  • Q5. Why does feature scaling speed up training?
  • Q6. What is the benefit and cost of larger mini-batches?
  • Q7. MSE is minimised by the conditional mean; MAE by the median. Why does this matter?
  • Q8. Why is the gradient of cross-entropy w.r.t. logits well behaved when the model is wrong?
  • Q9. Does a lower training loss always mean a better model?
  • Q1. Why is backprop efficient compared with differentiating each weight separately?
  • Q2. Derive $\boldsymbol\delta^{(\ell)}$ in terms of $\boldsymbol\delta^{(\ell+1)}$.
  • Q3. Why must weights not all be initialised to the same value?
  • Q4. Why does the bias gradient sum over the batch?
  • Q5. How does a hidden layer solve XOR?
  • Q6. Why is softmax+cross-entropy preferred over softmax+MSE?
  • Q7. What dominates the memory use of backprop?
  • Q8. How would you verify your own backprop implementation?
  • Q1. Why does momentum help in narrow valleys?
  • Q2. Derive the effective step size of momentum under a constant gradient.
  • Q3. Why does Adam need bias correction?
  • Q4. What is the difference between L2 regularisation and weight decay in Adam?
  • Q5. Why are saddle points more of a concern than local minima in high dimensions?
  • Q6. Why use warm-up?
  • Q7. How does gradient clipping by norm work and when is it needed?
  • Q8. Which iteration count scaling do plain GD and momentum have on quadratics?
  • Q9. When might SGD+momentum outperform Adam?
  • Q1. Derive He initialisation.
  • Q2. Why does zero initialisation fail?
  • Q3. Why does BatchNorm behave differently in train and eval mode?
  • Q4. Why do Transformers use LayerNorm rather than BatchNorm?
  • Q5. Why do residual connections make very deep networks trainable?
  • Q6. What is the role of $\gamma$ and $\beta$ in BatchNorm?
  • Q7. Pre-LN versus post-LN: which is more stable and why?
  • Q8. When do you choose GroupNorm?
  • Q9. How does RMSNorm differ from LayerNorm?
  • Q1. State the bias–variance decomposition and say what each term means.
  • Q2. Why does L2 regularisation shrink weights, and how is it a prior?
  • Q3. Why does L1 yield sparse solutions while L2 does not?
  • Q4. Why scale activations by $1/(1-p)$ in dropout?
  • Q5. Give three examples of data leakage.
  • Q6. What is double descent and does it contradict the bias–variance trade-off?
  • Q7. How does early stopping regularise?
  • Q8. Why does ensembling help and when does it not?
  • Q9. What does label smoothing do to the logits?
  • Q10. Why can networks that fit random labels still generalise on real data?
  • Q1. Why do CNNs need fewer parameters than dense networks on images?
  • Q2. Derive the output size formula for $n=32$, $k=5$, $p=0$, $s=1$.
  • Q3. Why stack small kernels instead of using one large kernel?
  • Q4. Why is the kernel gradient summed over spatial positions?
  • Q5. Equivariance versus invariance?
  • Q6. What problem do residual connections solve in CNNs?
  • Q7. How much does a depthwise separable convolution save?
  • Q8. Why use global average pooling?
  • Q1. Why do RNNs share weights across time?
  • Q2. Derive why gradients vanish in a vanilla RNN.
  • Q3. Why does clipping help only with exploding gradients?
  • Q4. How does the LSTM cell state mitigate vanishing gradients?
  • Q5. Compare GRU and LSTM.
  • Q6. What is teacher forcing and its drawback?
  • Q7. When can you use a bidirectional RNN?
  • Q8. What does truncated BPTT trade off?
  • Q1. What is the bottleneck problem and how does attention solve it?
  • Q2. Why is softmax used for alignment weights?
  • Q3. Additive vs dot-product attention?
  • Q4. How does beam search differ from greedy decoding?
  • Q5. What is exposure bias?
  • Q6. Soft vs hard attention in image captioning?
  • Q7. Why length-normalise beam scores?
  • Q8. Are attention weights explanations?
  • Q1. Why divide by $\sqrt{d_k}$?
  • Q2. Why is self-attention permutation-equivariant and what is the consequence?
  • Q3. What does multi-head attention buy over single-head attention of the same width?
  • Q4. How are causal masks implemented and why before the softmax?
  • Q5. Where are most of a Transformer's parameters?
  • Q6. Encoder-only vs decoder-only models?
  • Q7. What is cross-attention?
  • Q8. What is the time/memory complexity of self-attention and why does it matter?
  • Q9. Why are residual connections essential in Transformers?
  • Q1. Why add positional information at all?
  • Q2. What is the main advantage of sinusoidal over learned embeddings?
  • Q3. Show that the RoPE score depends only on relative position.
  • Q4. How does ALiBi allow inference on longer sequences than training?
  • Q5. Why do high-frequency RoPE dimensions complicate position interpolation?
  • Q6. How does T5's relative bias differ from RoPE?
  • Q7. Why are absolute one-hot positions a poor choice?
  • Q8. Does a longer context window mean the model uses all of it well?
  • Q1. Why does an autoencoder need a bottleneck or regulariser?
  • Q2. How is a linear autoencoder related to PCA?
  • Q3. Why does a denoising autoencoder learn the data distribution's structure?
  • Q4. What does the sparse KL penalty enforce?
  • Q5. Can a plain autoencoder generate new samples?
  • Q6. How would you test that learned features are useful?
  • Q7. What is the difference between sparse and undercomplete autoencoders?
  • Q1. Why is InfoNCE a classification loss?
  • Q2. What does temperature do?
  • Q3. How does MoCo get many negatives with a small batch?
  • Q4. How do BYOL/SimSiam avoid collapse without negatives?
  • Q5. Why use a projection head and discard it later?
  • Q6. State the InfoNCE mutual information bound.
  • Q7. What are false negatives?
  • Q8. How does CLIP enable zero-shot classification?
  • Q1. Derive the ELBO.
  • Q2. Why is the reparameterisation trick needed?
  • Q3. What does each ELBO term encourage?
  • Q4. What is posterior collapse and how is it mitigated?
  • Q5. Why are VAE samples blurry?
  • Q6. How does β-VAE differ from a VAE?
  • Q7. How does IWAE tighten the bound?
  • Q8. Compare the pathwise and score-function gradient estimators.
  • Q1. Derive the optimal discriminator.
  • Q2. What does the generator minimise when $D$ is optimal?
  • Q3. Why use the non-saturating generator loss?
  • Q4. What is mode collapse?
  • Q5. Why does the Wasserstein distance help?
  • Q6. How does the gradient penalty enforce Lipschitzness?
  • Q7. Why might GAN training oscillate rather than converge?
  • Q8. What does FID measure and what are its weaknesses?
  • Q1. Derive $q(\mathbf{x}_t\mid\mathbf{x}_0)$.
  • Q2. Why is the training objective just noise prediction?
  • Q3. How is the noise predictor related to the score function?
  • Q4. Why is DDPM sampling slow and how does DDIM help?
  • Q5. Explain classifier-free guidance.
  • Q6. Why do diffusion models cover modes better than GANs?
  • Q7. Why is the cosine schedule useful?
  • Q8. What is the advantage of latent diffusion?
  • Q9. How does flow matching differ from DDPM?
  • Q1. Why must GNN layers be permutation-equivariant?
  • Q2. Why add self-loops and normalise in GCN?
  • Q3. What is the relation between GAT and a Transformer?
  • Q4. Explain over-smoothing.
  • Q5. What does 1-WL expressivity mean?
  • Q6. Why does GraphSAGE sample neighbours?
  • Q7. What property must a graph readout satisfy?
  • Q8. What does the Laplacian quadratic form $\mathbf{x}^\top L\mathbf{x}$ measure?
  • Q1. When should you freeze the backbone?
  • Q2. Why use a smaller learning rate for pretrained layers?
  • Q3. State the domain-adaptation bound and interpret its terms.
  • Q4. How does gradient reversal align domains?
  • Q5. What is catastrophic forgetting and how does EWC reduce it?
  • Q6. Why does LoRA initialise $B=0$?
  • Q7. What are the advantages of LoRA over full fine-tuning?
  • Q8. How do you detect negative transfer?
  • Q1. Why sub-word tokenisation?
  • Q2. Derive the $6ND$ rule.
  • Q3. What did Chinchilla change?
  • Q4. Why is the KV cache needed and what dominates its size?
  • Q5. How does GQA help?
  • Q6. Compare top-$k$ and top-$p$ sampling.
  • Q7. What does the KL term do in RLHF?
  • Q8. How does DPO relate to RLHF?
  • Q9. Why do LLMs hallucinate?
  • Q10. How do vision-language models connect images to an LLM?
  • Q1. Why is accuracy misleading for imbalanced data, and what should you report?
  • Q2. ROC vs precision–recall curves?
  • Q3. What is calibration and how does temperature scaling fix over-confidence?
  • Q4. State the completeness axiom of Integrated Gradients.
  • Q5. Why might a saliency map be misleading?
  • Q6. Explain FGSM and why high-dimensional inputs are vulnerable.
  • Q7. Why does distillation use temperature and a $T^2$ factor?
  • Q8. Why do fp16 training runs need loss scaling but bf16 usually do not?
  • Q9. Why can't all fairness criteria be satisfied at once?
  • Q10. What is in a model card?

🎓 Deep Learning Hub

🏠 Home · 🗺️ Curriculum · 🧭 Learning paths

❓ Question bank · 📖 Glossary · 📚 References

Jump to module:

01 02 03 04 05 06 07 08 09 10 11 12

13 14 15 16 17 18 19 20 21 22 23 24

Part 1 · Mathematical foundations
Part 2 · Neural network fundamentals
Part 3 · Training deep networks
Part 4 · Core architectures
Part 5 · Representation and generative learning
Part 6 · Specialised, modern and responsible deep learning
Reference and meta

Clone this wiki locally