AIF study materials
AIF study resources

AIF practice questions

One question at a time. Build your AIF understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Fundamentals of AI and ML

Which statement best describes the relationship among artificial intelligence, machine learning, and deep learning?

  1. Machine learning is a subset of deep learning, which is a subset of AI.
  2. Artificial intelligence is a subset of machine learning and of deep learning.
  3. The three terms describe unrelated fields that share no overlap.
  4. Deep learning is a subset of machine learning, which is a subset of AI. Correct answer.

Explanation

AI is the broad goal of building systems that perform tasks requiring intelligence; machine learning is one approach to that goal, and deep learning is a family of machine learning using multi-layer neural networks. The relationship is therefore nested, with each term contained inside the one before it.

Question 2Fundamentals of AI and ML

A model is trained on a dataset where every input record is paired with the correct answer. Which learning paradigm does this describe?

  1. Unsupervised learning
  2. Reinforcement learning
  3. Self-supervised clustering
  4. Supervised learning Correct answer.

Explanation

Supervised learning trains on labeled examples, meaning each input is paired with a known target output that the model learns to reproduce. The presence of those answer labels is what distinguishes it from the other paradigms.

Question 3Fundamentals of AI and ML

A lender wants a model that outputs whether an applicant will default, expressed as yes or no. Which task type fits best?

  1. Dimensionality reduction
  2. Clustering
  3. Regression
  4. Binary classification Correct answer.

Explanation

Predicting one of two discrete outcomes is binary classification, because the target has exactly two mutually exclusive classes. The choice of task type follows from the nature of the target variable, not from the algorithm used.

Question 4Fundamentals of AI and ML

Which of these is an example of unsupervised learning?

  1. Flagging spam using a labeled set of past emails
  2. Detecting fraud using records confirmed as fraudulent
  3. Grouping customers into segments without predefined labels Correct answer.
  4. Predicting house prices from property features

Explanation

Unsupervised learning finds structure in data that has no target labels, and customer segmentation by similarity is a classic example. The defining feature is the absence of a known correct answer during training.

Question 5Fundamentals of AI and ML

In supervised learning, what is a label?

  1. The number of layers in a neural network
  2. A raw input column used as a predictor
  3. The learning rate applied during training
  4. The target value the model is trained to predict Correct answer.

Explanation

A label is the target or ground-truth output attached to each training example, and the model's objective is to predict it from the inputs. Input columns are features, while layers and learning rate are design and training settings.

Question 6Fundamentals of AI and ML

Why is a dataset typically divided into a training set and a test set?

  1. To estimate how well the model generalizes to unseen data Correct answer.
  2. To increase the number of features available to the model
  3. To ensure the model trains faster on larger batches
  4. To reduce the amount of data that must be labeled

Explanation

Holding out data the model never saw during training gives an unbiased estimate of performance on new inputs. Without a held-out set, high training scores cannot distinguish genuine learning from memorization.

Question 7Fundamentals of AI and ML

In reinforcement learning, what drives the agent's improvement over time?

  1. Rewards received from interacting with an environment Correct answer.
  2. A fixed set of labeled correct answers
  3. A precomputed correlation matrix of the inputs
  4. A distance metric computed between clusters

Explanation

A reinforcement learning agent takes actions in an environment and adjusts its behavior to maximize cumulative reward. The reward signal, not a labeled answer key, tells the agent how good its actions were.

Question 8Fundamentals of AI and ML

What is a defining characteristic of generative AI models?

  1. They require no training data at all
  2. They output only single numeric regression values
  3. They produce new content such as text, images, or audio Correct answer.
  4. They can only sort inputs into a fixed set of categories

Explanation

Generative models learn the distribution of their training data and sample from it to create new content, such as prose, pictures, or sound. Models that only assign categories or numbers to inputs are discriminative rather than generative.

Question 9Fundamentals of AI and ML

