Reducing Overfitting — Applying L2 Regularization First
Exhibit
Refer to the exhibit.
{
"model": {
"layers": [
{"type": "Dense", "units": 256, "activation": "relu"},
{"type": "Dropout", "rate": 0.5},
{"type": "Dense", "units": 128, "activation": "relu"},
{"type": "Dropout", "rate": 0.5},
{"type": "Dense", "units": 10, "activation": "softmax"}
],
"optimizer": {"type": "Adam", "learning_rate": 0.001},
"loss": "categorical_crossentropy"
}
}A data scientist notices the model overfits. Which change to the exhibit's configuration would most likely reduce overfitting?
⚠ Common exam trap
CompTIA often tests the misconception that increasing model capacity (more units or layers) or removing regularization always improves performance, when in fact these changes exacerbate overfitting; candidates must recognize that regularization techniques like L2 are specifically designed to penalize complexity and reduce overfitting.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Add L2 regularization to dense layers
Adding L2 regularization to dense layers penalizes large weights by adding a squared magnitude term to the loss function, which forces the model to learn simpler patterns and reduces overfitting. This directly addresses the core issue of the model memorizing noise in the training data.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Remove dropout layers
Why it's wrong here
Removing dropout layers eliminates the regularisation that randomly deactivates units during training, increasing overfitting rather than reducing it. Dropout is tempting to strip when training accuracy lags, and it would be correct to remove only if the model were underfitting instead.
- ✗
Increase learning rate to 0.01
Why it's wrong here
Raising the learning rate to 0.01 makes optimisation steps larger, which can destabilise convergence and worsen generalisation rather than reduce overfitting. A higher rate is tempting when training is slow, and it would be correct for escaping a plateau or speeding convergence on an underfit model.
- ✓
Add L2 regularization to dense layers
Why this is correct
Adding L2 regularization to dense layers penalises large weights in the loss function, reducing the network's capacity to fit training noise. This directly counteracts the overfitting observed in the exhibit's configuration without altering the architecture.
- ✗
Increase units in the first dense layer to 512
Why it's wrong here
Increasing the first dense layer to 512 units raises model capacity, giving the network more parameters to memorise training samples and worsening overfitting. Wider layers are tempting when accuracy is low, and would be correct if the model were underfitting due to insufficient capacity.
About these practice questions
This AI0-001 question is part of Courseiva's 962-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI0-001 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI0-001 exam.