Compare the exact fitted coefficients produced by absolute and squared penalties under one explicitly defined quadratic objective.
Problem
Context. Fit using data loss and coefficient . Compare L1 penalty with half-scaled L2 penalty .
Task. Derive the minimizing coefficients for each penalized objective and identify which coefficients become exactly zero. Explain how changing the penalty convention or feature scaling changes the comparison.
Constraints. Coordinates are independent, feature units are comparable, and no intercept appears in this fixture. Use subgradients at the absolute-value corner; distinguish objective sparsity from a solver merely returning a small number.
Fix the objective
Use L1 penalty and L2 penalty . An unhalved L2 convention, , doubles its penalty derivative for the same numerical coefficient. Changing summed loss to mean loss also changes relative penalty strength unless rescaled. State intercept treatment and feature scaling in a real fit.
Solve the corner and the smooth condition
For one L1 coordinate, minimize .
- If , stationarity gives , valid for .
- If , it gives , valid for .
- At zero, holds exactly when .
Together these give . For L2, gives .
| Objective | First coordinate | Second coordinate |
|---|---|---|
| Unpenalized | ||
| L1 | , since | |
| Half-scaled L2 |
Learning objective
An L1 corner can touch the loss at an exactly zero coefficient
Derivation
Which boundary has a corner on a coordinate axis?
Change the requirements
New task: reduce L1 strength to while keeping the fitting surface fixed. Move the threshold inward. Check: ; the removed coefficient returns. Use when: validation or a feature-count requirement favors less sparsity.
New task: combine L1 strength with L2 strength . Threshold, then shrink: , giving . Use when: sparse selection and correlated-feature stability both matter. Boundary: this reference has independent coordinates; correlated designs require solving the coupled objective.
Failure: for , step size one sends to , then alternates between and . The optimum is zero; fixed-step subgradient updates need not reach it. Numerical jitter is not an exact-sparsity method.
Reconstruct: multiply a feature by while preserving its prediction contribution. Is its coefficient penalty unchanged?
Answer
No. Its coefficient becomes one hundredth as large. The same contribution receives one hundredth the L1 penalty and one ten-thousandth the L2 penalty. Standardize features or justify scale-specific penalties.
Priors and solver choices
Independent Laplace and Gaussian priors yield L1 and L2 MAP penalties under matching likelihood units and scale. MAP is a point estimate, not the whole posterior. Intercept exclusions and rescaled features alter that interpretation.
Proximal gradient methods apply soft thresholding after the smooth-loss step; their threshold includes step size. ISTA, FISTA, coordinate descent, and specialized solvers handle nonsmoothness explicitly. The separable closed form does not extend unchanged to an arbitrary correlated design. See Parikh and Boyd’s Proximal Algorithms.
Keep optimizer effects separate
For frozen coordinate preconditioners, a coupled L2 gradient is preconditioned; AdamW’s shrinkage is separate. The decay trace computes that difference. Neither procedure is universally preferable for every statistical objective.
Optimizer noise, architecture, and early stopping can bias fitted solutions without an explicit penalty. Their generalization effects and relative importance depend on workload and training protocol.
Common follow-up
When should decay be disabled? Compare matched validation outcomes, parameter groups, schedules, and deployment constraints, including a zero-decay control. Model size alone does not prescribe a universal coefficient.
Related: regularization and Adam and AdamW.