Title: Memory-Efficient Gradient Unrolling for Large-Scale Bi-level Optimization
Venue: NeurIPS 2024
Accepted: yes
Keywords: bi-level optimization

large-scale optimization

meta learning
Abstract: Bi-level optimizaiton (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 has become increasingly critical.
Traditional gradient-based bi-level optimizaiton algorithms, due to their inherent characteristics, are ill-suited to meet the demands of large-scale applications.
In this paper, we introduce **F**orward **G**radient **U**nrolling with **F**orward **G**radient, abbreviated as **$($FG$)^2$U**, which achieves an unbiased stochastic approximation of the meta gradient for bi-level optimizaiton.
$($FG$)^2$U circumvents the memory and approximation issues associated with classical bi-level optimizaiton approaches, and delivers significantly more accurate gradient estimates than existing large-scale bi-level optimizaiton approaches.
Additionally, $($FG$)^2$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, $($FG$)^2$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, $($FG$)^2$U is easy to implement within popular deep learning frameworks, and can be conveniently adapted to address more challenging zeroth-order bi-level optimizaiton scenarios.
We provide a thorough convergence analysis and a comprehensive practical discussion for $($FG$)^2$U, complemented by extensive empirical evaluations, showcasing its superior performance in diverse large-scale bi-level optimizaiton tasks.

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

Abstract

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 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 F orward G radient U nrolling with F orward G radient, abbreviated as (FG) 2 U , which achieves an unbiased stochastic approximation of the meta gradient for bi-level optimization. (FG) 2 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, (FG) 2 Uis inherently designed to support parallel computing, enabling it to effectively leverage large-scale distributed computing systems to achieve significant computational efficiency. In practice, (FG) 2 Uand other methods can be strategically placed at different stages of the training process to achieve a more cost-effective two-phase paradigm. Further, (FG) 2 U is easy to implement within popular deep learning frameworks, and can be conveniently adapted to address more challenging black-box bi-level optimization scenarios. We provide a thorough convergence analysis and a comprehensive practical discussion for (FG) 2 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 .

1 Introduction

Bi-level optimization is a mathematical framework with a long history of research [10, 65, 73], dealing with hierarchical optimization problems where one problem is nested within the other. A bi-level optimization problem can be formulated as:

where θ ∈ Θ ⊆ R M denotes the inner parameter, ϕ ∈ Φ ⊆ R N denotes the meta parameter, and f , g are called the meta objective function and inner objective function, respectively.

Recently, with the rise of deep learning, bi-level optimization has regained attention as a theoretical framework covering a wide range of machine learning problems, including hyperparameter optimization [46, 43, 17, 16, 45], neural architecture search [78, 38, 14], robust machine learning [79, 76, 71, 26], meta learning [15, 53, 49, 2], and physics-informed machine learning [23, 62]. In these scenarios, the inner problem often pertains to the optimization of neural networks, thereby

1

Category

Method

Constant

Hessian-Free

Stochastic

Grad. Approx.

Memory

Optimization

Preference

Classical

GU [17, 16]

✗

✓

✓

-

IF [53, 19, 64]

✓

✗

✓

-

VF [39, 37, 61, 33]

✓

✓

✗

-

Large-scale

TRGU [60]

✓

✓

✓

Efficiency

Hessian-Free [76, 75, 9]

✓

✓

✓

Efficiency

(FG)

2

U

(ours)

✓

✓

✓

RGU/1

RGU/2

RGU/4

RGU/6

(FG) 2 U/24

(FG) 2 U/48

Method/Unrolled Depth

10

11

12

13

14

15

RGU: Non-constant Memory

Meta Learning Online Adaptation (DistilGPT2)

Memory

TRGU

Hessian-Free

(FG) 2 U (ours)

Method

15

18

21

24

27

30

Accuracy (%)

Data Condensation (CIFAR 100, IPC=50)

Memory

0

5

10

15

20

25

30

35

0

8

16

24

32

40

Efficiency (sec/step)

Data Condensation (CIFAR 100, IPC=50)

TRGU

Hessian-Free

(FG) 2 U: 1 GPUs

(FG) 2 U: 2 GPUs

(FG) 2 U: 4 GPUs

(FG) 2 U: 8 GPUs

0

8

16

24

32

40

0

3

6

9

12

15

precipitating challenges associated with gradient-based bi-level optimization. Consequently, various gradient-based bi-level optimization algorithms have been developed [73]. These algorithms typically employ an iterative solution θ T obtained by executing multiple inner optimization steps to approximate the meta gradient, and provide different tradeoffs between computational costs and performance for meta gradient approximation.

However, as the scale of deep learning models continues to expand, the requirements for scalability in bi-level optimization correspondingly increase. Existing gradient-based bi-level optimization algorithms, due to their inherent characteristics, are ill-suited to meet the demands of large-scale applications. Concretely, gradient unrolling (GU) methods [17, 16, 40, 60] are bottlenecked by the memory overhead associated with either the dimension of the inner parameter or the number of iterative steps for the inner problem. Implicit Function (IF) approaches [48, 19, 64, 76] are compromised by approximation errors, which stem from the iterative estimation of inner solutions and computations that involve the Hessian matrix. Value Function (VF) based strategies [39, 37, 61, 33], although exhibit commendable theoretical properties [8] for deterministic bi-level optimization, have yet to gain traction in practical applications, predominantly due to their limitations in addressing largescale stochastic challenges [73]. Recent advancements in algorithms [60, 9] have been specifically tailored for large-scale bi-level optimization. Although these methodologies facilitate efficient gradient approximation by compromising accuracy, they may result in significantly suboptimal performance due to biased gradient approximations. Additionally, these methods struggle in more complex scenarios, such as when inner problems are addressed through black-box optimization.

In this paper, we propose a novel method called F orward G radient U nrolling with F orward G radient, abbreviated as (FG) 2 U , which achieves an unbiased stochastic approximation of the meta gradient for bi-level optimization. (FG) 2 U circumvents the memory issues associated with GU-based approaches and approximation issues associated with IF-based approaches. Compared to recently developed large-scale bi-level optimization approaches, (FG) 2 U delivers significantly more accurate gradient estimates. Additionally, (FG) 2 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, a cost-effective two-phase paradigm can be achieved by strategically placing

(FG) 2 U and other methods at different stages of the training process to balance efficiency and performance. Further, (FG) 2 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 an overview of (FG) 2 U in Figure 1 to illustrate its strengths and role in large-scale bi-level optimization. The rest of the paper is organized as follows. Firstly, in Section 2, we provide summaries of existing bi-level optimization algorithms and discuss their limitations in large-scale contexts. Next, in Section 3, we introduce the proposed method, (FG) 2 U, followed by a convergence analysis in Section 3.1 and a detailed discussion of the practical considerations in Section 3.2. Further, in Section 4, we conduct extensive empirical studies covering large-scale bi-level optimization in computer vision, natural language processing, and physics-informed machine learning to demonstrate the efficacy of (FG) 2 U in large-scale bi-level optimization scenarios.

2 Background

Gradient-based Bi-level Optimization. Within deep learning applications, the model concerned with optimizing over θ as presented in (1) typically constitutes deep neural networks. The optimal parameters of such networks are not explicitly accessible and are estimated through iterative procedures. Consequently, the primal problem of bi-level optimization in (1) is approximately reformulated as follows:

where Φ ⊆ R N , Θ ⊆ R M are the parameter spaces; T , commonly called the unrolled depth, denotes the number of inner optimization steps for approximating θ ∗ ( ϕ ) ; Ω 0 : R N → R M specifies the initialization of the inner optimization, and Ω t : Θ × Φ → Φ delineates the transition dynamics of the inner optimization at timestep t . In particular, for gradient descent, Ω t ( θ t -1 ( ϕ ) , ϕ ) = θ t -1 -η t ∇ θ g ( θ t -1 , ϕ ) , where η t denotes the step size at timestep t .

To optimize ϕ using a first-order method, it is necessary to estimate the meta gradient ∇ ϕ h , which can be further decomposed according to the chain rule:

The computation of meta-gradient poses a significant challenge, primarily due to the need for efficient approximation of the implicit gradient. This task is complicated by the recursive dependency of θ T on ϕ . To surmount this challenge, a variety of gradient-based bi-level optimization algorithms have been developed, as extensively reviewed recently in [73]. These algorithms can be fundamentally categorized into three types based on their approach to meta-gradient approximation: Gradient Unrolling (GU), Implicit Function (IF), and Value Function (VF). Recent innovations such as truncated RGU (TRGU) [60] and Hessian-Free approaches [76, 75, 9], which are predicated on GU and IF methodologies respectively, have introduced significant biases in their approximations to accommodate the computational constraints of large-scale scenarios. In the subsequent paragraph, we furnish a concise overview of GU-based approaches, addressing their non-constant memory issues in large-scale applications. Extended discussions on the remaining methods are reserved for Appendix B.

Gradient Unrolling. The core idea behind GU [17, 16, 40, 60] entails unrolling the inner optimization into an expansive computational graph, followed by the employment of automatic differentiation (AD) techniques for the iterative computation of gradients.

Forward Gradient Unrolling (FGU) [17, 16] computes the meta gradient using the following forward recursive formula, starting from Z 0 = d Ω 0 ( ϕ ) d ϕ :

Reverse Gradient Unrolling (RGU) [46, 16], instead of the employment of explict reccursive formulas of Z T , focuses on the implicit reccursive formulas of ∇ ϕ h :

The corresponding reverse recursive formulas can thus be summarized as

Weakness (GU): Non-Constant Memory . Both GU approaches exhibit a non-constant memory overhead, which constrains their utility in large-scale scenarios. The forward reccursive formulas in (4) revolve around the Jacobian matrix product, demanding O ( MN ) space consumption. The reverse recursive formulas in (6) necessitate the storage of the entire trajectory of the inner optimization θ 0: T for backward computation, thereby imposing a memory requirement of O ( TM ) . These requirements are often impractical for large-scale bi-level optimization, when ϕ and θ are of high dimension and a significant unrolled depth is required.

Forward Gradient. Forward-mode automatic differentiation (forward-mode AD) has been applied to a variety of research fields, including the training of recurrent neural networks [70], the computation of Hessian vector products [50], etc. However, the computation of the true gradient via forward-mode AD requires the full Jacobian, which is typically too costly to compute.

To solve this, forward gradient learning [69, 4, 63, 4, 56], built upon forward-mode AD, was proposed. Forward gradient methods update parameters based on the directional gradient along a random perturbation direction for backpropagation-free training. More formally, given a differentiable function h : R N → R , the gradient for a given input ϕ ∈ R N can be approximated as

where v ∼ p ( v ) is a N -dimensional multivariate random variable, satisfying E [ vv T ] = I . Common choices of the distribution of v include Rademacher v ∼ Unif( {-1 , 1 } N ) , Gaussian v ∼ N ( 0 , I ) , and uniform distribution over a set of normalized orthogonal coordinates v ∼ Unif( { √ N e i } 1: N ) . For any given ϕ , ˆ ∇ h ( ϕ ) is an unbiased estimator of ∇ h ( ϕ ) , as E [ ˆ ∇ h ( ϕ )] = E [ ∇ h ( ϕ ) vv T ] = ∇ h ( ϕ ) E [ vv T ] = ∇ h ( ϕ ) I = ∇ h ( ϕ ) . Despite the unbiasedness of ˆ ∇ h , the dimension-dependent variance of the estimated gradient with a single direction impedes the scaling-up to high-dimensional problems. In practice, Monte Carlo gradient estimation can be used via averaged forward gradients over multiple random directions to reduce the variance.

3 (FG) 2 U: Forward Gradient Unrolling with Forward Gradient

We aim to circumvent the memory overhead issues associated with forward gradient unrolling (FGU) as discussed in Section 2. We begin by examining the forward gradient of h at ϕ ,

where v ∼ p ( v ) is a N -dimensional multivariate random variable, satisfying E [ vv T ] = I . We follow the idea of FGU introduced in Section 2 to compute Z T v . By multiplying both sides of (4) by v on the right, we can obtain the recursive formulas for Z t v as

The revised recursive formulas in (9) facilitate the tracking of a M -dimensional vector Z t v , rather than full Jacobian Z t of size M × N , throughout the forward pass. The stochastic estimation in (8) is unbiased, adhering to the properties of forward gradient methods. To reduce the variance, we use

Monte Carlo estimate via averaged forward gradients over b i.i.d. random directions:

We call this algorithm (FG) 2 U , as an abbreviation of F orward G radient U nrolling with F orward G radient. The algorithm is summarized in Appendix A as Algorithm 1.

Compared to GU-based methods, as discussed in Section 2, (FG) 2 U eliminates the dependency on the meta parameter dimension N and the depth of unrolling T without introducing bias, significantly enhancing memory efficiency. Unlike IF-based methods, as discussed in Appendix B.2, (FG) 2 U overcomes the approximation issues associated with them while maintaining a constant memory overhead, thus providing superior gradient approximation. Compared to TRGU and Hessian-Free methods, which compromise approximation accuracy for efficiency, (FG) 2 U consistently delivers accurate gradient approximations. The computational efficiency of (FG) 2 U can be further enhanced by leveraging large-scale distributed computing resources, capitalizing on its inherently parallelizable formulation as presented in (10). In practice, a more cost-effective two-phase paradigm can be achieved by strategically placing (FG) 2 Uand other methods at different stages of the training process, as we will discuss in Section 3.2. For an illustration of the role of (FG) 2 U in large-scale bi-level optimization, please refer to Figure 1.

3.1 Convergence

In this section, we provide a convergence analysis for (FG) 2 U. The proofs can be found in Appendix C. First, we establish a bound on the variance of the estimated gradient, when employing random vectors whose entries follow the Rademacher distribution.

Lemma 3.1. For any ϕ ∈ Φ , if v i ∼ Unif( {-1 , 1 } N ) , the gradient estimation in (10) , satisfies

where ρ := b N -1 ∈ (0 , 1] as the sample size b is selected from 1 , · · · , N -1 .

The resultant error is bounded by O ( N -1 b ) , where b represents the sample size used for computing the forward gradient, and N is the dimensionality of the gradient itself. This bound demonstrates how the error scales inversely with the sample size while also being influenced by the gradient's dimensionality.

Next, we lay down the following assumptions, on which our main theorems are based. Let ψ = ( θ , ϕ ) ∈ Θ × Φ denote the combination of the lower-level parameter θ and the meta parameter ϕ . Following existing papers on the theory of bilevel optimization [45, 60, 28], in Assumption 3.2, we adopt some standard assumptions over the smoothness of the objective functions f and g .

Assumption 3.2. The meta objective function f ( ψ ) and the lower-level objective function g ( ψ ) are both C -Lipschitz and L -smooth, i.e. , for any ψ , ψ ′ ∈ Θ × Φ ,

The next assumption regulates that the transition functions Ω satisfy similar smoothness conditions. Assumption 3.3. The transition functions Ω 0: T are C Ω -Lipschitz and L Ω -smooth, i.e. , for any ϕ , ϕ ′ ∈ Φ ,

For any ψ , ψ ′ ∈ Θ × Φ , t = 1 , . . . , T ,

Assumption 3.3 is made to ensure the generality of our analysis over different optimizers. Note that Ω is scheme-dependent w.r.t. the gradient-based optimizer we adopt for lower-level problems. In many cases, such as gradient descent where Ω t ( ψ t -1 ) = θ t -1 -η t ∇ θ g ( ψ t -1 ) , Assumption 3.3 is a direct consequence of Assumption 3.2.

We propose the following theorem and remark for convergence analysis of (FG) 2 U on problem (2). Notice the convergence result can be extended to the primal BO problem (1) with some further assumptions. We place a proof scratch and some discussions in Appendix C.3.

Theorem 3.4 (Convergence) . Suppose that Asumption 3.2 and Assumption 3.3 hold. Setting the learning rate β = ρ ( ρ +1) L h for gradient descent over the hyperparameter ϕ , then there exists a constant L h (depending on C , L , C Ω , L Ω , and T , and defined formally in the proof) such that

Remark 3.5. Theorem 3.4 shows that Algorithm 1 converges to an ϵ -accurate stationary point with a convergence rate of = O ( ϵ -1 ρ -1 ) .

Recall that ρ = b N -1 , which indicates that the convergence rate is linearly dependent on N , which poses a significant challenge when managing high-dimensional meta-parameters ϕ . However, it is important to note that the dimension-dependent convergence rate represents an upper bound, and scalability has been found to be feasible with several practical considerations, as discussed in the following subsection.

3.2 Practical Considerations

Choice of b . According to the convergence analysis in Section 3.1, a sample size of b = O ( N ) is required to achieve a convergence rate of O ( ϵ -1 ) . However, it has been widely observed that forward gradient and zeroth-order optimization, despite having dimension-dependent convergence rates, work well empirically with b = O (1) in large-scale scenarios, such as in LLM fine-tuning [47, 74]. In this paper, we select the largest possible b that does not exceed the GPU memory limit for our empirical study. Additionally, gradient accumulation is utilized to further control variance and stabilize the training process.

Cost-Effective Two-Phase Paradigm . It is important to note that the upper bound delineated in (15) linearly depends on the performance discrepancy between the initialized meta parameter ϕ 0 and the optimal. This dependence motivates the adoption of a more cost-effective two-phase paradigm for large-scale bi-level optimization. In the initial phase, we utilize efficient yet less accurate gradient approximation methods, such as TRGU [60] and Hessian-Free [9], to efficiently establish an initial ϕ 0 that surpasses random initialization, while keeping computational overhead manageable. Subsequently, in the second phase, (FG) 2 Uis utilized for a more accurate, albeit less efficient, gradient approximation to further elevate the performance, leveraging extensive computational resources.

Implementation . The technique employed in computing ∇ h ( ϕ ) v is identified as forward-mode automatic differentiation (forward-mode AD). In advanced automatic differentiation libraries, such as JAX [5] and PyTorch [3], forward-mode AD is efficiently implemented as Jacobian-vector product ( jvp ), without the necessity of explicitly computing the Jacobian matrix. The FLOP cost of jvp is approximately three times that of a standard forward pass, while the memory overhead is doubled. In practice, it is only necessary to define the forward computational graph of inner optimization and invoke forward-mode AD, which simplifies the implementation process significantly. Regarding distributed training, JAX offers the vmap interface for efficient intra-GPU parallelism and the pmap interface for effective inter-GPU parallelism.

Zeroth-order Bi-level optimization . In certain applications of bi-level optimization, the inner problem is approached as a black box, where the gradient of Ω is inaccessible, rendering the analytical gradient unrolling unfeasible. For example, in PDE-constrained optimization [23, 62], in which the inner problem entails solving a Partial Differential Equation (PDE) using a non-differentiable solver. In such scenarios, rather than employing forward-mode Automatic Differentiation (AD), one can resort to Finite Difference methods to approximate the directional gradient ∇ h ( ϕ ) v by

with sufficiently small positive ¯ µ > 0 . We refer to this zeroth-order variant of (FG) 2 U as (FG) 2 UZO, noting that the computation solely encompasses two forward passes and does not involve the utilization of any first-order information. The memory complexity is the same as forward-mode AD

and the actual computation time will be slightly less than forward-mode AD, at the cost of introducing an approximation bias. We give a more detailed discussion within the context of zeroth-order optimization [41] in Appendix D, and empirically study a corresponding case in Section 4.

4 Experiments

We conduct experiments across various contexts, as detailed in the respective subsections. Initially, we engage in an image data condensation task, where we focus on a comprehensive performance comparison between (FG) 2 U and both classical and large-scale bi-level optimization algorithms. Subsequently, we investigate meta-learning for the online adaptation of language models, employing a GPT model as the inner model, to illustrate how (FG) 2 U effectively circumvents the non-constant memory issue associated with RGU. Finally, we address a physics-informed bi-level optimization problem, where gradient-based inner solvers are ineffective, to demonstrate the efficacy of combining (FG) 2 U-ZO, the zeroth-order variant of (FG) 2 U discussed in Section 3.2, with non-differentiable numerical solvers.

Data Condensation . To overcome the challenges posed by large-scale datasets, a line of works known as data condensation [68, 72] has been proposed. The main idea is to generate a compact, synthesized dataset, designed to elicit similar behaviors in machine learning models as those trained with the original, massive dataset. The objective of the mainstream principles [72] designed for data condensation can be naturally formulated as a bi-level optimization problem. We focus on the best-known principle performance matching [72] on classification tasks, which can be formulated as

where D o , D c respectively denote the original and condensed dataset, θ denotes the model parameter, L denotes the cross-entropy loss function, and η represents the step-size for inner optimization.

Table 1: The performance (testing accuracy %) comparison among various bilevel optimization methods on the data condensation task over three datasets. All the datasets are condensed using a 3-layer ConvNet. IPC: image(s) per class. Ratio (%): the ratio of condensed examples to the whole training set.

We conducted our experiments following the standard data condensation setting established by [68, 77, 67]. A more detailed task description is given in Appendix E.1 and implementation details are given in Appendix F.1.

The condensed datasets are evaluated using 3-layer convolutional networks with randomly initialized parameters, and the average accuracies on test datasets are summarized in Table 1. Compared to large-scale bi-level optimization methods like TRGU and Hessian-Free, which prioritize efficiency at the expense of approximation accuracy, (FG) 2 Uexhibits significantly better performance, due to more accurate gradient approximation as explained in Appendix B. Additionally, we assessed Neumann Series (denoted as Neumann in Table 1), an IF-based method that mitigates gradient approximation errors through extended computations, as introduced in Appendix B.2. While it demonstrates performance enhancements over the Hessian-Free method, Neumann still yields suboptimal performance

compared to (FG) 2 U, owing to the inherent bias of the IF-based method. Further discussions and supporting evidence are available in Appendix B.2.

The results of RGU, which represent the upper performance bound for both TRGU and (FG) 2 U, are provided for reference, along with the results from training on the entire dataset (denoted as WHOLE in Table 1), representing the upper performance bound for all approaches. However, it is crucial to acknowledge that RGU is not practical in large-scale bi-level optimization scenarios due to its non-constant memory requirements, as discussed in Section 2. This limitation will be further exemplified in the subsequent, where the inner model is significantly larger. In principle, the performance of (FG) 2 U can be further improved to approach that of RGU by increasing the number of random directions for gradient approximation.

The memory and computational efficiencies of TRGU, Hessian-Free, and (FG) 2 U in the most challenging case (CIFAR-100, IPC=50) are reported in Figure 1 (Bottom Right), demonstrating that the efficiency of (FG) 2 U can be significantly enhanced through intra/inter-GPU parallelism.

Meta Learning Online Adaptation of Language Models . The online adaptation of language models (LM) has been studied recently to keep the knowledge of LM current [34, 27]. However, trivial auto-regressive fine-tuning the LM, which applies uniform weights to all tokens, often results in suboptimal performance in downstream tasks. This issue stems from the default average negative log-likelihood (NLL) loss, which fails to capture the significance of tokens [25]. To overcome this limitation, [25] proposed Context-aware Meta-learned Loss Scaling (CaMeLS), a strategy that employs meta-learning to adjust token weights for more effective online adaptation. Specifically, they meta train a weight model to reweight the auto-regressive loss during online fine-tuning, aiming to enhance LM performance on downstream question-answering tasks. A comprehensive task description and the mathematical formulation of the objectives are detailed in Appendix E.2.

The trained weight model is subsequently fine-tuned on unseen online documents and evaluated on corresponding question-answering tasks. In [25], RGU is utilized for meta gradient approximation. To mitigate the non-constant memory issue associated with RGU, a DistilGPT2 model [59] is chosen as the surrogate base model for training the weight model, instead of larger models typically employed for online adaptation. Additionally, a very limited unrolled depth of 6 is utilized within a 40 GiB GPU memory budget. In our experiments, since (FG) 2 U has circumvented the non-constant memory issue associated with RGU, we are able to increase the unrolled depth and upscale the base model for training the weight model. Empirical evaluations are conducted on two datasets, StreamingQA [36] and SQuAD-Seq [54].

Table 2: Comparison of the online adaptation performance. The reported evaluation metrics include the exact match (EM) and F 1 scores. For vanilla CaMeLS [25], RGU is conducted with unrolled depth 6 , using DistilGPT2 as the base model. We present both the results reported by [66] and those from our implementation (denoted as impl.). For CaMeLS + (FG) 2 U, we select unrolled depths from { 24 , 48 } , and the base model from { DistilGPT2, GPT2 } . We report the results for the combination that yields the best F1 score. Additional details and ablation studies are documented in Appendix G.1.

Firstly, we increased the unrolled depth while maintaining the base model as a DistilGPT2. We plotted the F1 scores and GPU memory usages for RGU with unrolled depths of { 1 , 2 , 4 , 6 } and (FG) 2 U with unrolled depths of { 24 , 48 } on StreamingQA in Figure 1 (Bottom Left). The performance of the weight model is positively correlated with the unrolled depth, substantiating the benefits of

training with larger unrolled depths. The non-constant memory issue associated with RGU can be observed when the unrolled depth increases, while (FG) 2 U maintains constant memory even with large unrolled depth. Subsequently, we endeavored to upscale the base model to GPT2 to reduce the disparity between training and evaluation. The performances are summarized in Table 2, with detailed ablation studies on unrolled depths and base model variants documented in Table G.1 and Table G.2.

Data-driven Discovery of Partial Differential Equations (PDEs) . Let us consider the following general forms of parametrized and nonlinear PDEs:

where x denotes the space-time coordinate, Ψ denotes a bounded domain with boundary, u : [0 , T ] × Ψ → R denotes the latent solution, u t represents the first-order derivative of u with respect to t , and N is a general differential operator parameterized by ϕ , acting on Ψ . This setup encompasses a broad spectrum of problems in physics. For example, the one-dimensional Burgers' equation is defined by N [ u ; ϕ ] = µuu x -νu xx , where ϕ = ( µ, ν ) ∈ R 2 , and u x , u xx represent the first and second-order derivatives of u with respect to x , respectively.

0

50

100

150

200

250

Speed (second per solution)

1E-3

1E-2

1E-1

1

Relative L2 Error (log)

Efficient

Burgers: PDE Solver Efficiency

PINN (Adam)

PINN (SGD)

Numerical

The problem of data-driven discovery of PDEs [52] can be framed as follows: given a set of scattered observations of the latent solution u ( x ) , what are the parameters most accurately describing the observed data? The problem can be formulated as a PDE-constrained optimization problem (PDECO):

where D = { ( x i , u i ) } 1: k denotes the observed data. In cases where the closed-form solutions of the nonlinear PDEs are intractable, parametric solutions u θ are used to approximate the latent solution u for given ϕ . The PDECO in (19) is then reformulated into a bi-level optimization problem:

Employing gradient-based PDE solvers, such as physics-informed neural networks (PINN) [52], facilitates the direct application of (FG) 2 U. However, as demonstrated in Figure 2 (Left), the accuracy and efficiency of PINNs fall short of the rigorous demands of scientific computing. This limitation has prompted us to integrate faster and more accurate traditional solvers like the spectral method [1] (see also Appendix E.3.4) to tackle the inner problem. Given these solvers are non-differentiable, we employ (FG) 2 U-ZO, the zeroth-order variant of (FG) 2 U introduced in Section 3.2, to solve the problem.

We conduct experiments on three non-linear PDEs: Burgers, Allen-Cahn, and KdV, with a more detailed task description available in Appendix E.3. The results are summarized in Figure 2 (Right). We can observe that the combination of (FG) 2 U-ZO and the numerical solver significantly outperforms (FG) 2 U and the PINN solver, in terms of both the prediction on ϕ and u . The implementation details are documented in Appendix F.3.

5 Conclusion

In this work, we propose a novel algorithm F orward G radient U nrolling with F orward G radient, abbreviated as (FG) 2 U , designed to tackle the challenges associated with large-scale bi-level optimization. We conduct a convergence analysis of (FG) 2 U, perform extensive comparisons with existing methods, and provide detailed discussions on its practical applications. Additionally, we undertake an empirical evaluation across a series of large-scale bi-level optimization tasks. Our findings indicate that (FG) 2 U effectively complements existing bi-level optimization algorithms, addressing gaps in large-scale bi-level optimization scenarios.

Limitations and future works . The experiments conducted in this paper are of relatively small scale, with the largest inner model being a GPT-2 model. We look forward to validating its effectiveness on larger-scale bi-level optimization tasks. Additionally, the application of black-box bi-level optimization and the potential of (FG) 2 U-ZO remain underexplored, considering the prevalent blackbox interaction between users and models today. We hope our work will inspire further development of large-scale bi-level optimization algorithms and their application in corresponding scenarios. Furthermore, we have not specifically addressed the efficiency issues inherited by (FG) 2 U from the forward gradient method. Enhancing the efficiency of (FG) 2 U while maintaining its gradient estimation accuracy will be an important direction for future research.

References

William F Ames. Numerical methods for partial differential equations . Academic press, 2014.

Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. Advances in neural information processing systems , 29, 2016.

Jason Ansel, Edward Yang, Horace He, Natalia Gimelshein, Animesh Jain, Michael Voznesensky, Bin Bao, Peter Bell, David Berard, Evgeni Burovski, Geeta Chauhan, Anjali Chourdia, Will Constable, Alban Desmaison, Zachary DeVito, Elias Ellison, Will Feng, Jiong Gong, Michael Gschwind, Brian Hirsh, Sherlock Huang, Kshiteej Kalambarkar, Laurent Kirsch, Michael Lazos, Mario Lezcano, Yanbo Liang, Jason Liang, Yinghai Lu, CK Luk, Bert Maher, Yunjie Pan, Christian Puhrsch, Matthias Reso, Mark Saroufim, Marcos Yukio Siraichi, Helen Suk, Michael Suo, Phil Tillet, Eikan Wang, Xiaodong Wang, William Wen, Shunting Zhang, Xu Zhao, Keren Zhou, Richard Zou, Ajit Mathews, Gregory Chanan, Peng Wu, and Soumith Chintala. PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation. In 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2 (ASPLOS '24) . ACM, April 2024.

Atılım Güne¸ s Baydin, Barak A Pearlmutter, Don Syme, Frank Wood, and Philip Torr. Gradients without backpropagation. arXiv preprint arXiv:2202.08587 , 2022.

James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018.

Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems , 33:1877-1901, 2020.

Claudio Canuto, M Yousuff Hussaini, Alfio Quarteroni, and Thomas A Zang. Spectral methods: fundamentals in single domains . Springer Science & Business Media, 2007.

Lesi Chen, Yaohua Ma, and Jingzhao Zhang. Near-optimal fully first-order algorithms for finding stationary points in bilevel optimization. arXiv preprint arXiv:2306.14853 , 2023.

Sang Choe, Sanket Vaibhav Mehta, Hwijeen Ahn, Willie Neiswanger, Pengtao Xie, Emma Strubell, and Eric Xing. Making scalable meta learning practical. Advances in neural information processing systems , 36, 2024.

Benoît Colson, Patrice Marcotte, and Gilles Savard. An overview of bilevel optimization. Annals of operations research , 153:235-256, 2007.

Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina N. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 , 2018.

Tian Dong, Bo Zhao, and Lingjuan Lyu. Privacy for free: How does dataset condensation help privacy? In International Conference on Machine Learning , pages 5378-5396. PMLR, 2022.

John C Duchi, Michael I Jordan, Martin J Wainwright, and Andre Wibisono. Optimal rates for zero-order convex optimization: The power of two function evaluations. IEEE Transactions on Information Theory , 61(5):2788-2806, 2015.

Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. Journal of Machine Learning Research , 20(55):1-21, 2019.

Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning , pages 1126-1135. PMLR, 2017.

Luca Franceschi, Michele Donini, Paolo Frasconi, and Massimiliano Pontil. Forward and reverse gradientbased hyperparameter optimization. In International Conference on Machine Learning , pages 1165-1173. PMLR, 2017.

Luca Franceschi, Paolo Frasconi, Saverio Salzo, Riccardo Grazzi, and Massimiliano Pontil. Bilevel programming for hyperparameter optimization and meta-learning. In International conference on machine learning , pages 1568-1577. PMLR, 2018.

Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.15723 , 2020.

Saeed Ghadimi and Mengdi Wang. Approximation methods for bilevel programming. arXiv preprint arXiv:1802.02246 , 2018.

Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211 , 2013.

David Gottlieb and Steven A Orszag. Numerical analysis of spectral methods: theory and applications . SIAM, 1977.

Evan Greensmith, Peter L Bartlett, and Jonathan Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. Journal of Machine Learning Research , 5(9), 2004.

Zhongkai Hao, Chengyang Ying, Hang Su, Jun Zhu, Jian Song, and Ze Cheng. Bi-level physicsinformed neural networks for pde constrained optimization using broyden's hypergradients. arXiv preprint arXiv:2209.07075 , 2022.

Ryuichiro Hataya and Makoto Yamada. Nyström method for accurate and scalable implicit differentiation. In International Conference on Artificial Intelligence and Statistics , pages 4643-4654. PMLR, 2023.

Nathan Hu, Eric Mitchell, Christopher D Manning, and Chelsea Finn. Meta-learning online adaptation of language models. arXiv preprint arXiv:2305.15076 , 2023.

WRonny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. Metapoison: Practical general-purpose clean-label data poisoning. Advances in Neural Information Processing Systems , 33:1208012091, 2020.

Joel Jang, Seonghyeon Ye, Sohee Yang, Joongbo Shin, Janghoon Han, Gyeonghun Kim, Stanley Jungkyu Choi, and Minjoon Seo. Towards continual knowledge learning of language models. arXiv preprint arXiv:2110.03215 , 2021.

Kaiyi Ji, Junjie Yang, and Yingbin Liang. Bilevel optimization: Convergence analysis and enhanced design. In International conference on machine learning , pages 4882-4892. PMLR, 2021.

Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 , 2014.

Steven George Krantz and Harold R Parks. The implicit function theorem: History, theory, and applications . Springer Science & Business Media, 2002.

Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.

Harshat Kumar, Dionysios S Kalogerias, George J Pappas, and Alejandro Ribeiro. Zeroth-order deterministic policy gradient. arXiv preprint arXiv:2006.07314 , 2020.

Jeongyeol Kwon, Dohyun Kwon, Stephen Wright, and Robert D Nowak. A fully first-order method for stochastic bilevel optimization. In International Conference on Machine Learning , pages 18083-18113. PMLR, 2023.

Angeliki Lazaridou, Adhi Kuncoro, Elena Gribovskaya, Devang Agrawal, Adam Liska, Tayfun Terzi, Mai Gimenez, Cyprien de Masson d'Autume, Tomas Kocisky, Sebastian Ruder, et al. Mind the gap: Assessing temporal generalization in neural language models. Advances in Neural Information Processing Systems , 34:29348-29363, 2021.

Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE , 86(11):2278-2324, 1998.

Adam Liska, Tomas Kocisky, Elena Gribovskaya, Tayfun Terzi, Eren Sezener, Devang Agrawal, D'Autume Cyprien De Masson, Tim Scholtes, Manzil Zaheer, Susannah Young, et al. Streamingqa: A benchmark for adaptation to new knowledge over time in question answering models. In International Conference on Machine Learning , pages 13604-13622. PMLR, 2022.

Bo Liu, Mao Ye, Stephen Wright, Peter Stone, and Qiang Liu. Bome! bilevel optimization made easy: A simple first-order approach. Advances in neural information processing systems , 35:17248-17262, 2022.

Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055 , 2018.

Risheng Liu, Xuan Liu, Xiaoming Yuan, Shangzhi Zeng, and Jin Zhang. A value-function-based interiorpoint method for non-convex bi-level optimization. In International conference on machine learning , pages 6882-6892. PMLR, 2021.

Risheng Liu, Pan Mu, Xiaoming Yuan, Shangzhi Zeng, and Jin Zhang. A generic first-order algorithmic framework for bi-level programming beyond lower-level singleton. In International conference on machine learning , pages 6305-6315. PMLR, 2020.

Sijia Liu, Pin-Yu Chen, Bhavya Kailkhura, Gaoyuan Zhang, Alfred O Hero III, and Pramod K Varshney. A primer on zeroth-order optimization in signal processing and machine learning: Principals, recent advances, and applications. IEEE Signal Processing Magazine , 37(5):43-54, 2020.

Sijia Liu, Bhavya Kailkhura, Pin-Yu Chen, Paishun Ting, Shiyu Chang, and Lisa Amini. Zeroth-order stochastic variance reduction for nonconvex optimization. Advances in Neural Information Processing Systems , 31, 2018.

Jonathan Lorraine, Paul Vicol, and David Duvenaud. Optimizing millions of hyperparameters by implicit differentiation. In International conference on artificial intelligence and statistics , pages 1540-1552. PMLR, 2020.

Lu Lu, Raphael Pestourie, Wenjie Yao, Zhicheng Wang, Francesc Verdugo, and Steven G Johnson. Physicsinformed neural networks with hard constraints for inverse design. SIAM Journal on Scientific Computing , 43(6):B1105-B1132, 2021.

Jelena Luketina, Mathias Berglund, Klaus Greff, and Tapani Raiko. Scalable gradient-based tuning of continuous regularization hyperparameters. In International conference on machine learning , pages 2952-2960. PMLR, 2016.

Dougal Maclaurin, David Duvenaud, and Ryan Adams. Gradient-based hyperparameter optimization through reversible learning. In International conference on machine learning , pages 2113-2122. PMLR, 2015.

Sadhika Malladi, Tianyu Gao, Eshaan Nichani, Alex Damian, Jason D Lee, Danqi Chen, and Sanjeev Arora. Fine-tuning language models with just forward passes. Advances in Neural Information Processing Systems , 36:53038-53075, 2023.

John L Nazareth. Conjugate gradient method. Wiley Interdisciplinary Reviews: Computational Statistics , 1(3):348-353, 2009.

Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999 , 2018.

Barak A. Pearlmutter. Fast exact multiplication by the hessian. Neural Comput. , 6(1):147-160, 1994.

George F Pinder. Numerical methods for solving partial differential equations: a comprehensive introduction for scientists and engineers . John Wiley & Sons, 2018.

Maziar Raissi, Paris Perdikaris, and George E Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics , 378:686-707, 2019.

Aravind Rajeswaran, Chelsea Finn, Sham M Kakade, and Sergey Levine. Meta-learning with implicit gradients. Advances in neural information processing systems , 32, 2019.

Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250 , 2016.

Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International conference on machine learning , pages 8821-8831. Pmlr, 2021.

Mengye Ren, Simon Kornblith, Renjie Liao, and Geoffrey Hinton. Scaling forward gradient with local losses. arXiv preprint arXiv:2210.03310 , 2022.

Levent Sagun, Leon Bottou, and Yann LeCun. Eigenvalues of the hessian in deep learning: Singularity and beyond. arXiv preprint arXiv:1611.07476 , 2016.

Levent Sagun, Utku Evci, V. Ugur Güney, Yann N. Dauphin, and Léon Bottou. Empirical analysis of the hessian of over-parametrized neural networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Workshop Track Proceedings , 2018.

Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108 , 2019.

Amirreza Shaban, Ching-An Cheng, Nathan Hatch, and Byron Boots. Truncated back-propagation for bilevel optimization. In The International Conference on Artificial Intelligence and Statistics , pages 1723-1732. PMLR, 2019.

Han Shen and Tianyi Chen. On penalty-based bilevel gradient descent method. In International Conference on Machine Learning , pages 30992-31015. PMLR, 2023.

Qianli Shen, Wai Hoh Tang, Zhun Deng, Apostolos Psaros, and Kenji Kawaguchi. Picprop: Physicsinformed confidence propagation for uncertainty quantification. Advances in Neural Information Processing Systems , 36, 2024.

David Silver, Anirudh Goyal, Ivo Danihelka, Matteo Hessel, and Hado van Hasselt. Learning by directional gradient descent. In International Conference on Learning Representations , 2021.

Sidak Pal Singh and Dan Alistarh. Woodfisher: Efficient second-order approximation for neural network compression. Advances in Neural Information Processing Systems , 33:18098-18109, 2020.

Ankur Sinha, Pekka Malo, and Kalyanmoy Deb. A review on bilevel optimization: From classical to evolutionary approaches and applications. IEEE Transactions on Evolutionary Computation , 22(2):276295, 2017.

Jihoon Tack, Jaehyung Kim, Eric Mitchell, Jinwoo Shin, Yee Whye Teh, and Jonathan Richard Schwarz. Online adaptation of language models with a memory of amortized contexts. arXiv preprint arXiv:2403.04317 , 2024.

Kai Wang, Bo Zhao, Xiangyu Peng, Zheng Zhu, Shuo Yang, Shuo Wang, Guan Huang, Hakan Bilen, Xinchao Wang, and Yang You. Cafe: Learning to condense dataset by aligning features. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 12196-12205, 2022.

Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros. Dataset distillation. arXiv preprint arXiv:1811.10959 , 2018.

R. E. Wengert. A simple automatic derivative evaluation program. Commun. ACM , 7(8):463-464, 1964.

Ronald J. Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural Comput. , 1(2):270-280, 1989.

Peng Yang, Yingjie Lao, and Ping Li. Robust watermarking for deep neural networks via bi-level optimization. In Proceedings of the IEEE/CVF International Conference on Computer Vision , pages 14841-14850, 2021.

Ruonan Yu, Songhua Liu, and Xinchao Wang. Dataset distillation: A comprehensive review. IEEE Transactions on Pattern Analysis and Machine Intelligence , 2023.

Yihua Zhang, Prashant Khanduri, Ioannis Tsaknakis, Yuguang Yao, Mingyi Hong, and Sijia Liu. An introduction to bi-level optimization: Foundations and applications in signal processing and machine learning. arXiv preprint arXiv:2308.00788 , 2023.

Yihua Zhang, Pingzhi Li, Junyuan Hong, Jiaxiang Li, Yimeng Zhang, Wenqing Zheng, Pin-Yu Chen, Jason D Lee, Wotao Yin, Mingyi Hong, et al. Revisiting zeroth-order optimization for memory-efficient llm fine-tuning: A benchmark. arXiv preprint arXiv:2402.11592 , 2024.

Yihua Zhang, Yuguang Yao, Parikshit Ram, Pu Zhao, Tianlong Chen, Mingyi Hong, Yanzhi Wang, and Sijia Liu. Advancing model pruning via bi-level optimization. Advances in Neural Information Processing Systems , 35:18309-18326, 2022.

Yihua Zhang, Guanhua Zhang, Prashant Khanduri, Mingyi Hong, Shiyu Chang, and Sijia Liu. Revisiting and advancing fast adversarial training through the lens of bi-level optimization. In International Conference on Machine Learning , pages 26693-26712. PMLR, 2022.

Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. arXiv preprint arXiv:2006.05929 , 2020.

Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578 , 2016.

Simiao Zuo, Chen Liang, Haoming Jiang, Xiaodong Liu, Pengcheng He, Jianfeng Gao, Weizhu Chen, and Tuo Zhao. Adversarial regularization as stackelberg game: An unrolled optimization approach. arXiv preprint arXiv:2104.04886 , 2021.

A Algorithm

Algorithm 1 (FG) 2 U : Forward Gradient Unrolling with Forward Gradient

Require: Initial inner parameters θ 0 , initial meta parameter ϕ 0 , random direction distribution p , number of random directions b , total meta steps K , meta update mappings Ψ 1: K .

B Extended Discussion on Bi-level Optimization

B.1 Truncated Reverse Gradient Unrolling (TRGU)

To address the memory issue of GU methods, truncated Reverse Gradient Unrolling (TRGU) [60] is proposed to reduce the memory usage by preserving only the last K steps of the inner optimization trajectory. However, this introduces a significant bias in large-scale scenarios, particularly when the permissible K is small.

Recall (5) and (6), where the conventional RGU method computes the hypergradient by fully unrolling the T -step inner optimization into a computational graph. Instead, TRGU performs s -step truncated back-propagation and approximates the gradient with the intermediate term c T -s :

According to Proposition 3.1 in [60], if the inner-level objective function g is L -smooth, twice-differentiable and globally α -strongly convex, and the gradient update rule writes θ t = θ t -1 -η ∇ θ g ( θ t -1 , ϕ ) , then the bias of s -step TRGU would be bounded by

The bound (22) demonstrates an exponentially decaying rate in s over the bias of s -step TRGU. However, when s gets smaller, which means that we truncate the computational graph heavier in pursuit of lower memory cost, the bias would grow exponentially. This would result in an inaccurate calculation of the hypergradient. Contrastively, our (FG) 2 U is an unbiased estimator of the hypergradient, while still keeping high memory efficiency with a small sample size of forward gradient as in (10).

B.2 Implicit Function (IF)

Another idea for computing the implicit gradient is to utilize the implicit function theorem (IFT) [30]. Suppose that the inner optimality ∇ θ g ( θ T ( ϕ ) , ϕ ) ≈ 0 is approximately achieved by sufficient inner optimization steps. If g is second-order differentiable, by applying the implicit function theorem and taking the first-order derivative of ϕ ,

Then, if the Hessian is further assumed to be invertible, the meta gradient can be approximated as

The main challenge lies in the computation of the inverse Hessian matrix H -1 , which is intractable when θ is of high dimensionality. Fortunately, several iterative inverse Hessian vector product ( ihvp ) approximators requiring only Hessian vector product ( hvp ) and O ( M ) space can be employed to produce ̂ dH -1 for approximating dH -1 , based on Conjugate Gradient [48, 53], Neumann Series [19, 28] and low-rank approximation [64, 24].

Neumann Series . The inverse Hessian vector product can be approximated with a truncated sum of Neumann series [19, 28],

where α is a hyperparameter to ensure the convergence, and K is the number of truncated steps. Compared to other IF-based methods, the Neumann Series has demonstrated good empirical performance and stability [19], and its stochastic variant has been well studied [28].

Weakness (IF): Approximation Errors . The errors of IF emanate from two distinct sources Firstly, IFT presupposes that the Karush-Kuhn-Tucker (KKT) conditions of the inner problem are satisfied, leading to an approximation error in (23) when iterative approximations of the inner solutions are used. Secondly, the singular nature of the Hessian within neural network training [57] leads to costly and unstable inverse Hessian approximation in practical applications, with a heavy reliance on engineering efforts [9]. More formally, recall

The approximation error can be decomposed into

To reduce the computational cost, Hessian-free approaches [76, 75, 9] propose approximating the Hessian as an identity matrix, incorporating additional assumptions about the inner model and objective.

where α > 0 is a hyperparameter to control the magnitude. However, these numerous assumptions often diverge from practical scenarios, resulting in significant approximation errors and consequently inducing suboptimal outcomes.

10 0

10 1

10 2

10 3

Iteration

0

1

2

3

4

5

Inner Loss

10 0

10 1

10 2

10 3

Iteration

2.0

1.5

1.0

0.5

0.0

(b). Gradient Norm v.s. Iterations.

In Figure B.1, it is evident that the inner optimization has not converged by the unrolled step 100, as indicated by both inner loss and gradient norm. This observation implies that the Karush-Kuhn-Tucker (KKT) conditions are not satisfied, leading to the conclusion that the approximation used in (23) introduces a bias.

B.3 Value Function (VF)

The VF-based methodology [39, 37, 61, 33] considers an equivalent reformulation of the original optimization problem as outlined in (2):

This reformulation casts the standard bi-level optimization challenge into a constrained single-level optimization framework. VF-based methods circumvent the need for second-order computations and have demonstrated near-optimal complexity, comparable to second-order methodologies in deterministic settings, as reported in [8].

Weakness (VF): stochastic optimization . VF-based strategies have yet to gain widespread acceptance in practical ML applications. This limited adoption is primarily attributed to the challenges these methods face in addressing large-scale stochastic problems, where the complexity significantly impedes their performance [73].

C Proofs of Theoretical Results

In this section, we detail the proofs of Lemma 3.1 and Theorem 3.4. Our approach to proving Theorem 3.4 follows a similar high-level approach as [19, 28, 60] with some important distinctions. Initially, in Lemma B.2, we extend the smoothness properties of the objective functions f and g , and the transition functions Ω , to the T -th iteration lower-level parameter θ T . Following this, Lemma B.3 establishes the smoothness of the meta-learning objective f ( θ T , ϕ ) , incorporating results from the inner-loop computations. Building on the demonstrated smoothness of the meta objective function and the variance of the forward gradient method (as shown in Lemma 3.1), we then validate the convergence properties of Algorithm 1.

The novelty in our proof of Theorem 3.4 lies in two primary aspects. Firstly, our analysis does not presume that the lower-level optimization yields an optimal solution θ ∗ ; instead, it more realistically assumes the use of θ T , which is derived from a finite number of iterations. This assumption aligns more closely with the computational constraints encountered in real-world scenarios. Secondly, our convergence analysis explicitly accounts for the variance of our unbiased gradient estimator, achieving a convergence rate of O ( ϵ -1 ρ -1 ) . This demonstrates that utilizing the forward gradient method, while significantly reducing memory requirements, does not adversely affect the algorithm's convergence rate, underscoring the practical viability and efficiency of our approach even with memory constraints.

In Appendix C.3, we discuss how to extend the convergence of optimization problem (2) into (1), with additional assumptions.

C.1 Proof of Lemma 3.1

For convenience, the lemma is restated as follows.

Lemma 3.1. For any ϕ ∈ Φ , the gradient estimation with forward gradient method:

where v i ∼ Unif( {-1 , 1 } N ) , and b denotes the sample size, satifies

where ρ := b N -1 ∈ (0 , 1] as b is selected from 1 , . . . , N -1 .

Proof. We start by computing the variance of one-sample estimation, ˆ ∇ h ( ϕ ) = ∇ h ( ϕ ) vv ⊤ . Since E [ vv ⊤ ] = I , we know that E [ ˆ ∇ h ( ϕ )] = ∇ h ( ϕ ) . Consequently,

Since v is an N -dimensional Rademacher random variable, we have E ∥∇ h ( ϕ ) v ∥ 2 = ∥∇ h ( ϕ ) ∥ 2 and E ∥ vv ⊤ ∥ 2 = N . Then,

For the multi-sample estimation ˆ ∇ h ( ϕ ) = 1 b ∑ b i =1 ∇ h ( ϕ ) v i v i ⊤ . Since v i are i.i.d. sampled, and E [ ˆ ∇ h ( ϕ )] = ∇ h ( ϕ ) , we have

C.2 Proof of Theorem 3.4

To prove our main result (Theorem 3.4), we first establish useful smoothness properties of the hyperparameter learned from solving the lower-level optimization problem. Subsequently, we establish the smoothness of the meta objective function examined at the approximated lower-level parameters in Lemma B.3.

Regarding the lower-level parameter θ ( ϕ ) , we present the following lemma, which is based on Assumption 3.3, and establishes that θ ( ϕ ) inherits similar Lipschitz continuity and smoothness properties as Ω t .

Lemma B.2. Under Assumptions 3.2 and 3.3, θ T ( ϕ ) is C Z -Lipchitz and L Z -smooth, i.e. , for any ϕ , ϕ ′ ∈ Φ ,

Proof. We start with the proof of Lipshitz continuity. For any pair of ϕ , ϕ ′ ∈ Φ , using (2) and Assumption 3.3, we have

Applying (31) recursively over s = 1 , . . . , t gives

where the last inequality holds from the fact that θ 0 = Ω 0 as well as Assumption 3.3, and the subsequent equality follows from the geometric series summation formula.

We now proceed with the proof of L Z -smoothness. For simplicity of notation, we follow (4) and denote

Subsequently, considering the update rule Z t ( ϕ ) = A t ( ϕ ) Z t -1 ( ϕ ) + B t ( ϕ ) of Forward Gradient Unrolling (4), we have

where the last inequality follows from Assumption 3.3 that Ω 0 ( ϕ ) and Ω 1: T ( ψ ) are C Ω -Lipshitz and L Ω -smooth, and the previously proved result that θ t ( ϕ ) is C Z ( t ) -Lipchitz.

Noting that

where the third line follows from Assumption 3.3 that Ω 0 ( ϕ ) is L Ω -smooth and the choice C Z ( t ) = C t +2 Ω -C Ω C Ω -1 (which gives C Z ( t ) + 1 = C t +2 Ω -1 C Ω -1 ), and the fifth line again uses the geometric series summation formula.

Next, we provide a lemma establishing that the upper-level objective f , evaluated at the learned parameter ( θ T ( ϕ ) , ϕ ) , also adheres to certain smoothness properties.

Lemma B.3. Define h ( ϕ ) := f ( θ T ( ϕ ) , ϕ ) . Under Assumptions 3.2 and 3.3, h ( ϕ ) is L h -smooth, i.e., for any ϕ , ϕ ′ ∈ Φ ,

where L h = ( C Z +1) 2 L + CL Z , with C Z and L Z defined in Lemma B.2.

Proof. For simplicity of notation, we follow (5) and denote

For any ϕ , ϕ ′ ∈ Φ , following a similar proof as Lemma B.2, we have

Subsequently, we deduce that

where the first, third, and fourth lines all follow directly from Lemma B.2 and Assumption 3.3 (recall that the latter states that f is L -Lipschitz and C -smooth).

Now based on the aforementioned lemmas, we put forward the proof of our main theorem: the convergence analysis for our bilevel optimization method (FG) 2 U .

Theorem 3.4 (Convergence) . Suppose that Asumption 3.2 and Assumption 3.3 hold. Setting the learning rate β = ρ ( ρ +1) L h for gradient descent over the hyperparameter ϕ , we have

Proof. We have

where the second line is a well-known inequality for smooth functions with the L h -smoothness itself following from Lemma B.3, and the third line uses the gradient descent rule ϕ k +1 = ϕ k -β ˆ ∇ h ( ϕ k ) .

By Lemma 3.1 and the fact that ˆ ∇ h is unbiased (see the proof of Lemma 3.1), we know that

Therefore, taking the conditional expectation E [ · | ϕ k ] over (36) gives

Furthermore, taking the full expectation and telescoping (37) over k form 0 to K -1 yields

Choosing β = ρ ( ρ +1) L h , we have

Hence, Algorithm 1 requires O ( ϵ -1 ρ -1 ) steps to attain an ϵ -accurate stationary point.

C.3 Extended Discussions

Convergence of Problem (1). To extend the convergence of optimization problem (2) into (1), we need to assume that the lower-level objective function g is strongly convex w.r.t. θ as commonly done by previous works [60, 28]. From the strong convexity and first-order smoothness (Assumption 3.2) of g , we have 1) the zeroth and first-order smoothness of θ ∗ ( ϕ ) ; 2) ∥ θ T ( ϕ ′ ) -θ ∗ ( ϕ ′ ) ∥ → 0 as T → + ∞ . Then the inequality

