Memory-Efficient Gradient Unrolling for Large-Scale Bi-level Optimization

Bi-level optimization (BO) has become a fundamental mathematical framework for addressing hierarchical machine learning problems. As deep learning models continue to grow in size, the demand for scalable bi-level optimization solutions has become increasingly critical. Traditional gradient-based bi-level optimization algorithms, due to their inherent characteristics, are ill-suited to meet the demands of large-scale applications. In this paper, we introduce $\textbf{F}$orward $\textbf{G}$radient $\textbf{U}$nrolling with $\textbf{F}$orward $\textbf{F}$radient, abbreviated as $(\textbf{FG})^2\textbf{U}$, which achieves an unbiased stochastic approximation of the meta gradient for bi-level optimization. $(\text{FG})^2\text{U}$ circumvents the memory and approximation issues associated with classical bi-level optimization approaches, and delivers significantly more accurate gradient estimates than existing large-scale bi-level optimization approaches. Additionally, $(\text{FG})^2\text{U}$ is inherently designed to support parallel computing, enabling it to effectively leverage large-scale distributed computing systems to achieve significant computational efficiency. In practice, $(\text{FG})^2\text{U}$ and other methods can be strategically placed at different stages of the training process to achieve a more cost-effective two-phase paradigm. Further, $(\text{FG})^2\text{U}$ is easy to implement within popular deep learning frameworks, and can be conveniently adapted to address more challenging zeroth-order bi-level optimization scenarios. We provide a thorough convergence analysis and a comprehensive practical discussion for $(\text{FG})^2\text{U}$, complemented by extensive empirical evaluations, showcasing its superior performance in diverse large-scale bi-level optimization tasks. Code is available at https://github.com/ShenQianli/FG2U.

Paper

Similar papers

Peer review

Reviewer J9FE5/10 · confidence 4/52024-07-10

Summary

This paper studies scalable bi-level optimization problems and points out the limitations of most traditional methods. Among all, to mitigate the high memory cost issue of the GU method, it proposes (FG)2U such that the space consumption is reduced to $\mathcal{O}(M)$ from $\mathcal{O}(MN)$. Convergence analysis is provided and extensive experiments show the benefit of the algorithm.

Strengths

1. The presentation is great and I feel relaxed to read this paper. 2. The experiment is extensive including both small and large scale settings.

Weaknesses

1. The memory cost is reduced but the computational cost seems to increase significantly. The computational cost takes the order of $\mathcal{O}(KTN)$ since $b=\mathcal{O}(N)$. This feels unrealistic as well in the large-scale application when $N$ is large. 2. Based on the previous question, I checked the choice of $b$ in the experiment, which is small. How do authors tune this parameter? Is there any ablation study on it? 3. In terms of the discussion in Appendix B.2, IF methods also require $\mathcal{O}(M)$ space using some approximation tricks. There indeed exist approximation errors in IF methods. However, normally, the approximation errors can be controlled to be very small based on the hyperparameter selections. Thus, IF methods seem suitable for scalable bi-level optimization problems to some extent. Do authors have time to include IF methods in Table 2? 4. The algorithm is deterministic without consideration of the batch data. Can authors provide some insights in stochastic settings? For example, can the unbiasedness of the hypergradient estimator still be satisfied, or is there any requirement for the batch size? 5. Can authors provide real space consumption in the comparison (Table 1, Table 2)?

Questions

See weakness part.

Rating

5

Confidence

4

Soundness

2

Presentation

3

Contribution

2

Limitations

See weakness part.

Reviewer 4Mx85/10 · confidence 4/52024-07-10

Summary

The paper introduces a method called Forward Gradient Unrolling with Forward Gradient, abbreviated as (FG)²U, which is designed to address the large memory requirements of forward method in bi-level optimization in large-scale machine learning model

Strengths

1. The method significantly reduces memory overhead compared to traditional gradient unrolling methods, making it suitable for large-scale applications. 2. Can be easily implemented within popular deep learning frameworks and adapted to various optimization problems.

Weaknesses

1. The proposed method introduces additional computational complexity. Can the author give an analysis of the complexity? 2. The convergences analysis is for the problem (2) not the original problem (1). 3. More large scale datasets are needed.

Questions

see weakness

Rating

5

Confidence

4

Soundness

2

Presentation

3

Contribution

2

Limitations

NA

Reviewer cwe56/10 · confidence 3/52024-07-11

Summary

This paper presents a novel gradient unrolling algorithm for bi-level optimization. The authors highlight that existing methods for calculating meta gradients in the literature are not memory efficient. They propose a sampling-based method, (FG)^2U, to estimate the meta gradient. This approach approximates the meta gradient by multiplying it with a random rank-1 matrix, thereby simplifying the Forward Gradient Unrolling (FGU) scheme. The paper includes discussions on sampling efficiency, convergence analysis, and numerical experiments for (FG)^2U.

Strengths

- The proposed method (FG)^2U is simple and easy to implement. - The writing is clear and easy to follow. - The theoretical results clearly demonstrate the relationship between convergence, sampling batch size, and parameter space size. - The three experiments, data condensation, LM fine-tuning, and PDE recovery, show the wide range of applications of bi-level optimization and the proposed method (FG)^2U.

Weaknesses

