ML MATH & LINEAR ALGEBRA · INTERVIEW QUESTION
What is the difference between model parameters and hyperparameters? Give examples for GPT and XGBoost.
🟢 beginner · Numerical Methods
Hint: If it's updated by backprop/optimizer → parameter. If you set it to control training → hyperparameter.
Answer
Model parameters are learned from data during training via optimization (backprop). Hyperparameters are set before training to control the learning process. GPT parameters: token embedding matrix, attention projection weights (W_Q, W_K, W_V), FFN weights, LayerNorm scale/shift. GPT hyperparameters: number of layers, hidden size (d_model), number of attention heads, context length, learning rate schedule. XGBoost parameters: split thresholds, feature indices at splits, leaf weights, tree structure. XGBoost hyperparameters: n_estimators, max_depth, learning rate (eta), subsample ratio, colsample_bytree. Nuance: BatchNorm running mean/variance are estimated from data but not via gradient descent — they're part of the trained model state but not 'parameters' in the optimization sense.
Likely follow-up: Are dropout rate and batch size parameters or hyperparameters?
Related questions
- Explain the KKT conditions and their role in SVM optimization.
- What is the difference between eigenvalues and singular values?
- Explain the role of SVD in PCA. How does truncated SVD relate to dimensionality reduction?
- Derive the gradient of the cross-entropy loss for softmax output.
- What is the difference between convex and non-convex optimization? Why does it matter in deep learning?