implies the the zeroth and first-order smoothness of θ T ( ϕ ) . Following the same line of proof as presented in our paper, we derive the smoothness of f ( θ ∗ ( ϕ ) , ϕ ) and f ( θ T ( ϕ ) , ϕ ) , and subsequently the convergence of either problem (1) or (2).

However, as discussed in Section 2, given that the scope of this paper is large-scale BO, the inner optimization typically involves deep neural networks. Therefore, the optimal parameters are not explicitly accessible and can only be estimated through iterative procedures. Most related works [9, 60, 28] are implicitly or explicitly solving (2) instead of (1). Additionally, it is important to acknowledge that achieving strong convexity is often unfeasible in practical applications. Consequently, we focus on (2), aiming to present a more practical convergence theory that proves the effectiveness of our method.

D Zeroth-Order Derivative Estimator

In this section, we give a more detailed introduction to zeroth-order (ZO) derivative estimators. These estimators are pivotal in scenarios where the computation of exact derivatives is either infeasible due to memory constraints or computationally prohibitive. Apart from the forward gradient method employed in (FG) 2 U , randomized smoothing (RS) is another widely-used derivative estimator, both in Reinforcement Learning [22, 32] and Large Language Models [18, 47, 74].

For a function F : R n → R , gradient estimation via RS can be mathematically formulated as:

