Advanced Deep Learning MCQs for the NSCT
Advanced deep learning covers the specialised architectures built on top of the basic neural network: CNNs for images, RNNs and LSTMs for sequences, transformers for attention-based modelling, and transfer learning for reusing pre-trained models. It is topic 12 of the 17 in the AI / Machine Learning and Data Analytics area, which carries 10% of the NSCT according to HEC's Areas of Competencies. Candidates averaged 50.8% accuracy in this area in 2026, per the HEC NSCT report.
You need Deep Learning Fundamentals first. The two formulas that earn the most marks here are the conv output size and the parameter count.
CNN
A convolutional neural network (CNN) slides small learned filters (kernels) over an image. Each filter shares its weights across all positions, so it detects an edge or texture wherever it appears. It also needs far fewer parameters than a fully connected layer.
Output size: (n + 2p − f) / s + 1, rounded down, where n is the input size, f the filter size, p the padding and s the stride.
| Input | Filter | Padding | Stride | Output |
|---|---|---|---|---|
| 32 × 32 | 5 × 5 | 0 | 1 | 28 × 28 |
| 32 × 32 | 5 × 5 | 2 ("same") | 1 | 32 × 32 |
| 227 × 227 | 11 × 11 | 0 | 4 | 55 × 55 |
The parameters of a conv layer are f × f × C_in × C_out weights plus C_out biases. For example, 3 × 3 filters from 3 to 64 channels give 1,792 parameters, whatever the image size. Pooling (such as 2 × 2 max pooling with stride 2) halves height and width and has no weights. A 1 × 1 convolution changes channel depth cheaply. Residual connections (ResNet) add the input back, F(x) + x, so very deep networks stay trainable.
Exam angle: the output depth equals the number of filters, not the number of input channels.
RNN
A recurrent neural network (RNN) processes a sequence one step at a time, updating a hidden state: h_t = tanh(W·x_t + U·h_(t−1) + b). The same weights are reused at every step.
A simple RNN with input size 10 and hidden size 20 has 20 × 10 + 20 × 20 + 20 = 620 parameters. It is trained with backpropagation through time. Gradients are multiplied at every step, so they either vanish (long-range links are lost) or explode (loss becomes NaN, fixed by gradient clipping). A bidirectional RNN adds a backward pass so that each position also sees future context.
Exam angle: "can't remember a word 80 tokens back" means vanishing gradients, and the answer is usually an LSTM, a GRU or attention.
LSTM
The long short-term memory (LSTM) cell (Hochreiter and Schmidhuber, 1997) adds a cell state that is updated additively and controlled by three gates:
| Gate | Job |
|---|---|
| Forget | What to erase from the cell state |
| Input | What new information to write |
| Output | What part of the cell state to expose as h_t |
The GRU is a lighter variant with two gates (reset and update) and no separate cell state. An LSTM has four weight blocks (three gates plus the candidate), so it has about four times the parameters of a simple RNN. With input 10 and hidden 20 that is 4 × 620 = 2,480. PyTorch stores two bias vectors per gate, giving 2,560, so check which convention a question assumes.
Exam angle: know the three LSTM gates against the two GRU gates; it is a favourite recall question.
Transformers
The transformer (Vaswani et al., 2017) drops recurrence and relies on self-attention: Attention(Q, K, V) = softmax(QKᵀ / √d_k)·V. Each token builds a query, key and value; the scores say how much it attends to every other token.
- Dividing by √d_k stops large dot products from saturating softmax.
- Multi-head attention splits d_model across heads: 512 / 8 = 64 per head.
- Positional encodings are needed because attention ignores order on its own.
- A causal mask stops decoder tokens from seeing future tokens.
- Cost is O(n²) in sequence length, so doubling the length quadruples the size of the attention matrix.
| Model | Blocks | Training objective | Good for |
|---|---|---|---|
| BERT | Encoder only | Masked language modelling (bidirectional) | Classification, tagging |
| GPT | Decoder only | Next-token prediction (left to right) | Text generation |
| Original transformer, T5 | Encoder–decoder | Sequence to sequence | Translation, summarisation |
Exam angle: "processes all tokens in parallel" points to the transformer; "processes tokens one at a time" points to an RNN or LSTM.
Transfer learning
Transfer learning reuses a model pre-trained on a large dataset (ImageNet, or web text for BERT) for a new task. Early layers learn general features such as edges and syntax, while later layers are more task-specific.
- Feature extraction: freeze the backbone and train only a new head. A frozen ResNet-50 with a 10-class dense head has 2,048 × 10 + 10 = 20,490 trainable parameters.
- Fine-tuning: also unfreeze some or all layers and train them with a small learning rate (BERT used 2e-5 to 5e-5). A large rate erases the pre-trained knowledge.
Exam angle: small dataset plus overfitting from scratch points to a pre-trained backbone with data augmentation.
Common traps
- Setting the conv output depth to the number of input channels instead of the number of filters.
- Forgetting biases in parameter counts, or forgetting that each filter spans all input channels.
- Mixing up LSTM gates (forget, input, output) with GRU gates (reset, update).
- Thinking transformers know word order without positional encodings.
- Saying self-attention is linear in sequence length. It is quadratic.
- Assuming CNN libraries flip the kernel. They compute cross-correlation and still call it convolution, as Goodfellow, Bengio and Courville note.
Worked examples
1. Understanding. Which gates does a GRU have? Answer: a reset gate and an update gate. The update gate plays the combined role of the LSTM's forget and input gates, and there is no separate output gate or cell state.
2. Application. A 28 × 28 × 1 image passes through a 3 × 3 conv layer with 16 filters, padding 1 and stride 1, then 2 × 2 max pooling with stride 2. What is the output shape? Answer: 14 × 14 × 16. The conv layer gives (28 + 2 − 3) / 1 + 1 = 28, so 28 × 28 × 16; pooling halves it to 14 × 14 × 16.
3. Analysis. Both use 64 input and 64 output channels. Why might you stack two 3 × 3 conv layers instead of one 5 × 5 layer? Answer: both see a 5 × 5 region, but two 3 × 3 layers use 2 × (3 × 3 × 64 × 64) = 73,728 weights against 102,400 for one 5 × 5 layer. They also add an extra non-linearity between them. This is the design idea behind VGG.
Practise
The quiz below has 100 questions on advanced deep learning, filterable by tier and difficulty.
Practise: 100 questions
FAQs
Is a CNN only for images?
No. CNNs suit any data with a local grid structure: 2D images, 1D signals such as audio or sensor readings, and even text, where 1D convolutions slide over word embeddings. Images are simply the classic case, which is why Computer Vision builds on this topic.
Have transformers replaced RNNs and LSTMs?
For most large-scale language tasks, yes. Transformers train in parallel and link distant tokens directly. LSTMs and GRUs are still used for small streaming or on-device sequence tasks, where their constant memory per step is an advantage. Exam questions mostly test the trade-off: parallelism and long-range context against quadratic attention cost.
What is the difference between BERT and GPT?
BERT is an encoder-only transformer trained to fill in masked words using context from both sides, so it suits understanding tasks such as classification. GPT is a decoder-only transformer trained to predict the next token using only earlier tokens, which suits generation. Both rely on transfer learning: pre-train once, then adapt.
Next step
Continue to Natural Language Processing MCQs, the next topic in the official order, where embeddings and transformers meet text. Revisit the AI & ML MCQs hub or test yourself in an NSCT mock test.