Why do weights become zero right away with L1 regularization (geometric interpretation)?
Asked at
AI answer
L1 regularization adds a penalty (\lambda\sum_j |w_j|) to the loss function. Geometrically, the set of solutions with the same L1 penalty is a diamond (in two dimensions) with vertices on the axes. The level sets of the original loss function expand until they first touch this region; the point of contact is often a vertex where one or more coordinates are zero. Therefore, L1 often produces sparse weights.
The same result follows from the optimality condition: for a nonzero weight, the penalty adds a gradient of (\lambda,\mathrm{sign}(w_j)), while at zero the subgradient lies in the interval ([-\lambda,\lambda]). If the loss gradient along a coordinate is sufficiently small, the optimality condition is satisfied at (w_j=0). This does not mean that every weight will necessarily become zero: the result depends on the data and the strength of regularization.
Also asked at СБЕР
Similar questions
- Could you explain L1 and L2 regularization in more detail?
- How do L1 and L2 regularization behave when trained on two highly correlated features?
- Have you heard of the probabilistic interpretation of L1 and L2 regularization?
- What regularization approaches do you know besides L1, L2, and Elastic Net?
- How would this show up in gradient descent with these two correlated features—what would the model try to do?