A model reaches 99 percent accuracy on its training data but only 62 percent on the held-out test set. What does this pattern indicate?

  1. The model is underfitting the training data
  2. The model is overfitting the training data Correct answer.
  3. The test set is too large to give a meaningful score
  4. The model has too few parameters to learn the pattern

Explanation

A wide gap between strong training performance and weak test performance is the signature of overfitting, where the model has memorized idiosyncrasies of the training examples instead of general patterns. The remedy is usually more data, simpler models, or stronger regularization.

Question 10Fundamentals of AI and ML

In a binary classification confusion matrix, false negatives are the cases that are

  1. excluded from the reported metrics
  2. actually positive but predicted negative Correct answer.
  3. correctly predicted as negative
  4. predicted positive but actually negative

Explanation

A false negative is a missed detection: the true class is positive and the model said negative. It is the complement of a true positive among all actual positives.

Question 11Fundamentals of AI and ML

A training image set contains mostly photos of one demographic group. What is the most likely consequence for the deployed model?

  1. It will convert itself into an unsupervised model
  2. It will likely perform worse for underrepresented groups Correct answer.
  3. It will train faster and generalize better to everyone
  4. It will automatically compensate for the imbalance during training

Explanation

A model learns the distribution it is shown, so groups that appear rarely receive fewer representative patterns and poorer predictions. This is a data bias problem that must be addressed at the data and evaluation level.

Question 12Fundamentals of AI and ML

What is the purpose of an activation function in a neural network?

  1. To count how many epochs have elapsed
  2. To store the training labels for later comparison
  3. To shuffle the input records between layers
  4. To introduce non-linearity into the layer output Correct answer.

Explanation

Activation functions transform the weighted sum produced by a neuron, and non-linear activations let stacked layers represent complex, curved relationships. Without them, a deep network would collapse into an equivalent single linear transformation.

Question 13Fundamentals of AI and ML

In gradient descent, what does the learning rate control?

  1. The proportion of data held out for testing
  2. The number of hidden layers in the network
  3. The size of the step taken when updating model weights Correct answer.
  4. The number of features the model is allowed to use

Explanation

The learning rate scales the gradient before it is subtracted from the weights, so it determines how far each update moves. Too large a value can overshoot and diverge, while too small a value makes training slow.

Question 14Fundamentals of AI and ML

In large language models, tokenization refers to

  1. splitting text into smaller units the model can process Correct answer.
  2. compressing model weights for faster deployment
  3. encrypting prompts before they reach the model
  4. deleting all punctuation from the source corpus

Explanation

Tokenization breaks raw text into tokens, such as words or subword fragments, which are then mapped to numeric identifiers the model can consume. The token vocabulary is a fixed property of the model and determines how input length is measured.

Question 15Fundamentals of AI and ML

A language model confidently provides a detailed citation for an article that does not exist. What is this behavior called?

  1. Overfitting
  2. Data leakage
  3. Regularization
  4. Hallucination Correct answer.

Explanation

Hallucination is fluent but fabricated output, produced because the model generates plausible text rather than looking up verified facts. Confident phrasing is not evidence of correctness in a generative model.

Question 16Fundamentals of AI and ML

What does an embedding represent?

  1. A list of stop words removed during preprocessing
  2. A dense numeric vector that captures meaning Correct answer.
  3. The vocabulary size of a tokenizer
  4. A compressed copy of the full training dataset

Explanation

An embedding maps an item such as a word, sentence, or image into a dense vector space where semantically similar items land close together. These vectors are what allow models to compare meaning numerically.

Question 17Fundamentals of AI and ML

Which task requires labeled training data?

  1. Predicting customer churn from past labeled outcomes Correct answer.
  2. Reducing dimensionality with principal component analysis
  3. Detecting anomalies without any historical labels
  4. Segmenting shoppers by purchase behavior

Explanation

Churn prediction uses historical records where the outcome is already known, making it supervised learning that depends on labels. The other listed tasks infer structure from unlabeled data.