A major concern is the theoretical dependence on the parameter dimension $N$. Theorem 3.4 indicates that the convergence rate depends linearly on N. It means that - With a fixed batch size, convergence on large-scale applications would be slow (vanilla (FG)^2U without additional techniques). - With an $O(N)$ batch size, convergence is satisfactory, but the memory cost grows as $O(MN)$, similar to FGU. - While the authors mention that (FG)^2U allows parallelization to mitigate computational overhead, it seems that the calculations of FGU (4) also permit parallelization, correct? Specifically, $d \theta / d \phi$ can be computed in parallel as $d \theta[1] / d \phi, d \theta[2] / d \phi, d \theta[3] / d \phi, \cdots$

Questions

Regarding the formula for data condensation (17) and related formulas in the appendix: should it be minimizing over ${\mathcal{D}_c}$ instead of minimizing over ${\mathcal{D}_o}$?

Rating

6

Confidence

3

Soundness

3

Presentation

4

Contribution

3

Limitations

The paper appears to have no potential negative societal impact. The authors discussed the limitations in the Appendix H.

Reviewer 4Mx82024-08-11

Response to author

Thank you for the rebuttal, the authors have addressed all my concerns. I will increase my score.

Reviewer J9FE2024-08-11

Thanks for the response

I thank the authors for their response. Some of my concerns have been addressed. However, I am still slightly concerned about the theoretical guarantee on the problem dimension. There are also some works on bilevel optimization using zeroth-order types of methods. Maybe the authors would like to include them and provide a comparison. I keep my current score. Best, Reviewer

Authorsrebuttal2024-08-12

Thanks again for your valuable feedback

Thank you for your response. We regret to hear that some concerns remain. Regarding the convergence guarantee dependent on the problem dimension, we acknowledge that further improvement of the theoretical results would require assumptions that may be impractical. In the field of backpropagation-free optimization (FG/ZO), the gap between dimension-dependent theoretical results and the significantly positive empirical outcomes in large-scale cases remains an open question. We hope that future research will help bridge this gap. Regarding BO + ZO, we followed the reviewer’s suggestions and identified several related works [1][2][3]. Given the limited time remaining in the discussion period, we are unable to conduct a comprehensive empirical study of these methods. However, we offer some preliminary comments here and will seriously consider incorporating comparisons in our revised paper. 1. [1][3] propose utilizing zeroth-order Hessian/Jacobian approximations for IF-based methods, whereas our work focuses on GU-based methods. It is important to note that zeroth-order approximation cannot eliminate the inherent bias introduced by IF-based methods, and the theoretical guarantees provided in these works are also dimension-dependent. 2. [2] employs zeroth-order optimization in a GU manner. However, [2] is limited to Neural Architecture Search rather than universal BO. Additionally, the inner problem considered in [2] is differentiable (white box), while our exploration of $($FG$)^2$U-ZO is in the more challenging black-box setting. We would like to once again extend our sincere thanks for your valuable feedback. We remain open to answering any further questions during the remaining time of the discussion period. $ $ [1] On the Convergence Theory for Hessian-Free Bilevel Algorithms, https://arxiv.org/abs/2110.07004 [2] ZARTS: On Zero-order Optimization for Neural Architecture Search, https://arxiv.org/abs/2110.04743 [3] Fully Zeroth-Order Bilevel Programming via Gaussian Smoothing, https://arxiv.org/pdf/2404.00158

Reviewer J9FE2024-08-12

Thank the authors for their further clarifications. Best, Reviewer

Reviewer cwe52024-08-12

Response to authors

I greatly appreciate the efforts made by the authors during the rebuttal phase, including their responses to my questions and the inclusion of additional experimental results. However, my primary theoretical concern, which I raised in the initial review, remains only partially addressed. The statement "Plan A requires exactly $M$ threads" may not be entirely accurate. It is possible to adaptively allocate the $M$ calculation tasks based on the constraints of the hardware. For instance, if $M=5$, one could opt for 3 threads and distribute the tasks as $[1,1,3]$, rather than being limited to $[1,1,1,1,1]$. This flexibility also casts doubt on the assertion that "the memory cost of $\text{(FG)}^2\text{U}$ can be more manageable than FGU and RGU," as one could potentially implement simple variants of FGU or RGU. Of course, as the authors have noted, these analyses are merely upper bounds. The actual performance in the experiments presented by the authors appears promising. Therefore, I will keep my positive score.

Authorsrebuttal2024-08-12

Thanks again for your valuable feedback

Thank you for your response and for the recognition of our work. Regarding the convergence guarantee dependent on the problem dimension, we acknowledge that further improvement of the theoretical results would require assumptions that may be impractical. In the field of backpropagation-free optimization (FG/ZO), the gap between dimension-dependent theoretical results and the significantly positive empirical outcomes in large-scale cases remains an open question. We hope that future research will help bridge this gap. Regarding the parallelization plan, the essential information we intended to convey in our rebuttal response is that "a special parallelization plan is covered by $($FG$)^2$U as a universal framework." We acknowledge that we may have overstated the advantages of $($FG$)^2$U over FGU and RGU in terms of memory management, as pointed out by the reviewer. We will exercise caution with related statements in our revised paper. We would like to once again extend our sincere thanks for your valuable feedback. We remain open to answering any further questions during the remaining time of the discussion period.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC