Research Frontiers & Practice
Level: 3 (Production: from-scratch derivations, code-from-memory, explain-out-loud) Time Limit: 45 minutes Total Marks: 60
Instructions: Answer all questions. Show full derivations. Where code is requested, pseudo-code or framework-agnostic Python is acceptable but must be complete and runnable in spirit. Use for math.
Question 1 — Contrastive Loss From Scratch (12 marks)
The SimCLR framework uses the NT-Xent (normalized temperature-scaled cross-entropy) loss. For a batch of images, two augmentations produce views. For a positive pair :
where .
(a) Explain why the indicator excludes but NOT . (3 marks)
(b) Compute numerically for a toy case: (so views). Assume all embeddings are unit-normalized and the cosine similarities of view against views are where is the positive. Use . Give the value to 3 decimals. (6 marks)
(c) State how the total batch loss is formed from the per-pair losses. (3 marks)
Question 2 — Implementing Layer Normalization From Memory (10 marks)
(a) Write from-scratch code (NumPy) for the forward pass of LayerNorm over the last dimension, including learnable and epsilon . (5 marks)
(b) Derive the gradient where (ignore in the derivative for simplicity), , . Express in terms of . (5 marks)
Question 3 — Benchmark Design & Evaluation Rigor (10 marks)
You are reviewing a paper claiming SOTA on a new benchmark.
(a) List and justify four distinct methodological red flags you would check for that threaten the validity of a SOTA claim. (4 marks)
(b) A paper reports accuracy 91.2% vs. baseline 90.8% on a test set of 2000 samples. Using the standard error of a proportion, compute the approximate 95% confidence interval half-width for a proportion near , and state whether the 0.4% gap is likely significant. (6 marks)
Question 4 — Federated Averaging (FedAvg) Derivation (10 marks)
(a) Given clients with local dataset sizes and total , write the FedAvg global update rule that aggregates client weights into . (3 marks)
(b) Show that when every client performs exactly one full-batch gradient step, FedAvg is equivalent to one step of centralized full-batch gradient descent. State the assumption required. (5 marks)
(c) Name one reason this equivalence breaks with multiple local epochs. (2 marks)
Question 5 — Neuro-Symbolic & World Models (Explain-Out-Loud) (10 marks)
(a) In two–three sentences each, explain out loud (as if to a peer) the core distinction between a neuro-symbolic system and a purely neural one, giving one concrete architectural example. (5 marks)
(b) A world model typically decomposes into an encoder, a latent dynamics/transition model, and a decoder/reward head. Explain what each component learns and why learning dynamics in latent space (rather than pixel space) is preferred. (5 marks)
Question 6 — Reproducibility & Portfolio Roadmap (8 marks)
(a) You attempt to reproduce a paper and get 87% where the paper reports 92%. List three systematic checks (beyond "check for bugs") you would perform to close the gap. (3 marks)
(b) Describe how you would structure a 6-month research portfolio to move from reproducing papers to an original contribution, naming concrete milestones. (5 marks)
Answer keyMark scheme & solutions
Question 1 (12 marks)
(a) (3 marks)
- The loss is a softmax over similarities where is the anchor. Including would put (self-similarity, trivially maximal) in the denominator, which is meaningless as a "negative" and would dominate — hence excluded. (2)
- is kept because is the positive whose similarity forms the numerator; it must also appear in the denominator so the expression is a proper normalized probability (numerator ⊆ denominator terms). (1)
(b) (6 marks) Similarities: , positive . Exclude . Scale by :
- numerator: (2)
- denominator (exclude ): (2)
- (2)
Answer:
(c) (3 marks) Sum over all views, each acting as anchor with its own positive, and average: Both directions of each positive pair are counted; loss is symmetric per pair but computed with each view as anchor. (3)
Question 2 (10 marks)
(a) (5 marks)
import numpy as np
def layernorm(x, gamma, beta, eps=1e-5):
# x shape (..., H), normalize over last axis
mu = x.mean(axis=-1, keepdims=True)
var = x.var(axis=-1, keepdims=True)
xhat = (x - mu) / np.sqrt(var + eps)
return gamma * xhat + betaMarks: mean (1), var over last axis (1), normalize (1), affine (1), eps inside sqrt (1).
(b) (5 marks) With , :
- (1)
- , so (1)
- Quotient rule: (1)
- Substitute : (2)
Question 3 (10 marks)
(a) (4 marks, 1 each)
- Tuning on the test set / no held-out validation — hyperparameters chosen using test data inflate results.
- Unfair baselines — baselines under-tuned or run with fewer epochs/compute than the proposed method.
- No variance reporting / single seed — no error bars; gap could be within run-to-run noise.
- Data leakage / contamination — train-test overlap, or pretraining data covering the benchmark. (Also accept: cherry-picked metrics, non-standard splits, missing ablations.)
(b) (6 marks)
- Standard error of a proportion: with , . (1)
- ; ; . (2)
- 95% half-width . (2)
- The observed gap is , which is smaller than the ~1.25% CI half-width of a single system (and a difference test on two proportions would give a comparable-or-larger threshold). The 0.4% gap is NOT likely statistically significant with only 2000 samples/one seed. (1)
Question 4 (10 marks)
(a) (3 marks) Weighted average by local dataset size. (3)
(b) (5 marks) Assumption: all clients start the round from the same global weights and each does one full-batch step with learning rate . (1) Local update: where . (1) Aggregate: (1) The weighted gradient equals the global gradient: (1) Thus = one centralized full-batch GD step. (1)
(c) (2 marks) With multiple local epochs, clients diverge from (client drift): their gradients are evaluated at different points , so the average of local updates no longer equals a single gradient at — the equivalence breaks (worse under non-IID data).
Question 5 (10 marks)
(a) (5 marks)
- Purely neural: everything is learned distributed representations; reasoning is implicit in weights, hard to interpret, needs lots of data. (2)
- Neuro-symbolic: combines learned perception with explicit symbolic structure (logic rules, programs, knowledge graphs) that support compositional, verifiable reasoning and data efficiency. (2)
- Concrete example: e.g. Neural Theorem Provers, DeepProbLog, or a VQA system where a CNN extracts objects and a differentiable program executor answers logical queries. (1)
(b) (5 marks)
- Encoder: maps high-dim observations (pixels) to compact latent state . (1)
- Latent dynamics/transition: learns — predicting how state evolves given actions. (1)
- Decoder/reward head: reconstructs observations and/or predicts reward, providing training signal / grounding. (1)
- Latent-space dynamics preferred because: pixel prediction wastes capacity on irrelevant detail; latent rollouts are far cheaper/faster for planning; and imagining trajectories in a low-dim, smooth space is more stable and generalizes better (as in Dreamer). (2)
Question 6 (8 marks)
(a) (3 marks, 1 each)
- Verify exact hyperparameters & schedule (LR, warmup, batch size, epochs, weight decay) — often under-reported; try author configs.
- Match data preprocessing/augmentation and splits precisely, plus dataset version.
- Account for compute/precision/seed variance — run multiple seeds, check hardware (fp16 vs fp32), effective batch size differences from distributed training. (Also accept: contact authors, check released code/checkpoints, EMA of weights.)
(b) (5 marks) Example roadmap:
- Month 1–2: reproduce 2–3 core papers end-to-end; publish clean repos + blog write-ups (milestone: matched numbers). (1)
- Month 3: implement a key model from scratch and ablate components to build intuition. (1)
- Month 4: identify a gap/open problem from a survey; form a concrete hypothesis and design a benchmark/experiment. (1)
- Month 5: run experiments with rigor (baselines, seeds, error bars); iterate. (1)
- Month 6: write up findings (workshop paper / preprint), open-source code, present. Portfolio = repos + reproductions + one original result. (1)
[
{"claim":"NT-Xent toy loss equals ~0.370",
"code":"import sympy as sp\nnum=sp.exp(sp.Rational(8,10)/sp.Rational(1,2))\nden=num+sp.exp(sp.Rational(1,10)/sp.Rational(1,2))+sp.exp(0)\nl=-sp.log(num/den)\nval=float(l)\nresult=abs(val-0.370)<0.002"},
{"claim":"Proportion SE at p=0.91,n=2000 gives 95% half-width ~0.0125",
"code":"p=sp.Rational(91,100);n=2000\nse=sp.sqrt(p*(1-p)/n)\nhw=1.96*se\nresult=abs(float(hw)-0.01254)<0.0005"},
{"claim":"FedAvg weighted gradient equals global gradient (symbolic identity)",
"code":"n1,n2,g1,g2=sp.symbols('n1 n2 g1 g2')\nn=n1+n2\nweighted=(n1/n)*g1+(n2/n)*g2\nglobal_grad=(n1*g1+n2*g2)/n\nresult=sp.simplify(weighted-global_grad)==0"},
{"claim":"LayerNorm Jacobian formula reduces correctly for i=j term",
"code":"H,sigma,xi,xj=sp.symbols('H sigma xi xj')\nexpr=(1/sigma)*(1-sp.Rational(1,1)/H - xi*xj/H)\n# check off-diagonal (delta=0) form: -(1/sigma)*(1/H)*(1+xi*xj)\noffdiag=(1/sigma)*(0-1/H-xi*xj/H)\nexpected=-(1/(sigma*H))*(1+xi*xj)\nresult=sp.simplify(offdiag-expected)==0"}
]