← Back to the problem

Malaysia MAIO 2025 · Correction by IOAI Training

Multiple choice questions

This page gives the full approach. Read it once you have searched.

Metric
correct answers out of 20
Evaluated on
written answers
Our score
20 answers derived, code ones run

We solved the problem ourselves: downloaded the data, ran the experiments and measured the score below. The statement and data belong to their organisers.

The problem in brief

Twenty multiple-choice questions from the Malaysian AI Olympiad 2025, answered in a notebook and submitted to the organisers' server. They mix three kinds of questions: predicting what a short piece of Python, NumPy or Hugging Face code does; checking core ML vocabulary (regression versus classification, gradient descent, backpropagation, CNN kernels, GANs, attention, perplexity); and a few "judgement" questions set in everyday situations (a cousin counting cars with a webcam, why chatbots type word by word, where AI hides at a festival). The judgement questions are the interesting ones: two options are often defensible, and the skill is to find the one the question is really testing.

How you are scored

Each question has one correct letter; the score is the number of correct answers out of 20 (up to 10 submissions, the last one counts). The organisers' answer key is not public, so below every answer is derived and, when it involves code, checked by running it (solution.py). Where a question is ambiguous we say so and explain the choice.

Final answer sheet:

Q1234567891011121314151617181920
answerABCBCCCDADBCBDDACCAC

Question by question

Q1. A loop that accumulates (answer A, 18)

range(4) yields 0,1,2,30, 1, 2, 3 and each step adds i⋅3i \cdot 3:

∑i=033i=3 (0+1+2+3)=18.\sum_{i=0}^{3} 3i = 3\,(0+1+2+3) = 18 .

The trap is to think range(4) goes up to 4 (that would give 30, option C).

Q2. np.sum(arr, axis=0) (answer B, [9, 12])

axis=0 is the axis that disappears: you move down the rows and get one sum per column, 1+3+5=91+3+5 = 9 and 2+4+6=122+4+6 = 12. With axis=1 you would get one sum per row, [3,7,11][3, 7, 11].

Two diagrams of the 3 by 2 array. With axis=0, arrows run down each column and give 9 and 12. With axis=1, arrows run along each row and give 3, 7 and 11.

A reliable rule: the shape of the result is the input shape with the summed axis removed, here (3,2)→(2,)(3, 2) \to (2,).

Q3. Regression (answer C: I, II and IV)

  • I is the definition of regression: the target is a continuous number. True.
  • II: training minimises an error between predicted and true numbers (MSE, MAE...). True.
  • III is false: cross-entropy compares probability distributions over classes, it is the classification loss. Regression typically uses squared or absolute error.
  • IV: linear regression extends naturally to many input features, y^=w⊤x+b\hat y = w^\top x + b with x∈Rdx \in \mathbb{R}^d. True.

Q4. Classification (answer B: II and IV)

This is the mirror of Q3. I is false (classes are discrete), III is false (classification uses cross-entropy; MSE on probabilities trains badly because its gradient vanishes when the sigmoid saturates), II and IV are true: a classifier carves the input space with decision boundaries, and logistic regression is the standard binary classifier.

Q5. Walking down the cost surface (answer C, gradient descent)

Gradient descent repeats θ←θ−η∇θL(θ)\theta \leftarrow \theta - \eta \nabla_\theta L(\theta): at each step it moves in the direction of steepest descent of the cost. Backpropagation (B) is only the algorithm that computes the gradient; it does not walk anywhere by itself.

Q6. Purpose of backpropagation (answer C)

Backpropagation applies the chain rule backwards through the network to obtain ∂L/∂w\partial L / \partial w for every weight, efficiently, in one backward pass. The optimiser (Q5) then uses those gradients. It neither initialises weights nor normalises inputs.

Q7. Universal Approximation Theorem (answer C)

The theorem says that a network with one hidden layer, enough neurons and a suitable non-linear activation can approximate any continuous function on a compact (closed and bounded) set to any accuracy. Option B contradicts it (one layer is enough in principle); option A undersells it. The theorem says nothing about how many neurons are needed or how to find the weights, which is why deep networks are still preferred in practice.

