In this article
How a breadth round works and how to use this page
A breadth round asks many short questions across the field and moves on once you have shown you know the idea. Where a breadth round sits in a full process is covered in the interview loops guide. A depth round does the opposite and stays on one topic, as in the project deep dive.
The questions below are grouped by topic. Candidates report questions of this kind in interviews at AI labs and large tech companies; those are candidate reports, not confirmed company practice. Each entry gives a short answer, one line on why it is asked, and where to read more. A strong answer defines the term, says how it works, names one trade-off, and stops. Entries that carry a number say where it comes from.1
Transformers and large language models
Explain transformers in the context of large language models
A transformer is a neural network architecture built only on attention, with no recurrence or convolution (Vaswani et al., 2017). Attention lets every position weigh every other position, so a whole sequence is processed in parallel, which made training faster than recurrent models. Large language models (LLMs) stack many transformer layers, and many keep only the text-generating half of the original design and output one next token at a time.
Why it is asked: it checks that you can state the one idea, attention, and why it replaced recurrence. Read the full explanation: Vaswani et al., Attention Is All You Need.
What is self-attention?
Self-attention lets each token build a new representation as a weighted mix of the tokens in the same sequence, itself included. Each token produces a query, a key and a value; how well a query matches every key gives the weights, and those weights mix the values. Attention alone ignores word order, so a position signal is added to the input. The match scores are scaled by the square root of the key size before the softmax turns them into weights. The original design dispenses with recurrence and convolution (Vaswani et al., 2017).
Why it is asked: it separates people who can draw the mechanism from people who repeat the name. Read the full explanation: Vaswani et al., Attention Is All You Need.
How are transformer language models trained: supervised fine-tuning and reinforcement learning?
Training has three stages. Pretraining teaches the model to predict the next token on a large text corpus; the text supplies the labels, so it is self-supervised. Supervised fine-tuning then trains it on labeler demonstrations of good answers. In reinforcement learning from human feedback (RLHF), labeler rankings of outputs train a reward model, and the model is optimised against it with reinforcement learning, using proximal policy optimization (PPO) in InstructGPT, which started from a Generative Pre-trained Transformer (GPT) model, GPT-3 (Ouyang et al., 2022). RLHF is the last stage, not the whole of training.
Why it is asked: a common mistake is to call RLHF the entire process. Read the full explanation: Ouyang et al., InstructGPT.
Is a bigger language model always better?
No. In the InstructGPT paper's human evaluations on its own prompt distribution, outputs from the 1.3B-parameter InstructGPT model were preferred to those of the 175B-parameter GPT-3, despite 100x fewer parameters, with gains in truthfulness and less toxic output (Ouyang et al., 2022). Training method and data can matter more than size, though the result holds for that paper's setup, not everywhere.
Why it is asked: it tests whether you can resist a slogan and cite evidence. Read the full explanation: Ouyang et al., InstructGPT.
What is fine-tuning a language model, and when do you do it?
Fine-tuning is continued training of a pretrained model on a narrower dataset so that its behaviour shifts toward a task or style. InstructGPT used labeler demonstrations to fine-tune GPT-3 with supervised learning (Ouyang et al., 2022). Full fine-tuning updates every weight; lighter methods update a small added set. Choose it when prompting alone falls short, and say what data you would use and how you would evaluate it.
Why it is asked: it shows whether you know the cost and the alternatives. Read the full explanation: AI engineer interview questions and answers.
What is model quantization?
Model quantization stores a model's weights, and sometimes its intermediate values, in fewer bits per number than the original. It cuts memory and can speed up inference, at the cost of some accuracy that varies by model and method. A strong answer ends with how you would check the damage: compare quality on your own task before and after, not only on a general benchmark.
Why it is asked: it links model quality to serving cost. Read the full explanation: AI engineer interview questions and answers.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Training and model basics
Describe linear and logistic regression and how they are trained
Linear regression fits a weighted sum of the features to a number by minimising the mean squared error (MSE). Logistic regression passes that weighted sum through a sigmoid to get a probability and minimises log loss, also called cross-entropy. Both gradients have the same form, the average of prediction minus label times the feature, with a factor of 2 for MSE, or none if the loss is defined as half the MSE. Training repeats gradient steps until the loss stops falling.
The formulas to write out, for examples with labels and predicted probabilities :
Why it is asked: candidates have reported being asked to write out the losses and gradients, so write them out. Related questions: AI engineer interview questions and answers.
How do you handle overfitting?
Overfitting is when a model fits noise in its training data and so does worse on new data. You detect it as a gap between training and validation scores. Remedies are more or cleaner data, a simpler model, regularisation that penalises large weights, early stopping, and for trees a depth limit or an ensemble. Name the remedy that matches the symptom you saw.
Why it is asked: it tests diagnosis before cure. Related questions: AI engineer interview questions and answers.
How would you implement gradient descent from scratch?
Gradient descent is a loop that moves parameters a small step against the gradient of the loss. For the illustrative function f(w) = (w - 3)^2, starting at w = 0 with step size 0.1, three updates give 0.6, 1.08 and 1.464, closing in on the minimum at 3.1 In code: compute the gradient, update, repeat, and stop when the change is tiny. Explain how you would pick the step size.
Why it is asked: candidates have reported this as a short coding task in an applied scientist screen. Where it is reported: Amazon applied scientist interview process.
What is the difference between supervised and unsupervised learning?
Supervised learning trains on examples with labels, such as spam or not spam, to estimate the label of new inputs. Unsupervised learning has no labels and looks for structure, such as clusters or compact representations. Language-model pretraining sits between the two: the text itself supplies the target, which is usually called self-supervised learning.
Why it is asked: it is a warm-up that shows whether your vocabulary is precise. Related questions: AI engineer interview questions and answers.
What is the difference between structured and unstructured data, and how do you process unstructured data?
Structured data fits rows and columns with defined fields; unstructured data, such as free text, images and audio, does not. To process it, you convert it to numbers: split text into tokens, resize and normalise images, and learn embeddings or extract features by hand. After that, ordinary models apply. Mention that the conversion step is where information can be lost.
Why it is asked: it checks that you can connect raw data to a model input. Related questions: AI engineer interview questions and answers.
Ensembles
What is bagging?
Bagging is an ensemble method that builds several estimators independently, each on a sample of the data drawn with replacement, and averages their predictions. Averaging lowers variance, so bagging works best with strong, complex base models such as fully grown decision trees (scikit-learn user guide, accessed October 2026). A random forest is the best-known example.
Why it is asked: it tests whether you know why averaging helps. Read the full explanation: scikit-learn ensemble methods.
What is boosting, and how does it differ from bagging?
Boosting is an ensemble method that builds estimators one after another, each trying to reduce the bias of the combined model, and it usually works best with weak models such as shallow trees (scikit-learn user guide, accessed October 2026). Gradient-boosted trees are the standard example. Bagging runs in parallel and lowers variance; boosting runs in sequence and lowers bias.
Text description of the diagram
- Bagging builds estimators independently and averages them, which lowers variance.
- Boosting builds estimators one after another to reduce bias.
- Gradient-boosted trees are the standard example.
Why it is asked: candidates have reported it paired with bagging, and the trap is saying they are the same. Read the full explanation: scikit-learn ensemble methods.
Data and evaluation
How do you handle class imbalance?
Class imbalance is a dataset where one label, the majority class, is far more frequent than another, the minority class. First train on the original data as a baseline, because mild imbalance is often not a problem. If the minority class is starved, downsample the majority and upweight it by the same factor (Google for Developers, accessed October 2026). In an illustrative 1:200 dataset, downsampling by 10 gives 1:20, with an example weight of 10. Then, in batches of 100, about 39% of batches contain at least one positive before and about 99% after.1
Why it is asked: the weak answer jumps straight to resampling. Read the full explanation: Google, class-imbalanced datasets.
Why is accuracy a poor metric on imbalanced data, and what do precision and recall measure?
Accuracy is the share of all answers that are right; precision is the share of flagged positives that are real; recall is the share of real positives that were found (Google for Developers, accessed October 2026). In an illustrative set of 10,000 examples with 50 positives, a model that finds 20 of them with 10 false alarms scores 99.6% accuracy, barely above the 99.5% of always answering negative, yet its recall is 40%.1
Why it is asked: it separates a metric you can recite from one you can choose. Read the full explanation: Google, accuracy, precision and recall.
What is calibration?
Calibration is the match between a model's stated probabilities and how often the events happen: in an illustrative case, of the examples scored 0.8, about 80% should be positive. scikit-learn documents it for classifiers whose probability is meant as a confidence (scikit-learn user guide, accessed October 2026). Check it on held-out data with a reliability plot, and recalibrate afterwards if the probabilities drift, for example with sigmoid (Platt) scaling or isotonic regression, both described in the same guide.
Why it is asked: candidates have reported it next to logistic regression, whose outputs are probabilities. Read the full explanation: scikit-learn probability calibration.
What is resampling, and how do you handle it?
Resampling is drawing new training or evaluation sets from the data you already have. Bootstrap sampling with replacement powers bagging (scikit-learn user guide, accessed October 2026); cross-validation resamples train and validation splits to estimate performance; over- and under-sampling rebalance classes. When you rebalance, resample only inside the training split, so duplicated rows never leak into validation.
Why it is asked: the word covers three different techniques, and naming which one you mean is the point. Read the full explanation: scikit-learn ensemble methods.
What is A/B testing, and how would you use it?
An A/B test randomly assigns users to a control, A, and a variant, B, measures a metric chosen in advance, and uses a statistical test to judge whether the difference is larger than chance. Fix the metric, sample size and duration before starting, and do not stop early because the numbers look good. Use it to check that a gain measured on a held-out set shows up for real users.
Why it is asked: candidates have reported it in a process that mixes coding, probability and system design. Where it shows up: interview loops guide.
Follow-up questions
What are machine learning breadth interview questions?
They are short questions that cover many core topics, such as transformers, regression, overfitting, ensembles and evaluation metrics, so the interviewer can see how wide your working knowledge is. Expect a one-minute answer, then the next topic.
How do you prepare for a machine learning breadth round?
Practise saying each answer aloud in the order definition, mechanism, trade-off, then stop. Pick the topics your target role needs, and read that company's own process page, such as the OpenAI interview process or the Anthropic interview process, because rounds differ.
What is the difference between a breadth round and a depth round?
A breadth round tests many topics lightly; a depth round keeps probing one topic or one of your own projects until the limit of your knowledge. For the second, see the project deep dive.
How long should each answer be?
Aim for about a minute: enough for the definition, one mechanism and one trade-off. Let the interviewer ask for more, because a long answer in a breadth round costs you time for the next question.
Which roles get machine learning breadth questions?
Candidates report them in screens for applied scientists and machine learning engineers; confirm for your own loop. Role-specific pages cover the applied scientist process at Amazon and the forward deployed and applied AI engineer rounds.
- A transformer uses attention instead of recurrence or convolution, and RLHF is a later stage after pretraining and supervised fine-tuning, not the whole of training.
- Bagging averages independent models to lower variance; boosting builds models in sequence to lower bias.
- On imbalanced data, train on the original data first, then downsample and upweight by the same factor if needed.
- Accuracy hides a weak minority class, so report precision and recall.
- Answer in the order definition, mechanism, trade-off, then stop.
Sources
- Attention Is All You Need (arXiv 1706.03762) — arXiv (Vaswani et al.), 2 Aug 2023
- Training language models to follow instructions with human feedback (arXiv 2203.02155) — arXiv / NeurIPS 2022 (Ouyang et al.), 4 Mar 2022
- Datasets: Class-imbalanced datasets (Machine Learning Crash Course) — Google for Developers, 26 Oct 2026
- Classification: Accuracy, recall, precision, and related metrics (Machine Learning Crash Course) — Google for Developers, 26 Oct 2026
- Ensembles: Gradient boosting, forests, random forests, bagging, voting, stacking (scikit-learn user guide) — scikit-learn, 26 Oct 2026
- Probability calibration (scikit-learn user guide) — scikit-learn, 26 Oct 2026