Question 18Fundamentals of AI and ML

What is the core idea behind ensemble methods?

  1. Combining multiple models to produce a stronger prediction Correct answer.
  2. Removing the test set to avoid optimistic bias
  3. Using a single very large model with no regularization
  4. Training on one feature at a time and averaging the results

Explanation

Ensembles aggregate the outputs of several models, so individual errors tend to cancel and the combined prediction is more robust than any single member. Bagging and boosting are two common ways to build such collections.

Question 19Fundamentals of AI and ML

A team takes a model already trained on general text and adapts it to a small labeled legal dataset. What is this practice called?

  1. Reinforcement learning from human feedback
  2. Feature scaling
  3. Unsupervised clustering
  4. Fine-tuning a pretrained model Correct answer.

Explanation

Fine-tuning continues training a pretrained model on a smaller, task-specific dataset so its weights shift toward the target domain. Starting from pretrained weights reduces the amount of labeled data and compute required.

Question 20Fundamentals of AI and ML

A spam filter flags emails, and the team wants the metric that answers what share of flagged emails are truly spam. Which metric applies?

  1. Precision Correct answer.
  2. Root mean squared error
  3. The F1 score alone
  4. Recall

Explanation

Precision is true positives divided by all predicted positives, so it measures how trustworthy a positive flag is. Recall instead measures how many of the actual positives were caught.

Question 21Fundamentals of AI and ML

A model exhibits high variance and low bias. What behavior should be expected?

  1. It cannot be improved by collecting additional training data
  2. It fits noise in the training data and transfers poorly to new data Correct answer.
  3. It underfits both the training data and the test data
  4. It has been regularized more strongly than necessary

Explanation

High variance means the fitted model changes sharply with the particular training sample, which typically shows up as fitting noise and poor generalization. High bias, by contrast, corresponds to underfitting and weak performance everywhere.

Question 22Fundamentals of AI and ML

A company needs an assistant that answers questions over its private, frequently updated document collection. Which approach fits best?

  1. Retrieval-augmented generation over that document store Correct answer.
  2. Training a classifier on the documents and returning the class label
  3. Raising the model's temperature setting for richer answers
  4. Fine-tuning the model on a single example document

Explanation

Retrieval-augmented generation retrieves the most relevant passages at query time and supplies them as context, so answers reflect current private content without retraining. It also makes grounding and citation easier than relying on parameters alone.

Question 23Fundamentals of AI and ML

A fraud dataset has 0.5 percent positive cases. A model that always predicts no fraud scores 99.5 percent accuracy. What is the soundest conclusion?

  1. The model is production ready because accuracy exceeds 99 percent
  2. The model needs more features before any metric is meaningful
  3. Accuracy is misleading here, so recall or AUPRC is more informative Correct answer.
  4. The dataset should be re-split until accuracy drops

Explanation

Under severe class imbalance, a trivial majority-class predictor already scores near the base rate, so accuracy hides the fact that no fraud is ever caught. Metrics focused on the positive class, such as recall, precision-recall curves, or AUPRC, reveal real detection performance.

Question 24Fundamentals of AI and ML

What does increasing a language model's temperature parameter typically do?

  1. Increases the size of the model's context window
  2. Reduces the number of tokens the model generates
  3. Makes token sampling more random and varied Correct answer.
  4. Guarantees that the outputs are factually correct

Explanation

Temperature rescales the output probability distribution before sampling, so higher values flatten it and produce more diverse, less predictable text. Lower values concentrate probability on likely tokens and yield more repeatable output.

Question 25Fundamentals of AI and ML

A team normalizes the entire dataset, including the test rows, before splitting it, then observes suspiciously strong test accuracy. What problem does this illustrate?

  1. A well-calibrated probability output
  2. Correct feature engineering practice
  3. Regularization applied as intended
  4. Data leakage from preprocessing before the split Correct answer.

Explanation