Q8. Kernel in a CNN (answer D)

A kernel (filter) is a small matrix of learned weights slid over the input; the convolution computes, at each position, a weighted sum that responds to a pattern (an edge, a texture). The distractors describe neighbouring ideas: A is the stride, C is close to the receptive field, B mixes up the fact that a kernel has one slice per input channel with what a kernel is.

Q9. Role of the discriminator (answer A)

The discriminator is a classifier that receives both real and generated samples and outputs "real or fake". Its gradient is what tells the generator how to improve. It never generates data (B), it does not force exact copies (C, that would be a failure mode called memorisation), and it does not update the generator's weights directly (D): the generator's own optimiser does that, using gradients that flow through the discriminator.

Q10. Attention (answer D)

For each output position, attention computes weights softmax⁡(qk⊤/d)\operatorname{softmax}(q k^\top / \sqrt{d}) over all input positions and takes a weighted average of their values: the model decides which parts of the input matter for the current token. It does not filter training data, enforce safety, or reduce the number of epochs.

Q11. A pre-trained NLP model (answer B, BERT)

BERT is a transformer pre-trained on text with masked language modelling. ResNet (image classification), YOLO (object detection) and U-Net (segmentation) are all vision models.

Q12. tokenizer.tokenize(text, add_special_tokens=True) (answer C)

The intended answer is C: tokenize() only splits text into sub-word strings, whereas special tokens ([CLS], [SEP]) belong to encode() / __call__, which return ids ready for the model. Two honest remarks, though:

  • In the transformers 4.x versions current in 2025, the code does not actually crash: the slow BertTokenizer logs "Keyword arguments {'add_special_tokens': True} not recognized" and returns the tokens without [CLS] and [SEP]. The code "does not do what was asked", which is what the question means by "does not run".
  • In transformers 5.x (we ran 5.6.2), tokenize accepts the keyword and returns ['[CLS]', 'deep', 'learning', 'is', 'amazing', '!', '[SEP]'].

The other options are clearly wrong: the tokenizer loads fine (A), bert-base-uncased lowercases by itself (B), and D is advice rather than the cause. Lesson: library questions are version-dependent; read the warning messages.

Q13. What makes a GAN special (answer B)

Two networks trained against each other, a generator and a discriminator, in a minimax game. GANs are unsupervised generative models (not A), notoriously data-hungry (not C), and not classifiers (not D).

Q14. Perplexity (answer D)

Perplexity is the exponential of the average negative log-likelihood the model gives to held-out text:

PPL=exp⁡(−1N∑t=1Nlog⁡p(xt∣x<t)).\mathrm{PPL} = \exp\Big(-\frac{1}{N}\sum_{t=1}^{N} \log p(x_t \mid x_{<t})\Big).

Low perplexity means the model was rarely surprised. A perplexity of kk means the model was, on average, as uncertain as if it hesitated uniformly between kk tokens. It does not count parameters, measure vocabulary diversity, or compare with human writing.

Q15 to Q17. Counting cars from a window

Q15 (answer D, object detection). To count cars you must find each car individually. Image classification answers "is there a car?", segmentation labels pixels without separating touching cars (unless it is instance segmentation), video classification gives one label per clip. Detection outputs one box per object, and counting boxes (plus tracking them across frames so a car is not counted twice) gives the count.

Q16 (answer A). A beginner proudly announcing "100 % accuracy" has most likely measured the easiest thing: whether the model detects cars in images that contain cars. During a traffic jam every frame contains cars, so this number is 100 % even for a terrible detector. The other options (mIoU, precision, recall) are proper metrics that are almost never exactly 100 % on real data.

Q17 (answer C, precision). What matters is the purpose: the cousin wants to prove that the count is large (above 1000). His own bias pushes in the same direction as one specific error, the false positive: a shadow, a truck counted twice, a reflection in the window all inflate the count. Precision,

precision=TPTP+FP,\text{precision} = \frac{TP}{TP + FP},

