Victor Sanches Portella
ime.usp.br/~victorsp
junto de Frederik Kunstner, Nick Harvey, e Mark Schmidt
Março, 2026
Treinar um modelo de ML normalmente é modelado via optimização irrestrita
Modelos de ML tendem a serem GRANDES
\(d\) é GRANDE
Métodos de primeira ordem (ex: usando gradientes) se encaixam
(Ainda mais as versões estocásticas)
\(O(d)\) tempo e espaço por iteração é preferível
\(f\) é convexa
Não é o caso de Redes Neurais
Métodos ainda úteis na teoria e prática
Mais condições para obtermos taxas de convergência:
\(L\)-suave
\(\mu\)-fortemente convexa
"Fácil de otimizar"
Qual tamanho de passo \(\alpha\) escolher?
Núm. de condição
\(\kappa\) Grande \(\implies\) Função difícil
Condição de Armijo
Se sabemos \(L\), \(\alpha = 1/L\) sempre funciona
a é ótima
E se não conhecemos \(L\)?
"Descent Lemma"
Ideia: Escolher \(\alpha\) grande and checar se "Descent lemma" vale
(Localmente \(1/\alpha\)-suave)
no pior caso
Busca em linha: testa se \(\alpha_{\max}/2\) nos dá progresso o suficiente:
Se falhar, CORTE todos os candidatos maiores que \(\alpha_{\max}/2\)
Converge em 1 passo
\(P\)
Conseguimos calcular \(P\) automaticamente?
"Se adaptar à \(f\)"
Precondicionador \(P\)
Podemos convergir mais rápido com um precondicionador (diagonal)
(Quasi-)Newton
Convergência superlinear perto da sol.
O que é um bom \(P\)?
Garantias globais fracas
Online Learning
Garantias formais até no caso adversarial
Muito conservador (ex: AdaGrad)
"Primos" (ex: Adam) tem poucas garantias
Hypergradient
Trata achar \(P\) como um prob. de otimização
Instável e quase zero teoria
"AdaGrad inspired an incredible number of clones, most of them with similar, worse, or no regret guarantees.(...) Nowadays, [adaptive] seems to denote any kind of coordinate-wise learning rates that does not guarantee anything in particular."
Francesco Orabona in "A Modern Introduction to Online Learning", Sec. 4.3
adaptive methods
only guarantee (globally)
In Smooth
and Strongly Convex optimization,
Should be better if there is a good Preconditioner \(P\)
Online Learning
Smooth Optimization
1 step-size
\(d\) step-sizes
(diagonal preconditioner )
Backtracking Line-search
Diagonal AdaGrad
Multidimensional Backtracking
Scalar AdaGrad
(and others)
(and others)
(non-smooth optmization)
Tamanho de passo ótimo: o maior que garante progresso
Precondicionador ótimo: maior (??) que garante progresso
\(L\)-suave
\(\mu\)-fort. convexa
\(f\) é
and
Precondicionador Diagonal Ótimo
\(\kappa_* \leq \kappa\), idealmente \(\kappa_* \ll \kappa\)
Sobre matrizes diagonais
minimiza \(\kappa_*\) tal que
Busca em Linha
Vale a pena se \(\sqrt{2d} \kappa_* \ll 2 \kappa\)
Multidimensional Backtracking
(nosso alg.)
# backtracks \(\lesssim\)
# backtracks \(\leq\)
Busca em linha:
"Progresso como se \(f\) fosse
\(\frac{2}{\alpha_{\max}}\)-smooth"
Se não, CORTA candidatos maiores que \(\alpha_{\max}/2\)
Testa se \(\alpha_{\max}/2\) garante progresso suficiente:
Passo candidatos: intervalo \([0, \alpha_{\max}]\)
Busca de precondicionador:
Testa se \(P\) garante progresso o suficiente
Precondicionadores candidatos: diagonais contidas num hipercubo
Se não, CORTE tudo maior que \(P\)
"Progresso se \(f\) fosse
\(P\)-suave"
Se \(P\) não garante progresso suficiente,
Quais candidatos podemos jogar fora?
\(P \) garante progresso suficiente \(\iff\) \(h(P) \leq 0\)
Convexidade \(\implies\)
induz um hiperplano separador
"Hypergradient"
Ideia principal
Se \(P\) não garante progresso suficiente,
Quais candidatos podemos jogar fora?
\(P \) garante progresso suficiente \(\iff\) \(h(P) \leq 0\)
\(P\) perto da origem \(\implies\) queda de volume em caso de corte
\(P\) perto da borda \(\implies\) melhor taxa de convergência
Elipisoides ao resgate!
that maximizes
that maximizes
\(\Omega(d^3)\) de tempo por iteração
O problema é muito simétrico!
\(O(d)\) por iteração
Trabalhos seguintes com novas ideias para otimização adaptativa
Um uso de "hypergradients" baseado em teoria
ML Opt encontra Métodos de corte
arxiv.org/abs/2306.02527
Training/Fitting a ML model is often cast a (uncontrained) optimization problem
Usually in ML, models tend to be BIG
\(d\) is BIG
Running time and space \(O(d)\) is usually the most we can afford
First-order (i.e., gradient based) methods fit the bill
(stochastic even more so)
Usually \(O(d)\) time and space per iteration
\(f\) is convex
Not the case with Neural Networks
Still quite useful in theory and practice
More conditions on \(f\) for rates of convergence
\(L\)-smooth
\(\mu\)-strongly convex
Which step-size \(\alpha\) should we pick?
Condition number
\(\kappa\) Big \(\implies\) hard function
If we know \(L\), picking \(1/L\) always works
and is worst-case optimal
What if we do not know \(L\)?
Locally flat \(\implies\) we can pick bigger step-sizes
If \(f\) is \(L\) smooth, we have
"Descent Lemma"
Idea: Pick \(\eta\) big and see if the "descent condition" holds
(Locally \(1/\eta\)-smooth)
Converges in 1 step
\(P\)
\(O(d)\) space and time \(\implies\) \(P\) diagonal (or sparse)
Can we find a good \(P\) automatically?
"Adapt to \(f\)"
Preconditioer \(P\)
Preconditioner at round \(t\)
AdaGrad from Online Learning
or
Better guarantees if functions are easy
while preserving optimal worst-case guarantees in Online Learning
Attains linear rate in classical convex opt (proved later)
But... Online Learning is too adversarial, AdaGrad is "conservative"
In OL, functions change every iteration adversarially
But... Online Learning is too adversarial, AdaGrad is "conservative"
"Fixes": Adam, RMSProp, and other workarounds
"AdaGrad inspired an incredible number of clones, most of them with similar, worse, or no regret guarantees.(...) Nowadays, [adaptive] seems to denote any kind of coordinate-wise learning rates that does not guarantee anything in particular."
Francesco Orabona in "A Modern Introduction to Online Learning", Sec. 4.3
Idea: look at step-size/preconditioner choice as an optimization problem
Gradient descent on the hyperparameters
How to pick the step-size of this? Well...
Little/ No theory
Unpredictable
... and popular?!
Newton's method
is usually a great preconditioner
Superlinear convergence
...when \(\lVert x_t - x_*\rVert\) small
Newton may diverge otherwise
Using step-size with Newton and QN method ensures convergence away from \(x_*\)
Worse than GD
\(\nabla^2 f(x)\) is usually expensive to compute
should also help
Quasi-Newton Methods, e.g. BFGS
(Quasi-)Newton: needs Hessian, can be slower than GD
Hypergradient methods: purely heuristic, unstable
Online Learning Algorithms: Good but pessimistic theory
at least for smooth optimization it seems pessimistic...
Online Learning
Smooth Optimization
1 step-size
\(d\) step-sizes
(diagonal preconditioner )
Backtracking Line-search
Diagonal AdaGrad
Coordinate-wise
Coin Betting
(non-smooth opt?)
Multidimensional Backtracking
Scalar AdaGrad
Coin-Betting
What does it mean for a method to be adaptive?
Busca em linha: testa se \(\alpha_{max}/2\) garante progresso suficiente:
Armijo condition
Se não, CORTA candidatos maiores que \(\alpha_{\max}/2\)
Busca por precondicionador:
Testamos se \(P\) garante progresso suficiente:
Espaço de candidatos: matrizes com diagonais em um cubo
Se não, CORTA candidatos maiores que \(P\)