where b is the number of random samples, ϵ is the smoothing parameter, v i are samples drawn from a standard Gaussian distribution. Regarding the accuracy of estimation, it has been shown in [13, 42] that the variance of RS is roughly in the order of O ( N/b ) , which is the same as FG as proved in Lemma 3.1.

RS stands out particularly in its ability to estimate gradients of functions evaluated through black-box systems, where internal operations are inaccessible or highly complex. This characteristic makes RS exceptionally valuable in practical applications such as adversarial robustness and black-box optimization, where obtaining direct gradients might not be possible. Another advantage of RS is its robustness against noise and discontinuities in the function landscape. Unlike deterministic methods, the stochastic nature of RS allows it to approximate the gradient over a smoothed version of the function, providing stability in scenarios where slight perturbations can lead to substantial changes in the output.

While RS provides robust gradient estimates across various scenarios, it is critical to recognize that RS inherently introduces bias if the expectation is not computed during inference. In many CV and NLP applications, the computational expense of Monte Carlo sampling at the evaluation stage is prohibitive, leading to a biased estimation when using RS. However, in the context of inverse PDE problems, where the inner-loop solvers are non-differentiable numerical solvers, we employ RS as a zeroth-order derivative estimator.

E Detailed Task Description

E.1 Data Condensation

In the era of rapid advancement in machine learning, a multitude of foundation models [11, 6, 55] has benefited from training on large-scale datasets, exhibiting formidable performance that models trained on small-scale data cannot match. However, the exponential growth of data also presents challenges: (1) Models updated with only new data are prone to catastrophic forgetting [20] while retaining all historical data for subsequent training imposes significant storage and computational burdens. (2) Applications within the realm of meta-learning, such as hyperparameter tuning [46, 43] and neural architecture search [78, 38], necessitate multiple training iterations over datasets. The computational cost of these operations scales dramatically with the size of the datasets, posing a bottleneck for efficiency and scalability. (3) The widespread dissemination and utilization of datasets have raised significant concerns regarding privacy and copyright [12].

To overcome the challenges posed by large-scale datasets, a line of work known as data condensation [68, 72] has been proposed, with the idea to generate a compact, synthesized dataset, designed to elicit similar behaviors in machine learning models as those trained with the original, massive dataset. The objectives of the mainstream principles [72] designed for data condensation can be naturally formulated as a bi-level optimization problem. We focus on the best-known principle performance matching [72] on classification task, which can be formulated as,

We conduct our experiments to condense the following image datasets:

MNIST [35]: a handwritten digits dataset containing 60 , 000 training images and 10 , 000 testing images with the size of 28 × 28 from 10 categories.