Fitting any transformation on the full dataset lets information about the test rows influence training, which inflates reported performance. Preprocessing steps that learn parameters, such as scaling or imputation, must be fit on the training portion only.

Question 26Fundamentals of AI and ML

What is the main purpose of applying one-hot encoding to a categorical variable?

  1. To replace missing values with the column mean
  2. To rescale the feature into a zero-to-one range
  3. To merge rare categories into one group
  4. To create one binary column per category Correct answer.

Explanation

One-hot encoding turns a categorical variable with k levels into k binary indicator columns, so the model treats the categories as unordered. This prevents a numeric code from implying a ranking between categories.

Question 27Fundamentals of AI and ML

What is a hyperparameter in machine learning?

  1. A setting fixed before training starts Correct answer.
  2. A value learned from the training data during fitting
  3. A column of the dataset used as model input
  4. The error the model makes on unseen data

Explanation

Hyperparameters are configuration choices such as learning rate, tree depth, or number of clusters that are set before training and are not adjusted by the fitting algorithm. Parameters, by contrast, are the internal values that training learns from the data.

Question 28Fundamentals of AI and ML

Which type of output does a regression model produce?

  1. A continuous numeric value Correct answer.
  2. A ranked list of documents
  3. A cluster assignment
  4. A discrete class label

Explanation

Regression models estimate a numeric target along a continuous scale, such as a price, temperature, or duration. Classification models instead assign one of a fixed set of labels.

Question 29Fundamentals of AI and ML

What is the main goal of dimensionality reduction techniques such as PCA?

  1. To expand the feature space for better accuracy
  2. To speed up training by adding hidden layers
  3. To reduce feature count while keeping structure Correct answer.
  4. To remove mislabeled rows from the dataset

Explanation

Dimensionality reduction projects data onto fewer dimensions that retain most of the variance or structure, which can reduce noise and computation. It replaces many correlated features with a smaller set of informative ones.

Question 30Fundamentals of AI and ML

A team has only 600 labeled examples and wants a more reliable estimate of model performance. Why should it use k-fold cross-validation?

  1. It guarantees the model will never overfit the data
  2. It trains the model on every row including test rows
  3. It averages scores across several data splits Correct answer.
  4. It removes the need for any holdout data later

Explanation

With a small dataset, a single split gives a high-variance estimate. k-fold cross-validation rotates which fold is held out and averages the resulting scores, producing a more stable estimate while still evaluating on unseen rows.

Question 31Fundamentals of AI and ML

What does adding an L2 penalty to the loss function encourage?

  1. Smaller weight values overall Correct answer.
  2. Larger weight values so the model fits faster
  3. More training epochs before convergence
  4. Exact zero weights for most features

Explanation

An L2 penalty adds the sum of squared weights to the loss, so the optimizer prefers weights closer to zero. This shrinks the model's sensitivity to individual features and reduces variance.

Question 32Fundamentals of AI and ML

When a decision tree chooses a split, what is it trying to achieve?

  1. Ensure every leaf contains a single class
  2. Minimize the number of leaves in the tree
  3. Make child nodes more pure than the parent Correct answer.
  4. Maximize the impurity of each child node

Explanation

Candidate splits are scored by the reduction in impurity, measured with Gini or entropy, so each child node is more homogeneous in the target than its parent. A split that increased impurity would not be selected.

Question 33Fundamentals of AI and ML

In k-means clustering, what must be specified before the algorithm runs?

  1. The labels for each training point
  2. The number of clusters Correct answer.
  3. The maximum depth of the tree
  4. The learning rate schedule

Explanation

k-means partitions points into a fixed number of clusters, so k must be chosen in advance, for example with the elbow method or silhouette analysis. The algorithm then alternates between assigning points and updating centroids.

Question 34Fundamentals of AI and ML

The F1 score combines precision and recall using which operation?

  1. Simple sum
  2. Geometric mean
  3. Arithmetic mean
  4. Harmonic mean Correct answer.

Explanation

