SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Krzysztof Kacprzyk
University of Cambridge kk751@cam.ac.uk
Zhaozhi Qian
University of Cambridge  
zq224@cam.ac.uk
University of Cambridge, The Alan Turing Institute mv472@cam.ac.uk
Closed-form differential equations, including partial differential equations and higher-order ordinary differential equations, are one of the most important tools used by scientists to model and better understand natural phenomena. Discovering these equations directly from data is challenging because it requires modeling relationships between various derivatives that are not observed in the data (equation-data mismatch) and it involves searching across a huge space of possible equations. Current approaches make strong assumptions about the form of the equation and thus fail to discover many well-known phenomena. Moreover, many of them resolve the equation-data mismatch by estimating the derivatives, which makes them inadequate for noisy and infrequent observations. To this end, we propose D-CIPHER, which is robust to measurement artifacts and can uncover a new and very general class of differential equations. We further design a novel optimization procedure, CoLLie, to help D-CIPHER search through this class efficiently. Finally, we demonstrate empirically that it can discover many well-known equations that are beyond the capabilities of current methods.
Scientists have been using mathematical equations to describe the world for centuries. In particular, closed-form differential equations turned out to be one of the best tools to model physical phenomena. A differential equation describes a relationship between a quantity and its derivatives (rates of change); it is called closed-form if this relationship is described by a mathematical expression consisting of a finite number of variables, constants, arithmetic operations, and some well-known functions (e.g., exponent, logarithm, trigonometric functions)<sup>1</sup>. Closed-form differential equations provide a general description of reality in a concise representation that is amenable to closer inspection by scientists. This renders them transparent and interpretable to human experts.
Discoveries of these equations required a thorough knowledge of the theory, strong mathematical skills, substantial creativity, and good intuition. The goal of this work is to discover closed-form differential equations directly from data thus accelerating the process of scientific discovery.
Challenges in discovering differential equations from data
- Partial and higher-order derivatives. Many algorithms [10, 42] can only identify Ordinary Differential Equations (ODEs) which evolve only with respect to one variable (usually time). In contrast, many natural phenomena are described by equations involving many variables (e.g., spatial coordinates) called Partial Differential Equations (PDEs). Many equations also involve higher-order derivatives.
Detailed discussion in Appendix A.2
- Derivatives not observed. Discovering differential equations from data is challenging because the derivatives are usually not observed in the dataset (equation-data mismatch [42]). This makes verifying a candidate equation a non-trivial task. Most of the methods try to resolve this issue by estimating the derivatives [10, 47]. However, derivative estimation is difficult, especially when the data is sampled infrequently or with high noise [42, 35]. For an illustrative study, see Appendix F.
- Strong assumptions and constrained search space. The majority of algorithms for identifying differential equations make many assumptions about the form of the equation. In particular, they make the evolution assumption (defined and explained later) and assume that the equation can be represented as a linear combination of prespecified functions and differential operators [10, 35]. However, many well-known equations, such as a forced harmonic oscillator or an inhomogeneous wave equation, cannot be represented in that way.
Currently, a few algorithms tackle only some of these challenges. In particular, Weak SINDy [35] is able to discover PDEs without estimating the derivative by utilizing a variational approach. However, the form of the equation is constrained to be in a form amenable for a sparse regression algorithm. D-CODE [42], on the other hand, uses a variational approach in conjunction with a symbolic regression algorithm to discover closed-form ODEs. However, it cannot handle higher-order derivatives or multiple independent variables, so it cannot be used to discover closed-form PDEs. The algorithms that do not require the evolution assumption appeared in [33] and [23] but they require derivative estimation and only consider equations represented as linear combinations of prespecified functions.
Contributions. In this work, we develop the Discovery of Closed-form Partial and Higher-order Differential Equations in a Robust Way framework (D-CIPHER) that does not estimate the derivatives, requires fewer assumptions, has a broader search space than previous techniques, and works for both higher-order ODEs and PDEs. Our contributions are as follows:
- We examine the landscape of different types of PDEs from the discovery perspective. In particular, we introduce new notions such as evolution form, evolution assumption, derivative-bound part, and derivative-free part. We use them to describe what kinds of PDEs can be discovered with current methods and to motivate our new class of differential equations. (Section 3)
- We propose a new general class of PDEs (Variational-Ready PDEs) that admit the variational formulation (and thus allows to circumvent the derivative estimation). We also prove a theorem that motivates a novel objective function. (Section 5)
- We use the novel objective function to develop D-CIPHER, a new algorithm that searches over the Variational-Ready PDEs. (Section 6)
In addition to the main contributions above, we also develop a new optimization procedure (CoLLie) to help D-CIPHER search through this space efficiently. (Section 7)
In this section, we provide background information about PDEs and their variational formulation.
Notation and definitions. We denote the set  $\{1,2,\dots ,n\}$  as  $[n]$  and the set of non-negative integers as  $\mathbb{N}_0$ . Throughout this paper we let  $M,N,K\in \mathbb{N}$  be some natural numbers and let  $\Omega \subset \mathbb{R}^{M}$  be an open set inside  $\mathbb{R}^M$ . A comprehensive table with all symbols used in this work can be found in Appendix A together with some definitions restated more formally.
Going beyond ODEs. The simplest differential equations are ordinary differential equations that describe quantities that evolve with respect to only one independent variable, usually time. Most methods assume that the ODE is explicit and can be represented as a system of first-order ODEs:
$$
\dot {u} _ {j} (t) = f _ {j} (t, \boldsymbol {u} (t)) \tag {1}
$$
where  $\dot{u}_j$  represents the derivative of  $u_j$ . Then the discovery problem is reduced to deciding the order of the derivative (usually first or second) and the discovery of  $f_j$ .
For PDEs, it is not enough to talk about the derivative, as we can take derivatives with respect to different variables. We denote the mixed derivative as  $\partial^{\alpha}$ , where  $\alpha \in \mathbb{N}_0^M$  is called a multi-index, and define it as  $\partial^{\alpha} = \partial_{1}^{\alpha_{1}}\partial_{2}^{\alpha_{2}}\ldots \partial_{M}^{\alpha_{M}}$ . Each  $\partial_i^{\alpha_i} = \partial^{\alpha_i} / \partial x_i^{\alpha_i}$  is a  $\alpha_{i}^{\mathrm{th}}$ -order partial derivative with respect to  $x_{i}$  (the  $i^{\mathrm{th}}$  independent variable) $^2$ . We define the order of  $\alpha$  as  $|\alpha| = \sum_{i=1}^{M}\alpha_{i}$ . We call  $\partial^{\alpha}$  non-trivial if  $|\alpha| > 0$ .
2 Throughout this work we assume that the functions we use are smooth enough for the equality of mixed partials [50] to hold. In that case, any mixed derivative can be uniquely specified by a multi-index.
A PDE of order  $K$  is any equation of the form
$$
f (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x}), \partial^ {[ K ]} \boldsymbol {u} (\boldsymbol {x})) = 0 \forall \boldsymbol {x} \in \Omega \tag {2}
$$
where  $\partial^{[K]}u$  are all non-trivial mixed derivatives of all  $u_{j}$  ( $j\in [N]$ ) up to the  $K^{\mathrm{th}}$  order. We call a PDE closed-form if  $f$  is closed-form.
Variational formulation (VF) of PDEs is a way to describe PDEs without referring to their derivatives [19]. It works as follows: we take a differential equation, we multiply it by a special testing function, and integrate. Finally, we perform integration by parts to move the derivatives from the dependent variable  $u$  onto the testing functions. E.g., for a homogeneous heat equation,
$$
\partial_ {t} u - \theta \partial_ {x} ^ {2} u = 0 \Longleftrightarrow \int_ {\mathbb {R} ^ {2}} \left(\partial_ {t} u - \theta \partial_ {x} ^ {2} u\right) \phi d t d x = 0 \forall \phi \Longleftrightarrow \int_ {\mathbb {R} ^ {2}} - u \partial_ {t} \phi + \theta u \partial_ {x} ^ {2} \phi d t d x = 0 \forall \phi \tag {3}
$$
For more details, see Appendix A and B. By not depending on the derivatives, methods that utilize VF are more robust to noise than their derivative-estimating counterparts [42, 35, 36].
3 Relaxing assumptions while staying robust to noise
Below, we introduce the evolution assumption (EA) and the linear combination (LC) assumption made by the current discovery methods.
Evolution Assumption. Although there is no generally accepted notion of an explicit PDE (as is the case for ODEs), we define an evolution form of a PDE to be an equation of the form
$$
\partial^ {\alpha} u _ {j} (\boldsymbol {x}) = f (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x}), \partial^ {[ K ] / \alpha} \boldsymbol {u} (\boldsymbol {x})) \forall \boldsymbol {x} \in \Omega \tag {4}
$$
where  $\partial^{[K] / \alpha}$  is  $\partial^{[K]}$  with  $\partial^{\alpha}$  omitted,  $\alpha$  is a known multi-index and  $j\in [N]$ . Note that if  $M = 1$  and  $|\alpha | = K$  then Equation 4 becomes exactly the definition of an explicit ODE.
In fact, many algorithms for PDE discovery assume a particular evolution form [35]. We call it an evolution assumption (EA). However, this assumption requires the knowledge of  $\alpha$  and  $j$  which might not be trivial. Usually,  $\partial^{\alpha}$  is assumed to be the first derivative with respect to time  $(\partial_t)$  [47] but it is not the case for many well-known PDEs such as the wave equation or Gauss's law.
Linear combinations. Current PDE discovery algorithms [47, 35, 12] consider PDEs that are linear in parameters. That means the PDE can be represented as a linear combination of functions, i.e.,
$$
\sum_ {p = 1} ^ {P} \theta_ {p} f _ {p} (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x}), \partial^ {[ K ]} \boldsymbol {u} (\boldsymbol {x})) = 0 \forall \boldsymbol {x} \in \Omega \tag {5}
$$
where  $\theta_p \in \mathbb{R}$  for  $p \in [P]$  are the only constants that are optimized. As there are lots of expressions that cannot be put in that form, these algorithms fail to discover more complex equations. In particular, for an unknown  $\theta \in \mathbb{R}$  functions such as  $\sin(\theta x_i)$ ,  $e^{\theta x_i}$  or  $\frac{1}{x_i + \theta}$  cannot be learned by these algorithms.
How to relax these assumptions and still allow for variational formulation? Current methods that utilize VF either assume that the PDE is in an LC form or they only work for explicit first-order ODEs. Moreover, all of them also make the evolution assumption. Relaxing LC is not trivial because not all PDEs admit VF. As in Equation 3, the PDE has to be a sum of terms for which the integration by parts can be performed. Our crucial observation is that for any term that does not contain any derivatives (and thus does not need to be integrated by parts) no additional constraints need to be put in place. Due to the significance of these terms, we propose the following characterization of a PDE.
Derivative-bound part and derivative-free part. Any PDE can be expressed in the form
$$
f (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x}), \partial^ {[ K ]} \boldsymbol {u} (\boldsymbol {x})) - g (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x})) = 0 \forall \boldsymbol {x} \in \Omega \tag {6}
$$
where we collect all the terms with the derivatives into  $f(\pmb{x}, \pmb{u}(\pmb{x}), \partial^{[K]}\pmb{u}(\pmb{x}))$  and all terms without the derivatives into  $g(\pmb{x}, \pmb{u}(\pmb{x}))$ . We call  $f$  the derivative-bound part and  $g$  the derivative-free part (denoted also  $\partial$ -bound and  $\partial$ -free).  $\partial$ -free part can be evaluated directly given  $\pmb{u}$ , whereas the  $\partial$ -bound part requires access to the derivatives. Note that for first-order ODEs,  $f$  is trivial and equal to  $\dot{u}_j$ .
Constraints on the derivative-bound part. Although VF does not require any constraints on the  $\partial$ -free part, we still need to put some constraints on the  $\partial$ -bound part for the integration by parts to
Table 1: Columns correspond to challenges outlined in Section 1 and answer the following questions: Can it discover PDEs? Does it avoid derivative estimation? Is the evolution assumption unnecessary (Equation 4)? Can it discover any closed-form  $\partial$ -free part (Equation 6)?
Method	PDEs	No ∂ estimation	No evolution assumption	Any closed-form ∂-free part
SINDy [10]	✗	✗	✗	✗
SINDy-implicit [33]	✗	✗	✓	✗
PDE-FIND [47]	✓	✗	✗	✗
PDE-Net 2.0 [29]	✓	✗	✗	✗
WSINDy [35, 46]	✓	✓	✗	✗
D-CODE [42]	✗	✓	✗	✓
D-CIPHER	✓	✓	✓	✓
work. This is what we do in Section 5, where we aim to define currently the broadest form of PDEs that admit the variational formulation using the above characterization.
Optimization challenge. D-CIPHER does not need the evolution assumption and it can even discover some PDEs that cannot be put into the evolution form. Moreover, unlike previous methods, D-CIPHER is not limited to PDEs that can be represented as a linear combination of functions (we describe the exact form we assume in Section 6). This makes the optimization problem much harder as we search over all closed-form functions  $g$  and for each candidate, we try to find the best counterpart  $f$  among the allowed expressions. This is very different from the previous approaches, which either do not need to find  $f$  as they work only for first-order ODEs [42] or they constrain equally both the  $\partial$ -bound part and  $\partial$ -free part to be a linear combination of some pre-specified functions [35] (for more details, see Table 10, and Table 11 in Appendix F). One way we address this challenge is by developing a new optimization procedure (Section 7).
4 Related works
Symbolic Regression. The goal of symbolic regression is to find a closed-form expression that best models the given dataset both in terms of accuracy and simplicity. In contrast with the conventional regression analysis which optimizes the parameters of a pre-specified model, symbolic regression aims at discovering both the general structure and the parameters of the model. Most of the existing work focuses on developing optimization algorithms. Genetic Programming [26] has been widely used for that task [49]. A different strategy has been employed in AI Feynman [54, 55] that uses neural networks to reduce the search space by identifying simplifying properties like symmetry or separability. Optimization methods based on pre-trained neural networks [4, 20], reinforcement learning [40], and Meijer-G functions [1, 13] have also been proposed.
Data-driven discovery of closed-form differential equations. Data-driven discovery of physical laws is an established area of machine learning [6, 49]. The pioneering work in that area was SINDy [10] that constrained the space of equations to linear combinations of functions from a predefined library and used sparse regression to discover explicit ODEs. It was later extended to include implicit ODEs [33, 23] and PDEs [47, 48]. Various other extensions were proposed by improving the derivative estimation and the training procedure [45, 61], adding additional selection criteria [32] and learning the library using genetic programming [34, 12, 62]. A different approach is taken by [29] (an extension of [30]) which uses convolutional and symbolic neural networks. It is important to note that all of these methods still assume the PDE to be a linear combination as discussed in Section 3 (Equation 5) which significantly limits their search space. Some other developments are based on Gaussian processes [44, 43] but they require the exact form of the PDE and only optimize the parameters.
Variational approach. Recently, the variational approach has been used as a viable alternative to derivative estimation. However, they have only been used for differential equations in a linear combination form [35, 36, 46] or closed-form first-order ODEs [42]. Extending the variational approach to closed-form PDEs is not trivial as PDEs are much more complex than ODEs and not all closed-form PDEs admit the variational formulation. In fact, the approaches that learn the library mentioned in the previous paragraph can produce exactly such terms which prohibits the use of variational formulation. To address these challenges we use the new notions defined in Section 3 to define a new and general class of PDEs in Section 5 that admit the variational formulation.
5 Variational-Ready PDEs
In this section, we propose a new and very general class of PDEs, the Variational-Ready PDEs (VR-PDEs), which can be characterized without referring to the derivative. The VR-PDEs allow arbitrary  $\partial$ -free part but make some minor restrictions on the  $\partial$ -bound part. These restrictions allow one to use the variational formulation of PDEs to circumvent derivative estimation entirely. Despite the minor restriction, VR-PDEs contain many well-known PDEs, including all linear PDEs, Maxwell's equations, and Navier-Stokes equations (additional examples provided in Appendix B).
To define the new class of PDEs, we need the following definition.
Definition 1 (Extended derivative and differential operator). Let  $\alpha \in \mathbb{N}_0^M$ ,  $|\alpha| \leq K$ , be a multi-index. Let  $h: \mathbb{R}^{M + N} \to \mathbb{R}$  and  $a: \mathbb{R}^M \to \mathbb{R}$  be smooth functions. An extended derivative  $\mathcal{E}$ , denoted  $(\alpha, a, h)$ , maps a vector field  $\boldsymbol{u}: \mathbb{R}^M \to \mathbb{R}^N$  to a function  $\mathcal{E}[\boldsymbol{u}]: \mathbb{R}^M \to \mathbb{R}$  defined as:
$$
\mathcal {E} [ \boldsymbol {u} ] (\boldsymbol {x}) = a (\boldsymbol {x}) \partial^ {\alpha} [ h (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x})) ] \tag {7}
$$
$\mathcal{E}$  is called closed-form if  $a$  and  $h$  are closed-form. We call  $\mathcal{E}$  non-degenerate if  $|\alpha| > 0$ .
Now, let  $(\mathcal{E}_p)_{p\in [P]}$  be a finite sequence of non-degenerate extended derivatives. The extended differential operator, denoted as  $\mathcal{E}_{[P]}$  is an operator defined as:
$$
\mathcal {E} _ {[ P ]} [ \boldsymbol {u} ] (\boldsymbol {x}) = \sum_ {p = 1} ^ {P} \mathcal {E} _ {p} [ \boldsymbol {u} ] (\boldsymbol {x}) \tag {8}
$$
Remark. Any linear operator  $L = \sum_{\alpha \in A} a_{\alpha} \partial^{\alpha}$  acting on  $u_{j}$  is an extended differential operator.
Definition 2 (Variational-Ready PDE). Let  $\mathcal{E}_{[P]}$  be an extended differential operator, and let  $g: \mathbb{R}^{M + N} \to \mathbb{R}$  be a continuous function. We denote a Variational-Ready PDE (VR-PDE) by a pair  $(\mathcal{E}_{[P]}, g)$  and define it as:
$$
\mathcal {E} _ {[ P ]} [ \boldsymbol {u} ] (\boldsymbol {x}) - g (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x})) = 0 \forall \boldsymbol {x} \in \Omega \tag {9}
$$
We extend the standard variational formulation of PDEs (Proposition 1 in Appendix B) from linear PDEs to all VR-PDEs. The following definition is useful in further discussion.
Definition 3. Consider a field  $\mathbf{u} : \Omega \to \mathbb{R}^N$ , and an extended derivative  $\mathcal{E} = (\alpha, a, h)$ . Let  $\phi : \Omega \to \mathbb{R}$  be a testing function (  $\mathcal{C}^K$  function with compact support). We define the functional
$$
\mathcal {F} (\mathcal {E}, \boldsymbol {u}, \phi) = \int_ {\Omega} h (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x})) (- 1) ^ {| \boldsymbol {\alpha} |} \partial^ {\boldsymbol {\alpha}} [ a (\boldsymbol {x}) \phi (\boldsymbol {x}) ] d \boldsymbol {x}
$$
We can now use this functional to formulate variational characterization of VR-PDEs.
Theorem 1.  $\pmb{u}:\Omega \to \mathbb{R}^{N}$ , where  $u_{j}\in \mathcal{C}^{K}$ , is a solution to a VR-PDE in Equation 9 if and only if
$$
\sum_ {p = 1} ^ {P} \mathcal {F} \left(\mathcal {E} _ {p}, \boldsymbol {u}, \phi\right) - \int_ {\Omega} [ g (\boldsymbol {x}, \boldsymbol {u} (\boldsymbol {x})) \phi (\boldsymbol {x}) ] d \boldsymbol {x} = 0 \tag {10}
$$
for all testing functions  $\phi :\Omega \to \mathbb{R}$
Proof. Appendix B.
This theorem motivates the variational loss function as we expect the left-hand side of Equation 10 to be closer to 0 the closer the candidate PDE is to the true one. To calculate how well a set of vector fields  $\mathcal{D} = \{\pmb{u}^{(d)}\}_{d=1}^{D}$  matches a VR-PDE  $(\mathcal{E}_{[P]}, g)$  we propose the following loss function.
$$
\mathcal {L} \left(\mathcal {E} _ {[ P ]}, g\right) = \sum_ {d = 1} ^ {D} \sum_ {s = 1} ^ {S} \left(\sum_ {p = 1} ^ {P} \mathcal {F} \left(\mathcal {E} _ {p}, \boldsymbol {u} ^ {(d)}, \phi_ {s}\right) - \int_ {\Omega} g (\boldsymbol {x}, \boldsymbol {u} ^ {(d)} (\boldsymbol {x})) \phi_ {s} (\boldsymbol {x}) d \boldsymbol {x}\right) ^ {2} \tag {11}
$$
where  $\{\phi_s\}_{s = 1}^S$  is a set of predefined testing functions.
This novel loss function makes it possible to evaluate to what extent any VR-PDE matches the observed data. This loss can be used as an optimization objective in any algorithm that searches over some subspace of closed-form VR-PDEs. We propose D-CIPHER in Section 6 as an example of such an algorithm.
3We say  $u:\mathbb{R}^M\to \mathbb{R}$  is in  $\mathcal{C}^K$  if  $\partial^\alpha u$  exists and is continuous for all  $|\pmb {\alpha}|\leq K$
6 D-CIPHER
In this section, we formulate the problem of PDE discovery and then we introduce a novel algorithm (D-CIPHER) to solve it. The diagram and pseudocode are presented in Figure 1 and in Appendix C.
Problem formulation We are given a dataset of observed fields  $\mathcal{D} = \{\pmb{v}^{(d)}\}_{d=1}^{D}$  with a finite sampling grid  $\mathcal{G} \subset \Omega$ . Each  $\pmb{v}^{(d)}(\pmb{x})$  is a noisy measurement, i.e.,  $\pmb{v}^{(d)}: \mathcal{G} \to \mathbb{R}^N$  is defined as
$$
v _ {j} ^ {(d)} (\boldsymbol {x}) = u _ {j} ^ {(d)} (\boldsymbol {x}) + \epsilon_ {j} ^ {(d)} (\boldsymbol {x}) \forall \boldsymbol {x} \in \mathcal {G} \forall j \in [ N ] \tag {12}
$$
where  $\epsilon_{j}^{(d)}(\pmb{x})$  is a realization of a zero-mean random variable (noise), each  $u_{j}^{(d)}:\Omega \to \mathbb{R}$  is a  $\mathcal{C}^K$  function, and every true field  $\pmb{u}^{(d)}$  is governed by the same closed-form PDE  $f$ . The task is to infer the closed-form PDE,  $f$ , from the dataset  $\mathcal{D} = \{\pmb{v}^{(d)}\}_{d=1}^{D}$  and the sampling grid  $\mathcal{G}$ . We assume that  $f$  is inside the class of closed-form VR-PDEs (Section 5) and its  $\partial$ -bound part is inside a subspace of extended differential operators spanned by a user-specified dictionary (see Step 1 below).
We propose an algorithm that consists of three steps. In the first step, we define the subspace of closed-form VR-PDEs we want to search over to reflect our knowledge of the problem. In the second step, we reconstruct the fields from noisy measurements. In the last step, we solve an optimization problem using a modified symbolic regression algorithm. For more details, check Appendix C.