CIFAR 10/100 [31]: colored natural images datasets contraining 50 , 000 training images and 10 , 000 testing images from 10 / 100 categories, respectively.

The scale of the condensed dataset will fundamentally impact the results. Therefore, we consider different scales for each dataset, with images per class set to 1, 10, and 50. The condensed dataset will be used to train random initialized models, and evaluated on a test dataset.

E.2 Meta Learning Online Adaptation of Language Models

The online adaptation of language models (LM) [34, 27] has been studied recently to keep the knowledge of LMupdated to date. However, trivial auto-regressive fine-tuning the LM with uniform weights for all tokens results in poor performance in downstream tasks, as the default average negative log-likelihood (NLL) loss does not accurately reflect the importance of tokens [25]. To address the issue, [25] proposed Context-aware Meta-learned Loss Scaling (CaMeLS) to meta-learning the weights of tokens for effective online adaption. More formally, let θ denote the parameter of the base model for adaptation, ϕ denote the parameter of a parametric weight model to assign weights for each token, the meta-learning online adaption of LM can be formulated as the following bi-level optimization,

We follow the setting studied by [25], where the downstream task is question-answering. The meta-objective consists of a question-answering term measuring the performance gained from adaptation, and a locality term that prevents the updated base model parameters from excessively changing the base model's behavior. Let D QA denotes the question-answering dataset, D loc denotes the locality dataset, and c ∈ R + denotes the weight of the locality term, then the meta objective is formally defined as

