AI Research Engineer interview questions
100 real questions with model answers and explanations for Middle candidates.
See a AI Research Engineer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
I would turn the idea into a falsifiable claim with a fixed comparison, metric, and decision rule before seeing results.
- I would state the intervention and mechanism, such as RoPE scaling improving 32K retrieval because relative phases remain usable beyond the 8K training length.
- I would freeze the baseline, data snapshot, token budget, three seeds, primary metric, and subgroup metrics in the experiment record.
- I would set a threshold such as at least +1.0 accuracy point with a 95% confidence interval excluding zero, rather than accepting any positive delta.
- I would label later analyses as exploratory and require a fresh confirmation run before treating them as evidence.
Why interviewers ask this: The interviewer is checking whether you can prevent hindsight bias and convert a plausible mechanism into a test that can genuinely fail.
I would run a 2 by 2 design so the main effects and the interaction are identifiable instead of testing each change only against baseline.
- The four cells are neither change, A only, B only, and A plus B, all matched on data order, tokens, initialization policy, and evaluation.
- With three seeds per cell, I would estimate A, B, and the interaction A:B rather than adding two independently measured deltas.
- A positive interaction means the combined gain exceeds the sum of main effects; a negative one can reveal that both changes solve the same bottleneck.
- If compute permits only eight runs, I would reduce secondary evaluations before dropping cells, because a missing cell destroys the factorial comparison.
Why interviewers ask this: A strong answer shows that the candidate can distinguish an interaction from two isolated improvements while keeping the design compute-conscious.
I would budget from the minimum detectable effect and observed variance, not from an arbitrary number of runs.
- I would estimate per-example or per-seed variance from a pilot, set alpha to 0.05 and power to 80%, then solve for the required examples and seeds.
- Pairing both models on the same evaluation items often cuts variance, so 3,000 paired items may be more informative than 6,000 independently sampled items.
- I would reserve roughly 10% of compute for failed starts and one untouched confirmation, while keeping that reserve outside the primary analysis.
- If the required budget is impossible, I would raise the detectable-effect threshold or narrow the hypothesis instead of running an underpowered test silently.
Why interviewers ask this: The interviewer wants evidence that you connect statistical power to GPU and evaluation budgets rather than treating three seeds as a universal rule.
A paired test removes item-difficulty variation by comparing both models on the same independent evaluation items.
- The pair is the item ID: I would store both outcomes for each item and analyze the within-item delta rather than two independent aggregate means.
- For binary correctness, McNemar's test uses discordant item pairs; for continuous scores, a paired permutation test or paired bootstrap preserves item covariance.
- Matching an integer decoding seed does not create the pairing, because different token distributions can map the same random stream to different draws.
- For stochastic generation, I would take repeated samples per item or use a justified common-random-number coupling, then model uncertainty across both items and samples.
Why interviewers ask this: The interviewer is checking whether you identify the true paired unit and handle stochastic generation without treating a shared seed as a statistical design.
I would use a two-level analysis that represents uncertainty from independent training runs and from the sampled evaluation items.
- I would build a crossed design in which each baseline and candidate seed block is scored on the same item set, preserving method pairing wherever the seed policy supports it.
- A two-level bootstrap resamples seed pairs and item IDs independently, then recomputes the overall method delta for every replicate.
- A crossed random-effects model is another option, but treating every seed-item score as an independent row would create pseudoreplication and an interval that is too narrow.
- I would report the interval with seed and item variance components, and add seeds if the run-level component is too poorly estimated for the decision.
Why interviewers ask this: A strong answer combines both uncertainty levels instead of letting thousands of benchmark items hide evidence from only a few training runs.
I would define the hypothesis family before looking at results and correct within that family rather than celebrating the smallest raw p-value.
- Holm correction is a good default for a small set of confirmatory claims because it controls family-wise error and is less conservative than Bonferroni.
- Benjamini-Hochberg fits a broader screening sweep where accepting a controlled false discovery rate, such as 5%, is reasonable.
- I would nominate one primary benchmark and metric, leaving the other five as secondary evidence rather than multiplying co-primary claims.
- The report would include raw and adjusted p-values, effect sizes, and confidence intervals so correction does not replace judgment about magnitude.
Why interviewers ask this: The interviewer is checking whether you understand that searching many variants and metrics changes the probability of a false research claim.
I would frame the quality comparison as a preregistered non-inferiority test with a margin of 0.3 points.
- I would define delta as candidate minus baseline, verify that the candidate actually consumes 75% of the stated total FLOPs, and set the non-inferiority margin at -0.3 before running either arm.
- The null is delta less than or equal to -0.3, so I would declare non-inferiority only if the lower one-sided 95% confidence bound is above -0.3.
- Matched training-seed blocks and the same evaluation items reduce variance, while the interval must still reflect uncertainty from both seeds and items.
- I would recommend the method only if the 25% saving and latency or memory guardrails also hold, because non-inferiority proves neither equivalence nor superiority.
Why interviewers ask this: The interviewer is evaluating whether you can trade a concrete compute saving against a precommitted acceptable quality loss with the correct one-sided test.
I would use repeated, crossed measurements to estimate which sources of randomness dominate the total variance.
- I would vary initialization seed, data-order seed, checkpoint step, and evaluation sampling separately instead of changing all four together.
- A random-effects model can attribute variance to seed, checkpoint, benchmark item, and residual terms, with interactions added when the design supports them.
- If data order explains 60% of observed variation, adding more evaluation examples will not fix uncertainty; more independent training runs will.
- I would publish variance components and the resulting seed count so later experiments spend compute on the dominant uncertainty source.
Why interviewers ask this: The interviewer wants to see whether you can diagnose noisy research quantitatively rather than averaging arbitrary repetitions.
I would first prove that the intervention activated its proposed mechanism rather than interpreting an inert implementation as a scientific negative.
- Before the run, I would name a mechanistic signature such as longer attention distance, changed routing entropy, or a measurable auxiliary representation.
- Treatment and baseline traces must differ on that signature, while config assertions, gradient flow, and parameter updates confirm that the new path was actually used.
- A removal, sham, or coefficient-dose check should turn the signature off or scale it predictably, which is stronger evidence than one final metric remaining flat.
- Only after activation passes would I use the effect interval to decide whether the minimum useful gain is excluded; otherwise the result is invalid or inconclusive, not negative.
Why interviewers ask this: A strong candidate validates the causal manipulation before using a null metric result to reject the underlying mechanism.
Warmup limits unstable early updates while optimizer moments and activation scales settle, and decay reduces update size as training approaches a minimum.
- I would start with linear warmup over 1% to 3% of total steps, then compare cosine and linear decay at equal peak rate, tokens, and optimizer settings.
- Too little warmup can cause loss spikes or overflow, while 10% warmup may waste a substantial fraction of a short run at an unnecessarily low rate.
- The comparison should include early loss, final validation loss, gradient norm, and quality at fixed FLOPs rather than only the final checkpoint.
- I would tune peak rate jointly with schedule shape because a cosine schedule can appear better merely because its average learning rate differs.
Why interviewers ask this: A strong answer connects schedule shape to optimization dynamics and proposes a controlled comparison rather than repeating a standard recipe.
AdamW combines adaptive first and second moments with weight decay applied separately from the gradient update, so its exact hyperparameters are part of the result.
- The update uses bias-corrected moment estimates with beta values often near 0.9 and 0.95 or 0.999, and changing beta2 alters responsiveness to gradient variance.
- Decoupled decay shrinks parameters directly; it is not equivalent to adding L2 loss under an adaptive preconditioner.
- Biases and normalization scales are often excluded from decay, while embedding and output weights need an explicit documented policy.
- Epsilon, precision, gradient clipping, and whether moments remain in FP32 can change low-magnitude updates, so I would checkpoint and report them all.
Why interviewers ask this: The interviewer is checking whether you understand AdamW beyond its name and can reproduce the update rule without hidden defaults.
Gradient noise scale estimates where a larger batch stops buying proportional optimization efficiency because gradient variance is already small relative to the mean signal.
- Below the critical batch, doubling batch size can often support an approximately doubled learning rate and reduce the steps needed for the same token exposure.
- Above it, extra examples mostly duplicate gradient information, so throughput may rise while quality per training FLOP falls.
- I would estimate the scale from gradient statistics across microbatches at several checkpoints because it changes during training.
- A batch study must match total tokens and retune learning rate; comparing equal steps gives the larger batch an unfair compute advantage.
Why interviewers ask this: A strong candidate uses gradient statistics to explain the limits of linear batch scaling instead of treating the scaling rule as universal.
Label smoothing moves some target mass away from the one-hot class, discouraging extreme logits and often improving calibration.
- With smoothing 0.1 in a K-class task, the target is mostly the correct class while the remaining mass is distributed across other classes according to the chosen convention.
- It can improve validation accuracy when labels are noisy, but too much smoothing weakens the signal for rare or fine-grained classes.
- It may hurt knowledge distillation or confidence-based selection because the model is explicitly trained not to match sharp target probabilities.
- I would sweep values such as 0, 0.05, and 0.1 and report accuracy, NLL, ECE, and per-class recall rather than accuracy alone.
Why interviewers ask this: The interviewer is evaluating whether you understand both the target-distribution mechanism and the calibration versus discrimination trade-off.
Focal loss is useful when easy examples dominate training and the experiment needs to emphasize hard or rare examples.
- It multiplies cross-entropy by (1 - p_t) raised to gamma, so gamma 2 strongly downweights examples the model already classifies confidently.
- An alpha weight can address class frequency separately, but tuning alpha and gamma together can overcorrect imbalance.
- Hard examples include mislabeled data, so focal loss may amplify annotation noise and reduce probability calibration even when recall improves.
- I would compare it with class-weighted cross-entropy at matched sampling and report PR-AUC, rare-class recall, NLL, and gradient mass by class.
Why interviewers ask this: A strong answer explains the gradient reweighting and recognizes that hard-example emphasis can focus on noise as well as useful minority cases.
Temperature scales similarity logits before softmax and controls how strongly the loss concentrates on the hardest negatives.
- In InfoNCE, dividing cosine similarities by 0.07 creates sharper probabilities and larger gradients around close negatives than a temperature of 0.2.
- A very low value can make a few false negatives dominate and destabilize training, while a high value may provide gradients that are too diffuse.
- The best value depends on embedding normalization, batch size, and negative mining because all three change the similarity distribution.
- I would track retrieval Recall@k, alignment and uniformity statistics, gradient norms, and false-negative slices, while constraining a learned temperature to a safe range.
Why interviewers ask this: The interviewer wants to see whether you connect temperature to negative weighting and can identify its interaction with the batch and embedding geometry.
I would combine hard-label supervision with a temperature-softened teacher-to-student divergence and isolate its value at fixed student conditions.
- A standard objective is (1 - alpha) times CE plus alpha times T^2 * KL(softmax(z_teacher / T) || softmax(z_student / T)).
- The T^2 factor compensates for the gradient shrinkage caused by softening, while values such as T from 2 to 4 expose secondary class preferences.
- Alpha trades task labels against teacher behavior, and feature matching is a separate hypothesis that should not be bundled into the first comparison.
- I would compare with the same-size student trained without a teacher, reporting quality, calibration, and slices while accounting separately for teacher-logit generation.
Why interviewers ask this: A strong candidate states the direction and temperature scaling of the KL term exactly and uses a baseline that isolates teacher signal.
I would choose the auxiliary coefficient from gradient behavior on shared parameters, not from the two scalar loss values alone.
- On the shared backbone I would compare ||g_main|| with ||lambda * g_aux||; parameters used only by the auxiliary head do not belong in that ratio.
- I would also measure cosine similarity between those same gradient vectors, because cosine shows direction while the norm ratio shows whether an aligned or conflicting signal is large enough to matter.
- A coefficient sweep can target a bounded auxiliary-to-main norm ratio, with clipping or a schedule added only as a separately controlled intervention.
- I would retain the term only if the main task improves at fixed total compute and a removal ablation reverses the claimed effect without hidden slice regressions.
Why interviewers ask this: The interviewer is checking whether you diagnose both gradient magnitude and direction on the parameters where the objectives actually interact.
I would predeclare whether the claim is about matched model training work or matched full algorithmic compute, because those are different comparisons.
- A matched-token view can hold data exposure and model forward-backward FLOPs fixed, but it must not be described as equal total FLOPs when optimizer work differs.
- Full compute adds recomputation plus optimizer updates, including preconditioner construction and application for methods such as Shampoo, to the forward-backward ledger.
- Every optimizer receives the same number of tuning trials for learning rate, decay, and its method-specific settings rather than inheriting AdamW defaults.
- I would plot validation loss against both cumulative forward-backward FLOPs and cumulative full FLOPs, alongside step time, peak memory, and seeded final quality.
Why interviewers ask this: A strong answer separates useful model work from full optimizer-inclusive compute and avoids favoring either a cheap or expensive update rule by accounting choice.
Pre-norm places normalization before each residual branch and usually gives deep Transformers a cleaner gradient path, while post-norm normalizes after residual addition.
- In pre-norm, the identity residual path bypasses the sublayer and normalization, which helps gradients propagate through dozens or hundreds of layers.
- Post-norm can produce stronger representation changes per block but is more sensitive to initialization, warmup, and depth.
- Pre-norm is not automatically better at matched compute; its residual stream can grow, and final normalization becomes important.
- I would compare both with matched parameters and tokens, then inspect loss spikes, layerwise gradient norms, activation scale, and final benchmark quality.
Why interviewers ask this: The interviewer is evaluating whether you can relate normalization placement to residual-path gradients and propose measurements beyond final accuracy.
RoPE rotates query and key features by position-dependent angles, while ALiBi adds head-specific linear distance penalties to attention scores.
- RoPE makes dot products depend on relative phase while retaining rich positional geometry, but unseen long positions can rotate beyond the trained frequency regime.
- ALiBi has no learned position table and biases heads toward different locality ranges, often extrapolating simply but with a less expressive positional interaction.
- I would train both to 8K with matched parameters and tokens, then evaluate perplexity, retrieval, and reasoning at 8K, 16K, and 32K.
- Any RoPE interpolation or frequency rescaling is a separate intervention, and I would verify short-context quality because improving 32K can damage the trained range.
Why interviewers ask this: A strong candidate explains the score-level mechanisms and designs an extrapolation test that does not hide short-context regressions.
Locked questions
- 21
What is the algorithmic idea behind FlashAttention, and why is it exact rather than an attention approximation?
flash-attnalgorithms - 22
What quality trade-off does grouped-query attention create compared with multi-head and multi-query attention?
queriesgqa - 23
How do routing and auxiliary losses work in a sparse mixture-of-experts Transformer?
nlptransformermoe - 24
How would you compare a sparse MoE model with a dense model at matched training FLOPs?
flops - 25
How would you study the depth-width trade-off in a Transformer?
nlptransformer - 26
How would you test whether a long-context method truly extrapolates beyond its training length?
long-context - 27
How would you compare early fusion, cross-attention, and late fusion in a multimodal model?
multimodal - 28
How would you frame speculative decoding as a research hypothesis rather than a serving task?
hypothesis-testingmodel-servingspec-decode - 29
What do saved tensors and version counters do inside PyTorch autograd?
pytorchautograd - 30
When would you implement a custom torch.autograd.Function, and how would you validate it?
validationautograd - 31
How does DistributedDataParallel synchronize gradients during backward?
distributed - 32
How do FULL_SHARD and SHARD_GRAD_OP differ in FSDP, including current FSDP concepts?
shardingfsdp - 33
What exactly does activation checkpointing trade, and how would you choose checkpoint boundaries?
checkpointactivationact-checkpoint - 34
What causes graph breaks in torch.compile, and how would you study their effect on a training experiment?
experiments - 35
How would you build a trustworthy CUDA kernel microbenchmark before claiming a speedup?
cuda - 36
How do jit, vmap, and grad compose in JAX, and what constraints do they impose?
jax - 37
How do a JAX device mesh and PartitionSpec describe a sharded computation?
shardingpartitioningjax - 38
Why does JAX use explicit PRNG keys, and how do you manage them in parallel experiments?
experimentsjax - 39
How would you choose weights for a multi-domain pretraining dataset mixture?
- 40
How do you select and validate a deduplication threshold for training data?
dedupvalidationqueries - 41
How would you audit benchmark contamination in a large training corpus?
contamination - 42
How do you measure and improve agreement among annotators for preference data?
- 43
How do you recognize benchmark saturation, and what do you do about it?
- 44
How would you evaluate and improve probability calibration in a research model?
probabilitycalibrationdecision-making - 45
How would you design subgroup slices without turning the evaluation into metric fishing?
designmonitoring - 46
What should a golden-trace replay and eval contract fix for reproducible model research?
reproducibility - 47
What objective and data choices matter most in supervised fine-tuning of a language model?
supervised - 48
How is a reward model trained from pairwise preferences?
reward-model - 49
What roles do the reference model and beta play in DPO?
dpo - 50
What distinct roles do PPO clipping and a KL penalty play in RLHF?
pporlhfdistinct - 51
An auxiliary objective is enabled at step 18,000 and the main loss spikes for one step before recovering. How would you validate the intervention?
validation - 52
A distributed refactor changes gradient-reduction order and a claimed evaluation lift is only 0.2 points. How would you test whether numerical order caused it?
refactoringdistributed - 53
One rank is consistently 18% slower than the other 63 ranks and extends every collective tail. How would you find the straggler's cause?
- 54
A DataLoader feeds 8 GPUs well but produces multi-second stalls when the same run scales to 64 GPUs. How would you debug it?
dataloader - 55
A distributed checkpoint directory exists, but rank 37 never finished writing its optimizer shard. What would you do?
checkpointshardingdistributed - 56
A resumed curriculum run crosses from general data to math data and later beats the uninterrupted control. How would you validate the result?
validation - 57
An FSDP FULL_SHARD run still OOMs on 8 GPUs even though the parameter and optimizer-state estimates fit. What would you inspect?
estimationoptimizationfsdp - 58
You saved an FSDP run on 8 GPUs and must resume it on 16 GPUs. How would you make the state dict portable across world sizes?
fsdp - 59
After adding a fused RMSNorm extension, torch.compile inserts one graph break per Transformer block and runs slower than eager mode. How would you fix it?
nlptransformer - 60
A fused bias-GELU autograd function passes gradcheck for one row but fails for a 7 by 128 input only on the bias gradient. What would you inspect?
autograd - 61
A Triton kernel is fast but silently returns wrong values for some odd sequence lengths. How would you debug it?
triton - 62
Your new Triton kernel is only 1.05 times faster than the PyTorch baseline. What would you profile before claiming the optimization worked?
pytorchtritonoptimization - 63
A precision study lets FP16 consume extra data to replace skipped updates while BF16 stops at the token budget. Why is that comparison invalid?
precisionbf16tokens - 64
Gradient accumulation matches the target batch size, but the result changes when ranks have different numbers of valid tokens. What is wrong?
tokensbatch - 65
Your data config assigns domains weights of 70%, 20%, and 10%, but the consumed-token ledger shows 84%, 11%, and 5%. How would you validate the realized mixture?
tokensvalidationconfig - 66
A reproduction uses the published weights but its first optimizer update differs from the authors' run. How would you investigate optimizer-state mismatch?
optimization - 67
The effective batch grows 8 times after a world-size and accumulation change. How would you adjust the learning rate?
optimizationbatch - 68
Preemptions arrive on average every six hours and a synchronous checkpoint pauses all GPUs for 90 seconds. What checkpoint cadence minimizes expected GPU waste?
checkpointhardware - 69
One node fails during a distributed run. What can elastic restart recover, and where would you set limits?
distributed - 70
A 32-GPU run shows only 35% utilization in nvidia-smi. How would you calculate model FLOPs utilization and interpret the difference?
flopshardware - 71
Evaluation scores silently regress after an eval-harness refactor even though the checkpoint is unchanged. How would you investigate?
checkpointrefactoring - 72
You suspect that benchmark examples in the training corpus inflated scores. How would you test dataset influence rather than run another overlap search?
test-data - 73
A team evaluates after every new seed and stops as soon as p is below 0.05. How would you control sequential peeking?
pitfallsdecision-making - 74
An adaptive sweep selected one winner from 30 ablations. How would you design an independent confirmatory study?
design - 75
How would you use item-response analysis to determine whether a benchmark still distinguishes strong models?
- 76
Annotator agreement stays stable, but preference labels appear to drift across monthly collection batches. How would you detect temporal rubric drift?
batchiac - 77
Before an expensive human evaluation, how would you determine whether it can detect a three-point preference gain?
- 78
A synthetic-data branch shows no gain over additional real data at fixed FLOPs. When would you kill it?
flops - 79
A code auxiliary objective raises the aggregate score by two points but lowers mathematical reasoning by three. How would you test capability interference and decide?
aggregation - 80
Your evaluation-trace schema must move from version 2 to version 3 without losing comparability with years of results. How would you build the migration bridge?
schemamigrations - 81
A mixture-of-experts run begins sending 70% of tokens to two experts. How would you diagnose expert collapse?
tokensmoe - 82
A team proposes attention sinks and RoPE position interpolation to fix long-context quality. How would you evaluate them as separate mechanisms?
ropelong-contextdecision-making - 83
DPO improves blinded helpfulness but causes a clear reasoning regression. How would you respond?
dpo - 84
A reward model performs well on its validation set but loses accuracy on a newly collected preference batch. How would you test validation overfitting?
overfittingreward-modelbatch - 85
During PPO, reference KL spikes sixfold and reward then collapses together with held-out quality. What would you do?
ppo - 86
An SFT run has falling loss, but sampled chats emit user markers and continue past the assistant turn. How would you debug the chat template?
sft - 87
How would you ablate filters in a synthetic-data pipeline without confusing filter quality with dataset size?
pipelinesci-cd - 88
A distilled student remains 13 points behind its teacher. How would you separate capacity limits from distillation failure?
capacitymodel-compression - 89
Which verifier and correction-path invariants would you test in an implementation of speculative decoding?
spec-decode - 90
A multimodal model's text loss improves while image-conditioned quality falls. How would you diagnose modality imbalance?
multimodal - 91
You own a queue of 40 sweep proposals but can run only 10 this week. How would you make the queue evidence-gated?
data-structures - 92
The dashboard's best run has no complete lineage record. What would you do with the result?
lineage - 93
Your theoretical FLOPs report and scheduler GPU-hour bill disagree by 28%. How would you reconcile them?
flopsconflicthardware - 94
How would you mentor a junior research engineer through their first ablation?
mentoring - 95
A PR claims to reproduce a new attention paper but changes 900 lines across the model and training configs. Which checks would you require?
config - 96
How would you contribute a Triton kernel to an open-source research library?
triton - 97
A collaborator disputes your reported gain and says their rerun is negative. How would you resolve it?
- 98
A paper deadline arrives before you can run the planned five seeds. What do you do?
estimation - 99
A scientific result regressed somewhere across 40 commits. How would you bisect it without fully retraining every revision?
retraining - 100
How would you choose the next experiment by expected information per GPU-hour?
experimentshardware