AI Research Engineer interview questions
100 real questions with model answers and explanations for Junior candidates.
See a AI Research Engineer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
A good research question names the intervention, the measured outcome, and the conditions of the comparison.
- Here the intervention is adding a defined amount and type of synthetic data.
- The outcome could be macro-F1 on a fixed, untouched test set rather than a vague claim of better quality.
- The conditions should fix the model, real training data, compute budget, and evaluation protocol so the question is answerable.
Why interviewers ask this: The interviewer is checking whether you can turn a broad idea into a precise and measurable research question.
I would make a directional, measurable prediction before running the comparison.
- For example, AdamW will reach validation loss below 0.40 in fewer training steps than SGD under the same data and compute budget.
- The optimizer is the changed factor, while the threshold and number of steps make the result observable.
- The claim is falsifiable because AdamW can fail to reach the threshold first or fail to reach it at all.
Why interviewers ask this: A strong answer distinguishes a falsifiable prediction from a general expectation that one method will work better.
The null hypothesis says the new variant has no real effect on the chosen outcome relative to standard attention.
- If the outcome is validation loss, the null can state that the mean loss difference across seeds is zero.
- An observed small difference may still be compatible with random variation under this hypothesis.
- The alternative hypothesis states the expected nonzero or directional effect that the experiment seeks to support.
Why interviewers ask this: The interviewer wants to see that you can define the no-effect claim against which evidence is evaluated.
The claim is the conclusion the authors want readers to accept, while the evidence is the measurement supporting it.
- Two points higher accuracy is evidence only after the dataset split, metric, baseline, and evaluation protocol are specified.
- The claim might be narrow, such as improvement on one benchmark, or broader, such as better generalization across tasks.
- A strong reading checks whether the tables, uncertainty, and ablations actually support the breadth of the stated claim.
Why interviewers ask this: This tests whether you read papers critically instead of treating a headline result as self-proving.
Reproduction usually re-creates a result with the original method and artifacts, while replication tests the claim with an independent setup.
- A reproduction might run the authors' code on the same dataset and compare the reported metric.
- A replication might use a fresh implementation, a new sample, or another benchmark that tests the same hypothesis.
- Terminology varies between fields, so a report should state exactly which code, data, and protocol were reused.
Why interviewers ask this: The interviewer checks whether you understand that matching one run and independently testing a claim provide different evidence.
A baseline gives a realistic reference to beat, while an oracle estimates an upper bound using information the real method cannot access.
- A majority-class predictor or the standard published model can serve as a baseline.
- An oracle might choose the correct candidate using ground-truth labels, so it is informative but not a valid usable method.
- If a proposal barely beats the baseline and remains far below the oracle, the two references reveal both its gain and remaining headroom.
Why interviewers ask this: A strong answer explains the distinct lower-reference and upper-bound roles rather than calling every comparison a baseline.
A controlled experiment changes the method of interest while holding other influential conditions fixed.
- Both runs should use the same model size, data split, training budget, and evaluation code.
- The control can be the established training recipe, and the treatment changes only the proposed method.
- Repeating both conditions across matched seeds helps separate the method's effect from training randomness.
Why interviewers ask this: The interviewer is evaluating whether you can design a fair comparison that isolates one cause.
Learning rate is the independent variable, and validation loss is the dependent variable.
- The researcher deliberately sets values such as 0.001, 0.0003, and 0.0001 for the independent variable.
- Validation loss is observed after training and may change in response to those settings.
- Model architecture, split, batch size, and step count should remain controlled rather than becoming extra independent variables.
Why interviewers ask this: This checks whether you can identify what an experiment changes, what it measures, and what it holds constant.
A confound is an uncontrolled factor that changes with the treatment and could explain the measured difference.
- If model A trains for 10,000 steps and model B for 20,000, training budget is confounded with architecture.
- Better accuracy from model B cannot then be attributed only to its architecture.
- Matching the step or compute budget removes that alternative explanation from the comparison.
Why interviewers ask this: The interviewer wants evidence that you notice alternative causes behind an apparent experimental gain.
Multiple seeds show whether a result persists across ordinary randomness in training.
- A seed can affect parameter initialization, data order, dropout masks, and sampled outputs.
- Reporting only the best of five seeds gives an optimistic and biased view of the method.
- Reporting the mean and spread across the same seed set for both methods makes the comparison more credible.
Why interviewers ask this: A strong answer treats the seed as a source of variation to measure rather than a magic guarantee of reproducibility.
The spread shows that the measured accuracy depends partly on stochastic training choices, not only on the recipe.
- The mean is 80%, but individual runs differ by up to two percentage points from it.
- A new method scoring 81% once is not convincing against this observed run-to-run variation.
- More repeated runs provide a better estimate of the typical result and its uncertainty.
Why interviewers ask this: The interviewer checks whether you interpret variation before declaring a small metric difference to be progress.
A 95% confidence interval summarizes the estimate's precision under the sampling assumptions of the calculation.
- A narrow interval means repeated measurements estimate the mean more precisely than a wide interval.
- Strongly overlapping intervals can warn that an apparent mean difference is uncertain, though overlap alone is not a formal test.
- In the frequentist interpretation, 95% refers to the long-run coverage of the procedure, not a 95% probability that this fixed interval contains the mean.
Why interviewers ask this: This tests whether you can discuss uncertainty without turning a confidence interval into a guarantee.
Effect size states how large the difference is, while statistical significance addresses how compatible the data are with a null model.
- With enough samples, a 0.05-point accuracy gain can be statistically significant but scientifically unimportant.
- An absolute metric difference or a standardized measure such as Cohen's d makes the magnitude visible.
- The useful judgment combines magnitude, uncertainty, and the cost or relevance of obtaining the gain.
Why interviewers ask this: The interviewer is checking whether you distinguish detectable evidence from a result that is large enough to matter.
Running many comparisons raises the chance of finding an apparently significant result by luck.
- At a 0.05 threshold, each null comparison has a 5% false-positive risk under its assumptions.
- Selecting the smallest p-value after seeing all 20 results hides the size of that search.
- Pre-registering the main comparison or applying a correction such as Bonferroni makes the evidence more honest.
Why interviewers ask this: A strong answer recognizes the basic multiple-comparisons problem and names a simple way to control it.
A packed causal-LM loss mask should count real next-token targets while excluding padding and artificial transitions between independent documents.
- After the causal shift, valid target tokens contribute to loss and ignored label positions use a value such as -100.
- If document B directly follows document A, keep an intended EOS target but mask B's first-token target unless the A-to-B transition belongs to the objective.
- The loss mask does not stop B from attending to A, so independent documents also need a segment-aware or block-diagonal causal attention mask.
Why interviewers ask this: The interviewer checks whether you distinguish target masking at packed boundaries from causal attention masking.
Per-sequence normalization gives each sequence equal weight, while per-nonpadding-token normalization gives each valid target token equal weight.
- With token normalization, a 400-target sequence contributes four times as much as a 100-target sequence before averaging.
- With sequence normalization, each sequence's valid-token mean is computed first, so short and long sequences affect the batch equally.
- Padding and ignored labels must be absent from both numerator and denominator, and the chosen rule must stay fixed across compared runs.
Why interviewers ask this: A strong answer explains how the normalization denominator changes example weighting and experimental results.
KL divergence measures the extra log-probability cost of using one distribution to represent samples from another.
- KL(P || Q) weights log(P divided by Q) by probabilities from P.
- It is zero when the distributions match but is asymmetric, so KL(P || Q) usually differs from KL(Q || P).
- In distillation, it can train a student distribution to match the teacher's probabilities rather than only hard labels.
Why interviewers ask this: The interviewer is evaluating whether you understand KL as a directional comparison of distributions and can name a research use.
Logits are unrestricted raw scores, and softmax converts them into nonnegative probabilities that sum to one.
- Logits of 2, 1, and 0 preserve class preference but are not probabilities themselves.
- Softmax exponentiates relative scores and normalizes them, so adding the same constant to every logit changes no probability.
- Cross-entropy implementations usually accept logits directly because combining the operations is numerically more stable.
Why interviewers ask this: A strong answer connects raw model outputs, normalization, and the stable loss interface used in research code.
A gradient of None means autograd found no differentiable path from the total loss to that parameter.
- I would verify that backward receives total_loss = main_loss + aux_weight * aux_loss, because merely logging aux_loss does not connect it to the graph.
- I would inspect parameter.requires_grad, detach, item, NumPy conversion, no_grad, and conditionals that skip the auxiliary head, then confirm that aux_loss.requires_grad is true.
- torch.autograd.grad with allow_unused=True on a tiny batch can locate unused parameters; optimizer membership affects updates but not whether backward creates gradients.
Why interviewers ask this: The interviewer checks whether you can distinguish a broken computation graph from a gradient that is merely small or zero.
The gradient tree must have the same paths and compatible leaves as the parameter tree, while parameter-shaped optimizer state must track those same leaves.
- Dict keys, tuple or list nesting, and leaves define a PyTree treedef, so adding or renaming a parameter changes the structure expected by updates.
- The optimizer state's outer tree may differ, but momentum or variance subtrees must still align with the parameter paths and shapes they track.
- I would compare tree structures and path-shape listings, then rebuild optimizer state and masks from the exact parameter tree after an architecture change.
Why interviewers ask this: A strong answer recognizes structural alignment without incorrectly claiming that the optimizer state's entire outer tree matches the parameter tree.
Locked questions
- 21
Why can a jitted JAX training step recompile when batch shapes change, and how would you prevent it?
batchjax - 22
What is weight decay, and why is it used with AdamW?
adamw - 23
What does gradient clipping do when a training step has a very large gradient?
grad-clip - 24
How can changing batch size affect a neural-network experiment?
experimentsbatch - 25
What is tokenizer fertility, and how would you compare it across languages?
tokenstokenizer - 26
How does an embedding layer represent token IDs?
nlptokens - 27
Why is each query-key dot product divided by sqrt(d_k) before attention softmax?
queries - 28
Why does a decoder-only Transformer use a causal attention mask?
nlpcausal-masktransformer - 29
What does multi-head attention add beyond a single attention calculation?
- 30
Why are residual connections used around Transformer sublayers?
nlptransformer - 31
What does LayerNorm normalize inside a Transformer?
nlptransformernormalization - 32
What is the role of the MLP sublayer in a Transformer block?
nlptransformer - 33
How does RoPE make a query-key attention score depend on relative position?
queriesrope - 34
Why does parameter initialization matter when training a neural network?
neural-nets - 35
What should be frozen in a benchmark protocol before model selection begins?
typing - 36
How can a team overfit a public leaderboard without benchmark examples entering training or gradients?
- 37
Why is dataset deduplication important before splitting or training?
dedupqueries - 38
What is benchmark contamination in language-model research?
contamination - 39
How would you detect answer-choice order bias in a multiple-choice language-model benchmark?
- 40
Why should an experiment preregister one primary metric and its guardrail metrics?
experimentsmonitoringguardrails - 41
What does language-model perplexity measure, and what is an important caveat when comparing it?
perplexity - 42
What does pass@k mean on a code-generation benchmark?
- 43
What changes when a PyTorch model switches between train mode and eval mode?
pytorch - 44
How do PyTorch autograd and detach differ in their treatment of a tensor?
pytorchautograd - 45
How do no_grad and inference_mode differ in PyTorch?
pytorchinference - 46
What jobs does a PyTorch DataLoader perform in a small training experiment?
pytorchdataloaderexperiments - 47
What should a research checkpoint contain beyond a model state_dict?
checkpoint - 48
What is mixed-precision training at a conceptual level?
training-efficiencymixed-precision - 49
Why should an evaluation retain per-item predictions and metric contributions instead of only an aggregate score?
aggregationmonitoring - 50
In a small PyTorch training loop, what do zero_grad, the forward pass, backward, and optimizer.step do?
pytorchoptimization - 51
A paper reports 76% accuracy, but your reproduction reaches only 71%. How would you triage the gap?
- 52
The authors released code but did not record the exact commit or dependency versions. What would you do?
dependencies - 53
Your model architecture matches a paper, but the reproduced score is lower and you suspect preprocessing. How would you check?
architecture - 54
A released checkpoint loads, but its outputs differ from the paper and you suspect the tokenizer or vocabulary. What would you inspect?
checkpointtokenstokenizer - 55
You converted a checkpoint to another format, and the converted model no longer matches the original. How would you debug it?
checkpoint - 56
Your evaluation score differs from a paper because its prompt, shot count, or decoding setup may be different. How would you resolve it?
- 57
One seed matches the paper, but four other seeds vary widely. How would you report the reproduction?
- 58
A new method looks strong only because the paper compares it with a weak baseline. What baseline would you run?
- 59
A result combines changes A, B, and C. What ablation matrix would you run, and when are five arms insufficient?
- 60
A proposed attention change improves accuracy, but you suspect a hidden confound. How would you find it?
- 61
How would you organize four methods with three seeds each in W&B, including their artifacts?
artifacts - 62
A Hydra override appears in your command, but the training run uses the default value. How would you debug it?
- 63
How would you prove that you used the same dataset version as another reproduction?
- 64
A validation score seems too high, and you suspect train and development leakage. What would you check?
leakagevalidation - 65
How would you perform a basic contamination check before evaluating a language model on a public benchmark?
- 66
What sampling configuration must match when reproducing a pass@k result?
samplingconfig - 67
You have only 80 evaluation examples. How would you estimate uncertainty with bootstrap sampling?
samplingbootstrapestimation - 68
The same checkpoint scores 72.4 at eval batch size 1 and 71.8 at batch size 16. How would you debug it?
checkpointbatch - 69
How would you use a 32-example overfitting check to validate a new training loop?
overfittingvalidation - 70
The main loss is finite, but an auxiliary loss is NaN. How would you isolate the cause?
- 71
Gradient norms grow rapidly for several steps before training diverges. What would you do?
- 72
An FP16 run makes little progress because many gradients underflow. How would you use GradScaler to investigate?
precisiongradscaler - 73
Your learning-rate schedule appears shifted by thousands of steps. How would you debug the step count?
- 74
A run uses microbatches of 4 on 8 GPUs with 16 accumulation steps. How should variable-length token counters refine its effective batch?
tokensbatch - 75
A small experiment runs out of memory on one GPU. What would you change first?
memoryhardwareexperiments - 76
The GPU waits for data during most training steps. How would you investigate the DataLoader?
hardwaredataloader - 77
GPU utilization is low even though the training job is not out of memory. What would you inspect?
memoryhardware - 78
How would you launch 24 Hydra configs as a Slurm job array while keeping each resolved config, seed, and output immutable?
configslurmimmutability - 79
What random-number-generator states would you restore for an exact training resume?
generators - 80
A Slurm job stays pending instead of starting. How would you find out why?
slurm - 81
Your Slurm training job may be preempted. How would you make checkpoint and requeue work?
checkpointslurm - 82
A basic DDP job fails during NCCL initialization because ranks disagree about the setup. What would you check?
conflictncclddp - 83
One DDP rank hangs at a collective while the others wait. How would you debug the basic cause?
ddp - 84
You enabled FSDP but expected a larger memory reduction. What basic sharding behavior would you verify?
shardingmemoryfsdp - 85
How would you measure the memory and step-time trade-off of activation checkpointing?
memoryact-checkpointactivation - 86
How would you capture and read a basic PyTorch profiler trace for a slow training step?
pytorch - 87
How would you check PyTorch and JAX parity for a new operation on a tiny tensor?
pytorchjax - 88
A Hugging Face model gives different outputs from a reference script using the same checkpoint. What would you check?
checkpoint - 89
How would you unit-test a custom evaluation metric before using it in a paper reproduction?
hypothesis-testingmonitoring - 90
How would you add a simple task adapter to lm-evaluation-harness?
- 91
An evaluation dataset contains malformed records. How would you handle them before scoring?
- 92
A candidate model improves an evaluation by 0.2 points. How would you decide whether the lift is real?
- 93
How would you estimate GPU-hours before launching a small hyperparameter sweep?
hyperparametersestimationhardware - 94
What would you put in a reproducibility README for a paper implementation?
- 95
How would you keep an experiment notebook and decision log without making the notebook the only source of truth?
experiments - 96
How would you plot results across seeds so spread and uncertainty in the mean effect are not confused?
spread - 97
A careful experiment finds no improvement from the proposed method. How would you report the negative result?
experiments - 98
What would make a small open-source research-engineering pull request strong?
code-review - 99
A paper makes a strong claim that its table does not appear to support. How would you challenge it?
- 100
How would you hand off a reproduction so another researcher can continue it exactly?