The inner objective is defined as a weighted NLL loss, where the weights are determined by the weight model w ϕ ,

The trained weight model is then fine-tuned on unseen online documents and evaluated on corresponding question-answering tasks.

E.3 Data-driven Discovery of Partial Differential Equations (PDEs)

1.00

0.75

0.50

0.25

0.00

0.25

0.50

0.75

1.00

x

0.0

0.2

0.4

0.6

0.8

1.0

time

Burgers

1.00

0.75

0.50

0.25

0.00

0.25

0.50

0.75

1.00

x

0.0

0.2

0.4

0.6

0.8

1.0

time

Allen-Cahn

1.00

0.75

0.50

0.25

0.00

0.25

0.50

0.75

1.00

x

0.0

0.2

0.4

0.6

0.8

1.0

time

KdV

1.0

0.5

0.0

0.5

1.0

1.5

2.0

We conducted experiments on three non-linear PDEs, with the latent solutions visualized in Figure E.1. The PDE structures (46) (47) (48) are assumed to be known while the PDE parameters ν in (46) (47) (48) are assumed to be unknown. For each equation, 64 observed data points are sampled on an 8 × 8 grid. The objective is to predict the unknown PDE parameters using the observed data. The predicted PDE parameters are evaluated by comparing the error with the ground truth, as well as the error in the corresponding prediction of the latent solution.