is the metric that tells you how many of his "cars" are real, so it is the one that can confirm or destroy his claim. Recall matters too for an unbiased count, but a low-recall model would only underestimate, which would weaken his argument rather than fake it. mIoU (B) measures box or mask overlap quality, which is irrelevant for counting. (This is a judgement question; the reasoning, "pick the metric that guards against the error that would fool you", is the point.)

Q18. Why chatbots "type" (answer C)

LLMs are autoregressive: they produce one token at a time, each conditioned on everything generated so far, p(xt∣x<t)p(x_t \mid x_{<t}). Streaming the tokens as they come out is simply showing that process live, which also lets you start reading before the answer is complete. It is not a theatrical convention (A), it is not cheaper to send small chunks (B), and memory is not the reason (D).

Q19. Confidently wrong facts (answer A)

A language model is trained to produce likely text, not true text. For obscure facts (the favourite colour of a historical figure) there is little or no training signal, so the most probable continuation is a plausible-sounding guess: a hallucination. "Lying" (B) and "misremembering" (D) attribute intentions or a memory store that the model does not have; C is nonsense.

Q20. AI at the festival (answer C: I, II and III)

  • I: feed recommendation is one of the most widespread uses of machine learning. Yes.
  • II: navigation apps use ML to predict traffic and travel times. Yes.
  • III: drone shows rely on automated path planning and onboard control; the question asks what might contain elements of AI, and this does. Yes.
  • IV: a festival mascot giving high fives is a person in a costume. No.

The key idea

Most questions in this set reward one habit: separate neighbouring concepts precisely. Backpropagation computes gradients, gradient descent uses them; tokenize splits text, encode adds special tokens and ids; a kernel is not the stride; the discriminator judges, it does not generate. Distractors are built from the concept next door, so knowing a definition vaguely is exactly what the question punishes.

The judgement questions (Q16, Q17, Q20) reward a second habit: ask what the measurement is for. A metric is only meaningful relative to the decision it supports and the errors that could mislead you.

What to remember

  • When in doubt about code, run it, and read warnings: Q12 behaves differently across library versions.
  • In NumPy, axis=k is the axis that disappears from the result shape.
  • Cross-entropy for classes, squared or absolute error for numbers.
  • "100 % accuracy" is a red flag: first ask what exactly was counted as a success.
  • Choose the metric that catches the error your conclusion is most vulnerable to (here, false positives inflating a count).
Full code (solution.py)
"""MAIO 2025 multiple-choice questions: checks for the questions that can be run,
and the final answer sheet."""
import numpy as np

# Q1: total = sum_{i=0}^{3} 3 i = 3 * (0+1+2+3)
def multiply_and_sum(x, y):
    total = 0
    for i in range(x):
        total += i * y
    return total
assert multiply_and_sum(4, 3) == 18 == 3 * sum(range(4))

# Q2: axis=0 collapses the rows, one sum per column
arr = np.array([[1, 2], [3, 4], [5, 6]])
assert np.sum(arr, axis=0).tolist() == [9, 12]
assert np.sum(arr, axis=1).tolist() == [3, 7, 11]   # the other axis, for comparison

# Q12: behaviour of tokenize(..., add_special_tokens=True) depends on the library version.
# transformers 4.x (slow BertTokenizer): the keyword is not recognised, a warning is logged
# and the tokens come back WITHOUT [CLS]/[SEP]. transformers 5.x accepts the keyword.
try:
    from transformers import BertTokenizer
    tok = BertTokenizer.from_pretrained("bert-base-uncased")
    text = "Deep Learning is amazing!"
    print("tokenize:", tok.tokenize(text, add_special_tokens=True))
    print("encode  :", tok.encode(text, add_special_tokens=True))
except Exception as e:  # no network or no transformers installed
    print("Q12 check skipped:", e)

answers = {1: "A", 2: "B", 3: "C", 4: "B", 5: "C", 6: "C", 7: "C", 8: "D", 9: "A", 10: "D",
           11: "B", 12: "C", 13: "B", 14: "D", 15: "D", 16: "A", 17: "C", 18: "C", 19: "A", 20: "C"}
print(" ".join(f"{k}{v}" for k, v in answers.items()))