F1 is the harmonic mean of precision and recall, which stays low when either metric is low. That makes it useful when both false positives and false negatives matter.

Question 35Fundamentals of AI and ML

Why is feature scaling important for a k-nearest-neighbors classifier?

  1. Because it reduces the number of training examples
  2. Because k-NN requires features to be normally distributed
  3. Because large-range features dominate distance Correct answer.
  4. Because unscaled data cannot be split into folds

Explanation

k-NN compares points using distances, so a feature measured in thousands outweighs one measured in fractions. Scaling puts features on comparable ranges so each contributes proportionally.

Question 36Fundamentals of AI and ML

What does dropout do during neural network training?

  1. Removes training examples that the model gets wrong
  2. Drops input features with low target correlation
  3. Cuts the learning rate after each epoch
  4. Randomly deactivates units during each update Correct answer.

Explanation

Dropout randomly sets a fraction of unit activations to zero on each training step, which stops units from co-adapting and acts as a regularizer. At inference time the units are used normally.

Question 37Fundamentals of AI and ML

A binary classifier has an ROC AUC of 0.5. What does this indicate?

  1. The model's precision equals its recall
  2. The model achieves exactly 50 percent accuracy
  3. The model separates the two classes perfectly
  4. Its ranking is no better than random guessing Correct answer.

Explanation

AUC is the probability that a randomly chosen positive is scored above a randomly chosen negative; a value of 0.5 means the ranking carries no information. It is a threshold-independent measure of ranking quality.

Question 38Fundamentals of AI and ML

Why does L1 regularization often produce models with many weights exactly equal to zero?

  1. It removes weak features before training begins
  2. It limits the number of training epochs allowed
  3. It rescales every input feature to unit variance
  4. Its constant-slope penalty drives small weights to zero Correct answer.

Explanation

The L1 penalty adds the absolute values of the weights, whose gradient has the same magnitude regardless of weight size, so small weights are pushed all the way to zero. This produces sparse models that behave like feature selection.

Question 39Fundamentals of AI and ML

As the number of features grows while the number of samples stays fixed, why does model performance often degrade?

  1. Labels get corrupted as the feature count rises
  2. The training set grows too large to fit in memory
  3. Gradient descent converges much too quickly
  4. Points grow sparse and distances lose meaning Correct answer.

Explanation

In high dimensions with limited samples, data become sparse and the distances between the nearest and farthest neighbors converge, so similarity-based learning loses discriminative power. Additional features also raise the chance of spurious correlations being fit.

Question 40Fundamentals of AI and ML

A fraud model trained on 2021 transactions performs poorly on 2023 data even though the feature columns are identical. What is the most likely explanation?

  1. The training dataset was far too large
  2. The model uses too few input features
  3. The model was trained for too many epochs
  4. The feature-target relationship drifted over time Correct answer.

Explanation

Concept drift means the statistical relationship between inputs and the target changes over time, so a model fitted on older data no longer matches the current world. Monitoring and periodic retraining are the standard mitigations.

Question 41Fundamentals of Generative AI

Which statement best describes generative AI?

  1. It applies hand-written rules to validate user input.
  2. It retrieves stored documents and returns the exact matching rows.
  3. It sorts existing records into predefined labelled categories.
  4. It learns patterns in data so it can generate new content. Correct answer.

Explanation

Generative models learn the statistical structure of their training data and sample from it to produce new text, images, audio, or code. The defining feature is creation of novel outputs rather than merely assigning labels, looking up records, or applying fixed rules.

Question 42Fundamentals of Generative AI

A large language model generates text by repeatedly performing which operation?

  1. Running a grammar checker that inserts the most likely part of speech.
  2. Searching the internet for the most frequent phrase that follows the prompt.
  3. Copying the longest matching sentence from its training corpus.
  4. Predicting a probability for each possible next token. Correct answer.

Explanation