E.3.1 Burgers Equation

The nonlinear viscous Burgers equation is a pivotal partial differential equation arising in diverse domains of applied mathematics such as fluid mechanics, nonlinear acoustics, and traffic flow. This equation can be deduced

from the Navier-Stokes equations for the velocity field by omitting the pressure gradient term. In our experiment, the equation along with Dirichlet boundary conditions, is expressed as follows:

with actual viscosity ν = 0 . 01 π ≈ 0 . 0031831 . For PINN, following [44], we enforced the initial condition into the output by choosing a surrogate model of the solution as

where NN ( x ; θ ) is a neural network.

E.3.2 Allen-Cahn Equation

The Allen-Cahn equation is a reaction-diffusion equation of mathematical physics describing the process of phase separation in multi-component alloy systems, including order-disorder transitions. In our experiment, it is expressed as follows:

with the actual diffusion coefficient ν = 0 . 001 . For PINN, we enforced the initial condition into the output by choosing a surrogate model of the solution as

where NN ( x ; θ ) is a neural network.

E.3.3 Korteweg-De Vries (KdV) Equation

The Korteweg-de Vries (KdV) equation serves as a mathematical model for waves on shallow water surfaces. This equation is distinguished as a prototypical example of an integrable PDE. It is characterized by features typical of integrable systems, including a plethora of explicit solutions, notably soliton solutions, and an infinite number of conserved quantities. These properties are particularly noteworthy given the inherent nonlinearity of the equation, which generally complicates the solvability of PDEs. In specific, we consider:

