Files
Rohit Ghumare dda194f840 fix(quiz): correct answer is always in the same position (slot B) (#381)
Every "Test Your Understanding" quiz placed the correct answer in option B.
Across the 2026 questions in 338 quiz files the correct answer sat at index 1
in 61.5% of cases (uniform would be ~25%), and 107 files had every answer at B,
making the quizzes guessable without reading them.

scripts/debias_quizzes.py rewrites each question's option order with a
deterministic, content-seeded permutation and updates the correct index to
follow the moved answer. It is idempotent: options are canonicalised to a sorted
base before permuting, so re-running produces byte-identical output. Questions
whose options reference each other by position ("all of the above", "both A and
B") are left untouched. The correct-answer value, the option set, and every
explanation are preserved exactly; only order and the index change.

Result: A 23.8% / B 26.3% / C 23.5% / D 26.4%.

The script doubles as a CI guard: `--check` exits non-zero if any quiz is not
de-biased, wired into the curriculum workflow so new lessons cannot regress.

Fixes #368
2026-08-01 14:24:15 +01:00

38 lines
2.5 KiB
JSON

[
{
"question": "Why can't you build a useful deep network using only linear layers (no activation functions)?",
"options": ["Stacking linear layers collapses to a single linear transformation, giving no benefit from depth", "Linear layers are too slow", "Linear layers can't handle batched data", "Linear layers don't have biases"],
"correct": 0,
"explanation": "y = W2(W1*x + b1) + b2 simplifies to y = Ax + c. No matter how many linear layers you stack, the result is equivalent to one linear layer. Activation functions break this composability.",
"stage": "pre"
},
{
"question": "What is the output range of the ReLU activation function?",
"options": ["(-infinity, infinity)", "[0, infinity)", "(0, 1)", "(-1, 1)"],
"correct": 1,
"explanation": "ReLU(x) = max(0, x). It outputs 0 for all negative inputs and passes positive inputs unchanged, giving a range of [0, infinity).",
"stage": "pre"
},
{
"question": "What is the 'dead neuron' problem in ReLU networks?",
"options": ["Neurons with zero bias", "Neurons that compute too slowly", "Neurons whose input is permanently negative, producing zero output and zero gradient forever", "Neurons that produce NaN values"],
"correct": 2,
"explanation": "If a ReLU neuron's weighted input is always negative (due to bad initialization or large negative bias), it outputs 0 with gradient 0. It can never recover because zero gradient means zero update.",
"stage": "post"
},
{
"question": "Which activation function is the default for hidden layers in modern transformers like GPT and BERT?",
"options": ["Sigmoid", "Tanh", "GELU", "ReLU"],
"correct": 2,
"explanation": "GELU (Gaussian Error Linear Unit) is the default activation in transformers. It provides smooth gradient flow, avoids dead neurons, and has been shown to outperform ReLU in language models.",
"stage": "post"
},
{
"question": "Why is softmax used only in the output layer and never in hidden layers?",
"options": ["It only works with two classes", "It causes exploding gradients", "It converts a vector into a probability distribution (values sum to 1), which is needed for classification output but not for intermediate representations", "It's too slow for hidden layers"],
"correct": 2,
"explanation": "Softmax normalizes a vector so all values are in (0,1) and sum to 1, creating a probability distribution. Hidden layers need to preserve and transform information, not compress it into probabilities.",
"stage": "post"
}
]