Autoregressive language models factor the probability of a sequence into a chain of next-token conditionals. At each step the model computes a distribution over the vocabulary conditioned on the tokens so far, then selects one token and appends it to the context.

Question 43Fundamentals of Generative AI

What does the word 'large' refer to in the term large language model?

  1. The maximum length of prompts users may submit.
  2. Its parameter count, often in the billions. Correct answer.
  3. The number of languages it can translate between.
  4. The physical size of the data centre hosting it.

Explanation

The 'large' in large language model refers to scale, chiefly the number of trainable parameters (weights) along with the volume of training data and compute. Modern LLMs commonly have billions of parameters, and capability tends to improve with this scale.

Question 44Fundamentals of Generative AI

What role does a training corpus play when building a generative model?

  1. It holds the user prompts received after deployment.
  2. It supplies the examples the model learns patterns from. Correct answer.
  3. It stores model outputs so they can be replayed later.
  4. It lists the safety rules the model must follow.

Explanation

A training corpus is the collection of source material used during learning; the model adjusts its weights to capture the regularities in that data. Everything the model can reproduce or imitate traces back to patterns present in this corpus.

Question 45Fundamentals of Generative AI

In a generative AI system, what is a prompt?

  1. An error message returned when the model fails to answer.
  2. The internal weight matrix that is updated during training.
  3. The billing unit that is charged for each API call.
  4. The input text that conditions the model's reply. Correct answer.

Explanation

A prompt is the conditioning input supplied at inference time; the model's output distribution depends on it. Changing the prompt changes the response without altering the model's learned weights.

Question 46Fundamentals of Generative AI

Why do language models convert text into tokens before processing it?

  1. Tokens strip grammar so the model focuses only on meaning.
  2. Models compute on numbers, so text maps to integer IDs. Correct answer.
  3. Tokens encrypt the prompt so providers cannot read it.
  4. Tokens shrink the text so it can be stored on disk permanently.

Explanation

Neural networks perform arithmetic on numeric arrays, so text must be segmented and mapped to integer identifiers that index into an embedding table. Tokenization is therefore the bridge between raw characters and the numeric tensors the model operates on.

Question 47Fundamentals of Generative AI

A chatbot confidently states a citation that does not exist. What is this behaviour called?

  1. Hallucination Correct answer.
  2. Regularization
  3. Underfitting
  4. Mode collapse

Explanation

Hallucination is fluent, confident output that is not grounded in fact or in the provided source material. It occurs because the model optimizes for plausible continuations rather than verified truth, and it can be reduced with retrieval and grounding.

Question 48Fundamentals of Generative AI

In a generative adversarial network, what does the discriminator do?

  1. It tunes the learning rate for the generator.
  2. It judges whether a sample is real or generated. Correct answer.
  3. It generates new samples from random noise.
  4. It labels the training set before training begins.

Explanation

A GAN pairs a generator that creates samples with a discriminator that estimates whether a sample came from the real dataset or the generator. Training alternates between them, pushing the generator toward outputs the discriminator cannot distinguish from real data.

Question 49Fundamentals of Generative AI

A team wants more varied, creative responses from a model. Which sampling setting should they raise?

  1. The maximum token limit
  2. Temperature Correct answer.
  3. The batch size
  4. The embedding dimension

Explanation

Temperature rescales the logits before the softmax, so higher values flatten the distribution and make low-probability tokens more likely to be sampled. Raising it increases diversity and creativity, while lowering it makes output more deterministic and focused.

Question 50Fundamentals of Generative AI

What does the self-attention mechanism in a transformer allow each token to do?

  1. Correct spelling errors before generating an answer.
  2. Skip layers that are not needed for the current input.
  3. Store previous conversations on the server for later reuse.
  4. Weigh information from other tokens in the sequence. Correct answer.

Explanation

Self-attention computes query, key, and value projections so that every token can aggregate information from all other tokens, weighted by learned relevance. This contextual mixing is what lets a transformer resolve dependencies such as pronoun reference across long spans.