̸

with the actual coefficient of dispersion ν equal to 0.0025. For PINN, we enforced the initial condition into the output by choosing a surrogate model of the solution as

where NN ( x ; θ ) is a neural network.

E.3.4 Numerical PDE solver

Numerical solvers play a critical role in the study and application of PDEs, enabling the simulation and analysis of complex physical phenomena that cannot be addressed analytically [51]. These solvers convert PDEs into a form that can be handled computationally, typically by discretizing the domain into a finite set of points or elements and approximating the derivatives. Conventional numerical methods include finite difference methods, finite element methods, and spectral methods [1].

Among the various numerical methods for solving PDEs, spectral methods stand out for their ability to deliver highly accurate solutions, particularly for problems with smooth solutions [21, 7]. Spectral methods involve representing the solution to a PDE as a sum of basis functions, such as trigonometric polynomials, which are globally defined over the domain. This approach contrasts with finite difference or finite element methods, where the solution is localized to the grid points or elements. In this paper, we mainly adopt spectral methods, as we focus on the Burgers, Allen-Cahn, and KdV equations. All these three equations can be efficiently and accurately resolved by spectral techniques.

F Implementation Details

F.1 Data Condensation

We conducted our experiments following the standard data condensation setting established by [68, 77, 67]. The condensation and evaluation are both performed on a depth-3 convolutional neural network [58]. The hyperparameters we used for (FG) 2 U are summarized in Appendix F.1. All experiments are conducted on NVIDIA-L40S (40G).

F.2 Meta Learning Online Adaptation of Language Models

We adhered to the standard settings of CaMeLS [25] and adapted their official code for our implementation. The only modification made was replacing the meta gradient approximation module with (FG) 2 U. It is important to note that the base models used for meta-learning were initially pre-trained on a split QA-paired set. While the official codebase provided the script for pretraining, it did not include the exact base model (weights) they used. We executed the official script to generate the pre-trained base models and observed that meta-learning performance is sensitive to the choice of base models. For a fair comparison, we reported both the results from [66] (where CaMeLS [25] presented performance improvements over baselines using bar plots without specific metric values) and the results with our best custom pre-trained base models. Following the two-phase training paradigm introduced in Section 3.2, we performed training of (FG) 2 U on RGU (DistilGPT2, unrolled depth 6) results. The hyperparameters we used for (FG) 2 U are summarized in Appendix F.2, while all remaining hyperparameters were kept the same as in [25]. All experiments are conducted on one NVIDIA A100 GPU (80G).

F.3 Data-driven Discovery of Partial Differential Equations (PDEs)

The hyperparameters we used for this experiment are summarized in Appendix F.3. All experiments are conducted on NVIDIA-L40S (40G). The structure for PINN is a depth-9 and width-20 MLP with tanh activations.

G Additional Experimental Results

G.1 Meta Learning Online Adaptation of Language Models

Ablation results on the unrolled depth and the base model are summarized in Table G.1 and Table G.2.

NeurIPS Paper Checklist

The checklist is designed to encourage best practices for responsible machine learning research, addressing issues of reproducibility, transparency, research ethics, and societal impact. Do not remove the checklist: The papers not including the checklist will be desk rejected. The checklist should follow the references and follow the (optional) supplemental material. The checklist does NOT count towards the page limit.

Please read the checklist guidelines carefully for information on how to answer these questions. For each question in the checklist:

You should answer [Yes] , [No] , or [NA] .

[NA] means either that the question is Not Applicable for that particular paper or the relevant information is Not Available.

Please provide a short (1-2 sentence) justification right after your answer (even for NA).

The checklist answers are an integral part of your paper submission. They are visible to the reviewers, area chairs, senior area chairs, and ethics reviewers. You will be asked to also include it (after eventual revisions) with the final version of your paper, and its final version will be published with the paper.

The reviewers of your paper will be asked to use the checklist as one of the factors in their evaluation. While "[Yes] " is generally preferable to "[No] ", it is perfectly acceptable to answer "[No] " provided a proper justification is given (e.g., "error bars are not reported because it would be too computationally expensive" or "we were unable to find the license for the dataset we used"). In general, answering "[No] " or "[NA] " is not grounds for rejection. While the questions are phrased in a binary way, we acknowledge that the true answer is often more nuanced, so please just use your best judgment and write a justification to elaborate. All supporting evidence can appear either in the main paper or the supplemental material, provided in appendix. If you answer [Yes] to a question, in the justification please point to the section(s) where related material for the question can be found.

IMPORTANT, please:

Delete this instruction block, but keep the section heading 'NeurIPS paper checklist" ,

Keep the checklist subsection headings, questions/answers and guidelines below.

Do not modify the questions and only use the provided macros for your answers .

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: The main claims made in the abstract and introduction accurately reflect the paper's contributions and scope.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: We discuss the limitations of the work in Section 5.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: The assumptions are included in Section 3.1, and the complete proof is placed in Appendix C.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and cross-referenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: To the best of our knowledge, all the information needed to reproduce the main experimental results are included in Section 4, Appendix E, and Appendix F.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [No]

Justification: The data used in this paper is public. We will release the code on the acceptance of the paper.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/public/ guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https://nips.cc/public/ guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: To the best of our knowledge, all necessary information has been included in Section 4, Appendix E, and Appendix F.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: We have reported the error bars in Data Condensation experiments and Data-driven Discovery of PDE experiments. For Meta Learning Online Adaptation of LM experiments, we adhere to the standard evaluation protocol as employed in [25, 66], specifically, using the identical evaluation script with the same random seed, to ensure a fair comparison, hence, without error bars.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: We provide the information of computer resources in Appendix F.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: The research conducted in the paper conforms, in every respect, with the NeurIPS Code of Ethics.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: The research presented in this paper focuses on fundamental algorithms rather than specific applications. Consequently, it is challenging to predict the potential social impacts of this work.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: We do not have plans to release any new data or models in conjunction with this work.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: All usages of the related assets are accompanied by formal citations and comply with the respective licensing terms and conditions.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: We do not have plans to release any new assets or models in conjunction with this work. The code, which will be released upon acceptance, will be well documented, and the documentation will also be made publicly available.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: The paper does not involve crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: The paper does not involve crowdsourcing nor research with human subjects

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis 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.\n\nSTRENGTHS:\n1.\tThe presentation is great and I feel relaxed to read this paper.\n2.\tThe experiment is extensive including both small and large scale settings.\n\nWEAKNESSES:\n1.\tThe 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. \n2.\tBased 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?\n3.\tIn 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?\n4.\tThe 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? \n5.\tCan authors provide real space consumption in the comparison (Table 1, Table 2)?\n\nQUESTIONS:\nSee weakness part.\n\nLIMITATIONS:\nSee weakness part.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-10"}

comments: 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

LIMITATIONS:
NA
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2024-07-10

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis 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.\n\nSTRENGTHS:\n- The proposed method (FG)^2U is simple and easy to implement. \n- The writing is clear and easy to follow.\n- The theoretical results clearly demonstrate the relationship between convergence, sampling batch size, and parameter space size.\n- 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.\n\nWEAKNESSES:\nA 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\n- With a fixed batch size, convergence on large-scale applications would be slow (vanilla (FG)^2U without additional techniques).\n- With an $O(N)$ batch size, convergence is satisfactory, but the memory cost grows as $O(MN)$, similar to FGU.\n- 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$\n\nQUESTIONS:\nRegarding 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}$?\n\nLIMITATIONS:\nThe paper appears to have no potential negative societal impact. The authors discussed the limitations in the Appendix H.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-11"}