Lesson overview | Previous part | Lesson overview
Convex Optimization: Part 7: Applications in Machine Learning to References
7. Applications in Machine Learning
This block develops applications in machine learning for Convex Optimization. It keeps the scope local to this section while pointing forward when a neighboring topic owns the full treatment.
7.1 logistic regression and softmax regression as convex baselines
In this section, convex sets is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "logistic regression and softmax regression as convex baselines" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, convex sets is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where convex sets can be computed directly and compared with theory.
- A logistic-regression or softmax objective where convex sets affects optimization but the model remains interpretable.
- A transformer training diagnostic where convex sets appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating convex sets as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving convex sets, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes convex sets visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about convex sets is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
7.2 support-vector machines through primal and dual convex programs
In this section, convex combinations is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "support-vector machines through primal and dual convex programs" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, convex combinations is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where convex combinations can be computed directly and compared with theory.
- A logistic-regression or softmax objective where convex combinations affects optimization but the model remains interpretable.
- A transformer training diagnostic where convex combinations appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating convex combinations as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving convex combinations, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes convex combinations visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about convex combinations is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
7.3 nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition
In this section, convex functions is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, convex functions is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where convex functions can be computed directly and compared with theory.
- A logistic-regression or softmax objective where convex functions affects optimization but the model remains interpretable.
- A transformer training diagnostic where convex functions appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating convex functions as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving convex functions, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes convex functions visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about convex functions is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
7.4 regularized empirical risk minimization with explicit certificates
In this section, Jensen inequality is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "regularized empirical risk minimization with explicit certificates" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, Jensen inequality is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where Jensen inequality can be computed directly and compared with theory.
- A logistic-regression or softmax objective where Jensen inequality affects optimization but the model remains interpretable.
- A transformer training diagnostic where Jensen inequality appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating Jensen inequality as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving Jensen inequality, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes Jensen inequality visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about Jensen inequality is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
7.5 Diagnostic checklist for real experiments
In this section, first-order characterization is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "Diagnostic checklist for real experiments" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, first-order characterization is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where first-order characterization can be computed directly and compared with theory.
- A logistic-regression or softmax objective where first-order characterization affects optimization but the model remains interpretable.
- A transformer training diagnostic where first-order characterization appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating first-order characterization as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving first-order characterization, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes first-order characterization visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about first-order characterization is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
8. Implementation and Diagnostics
This block develops implementation and diagnostics for Convex Optimization. It keeps the scope local to this section while pointing forward when a neighboring topic owns the full treatment.
8.1 Minimal NumPy experiment for Lagrangian duality
In this section, Jensen inequality is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "Minimal NumPy experiment for Lagrangian duality" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, Jensen inequality is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where Jensen inequality can be computed directly and compared with theory.
- A logistic-regression or softmax objective where Jensen inequality affects optimization but the model remains interpretable.
- A transformer training diagnostic where Jensen inequality appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating Jensen inequality as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving Jensen inequality, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes Jensen inequality visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about Jensen inequality is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
8.2 Monitoring signal for weak duality
In this section, first-order characterization is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "Monitoring signal for weak duality" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, first-order characterization is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where first-order characterization can be computed directly and compared with theory.
- A logistic-regression or softmax objective where first-order characterization affects optimization but the model remains interpretable.
- A transformer training diagnostic where first-order characterization appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating first-order characterization as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving first-order characterization, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes first-order characterization visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about first-order characterization is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
8.3 Failure signature for strong duality
In this section, second-order characterization is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "Failure signature for strong duality" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, second-order characterization is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where second-order characterization can be computed directly and compared with theory.
- A logistic-regression or softmax objective where second-order characterization affects optimization but the model remains interpretable.
- A transformer training diagnostic where second-order characterization appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating second-order characterization as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving second-order characterization, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes second-order characterization visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about second-order characterization is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
8.4 Framework-level implementation pattern
In this section, smoothness is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "Framework-level implementation pattern" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, smoothness is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where smoothness can be computed directly and compared with theory.
- A logistic-regression or softmax objective where smoothness affects optimization but the model remains interpretable.
- A transformer training diagnostic where smoothness appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating smoothness as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving smoothness, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes smoothness visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about smoothness is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
8.5 Reproducibility and logging checklist
In this section, strong convexity is treated as a concrete optimization object rather than a slogan. The goal is to understand how it changes the objective, the update rule, the convergence story, and the diagnostics a practitioner should inspect when training a modern model. For Convex Optimization, the phrase "Reproducibility and logging checklist" means a precise mathematical habit: state the assumptions, write the update, identify what can be measured, and connect the result to a real AI training decision.
Definition.
For this section, strong convexity is the part of Convex Optimization that controls how the objective, feasible region, or update rule behaves under the assumptions currently in force.
Symbolically, we track it through , , , , and any auxiliary state used by the algorithm.
Examples:
- A small synthetic quadratic where strong convexity can be computed directly and compared with theory.
- A logistic-regression or softmax objective where strong convexity affects optimization but the model remains interpretable.
- A transformer training diagnostic where strong convexity appears through gradient norms, update norms, curvature, or validation loss.
Non-examples:
- Treating strong convexity as a hyperparameter recipe without checking the objective assumptions.
- Inferring global behavior from one noisy minibatch when the section requires a population or full-batch statement.
Useful formula:
Proof sketch or reasoning pattern:
Start with the local model around , isolate the term involving strong convexity, and use the section assumptions to bound the change in objective value. If the assumption is geometric, the proof turns a picture into an inequality. If the assumption is stochastic, the proof takes conditional expectation before applying the bound. If the assumption is algorithmic, the proof checks that the proposed update is a descent, projection, or preconditioning step. This pattern is reusable across optimization theory.
Implementation consequence:
- Log a metric that makes strong convexity visible; otherwise a training run can fail while the scalar loss hides the cause.
- Compare the measured update with the mathematical update below before blaming data or architecture.
- Keep units straight: parameter norm, gradient norm, update norm, objective value, and validation metric are different objects.
Diagnostic questions:
- Which assumption about strong convexity is most fragile in the current training setup?
- What number would you log to catch the failure one thousand steps before divergence?
AI connection:
- logistic regression and softmax regression as convex baselines.
- support-vector machines through primal and dual convex programs.
- nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition.
- regularized empirical risk minimization with explicit certificates.
Local scope boundary: This subsection may reference neighboring material, but the full canonical treatment stays in its own folder. For example, stochastic gradient noise belongs to Stochastic Optimization, external schedule shapes belong to Learning Rate Schedules, and cross-entropy as an information measure belongs to Cross-Entropy.
9. Common Mistakes
| # | Mistake | Why It Is Wrong | Fix |
|---|---|---|---|
| 1 | Using a recipe without checking assumptions | Optimization guarantees depend on smoothness, convexity, stochasticity, or feasibility assumptions. | Write the assumptions next to the update rule before choosing hyperparameters. |
| 2 | Confusing objective decrease with validation improvement | The optimizer sees the training objective; validation behavior also depends on generalization and data split quality. | Track objective, train metric, validation metric, and update norm separately. |
| 3 | Treating all norms as interchangeable | The geometry changes when the norm changes, especially for constraints and regularizers. | State whether you use , , Frobenius, spectral, or another norm. |
| 4 | Ignoring scale | Learning rates, penalties, curvature, and gradient norms are all scale-sensitive. | Normalize units and inspect effective update size . |
| 5 | Overfitting to a single seed | Optimization can look stable for one seed and fail under another. | Run small seed sweeps for important claims. |
| 6 | Hiding instability behind smoothed plots | A moving average can hide spikes, divergence, and bad curvature events. | Plot raw metrics alongside smoothed metrics. |
| 7 | Using test data during tuning | This contaminates the final evaluation. | Reserve test data until after model and hyperparameter selection. |
| 8 | Assuming large models make theory irrelevant | Large models often make diagnostics more important because failures are expensive. | Use theory to decide what to log, not to pretend every theorem applies exactly. |
| 9 | Mixing optimizer state with model state carelessly | State corruption changes the effective algorithm. | Checkpoint parameters, gradients if needed, optimizer moments, scheduler state, and random seeds. |
| 10 | Not checking numerical precision | BF16, FP16, FP8, and accumulation choices can change the observed optimizer. | Cross-check suspicious runs against higher precision on a small batch. |
10. Exercises
- Exercise 1 [*] - Convex Functions (a) Define convex functions using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 2 [*] - First-Order Characterization (a) Define first-order characterization using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 3 [*] - Smoothness (a) Define smoothness using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 4 [] - Condition Number** (a) Define condition number using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 5 [] - Linear Programs** (a) Define linear programs using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 6 [] - Semidefinite Programs** (a) Define semidefinite programs using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 7 [] - Proximal Operators** (a) Define proximal operators using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 8 [*] - Weak Duality** (a) Define weak duality using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 9 [*] - Slater Condition** (a) Define Slater condition using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
- Exercise 10 [*] - Logistic Regression Convexity** (a) Define logistic regression convexity using the notation of this repository. (b) Give three valid examples and two non-examples. (c) Derive the relevant update or inequality shown below.
(d) Implement a NumPy check on a synthetic two-dimensional objective. (e) Explain what metric you would log in a real LLM or fine-tuning run.
11. Why This Matters for AI (2026 Perspective)
| Concept | AI Impact |
|---|---|
| convex sets | logistic regression and softmax regression as convex baselines |
| convex combinations | support-vector machines through primal and dual convex programs |
| convex functions | nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition |
| Jensen inequality | regularized empirical risk minimization with explicit certificates |
| first-order characterization | logistic regression and softmax regression as convex baselines |
| second-order characterization | support-vector machines through primal and dual convex programs |
| smoothness | nuclear-norm relaxations behind low-rank matrix recovery and LoRA intuition |
| strong convexity | regularized empirical risk minimization with explicit certificates |
| condition number | logistic regression and softmax regression as convex baselines |
| convex problem classes | support-vector machines through primal and dual convex programs |
12. Conceptual Bridge
Convex Optimization sits inside a chain. Earlier sections give the calculus, probability, and linear algebra needed to write the objective and interpret the update. Later sections use this material to reason about noisy gradients, adaptive state, regularization, tuning, schedules, and finally information-theoretic losses.
Backward link: Chapters 5-7 supply gradients, Hessians, probability, estimation, and empirical risk.
Forward link: Gradient Descent uses this section as a building block.
+------------------------------------------------------------+
| Chapter 8: Optimization |
| >> 01-Convex-Optimization Convex Optimization |
| 02-Gradient-Descent Gradient Descent |
| 03-Second-Order-Methods Second-Order Methods |
| 04-Constrained-Optimization Constrained Optimization |
| 05-Stochastic-Optimization Stochastic Optimization |
| 06-Optimization-Landscape Optimization Landscape |
| 07-Adaptive-Learning-Rate Adaptive Learning Rate |
| 08-Regularization-Methods Regularization Methods |
| 09-Hyperparameter-Optimization Hyperparameter Optimization |
| 10-Learning-Rate-Schedules Learning Rate Schedules |
+------------------------------------------------------------+
Appendix A. Extended Derivation and Diagnostic Cards
References
- Boyd and Vandenberghe, Convex Optimization.
- Nesterov, Introductory Lectures on Convex Optimization.
- Shalev-Shwartz and Ben-David, Understanding Machine Learning.
- Bubeck, Convex Optimization: Algorithms and Complexity.
- Goodfellow, Bengio, and Courville, Deep Learning.
- Bottou, Curtis, and Nocedal, Optimization Methods for Large-Scale Machine Learning.
- PyTorch optimizer and scheduler documentation.
- Optax documentation for composable optimizer transformations.