A Bayesian-Symbolic Approach to Learning and Reasoning for Intuitive Physics

1 INTRODUCTION . Imagine a ball rolling down a ramp . If asked to predict the trajectory of the ball , most of us will find it fairly easy to make a reasonable prediction . Not only that , simply by observing a single trajectory people can make reasonable guesses about the material and weight of the ball and the ramp . It is astonishing that while the exact answers to any of these prediction and reasoning tasks requires an indepth knowledge of Newtonian mechanics and solving of some intricate equations , yet an average human can perform such tasks without any formal training in physics . Even from an early age , humans demonstrate an innate ability to quickly learn and discover the laws of physical interactions with very limited supervision . This allows them to efficiently reason and plan action about commonsense tasks even in absence of complete information ( Spelke , 2000 ; Battaglia et al. , 2013 ) . Recent studies suggest that this ability of efficient physical reasoning with limited supervision is driven by a noisy model of the exact Newtonian dynamics , referred as the intuitive physics engine ( IPE ; Bates et al. , 2015 ; Gerstenberg et al. , 2015 ; Sanborn et al. , 2013 ; Lake et al. , 2017 ; Battaglia et al. , 2013 ) . As sample-efficient physical reasoning is recognized as a core domain of human common-sense knowledge ( Spelke & Kinzler , 2007 ) ; therefore an important problem in artificial intelligence is to develop agents that not only learn faster but also generalize beyond the training data . This has lead to a surge in works aimed at developing agents with an IPE or a model of the environment dynamics ( Amos et al. , 2018 ; Chang et al. , 2016 ; Grzeszczuk & Animator , 1998 ; Fragkiadaki et al. , 2015 ; Watters et al. , 2017 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ; Ehrhardt et al. , 2017 ; Kipf et al. , 2018 ; Seo et al. , 2019 ; Baradel et al. , 2020 ) . Among these , neural-network based learned models of physics ( Breen et al. , 2019 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ) tend to have good predictive accuracy but poor sample efficiency for learning . On the other hand , symbolic models ( Ullman et al. , 2018 ; Smith et al. , 2019 ; Sanborn et al. , 2013 ; Bramley et al. , 2018 ) are sample efficient but fail to adapt or accommodate any deviation from their fixed physics engine . Inspired by humans ’ highly data-efficient ability of learning and reasoning about their environment , we present Bayesian-symbolic physics ( BSP ) , the first fully Bayesian approach to symbolic intuitive physics that , by combining symbolic learning of physical force laws and statistical learning of unobserved properties of objects , enjoys the sample efficiency of symbolic methods with the accuracy and generalization of data-driven learned approaches . In BSP , we pose the evolution of the environment dynamics over time as a generative program of its objects interacting under Newtonian mechanics using forces , as shown in figure 2 . Being a fully Bayesian model , we treat objects and their properties such as mass , charge , etc . as random variables . As force laws are simply functions of these properties under the Newtonian assumption , in BSP we replace data-hungry neural networks ( NN ) with symbolic regression ( SR ) to learn explicit force laws ( in symbolic form ) and then evolve them deterministically using equations of motion . But a naive SR implementation is not enough : a vanilla grammar that does not constrain the search space of the force-laws can potentially have far worse sample efficiency and accuracy than a neural network . Therefore , we also introduce a grammar of Newtonian physics that leverages dimensional analysis to induce a physical unit system over the search space and then imposes physics-based constraints on the production rules , which help prune away any physically meaningless laws , thus drastically speeding up SR. Our main contributions are threefold : • We introduce a fully differentiable , top-down , Bayesian model for physical dynamics and an expectation-maximization ( EM ) based algorithm , which combines Markov chain Monte Carlo ( MCMC ) and SR , for maximum likelihood fitting of the model . • We introduce a grammar of Newtonian physics that appropriately constrains SR to allow data-efficient physics learning . • Through empirical evaluations , we demonstrate that the BSP approach reaches human-like sample efficiency , often just requiring 1 to 5 observations to learn the exact force laws – usually more than 10x fewer than that of the closest neural alternatives . 2 RELATED WORK . At a high level , the logic of physics engines can be decomposed into a dynamics module and a model of how the entities interact with each other depending on their mutual properties . These modules can be further divided into more components depending on how the module is realized . Using this break-down , we can categorize different models of physics based on what components of the model are learned . In figure 1 , we compare some of the recent models of physics that are of closely related to our work . Starting on the right end , we have fully learned , deep neural-network approach used by Breen et al . ( 2019 ) that do not use any prior knowledge about physics and therefore learn to predict dynamics completely in purely data-driven way . In the middle are hybrid models that introduce some prior knowledge about physical interaction or dynamics in their deep network based prection model . These include interaction networks ( INs ; Battaglia et al. , 2016 ) , ODE graph networks ( OGNs ) and Hamiltonian ODE graph networks ( HOGNs ; Sanchez-Gonzalez et al. , 2019 ) . Since these approaches employ deep networks to learn , they tend to have very good predictive accuracy but extremely bad sample efficiency and therefore require orders of magnitude more data to train than humans ( Ullman et al. , 2018 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ) . On the other end of the spectrum ( left ) are the fully symbolic , rule-based physics models and engines ( Smith et al. , 2019 ; Allen et al. , 2019 ; Wu et al. , 2015 ; Ullman et al. , 2018 ) . While these methods are suitable for reasoning tasks , they lack the flexibility of the data-driven , learned models as they can not generalize or adapt to any changes in the environment that their fixed physics engine simulates . For example , in such fixed models , inference can fail on physically implausible scenes and may require additional tricks to resolve such issues ( Smith et al. , 2019 ) . Symbolic regression has been used for general physics learning in many prior works ranging from Schmidt & Lipson ( 2009 ) that used SR to discover force laws from experimental data to the more recent work of Cranmer et al . ( 2020 ) on distilling symbolic forces from INs using genetic algorithms . Even more recently , Udrescu & Tegmark ( 2020 ) proposed an interesting framework AI Feynman , which recursively simplifies the SR problem using dimensional analysis and symmetries discovered by neural networks to discover the underlying physics equation that generated the data . The focus of these prior work has been to discover the underlying physical equations that directly leads to the observed data but unlike our approach , they do not target to allow for reasoning in physical environments , that is common task of interest in intuitive physics studies . 3 BAYESIAN-SYMBOLIC PHYSICS . Our framework , Bayesian-symbolic physics , combines symbolic learning of physical force laws with Bayesian statistical learning of object properties such as mass and charge . The environment is modelled by a probabilistic generative model governed by Newtonian dynamics . Physical laws are learnable symbolic expressions that determine the force exerted on each object , based on the position and properties of other objects . These properties might not be observed , so they are treated as latent variables and learned in a Bayesian fashion . The physical laws themselves have a prior distribution to organize the search space and discourage the model from learning physically meaningless laws ; we call this distribution a grammar of Newtonian physics . To learn with incomplete data , we are inspired by results from Ullman et al . ( 2018 ) , humans are able to simultaneously predict the trajectory and update their inference about the properties of the object under new observation . This motivates an EM-based learning and inference method to fit BSP models . In the E-step , we obtain the distribution of entity properties by sampling from their posterior distribution using the current guess of force laws , and in the M-step , we use the samples from the E-step to perform SR to update the force functions . This enables BSP models to learn and reason in environment with incomplete information . 3.1 GENERATIVE MODEL OF THE ENVIRONMENT . We represent each entity i ∈ { 1 . . . N } by a vector of properties zi , such as mass , charge , coefficient of friction , and shape , some of which may be unobserved . At each time step t , a state vector sit = ( p i t , v i t ) is associated with each entity i , where p i t ∈ Rd and vit ∈ Rd are position and velocity vectors respectively and d is the dimensionality of the environment , typically 2 or 3 . Let { τ i } Ni=1 , where τ i = pi1 : T : = ( p i 1 , . . . , p i T ) , be the set of observed trajectories from an environment with N entities . Together with a prior on z , the generative process of BSP defines a joint probability distribution p ( D , z ; F ) over the observed trajectory data D and latent properties z given the force function F .1 An example of the generative process of a three-body problem is shown in figure 2 . The state transition of an entity in a Newtonian system depends not only on its properties and current state but also on its interaction with other entities in the environment . Therefore , we define a pairwise interaction function F ( zi , si , zj , sj ) , where i , j ∈ { 1 . . . N } ; we interpret F as the force applied to i due to its interaction with j . Then , the trajectory τi of each entity is generated by a transition function T that consumes the current state and all of its interactions as sit+1 = T ( sit , F ( z i , sit , z 1 , s1t ) , . . . , F ( z i , sit , z N , sNt ) ) . ( 1 ) As forces are additive , forces on entity i can be easily summed to get the total force applied as f it = ∑N j=1 F ( z i , sit , z j , sjt ) . Similar to Sanchez-Gonzalez et al . ( 2019 ) , we use numerical integration to simulate the Newtonian dynamics , updating s with the acceleration obtained from f it . 1As physical dynamics are typically sensitive to initial states , we assume the noise-free initial states are given either as part of the data D or as a point-mass prior over the initial state , thus are omitted in the notation . Specifically , we choose the Euler integrator since its update rules correspond to the basic relations between position , velocity and acceleration . With these specifications , equation 1 becomes ait = f i t/m i , vit+1 = v i t + at∆t , p i t+1 = p i t + v i t+1∆t , ( 2 ) where mi is the mass of the recipient of the force f it and ∆t is the step size of the Euler integrator . Finally , we add Gaussian noise to each trajectory { τ i } Ni=1 , that is , D : = { τ̃ i } Ni=1 where τ̃ i : = ( p̃i1 , . . . , p̃ i T ) , p̃ i t ∼ N ( pit , σ2 ) and σ is the noise level . For clarity , Appendix A provides the complete generative process represented by a probabilistic program .

Summary: The paper proposes an Bayesian-symbolic physics (BSP), an intuitive physics model that jointly infers symbolic force laws and object properties (mass, friction coefficient). The inductive bias is force summation, F=ma, and a grammar of force laws to express object interactions. The inference is done via an EM method that alternates between object property estimation (E-step) and force law induction (M-step), using techniques like symbolic regression and Hamiltonian Monte Carlo (HMC). Some preliminary experiments are shown for the method's effectiveness and data efficiency.