L2 shrinks every weight smoothly toward zero; L1 drives many weights to exactly zero, which is automatic feature selection. The geometric reason L1 hits the corners is the part interviewers actually want, plus the call on when sparsity beats smooth shrinkage.
L1 vs L2 regularization: what does each do to the weights, why does L1 induce sparsity, and when would you prefer L1?
L2 shrinks every weight smoothly toward zero; L1 drives many weights to exactly zero, which is automatic feature selection. The geometric reason L1 hits the corners is the part interviewers actually want, plus the call on when sparsity beats smooth shrinkage.
Updated Aug 2026 · Grounded in real Forward Deployed Engineer interview loops and written to a senior-engineer editorial bar.
The screen is whether the candidate can explain WHY L1 zeroes weights (the constraint region has corners, and the loss contour touches them; equivalently the L1 gradient is a constant pull that can reach zero, while L2's pull vanishes as the weight shrinks) rather than just asserting 'L1 is sparse.' Strong candidates tie L1 to feature selection and interpretability, L2 to handling correlated features and smooth shrinkage, and name elastic net as the practical compromise. The reserved follow-up is 'what happens with correlated features': L1 arbitrarily picks one and zeroes the rest, L2 spreads weight across them, which is why elastic net exists.
No comments yet — be the first to share your approach.
