Transforming Worlds: Automated Involutive MCMC for Open-Universe Probabilistic Models

Introduction Open-universe probabilistic models (OUPMs) enable Bayesian inference about the existence and attributes of latent objects underlying observed data, as well as their interconnections. Prominent applications include seismic monitoring for global nuclear safety (Arora et al., 2013; Arora, 2012) ; information extraction from natural language documents (Russell et al., 2016) ; generating realistic 3D scenes with varying numbers of objects (Yeh et al., 2012) ; "inverse graphics" approaches to breaking CAPTCHAs (Mansinghka et al., 2013) and inferring 3D scenes from 2D data (Kulkarni et al., 2015; Zinberg et al., 2019) ; and simultaneous deduplication, cleaning, and record linkage from real-world databases with millions of records . Because the state space in OUPMs has a priori unknown dimension, popular black-box inference algorithms such as Hamiltonian Monte Carlo cannot be applied. Instead, applications rely on custom MCMC kernels. These kernels use application-specific, data-driven heuristics to intelligently delete, split, or merge hypothesized objects, "birth" new objects, and modify the properties of and relationships between objects. Although these proposals can be designed and justified in the reversible-jump MCMC framework, this is often challenging. As Brooks et al. (2003) noted, "the application of reversible jump...has predominantly remained within the domain of the MCMC expert," due to the difficulty of deriving and implementing effective RJMCMC kernels. This abstract introduces a new framework for OUPM inference that makes it easier to design and implement custom, data-driven kernels. We adapt involutive MCMC (Cusumano-Towner et al., 2020; Neklyudov et al., 2020) , a generalization of reversible-jump MCMC, to the setting of OUPMs. This enables software to automatically generate correct and scalable implementations of complex, application-specific kernels from high-level user specifications. Users design inference programs that propose incremental changes to possible worlds, creating, deleting, or modifying objects according to data-driven, application-specific heuristics; these proposals are automatically converted into stationary MCMC kernels via an accept/reject step. To automatically compute the acceptance probability, our approach leverages program tracing and dependency tracking (for efficient computation of proposal and model densities) and differentiable programming (for the Jacobian determinant). Preliminary experiments on (1) an auditory scene analysis application (Cusimano et al., 2018) (Figure 3 ) and (2) Gaussian mixture modeling with an unknown number of components (Richardson and Green, 1997) (Figure 4) show that our approach enables data-driven kernels that are faster than generic probabilistic programming language (PPL) inference and generic birth/death RJMCMC kernels without application-specific customizations. Related Work. We build on involutive MCMC, introduced by Cusumano-Towner et al. (2020) as a framework supporting higher degrees of automation for application-specific MCMC algorithms, and (independently) as a mathematical generalization of many classic MCMC methods by Neklyudov et al. (2020) . Our main theoretical contribution is a generalization of involutive MCMC to OUPMs. We compare our approach to the generic ancestral resampling MH algorithm (Wingate et al., 2011) used by PPLs such as BLOG (Milch et al., 2005a) . Previous work has explored using application-specific kernels for BLOG models (Milch and Russell, 2012) , but requires modifying the BLOG inference engine's source code. The Gen (Cusumano-Towner et al., 2019) and Stochaskell (Roberts et al., 2019) PPLs support forms of automated reversible-jump MCMC, but neither features high-level OUPM inference constructs; custom kernels in both languages operate on low-level program traces, not high-level world representations, which can compromise ease of use and asymptotic performance. The automation technique proposed by Roberts et al. (2019) does not support unrestricted use of auxiliary variables, and (e.g.) cannot handle the algorithms benchmarked in Figure 3 . Zhou et al. (2020) introduced an automated inference approach applicable to OUPMs, which does not address the implementation of custom MCMC kernels.
 Open Universe Probabilistic Models Figure 1 shows an open-universe model for inferring the set of seismic events underlying observed detections from seismic monitoring stations. A priori, it is unknown how many events there are, and which detections correspond to the same event (or, in the case of spurious false positives, to no event at all). Standard probabilistic graphical models are ill-suited for encoding this sort of uncertainty about the number of objects reflected in a dataset and their causal relationships. Open-universe probabilistic models enable reasoning about such problems, by defining generative processes over entire relational domains. Model specification. An OUPM is fully specified by: (1) a finite set T of object types (in Figure 1 , Event, Station, and Detection); (2) a finite set N τ of possible origins for each object type τ (in Figure 1 , a Detection may originate from a (Station, Event) pair, or from a single (Station) that records a false positive); (3) a countable set P of typed object properties P (τ 1 , . . . , τ n ) (such as magnitude(Event) and reading(Detection)); and (4) a contingent Bayesian network C over a set of random variables that encode the number of objects that exist, as well as their properties and relationships (Milch et al., 2005b) . Contingent Bayesian networks. The probabilistic structure of an OUPM is given by a contingent Bayesian network C over an infinite set V of possible variables. These variables are defined in terms of objects: we write τ ((o 1 , . . . , o n ), i) to refer to the i th object of type τ with origin (o 1 , . . . , o n ). Then each node v ∈ V of the contingent Bayesian network corresponds to either a number variable N τ (o 1 , . . . , o n ), which represents the number of objects of type τ with origin (o 1 , . . . , o n ), or to a property variable P (o 1 , . . . , o n ), which represents the value of the property P for the given tuple of objects. Like an ordinary Bayesian network, a contingent Bayesian network uses a directed graph to describe the probabilistic dependencies among variables. However, the edges in a CBN's graph are contingent: they are Algorithm 1 Automated Involutive MCMC for OUPMs procedure OUPM-IMCMC(p, q, f, x) (y, qx(y)) ← SampleAndScore(q, x) (U, M, y , J) ← ProcessInvolution(f, (x, y)) (x , p(x ) p(x) ) ← UpdateWorld(x, U, M ) q x ( y ) ← Score(q, x , y ) with probability p(x ) p(x) × q x (y ) × 1 qx(y) × J return x else return x end procedure procedure ProcessInvolution(f, (x, y)) Track continuous reads and writes, manipulation moves M , and property updates U (Rd, Wr, M, U, y ) ← {}, {}, [ ], {}, {} Execute f , but with each manipulation command m (create, delete, change, split, merge) ≡ (M ← M ∪ {m}) "proposed[k]" ≡ (if y[k] is continuous: Rd ← Rd ∪ {y[k]}; y[k]) "set backward[k] = v" ≡ (if v is continuous: Wr ← Wr ∪ {y[k]}; y ← y ∪ {k → v}) "get(P (o1, . . . , on))" ≡ (v ← x[P (o1, . . . , on)]; if v is continuous: Rd ← Rd ∪ {v}; v) "set P (o1, . . . , on) = v" ≡ (if v is continuous: Wr ← Wr ∪ {v}; U [P (o1, . . . , on)] ← v) J ← uninitialized |Rd| × |Rd| matrix for i in {1, . . . , |Wr|}: Execute f with reverse-mode AD to compute ∂Wr[i] ∂Rd[j] for each j ∈ {1, . . . , |Rd|} J[:, i] ← ∇ Rd (Wr[i]) return (U, M, y , |det J|) end procedure labeled with predicates, involving the other possible variables, determining the conditions under which they are active. The conditional distribution for a variable v, p v (ω[v] | ω P aω(v) ), may depend only on v's active parents P a ω (v) in a particular possible world ω. Induced probability distribution over minimal self-supporting instantiations. Fixing a set U ⊆ V of observed variables (in Figure 1 , {detections()}), the CBN C can be used to define a probability distribution over minimal self-supporting instantiations (MSSIs) for U : finite assignments w to a subset of variables vars(w) ⊆ V, where U ⊆ vars(w), such that (1) w is self-supporting-if v ∈ vars(w) and u ∈ P a w (v) then u ∈ vars(w); and (2) w is minimal -if any variable v ∈ U were removed from w it would no longer be self-supporting. Let W be the set of all possible minimal self-supporting instantiations for a fixed set U of observed variables, and let vars(W) = {vars(w) | w ∈ W} be the set of possible setsof-variables that can be jointly specified by a minimal self-supporting instantiation. For v ∈ vars(W), let v d be the set of all possible joint assignments to the discrete variables in v. Then we can define a reference measure µ over the space W of MSSIs, given by µ(E) = v∈vars(W) w d ∈v d λ |v|−|w d | ({w c | w ∈ E∧vars(w ) = v∧∀v ∈ vars(w d ), w [v] = w d [v]}), where w c is the vector of values of the continuous variables in an MSSI w, and λ k is the Lebesgue measure on R k . With respect to µ, the probability density for the OUPM, as a distribution over MSSIs, is given by p (w) = v∈vars(w) p v (w[v] | {u → w[u] | u ∈ P a w (v)}). 1 + + + + +
 Involutive MCMC for Open Universe Models An involutive MCMC kernel (Cusumano-Towner et al., 2020; Neklyudov et al., 2020) for a target density p on a measure space (X, Σ X , µ X ) uses a three-step process to transform a state x into a next state x . First, auxiliary variables y are sampled from a state-dependent proposal with density q x , defined over a measure space (Y, Σ Y , µ Y ). Second, an involution 2 f is applied to (x, y) to obtain (x , y ): x is the proposed next state, and y is an auxiliary variable value that would cause the kernel to propose the old state x from the new state x (since f (x , y ) = (x, y)). Third, an acceptance probability α(x, y, x , y ) is computed. With probability α, x is the Markov chain's next state; otherwise the state x is repeated. Cusumano-Towner et al. (2020) show that this process yields a stationary kernel for p when α(x, y, x , y ) = p(x )q x (y ) p(x)q x (y) × d(µ • f −1 ) dµ (x, y) , (1) where d(µ•f −1 ) dµ is the Radon-Nikodym derivative of the pushforward of µ = µ X ×µ Y through f with respect to µ. In general, this does not yield a constructive procedure for computing this Radon-Nikodym derivative, but Cusumano-Towner et al. (2020) show that when p and q are distributions over a space D of finite dictionaries, i.e., finite sets of key-value pairs, the Radon-Nikodym derivative can be computed as the determinant of a Jacobian matrix. It turns out (Theorem 1) that a similar result holds when p is an open-universe model. Suppose f is an involution on the space W × D, and that there is a countable partition {C i } of W × D such that: (i) (x, y) ∈ C i =⇒ f (x, y) ∈ C i , (ii) for all (x, y) ∈ C i , the total number of continuous values in minimal self-supporting instantiation x, plus the number of continuous values in dictionary y, is constant, and (iii) for each C i , for (x, y) ∈ C i , there is a differentiable bijection h i : R k i → R k i mapping the continuous values in x and y to continuous values in x and y (where (x , y ) = f (x, y)). Then, we have: Theorem 1 For any open universe model with density p, any collection of distributions over finite dictionaries with densities q x , and any involution satisfying the above conditions, involutive MCMC with α(x, y, x , y ) = p(x )q x (y ) p(x)qx(y) ×| det(Jh i (x, y))| is stationary for p, where Jh i (x, y) is the Jacobian of h i at the continuous variables of (x, y), and i is s.t. (x, y) ∈ C i . The proof involves a translation to the finite dictionary case, and exploits the structure of minimal self-supporting instantiations to guarantee the necessary properties of f .
 Automation of Acceptance Probability via PPLs and AD We have extended the Gen probabilistic programming system (Cusumano-Towner et al., 2019) with new constructs for OUPMs (sample code in Figure 1 ) and automated involutive MCMC for these models (Figure 2 , Algorithm 1). The contributions are: (1) a new modeling language for open-universe models, capable of efficiently simulating MSSIs, evaluating densities, and modifying world states; (2) a new DSL for defining object-based involutive MCMC proposals (Appendix C); and (3) an automated implementation of involutive MCMC for open-universe models, which automatically calculates acceptance ratios via probabilistic and differentiable programming techniques (Algorithm 1). See Appendix D for more details.
 Experiments Auditory scene analysis. We implemented a variant of Cusimano et al. (2018) 's model of human auditory scene perception, which is based on an OUPM of sound sources with properties including amplitude, type, pitch, and duration. See Figure 3 for an example problem, and Appendix A.2 for details. We implemented two custom, data-driven kernels: a data-driven sound detection kernel (Figure 11 ) that applies image-filtering and edgedetection to frequency-domain spectrograms and proposes new audio sources to explain sounds it detects in the data but not in the currently-hypothesized world, and a datadriven sound splitting kernel (Figure 12 ) that splits long sounds into shorter ones at endpoints detected in the observed soundwaves. We also implemented two baseline inference strategies: an ancestral resampling kernel (Figure 9 ) based on generic PPL inference in BLOG; and a generic birth/death RJMCMC kernel (Figure 10 ) that proposes to create a sound with parameters generated from the prior, or delete a sound. Figure Figure 3(b) shows quantitative performance comparisons indicating superior performance for custom datadriven kernels. Common failure modes of the generic kernels are illustrated in Figure 3(c) . Open-universe Gaussian mixture modeling. We also implemented Richardson and Green (1997) 's data-driven inference algorithm for clustering in a Gaussian mixture model with an unknown number of components. See Appendix A.1 for details, including an illustration in Figure 4 . We have found that BLOG inference typically fails to accept moves to world states with different numbers of clusters, whereas the data-driven algorithm rapidly mixes. Note that Richardson and Green (1997) 's algorithm includes a split-merge kernel with a Jacobian term that our approach calculates automatically. Ben Zinberg, Marco Cusumano-Towner, and Vikash K. Mansinghka. Structured differentiable models of 3D scenes via generative scene graphs. In Workshop on Perception as Generative Reasoning, 2019. URL https://pgr-workshop.github.io/img/PGR025. pdf.
 Appendix A. Experimental Details A.1. Open-universe Gaussian Mixture Model. Richardson and Green (1997) develop a series of highly data-driven MCMC kernels for a Gaussian mixture model with an unknown number of mixture components. Here we compare their algorithm, implemented using our system for involutive MCMC in OUPMs, to the generic inference engine in BLOG. The model is as follows. The number of mixture components, k, is a Poisson random variable. The mixture weights and the parameters of each mixture component are drawn from the appropriate conjugate priors: w 1 , . . . , w k ∼ Dirichlet(δ1 k ) µ j ∼ N (ξ, 1/κ) σ 2 j ∼ inverse-gamma(α, β), where 1 k denotes a vector of ones in R k ; w j , µ j , and σ 2 j denote the weight, mean, and variance of the j-th mixture component respectively; and α, β, δ, κ, and ξ are fixed hyperparameters. Lastly, for the i-th data point we sample a cluster allocation, and given the cluster allocation, we sample a value from the assigned cluster; ie. z i ∼ Categorical(w 1 , . . . , w k ) y i ∼ N (µ z i , σ 2 z i ) Our involutive MCMC proposal consists of first updating the weights, means, variances, and allocations using Gibbs updates, and then performing a split or merge move to change the number of clusters. The Gibbs updates are given by w 1 , . . . , w k | . . . ∼ Dirichlet(w 1 + n 1 , . . . , w k + n k ) µ j | . . . ∼ N κξ + σ −2 j z i =j y i σ −2 j n j + κ , σ −2 j n j + κ −1 σ 2 j | . . . ∼ inverse-gamma(α + 1 2 n j , β + z i =j (y i − µ i ) 2 ) p(z i = j| . . .) ∝ N (µ j , σ 2 j ), where n j denotes the number of data points allocated to the j-th cluster. Our merge moves consist of choosing indices j 1 = j 2 and j \* uniformly at random and merging the j 1 -th and j 2 -th clusters into the j \* -th cluster. We ensure that the zeroth, first, and second moments of the newly generated cluster match the corresponding moments in the mixture of the original clusters; i.e. w \* = w 1 + w 2 w \* µ \* = w 1 µ 1 + w 2 µ 2 w \* (µ \* + σ 2 \* ) = w 1 (µ 1 + σ 2 1 ) + w 2 (µ 2 + σ 2 2 ). ( 2 ) To ensure ergodicity, our split procedure relies on three auxiliary variables and generates new clusters according to u 1 ∼ beta(2, 2) u 2 ∼ beta(2, 2) u 3 ∼ beta(1, 1), w 1 = w \* u 1 w 2 = w \* (1 − u 1 ) µ 1 = µ \* − u 2 σ \* w 2 /w 1 µ 2 = µ \* + u 2 σ \* w 1 /w 2 σ 2 1 = u 3 (1 − u 2 2 )σ 2 \* w \* /w 1 σ 2 2 = (1 − u 3 )(1 − u 2 2 )σ 2 \* w \* /w 2 . (3) Using ( 2 ) and ( 3 ), we can derive our involution's Jacobian matrix (leaving out rows and columns which merely copy a value): J =               µ \* σ 2 \* w \* u 1 u 2 u 3 w 1 0 0 u 1 w \* 0 0 µ 1 1 − u 2 w 2 w 1 2σ \* 0 − u 2 σ \* − u 1 −1 u 1 2u 1 (u 1 −1) −σ \* w 2 w 1 0 σ 2 1 0 − u 3 w \* (u 2 2 −1) w 1 0 u 3 σ 2 \* (u 2 2 −1) u 2 1 − 2u 2 u 3 w \* σ 2 \* w 1 − w \* σ 2 \* (u 2 2 −1) w 1 w 2 0 0 1 − u 1 −w \* 0 0 µ 2 1 u 2 w 1 w 2 2σ \* 0 − u 2 σ \* − u 1 u 1 −1 2u 1 (u 1 −1) σ \* w 1 w 2 0 σ 2 2 0 w \* (u 2 2 u 3 −u 2 2 −u 3 +1) w 2 0 σ 2 \* (u 2 2 u 3 −u 2 2 −u 3 +1) (u 1 −1) 2 2u 2 w \* σ 2 \* (u 3 −1) w 2 w \* σ 2 \* (u 2 2 −1) w 2               . Given a specification of the inference kernel, our system automatically calculates this Jacobian matrix and its determinant |det J| = w \* |µ 1 − µ 2 |σ 2 1 σ 2 2 u 2 (1 − u 2 2 )u 3 (1 − u 3 )σ 2 \* without the user needing to work through this derivation. Figure 4 shows representative results, in which the involutive MCMC proposal accurately recovers the true latent clusters, whereas the ancestral sampling proposal only roughly narrows down the component parameters. Richardson and Green (1997) .
 A.2. Auditory Scene Interpretation. Auditory scene analysis Bregman (1994) is a perception task that involves separating an audio waveform into individual sound sources when the number and properties of the sources are unknown a-priori (Figure 3a ). Recently, Cusimano et al. (2018) proposed a computational model of human auditory scene analysis based on an open-universe probabilistic model of sound sources, and showed that probabilistic inference in this model based on MCMC is able to qualitatively reproduce human inferences about auditory scenes, including reporting ambiguity in the same situations as humans. The model. We developed a simplified version of the model of Cusimano et al. (2018) that uses a prior distribution on the number of sounds and the type of each sound ('tone' or 'white noise'). Tones have an unknown frequency, onset time, and duration, and white noise sounds have an unknown amplitude, onset time, and duration. Inference Experiments. We implemented four involutive MCMC kernels for this model in our extended version of Gen. We performed experiments applying these kernels to the audio waveform shown in Figure 3a , which consists of a short tone, followed by a short period of white noise, followed by a short tone at the same frequency as the first tone (Cusimano et al., 2018) . When the noise is very loud, humans tend to hear one continuous tone temporarily obscured by a loud noise, whereas when the noise is quiet, humans hear two distinct short tones, with noise in the middle. Our example uses a softer noise, and our best-performing inference programs, which use application-specific kernels implemented via our framework, recover the true decomposition (two tones separated by noise). However, generic inference kernels often incorrectly infer a single long tone (Figure 3 ). In addition to testing our kernels on the specific audio scene in Figure 3a , we tested them on 100 audio scenes generated from our model's prior distribution, with similar results (Figure 8 ).
 Generic Kernels The first two kernels we implemented are not application specific or data driven. Our ancestral resampling kernel (Figure 9 ) resimulates a single variable from the prior distribution (also ancestrally generating any additional variable values which need to be added to the world due to the resimulated variable). Our generic birth-death reversible-jump kernel (Figure 10 ) randomly proposes to create or delete individual sounds, proposing new sounds' properties from the prior. We cycle this kernel with the ancestral resampling kernel so that property values of existing sounds can more easily be updated. Figure 3 (b) shows that in our experiments, these two kernels converge to inferences of latent waveforms under which the observed sounds are substantially less likely than under the latent waveforms our data-driven kernels recover. Figure 3 (c) visualizes two common failure mode these kernels exhibit due to their inability to efficiently incorporate evidence from the data, and their inability to make proposals to split long sounds into short ones (which require application-specific logic to calculate endpoints of the new sounds based on the position of the sound being split). We found that the generic birth-death kernel often failed to exit a local minimum in which a single continuous tone is inferred instead of two temporally separated tones of the same frequency (Figure 3c , left). The generic kernel performs worst-it usually infers one continuous tone, but often also infers spurious tones. Aside: proposing from the prior in involutive MCMC. To facilitate proposing values from the prior in involutive MCMC kernels, we have implemented a regenerate command which can be called from within the involution DSL. (For examples, see Figures 9, 10, and 11.) The command regenerate properties of object samples a value from the prior for each property of the given object (using the prior as it will appear in x ). This complicates our picture of involutive MCMC slightly, as there are now random values being sampled during the execution of the involution function, instead of only in the proposal probabilistic program. We thus must view the proposal function as only implementing part of the q distribution and sampling part of y, with the rest of q implemented by the involution DSL's regenerate commands. To ensure involutiveness, when a transition (x, y) → (x , y ) uses a regenerate command, the reversing move (x , y ) → (x, y) must specify in y the value sampled by regeneration during the forward move. To specify reverse-move values for non-regenerated values, users use syntax backward[addr] = value, where addr is the address (variable name) at which the proposal function should sample this value. Since users do not specify an address for the values in y which are regenerated (unlike values in y which are sampled in the proposal function), we provide the following additional syntax syntax: backward[property(object)] = regenerated sets the value in y for regenerating the variable property(object) to the value of property(object) in x, and backward[properties of object] = regenerated does this for all properties of object. See Section E for more details. Custom kernels. Some specific domains, like data-clustering, have seen standard MCMC kernels developed for data-driven inference, which are fairly conceptually simple but previously required fairly deriving fairly involved calculations (Richardson and Green, 1997; Wang and Russell, 2015) . In addition to facilitating the implementation of these types of kernels and removing the need to manually derive acceptance probabilities, involutive MCMC facilitates the development of data-driven kernels in more complicated domains which involve complicated logic to use information from data effectively. For instance, Cusimano et al. (2018) 's experiments used MCMC inference with a proposal based neural-Figure 9 : Our ancestral resampling kernel, which selects a random variable and samples a new value for it from the prior. The only complication is that when we sample the number variable (changing the number of audio sources in the world), we must also generate new properties for any newly created audio sources. (These properties are also generated from the prior.) For details on generating values from the prior in involutive MCMC, see Section E. Figure 10 : The generic birth/death kernel either creates or deletes a random sound. When a new sound is created, its properties are all generated from the prior. For details on generating values from the prior in involutive MCMC, see Section E. network transformations of observed soundwaves, implemented in an early version of our inference programming system. For our experiments in this paper, we developed a roughly 250-LOC image-filtering and edge-detection algorithm to analyze observed soundwaves and detect possible errors in the currently inferred latent sounds. We called this sound-analysis program from within 2 involutive MCMC kernels we developed, which our system automated the implementation of, including efficiently updating world states and calculating the Jacobian correction term. Our data-driven sound detection kernel (Figure 11 ) either proposes to delete a sound, or to create a new sound which with high probability is proposed at a time and frequency where our analysis program detected a sound in the data but not the currently inferred latents. Figure 3 (b) and Figure 8 show that this kernel both initially performs better than the generic kernels, and ultimately converges to a better state. We also add a data-driven sound splitting kernel (Figure 12 ), which either proposes to merge two short tones/noises into a long one, or splits a long sound into two short ones, The kernel uses an image-filtering edge-detection algorithm detect sounds (not shown) to detect noises and tones in the observed sound waves which are not explained by the currently hypothesized audio sources. Heuristic scoring functions birth score and death score (not shown) are used to score the value of adding detected sounds to the latents, or deleting sounds in the current latents. Based on these scores, either a currently inferred sound is selected to be deleted (a DeathAction), or a detected sound is selected to be created, with some noise added to the detected sound parameters (a "birth" move). To ensure reversibility, death moves must select which detected sound will be sampled during the reversing birth move. If no compatible sounds will be detected during a reversing birth, the death move will specify that the reversing birth should be "dumb" (non-data-driven) and create a sound generated from the prior. Figure 12 : The data-driven sound splitting kernel either chooses to split one long sound into two short ones, or merge two short tones into a longer one. In the split move, we use a similar edgedetection algorithm to what was used in the create detected sound kernel to detect changepoints in the observed sound during the time at which the sound being split occurs. The kernel proposes an endpoint for the first new sound and a startpoint for the second new sound to be close to the detected changepoints. proposing endpoints for the new sounds based on the analysis of the sounds. Figure 3(b) and Figure 8 show that the addition of this kernel substantially speeds up convergence. This is to be expected, since this kernel can integrate information from the data about another class of possible mistakes in inferred latents: when one sound has been mistakenly interpreted as two, or vice versa. We cycle both of the data-driven kernels with Gaussian drift kernels for the parameters of inferred audio sources. A.2.1. The automated acceptance probability for the data-driven sound detection kernel To illustrate the calculations our system automates, we give the acceptance probability calculation performed when running the data-driven sound detection kernel, including calculating the Jacobian of the transformation. Model density. We can factor the density of the model, p(x), as p(x) = p(x L )p(x O |x L ), where x L is the collection of latent variable values in x (the number of underlying sound sources, and the properties of each one), and x O is the observed sound waves variable in x. For any x where each variable is within its support, the probability of the latents is: p(x L ) = 1 4 x N S i=1 (p(x D,i ) × p(x τ,i ) × p(x (α|f ),i ) × p(x n,ys )) = 1 4 x N S i=1 (( 1 L − 0.1 ) × ( 1 L − 0.1 ) × ( N (x (α|f ),i , 8, 10) x n,i = 1 1 24−0.4 otherwise ) × 0.4 x n,i (1 − 0.4) 1−x n,i ) Here, x N S is the number of sound sources in MSSI x (the value of the number variable number Source()); x D,i is the duration of the ith audio source in x; x τ,i is the starttime of the ith audio source in x; x n,i is an indicator which is 1 if the ith source in x is a noise and 0 otherwise; x (α|f ),i denotes the amplitude of the ith sound in x if it is a noise, and the frequency of this sound if it is a tone. We let L denote the length of the rendered audio tones (which is a global constant). The probability of the observation given the latents is: p(x O | x L ) = N (x O , r(x L ), I |r(x L )| ) where x O denotes the observed soundwaves in x (from the observed sound property in Figure 7 ) represented as a vector, r(x L ) denotes the rendering of the latent audio sources in x into sound-waves, and I k denotes the k-dimensional identity matrix. State-dependent proposal density. The state-dependent proposal distribution q x (y) is parameterized by a current MSSI x. It is a distribution over finite dictionaries, implemented as a Gen program. Using standard techniques from probabilistic programming, Gen can automate the computation of densities of dictionaries sampled by the proposal: q x (y) =                  (1 − β(x))φ n (x) yn φ(x; y n ) y i (β ρ (x, y i )θ ρ (x, y i ; y n ) y s ) yρ (1 − β ρ (x, y i )) 1−yρ y b = 0 β(x)•(1−βσ(x)) x N S +1 • (0.4•N (yα;8,10)) yn •(0.6•(37−0.4) −1 ) 1−yn (L−0.1) 2 y b = 1 ∧ y σ = 0 β(x)•βσ(x) x N S +1 • θ n (x) yn θ(x; y n ) ys • N T       y D y τ y v(yni)    ;    R D R τ R v(yn)    ,    D D (x, y s , y n ) D τ (x, y s , y n ) D v(yn) (x, y s , y n )    ,    0.1 0 0 0 0.1 0 0 0 σ v(yn)       y b = 1 ∧ y σ = 1 Here, x N S is the number of sound sources in MSSI x, and y b determines whether a new sound source will be proposed; if y b = 1, y σ determines whether the new source will be proposed using the data-driven edge-detection proposal or from the prior. (In Figure 11 , y b corresponds to do birth; y σ to do smart birth.) y n is an indicator for whether the source being created/deleted is white noise, as opposed to a tone (y n is objtype in Figure 11 when y b = 0 ∨ y σ = 1, and is proposed via regenerate when y b = 1 ∧ y σ = 0). When y σ = 1, an index y s is computed determining which of the sounds from the image-filtering and edge-detection algorithm with the type indicated by y n will be proposed (the index of sample action in Figure 11 ). Based on y s , new sound onset and duration parameters y τ and y D , as well as either a frequency y f or an amplitude y α . When the data-driven proposal is not used (y b = 1 ∧ y σ = 0), y α (or y f ), y n , and other parameters are proposed from the model's prior over sound sources. If y b = 0, a death move is proposed, to delete sound y i . The variable y ρ is introduced to enable the implementation of an involution: it represents whether the move reversing a proposed death move will be data-driven. If y ρ = 1, y s represents which heuristically detected sound source with the type indicated by y n will be used as the basis to repropose the deleted audio source, in the reverse proposal. N T (v; R, µ, Σ) denotes the PDF of a multivariate truncated normal distribution with ranges R, means µ, and covariance matrix Σ, evaluated at v. The proposal is based on a number of functions, as well as the scene length parameter L, the standard deviations σ α = 4 and σ f = 1, and the ranges R D = (0.1, 1), R τ = (0, L), R f = (0.4, 24), and R α = (−∞, ∞). These functions, and some additional functions needed for their definitions, are described below: • k(x, y n ) is the number of possible sounds to create of type y n detected in state x • S B (x, i, y n ) is a score for the action of creating a sound close to the ith detected sound of type y n , from a user-written scoring heuristic • S D (x, i ) is a score for the action of deleting the ith sound in the current world, from a user-written scoring heuristic (a different heuristic from S B ) • π B (x) = 1 yn=0 k(x,yn) i=1 S B (x,i,yn) 1 yn=0 k(x,yn) i=1 S B (x,i,yn)+ x N S i=1 S D (x,i) is the total score of all detected birth actions, divided by the total score of all detected birth and death actions • β(x) =      π B (s)+π \* B π R 1+π R x N S ∈ (0, 4) 0 x N S = 4 1 x N S = 0 is the probability of y b = 1, given x. Hyperparameter π \* B = 0.5 is a prior probability of doing a birth move, not factoring in the scores assigned to detected actions, and hyperparameter π R = 0.1 is the probability of making a decision to do a birth vs death move without considering the scores. • β σ (x) = 1 − 0.05 [|θ(x)|>0] is the probability of y σ = 1 given that y b = 1 for MSSI x. • β ρ (x, i) is 0, if removing sound i from x and running image filtering and edge detection does not find any sounds of the same type as sound i in x, and 0.95 otherwise. • D D (x, i, y n ) is the predicted duration of the i th detected sound source of type y n from the image filtering and edge detection algorithm applied to x. Similarly, D τ gives the predicted onset, D α the predicted amplitude (if applicable), and D f the predicted frequency (if applicable). • v(y n ) is the symbol α (amplitude) if y n = 1 and the symbol f (frequency) if y n = 0. • θ n (x) = {0 → k(x,0) i=1 S B (x,i,0) k(x,0) i=1 S B (x,i,0)+ k(x,1) i=1 S B (x,i,1) , 1 → k(x,1) i=1 S B (x,i,1) k(x,0) i=1 S B (x,i,0)+ k(x,1) i=1 S B (x,i,1) } is a dictionary from values of y n to the probability of choosing to birth an object of type y n based on the heuristically-assigned S B scores. • φ n (x) = {0 → i∈N∩(0,x N S ):x n,i =0 S D (x,i) x N S i=1 S D (x,i) , 1 → i∈N∩(0,x N S ):x n,i =1 S D (x,i) x N S i=1 S D (x,i) } gives the probability of deleting a noise vs deleting a tone. • θ(x; y n ) is a vector-valued function, taking values in the (k(x, y n ) − 1)-simplex. It represents a distribution over more or less promising detections based on the S B scores. In particular, θ(x; y n ) j = S B (x,j,yn) k(x,yn) i=1 S B (x,i,yn) . • φ(x; y n ) is a vector-valued function representing a distribution over which existing audio source of type y n to delete. In particular, φ(x; y n ) j = S D (x,j) i∈N∩(0,x N S ):x n,i =0 S D (x,i) . • θ ρ (x, i; y n ) is a vector-valued function, taking values in the (k ρ (x, i, y n )-1) simplex, where k ρ (x, i, y n ) is the number of detected sounds of type y n from the edge detection routine, applied to x without sound source i. In particular, θ ρ (x, i; y n ) j ∝ N T     x D,i x τ,i x v(yn),i   ;   R D R τ R v(yn) )   ,   D ρ D (x, i, j, y n ) D ρ τ (x, i, j, y n ) D ρ v(yn) (x, i, j, y n )   ,   0.1 0 0 0 0.1 0 0 0 σ v(yn)     where D ρ D , D ρ τ , D ρ α , and D ρ f are functions on (x, i, j, y n ) giving the duration, onset, and amplitude/frequency of the jth sound of type y n detected via the detector applied to x without source i. The Jacobian. The create detected sound kernel always either creates or deletes a sound; we show the Jacobian of the matrix for a move which creates a sound (the transpose of which is the Jacobian of the matrix for the corresponding deletion). The transition (x, y) → (x , y ) during a creation copies over every continuous value in x and y into x . These values come from the properties starttime (τ ) and duration (D) of each source, and the amplitude (D) property of each noise or frequency (f ) property of each tone. Depending on the index of the newly-created sound, the indices of each object may change, as is described in . In particular, when we birth a new source with index i, we must increment the index of each existing source with index ≥ i. We define the following identifiers for whether the object at index a is moved to index b, and whether the birth index i equals a given index a: C a→b = 1 (i > a ∧ a = b) ∨ (i ≤ a ∧ b = a + 1) 0 otherwise B a = 1 i = a 0 otherwise Using these definitions, we can write the Jacobian of the transformation which copies starttime (τ ), duration (D), and amplitude/frequency (α|f ) values for each object as: J =                    x (α|f ),1 x τ,1 x D,1 x (α|f ),2 x τ,2 x D,2 ... x D,N S +1 y (α|f ) B 1 0 0 B 2 0 0 . . . 0 yτ 0 B 1 0 0 B 2 0 . . . 0 y D 0 0 B 1 0 0 B 2 . . . B N S +1 x (α|f ),1 C 1→1 0 0 C 1→2 0 0 . . . 0 x τ,1 0 C 1→1 0 0 C 1→2 0 . . . 0 x D,1 0 0 C 1→1 0 0 C 1→2 . . . C 1→N S +1 x (α|f ),2 C 2→1 0 0 C 2→2 0 0 . . . 0 x τ,2 0 C 2→1 0 0 C 2→2 0 . . . 0 x D,2 0 0 C 2→1 0 0 C 2→2 . . . C 2→N S +1 . . . . . . . . . . . . . . . . . . . . . . . . x D,N S 0 0 C 2→N S 0 0 C 2→N S . . . C N S →N S +1                    where J a,b =      0 a (mod 3) = b (mod 3) B b a ≤ 3 C a→b a > 3 Since this is a permutation matrix, it always has determinant −1 or 1. Our system is capable of computing this Jacobian using automatic differentiation and discovering this. As an optimization, in practice, our system can identify that this transformation only copies values, and thus will have a permutation-matrix Jacobian which it does not need to take the determinant of, since it will certainly have magnitude 1, as we describe in the Jacobian sparsity paragraph in Section D. For an description of an inference kernel we have implemented which has a Jacobian whose determinant's magnitude is (usually) not 1, see Section A.1. Acceptance probability. When using the involutive MCMC kernel, our system automatically calculates q x (y), q x (y ), p(x), p(x ), and J, to compute the acceptance probability of the move (x, y) → (x , y ), p(x ) p(x) × q x (y ) q x (y) × | det J| These terms are all equivalent to the above expressions for q x (y), p(x), and J (sometimes substituting x for x or y for y). In practice, the q terms are automatically calculated using the given expressions, while computational optimizations let us avoid calculating the determinant of the Jacobian matrix (which is just a permutation matrix), and let us avoid fully calculating p(x ) and p(x), instead directly calculating p(x ) p(x) = p(x O |x L ) × 1 4 x N S i=1 p(x D,i ) × p(x τ,i ) × p(x (α|f ),i ) × p(x n,i ) p(x O |x L ) × 1 4 x N S i=1 p(x D,i ) × p(x τ,i ) × p(x (α|f ),i ) × p(x n,i ) = p(x O |x L ) p(x O |x L ) × p(x D,ys ) × p(x τ,ys ) × p(x (α|f ),ys ) × p(x n,ys ) y b = 1 1 p(x D,ys )×p(xτ,y s )×p(x (α|f ),ys )×p(xn,y s ) y b = 0 where, as above, y b is 1 when y proposes to create a new source and 0 otherwise, and y s is the index of the source being created/deleted. We can avoid evaluating the product expressions because the majority of terms in the numerator and denominator cancel out, since all audio sources except the one being created/deleted are unaffected by the update.
 Appendix B. Open-Universe Models and Contingent Bayesian Networks In this section, we give a more complete definition of open-universe probabilistic models and contingent Bayesian networks (outlined in Section 2). Open-universe probabilistic models are models of relational domains in which the number of objects, and their link structure, is not known a priori. The usual representations for structured probability distributions-e.g., probabilistic graphical models-are insufficient for specifying OUPMs, which typically define an unbounded number of random variables, with conditional independence relationships that are themselves random. OUPMs can be specified formally, however, as programs in sufficiently expressive probabilistic programming languages (Milch et al., 2005a) , or as contingent Bayesian networks (CBNs) with infinitely many nodes (Milch et al., 2005b) . Here, we review the standard definition of OUPMs as CBNs, and extend it to allow for objects with real-valued random properties. Open-Universe Probabilistic Models. An open universe probabilistic model is a tuple (T , N , P, C), where • T is a finite 3 set of object types over which the model is defined (e.g., Person). • N is a finite 3 set of object origin declarations (τ, (τ 1 , . . . , τ n )), with τ, τ j ∈ T . An object origin declaration specifies that a tuple of objects, of types (τ 1 , . . . , τ n ) respectively, can be the origin of a separate object of type τ . For example, in a model of genealogy, we might declare (Person, (Person, Person)) ∈ N , encoding that a pair of people can be the origin (i.e., parents) of other people. A model's object origin declarations determines sets of possible objects O τ (N ) for each type τ , which are finite expressions of the form (τ, (o 1 , . . . , o n ), i), where (τ, (τ 1 , . . . , τ n )) ∈ N , i ∈ N, and o j ∈ O τ j (N ) for each j. We call (τ, (o 1 , . . . , o n ), i) the i th object of type τ with origin (o 1 , . . . , o n ). • P is a countable set of typed object property declarations (P, (τ 1 , . . . , τ n )), with τ j ∈ T , together with value domains dom(P ) for each property. A property represents data concerning zero or more objects, of types (τ 1 , . . . , τ n ) respectively. For example, a model might declare a property representing the number of flights between two places. • C is a continuously-extended contingent Bayesian network on the set of possible variables for (T , N , P), {(x, (o 1 , . . . , o n )) | (x, (τ 1 , . . . , τ n )) ∈ P ∪ N ∧ ∀j, o j ∈ O τ j (N )}. For every origin declaration (τ, (τ 1 , . . . , τ n )) ∈ N , and every tuple (o 1 , . . . , o n ) ∈ j O τ j (N ) of possible objects of the correct types, there is a possible number variable (τ, (o 1 , . . . , o n )), with domain Z ≥0 , representing the number of objects of type τ that have objects (o 1 , . . . , o n ) as their origin. For every property declaration (P, (τ 1 , . . . , τ n )) and object tuple (o 1 , . . . , o n ) of the correct types, there is a possible property variable specifying the value of the property P (within dom(P )) of the object tuple (o 1 , . . . , o n ). The contingent Bayesian network itself defines a distribution over assignments to these infinitely many possible variables, as we describe in the following section. Contingent Bayesian Networks. For a set of possible variables V, let Ω = v∈V dom(v) be the space of all possible assignments of the (possibly infinitely many) variables to values within their domains. When the domains are discrete, we can use a contingent Bayesian network (CBN) (Milch et al., 2005b) to define a distribution over such assignments. Analogously to a Bayesian network on a finite number of variables, a CBN on an infinite set of variables V specifies an infinite directed graph with V as the nodes. But whereas traditional Bayesian networks fix the dependency structure, in a CBN the edges are contingent: each edge u → v is labeled with an event Ω u→v ⊆ Ω within which the edge is active. As in Bayesian networks, to each variable v we associate a conditional probability distribution (CPD) p v . But this conditional probability distribution is allowed to depend only on the active parents of v, which can be formalized as follows: for each variable v ∈ V, the contingent Bayesian network associates a partition Λ v of the space Ω, such that if ω 1 and ω 2 differ only in their assignment to u, and the edge u → v either does not exist or is inactive in ω 1 , then ω 1 and ω 2 belong to the same component of Λ v . Then p v (• | ω ∈ λ) is allowed to depend on which component λ of the partition ω is in, but nothing else, preventing dependencies on the values of inactive parents. We write P a ω (v) for the active parents of the variable v in state ω. These conditional probabilities together define a probability measure Π on the space Ω, equipped with a non-standard σ-algebra; we refer the reader to Milch et al. (2005b) for a detailed treatment. Minimal Self-Supporting Instantiations. In open-universe models, possible worlds ω ∈ Ω are generally infinite, because they specify assignments to all of the possible variables v ∈ V. But for inference, we must work with finite representations. If we can partition Ω into disjoint equivalence classes Ω i , then we can work with the equivalence classes, using the distribution p(Ω i ) = Π(Ω i ). One useful strategy for partitioning Ω is to consider the minimal self-supporting instantiations of a finite set of variables U ⊆ V. Each component w of the partition is labeled by a set of variables vars(w) ⊆ V, with U ⊆ vars(w), as well as an assignment w[v] ∈ dom(v) for each v ∈ vars(w). The component w contains all full possible worlds ω ∈ Ω that agree with w on the values of each v ∈ vars(w). To ensure that the components w are indeed disjoint, we only include w as a component if: (1) it is selfsupporting, meaning that for all ω ∈ w, if v ∈ vars(w) and u ∈ P a ω (v), then u ∈ vars(w); and (2) it is minimal, meaning that removing any variable v ∈ U from vars(w) would cause it to fail to be self-supporting. Together, these criteria ensure that for any U ⊆ V, the components w are disjoint, and so p(w) = Π(w) is a valid probability distribution over minimal self-supporting instantiations w. Conveniently, the probability of each component w is a simple product of the conditional distributions p v , as in a typical Bayesian network: p(w) = Π(w) = p v (w[v] | {w[u] | u ∈ P a w (v)}). (4)
 B.1. Contingent Bayesian Networks with Continuous Variables We now extend the CBN framework to support models with some continuous object property domains, so long as no discrete variables count continuous variables as parents. 4 (Wu et al. (2018) give a semantics for open-universe models that interprets them as infinite product measures over assignments to all basic random variables. This allows them to interpret OUPMs with continuous and discrete random variables, but does not serve our purposes: it does not yield a formula for the density of an MSSI in an open-universe model, nor can it be used to prove that incremental computation strategies for fast MCMC are correct, as-unlike in CBNs-it does not account for contingent dependency structure among variables.) As before, let V be a collection of variables, but now suppose some variables V c ⊆ V have continuous domains. Then define the surrogate discrete domain dom D (v) of a variable v to be dom(v) if v ∈ V c , and { } otherwise. A continuously extended CBN defines (1) an ordinary CBN on the variables V, treating them as having surrogate discrete domains dom D , and (2) conditional probability densities p v (• | {w[u] | u ∈ P a w (v)}) for each continuous variable v ∈ V c . The CBN induces a distribution Π on minimal self-supporting worlds, which we modify to define a probability measure on the space W of continuously extended minimal self-supporting worlds: pairs (w d , w c ) of a minimal self-supporting world w d for the discrete CBN, plus a real-valued assignment w c to all variables in vars(w d ) ∩ V c . We let w[v] denote w c [v] if v ∈ V c and w d [v] otherwise. The distribution has density p(w) = Π(w d ) × v∈Vc∩vars(w) p v (w c [v] | {w[u] | u ∈ P a w (v)}) (5) with respect to the reference measure µ(E) = w λ |wc| ({w c | w ∈ E ∧ vars(w ) = vars(w) ∧ ∀v ∈ vars(w ) \ V c , w [v] = w[v]}), where λ k denotes the k-dimensional Lebesgue measure. Using Equation 4 for the first term of p(w), we see that in the continuous case, we still have the ordinary Bayes net factorization p(w) = v∈vars(w) p v (w[v] | {w[u] | u ∈ P a w (v)}).
 B.1.1. Continuously-Extended CBNs with Continuous Parents of Discrete Variables In the previous section, we define continuously-extended contingent Bayesian networks with the restriction that no discrete variables have continuous variables as parents. We now give a more flexible development. Let V be a collection of variables, where V c ⊆ V have continuous domains. Define surrogate discrete domain dom D (v) to be dom(v) if v / ∈ V c , and { } otherwise. Now define a continuously extended CBN to comprise: (1) an ordinary CBN on the variables V, treating them as having surrogate discrete domains dom D , and (2) a conditional joint probability density P c (w c | w) on the values of the continuous variables in a minimal selfsupporting instantiation w given the values of all w's discrete variables. This CBN induces distribution Π on minimal self-supporting worlds; as before, we modify this to define the space W of continuously extended minimal self-supporting worlds, consisting of a minimal self-supporting world w of the CBN, and an assignment w[v] to each continuous variable in vars(v) ∩ V c . We use w c to denote the assignment of values w[v] to the continuous variables v ∈ V c ∩ vars(w) in w. The distribution then has density p(w) = Π({ω | ∀v ∈ vars(w) \ V c , ω[v] = w[v]}) × P c (w c |w) with respect to the same reference measure from Section 2: µ(E) = w λ |wc| ({w c | w ∈ E ∧ vars(w ) = vars(w) ∧ ∀v ∈ vars(w ) \ V c , w [v] = w[v]}), where λ k denotes the k-dimensional Lebesgue measure. We note that the density we give ultimately factorizes, as before, as a marginal probability for the discrete variables and a conditional density for the continuous variables. (In principle, this alone is not a restriction, because any distribution over minimal self-supporting instantiations can be factored in this way.) But in the previous formulation (from Section 2), this factorization was embedded into the discrete CBN itself, affecting which worlds w counted as minimal and self-supporting in the first place. The key difference between this section's formulation and the one in Section 2 is that here we divorce the factorization of the continuous density from the CBN's structure; the edges involving continuous variables in the CBN serve only to determine which continuous variables are required in a minimal, self-supporting instantiation for an observed set of variables U .
 Appendix C. Modeling and Inference Programming Languages for OUPMs In this section, we briefly outline our modeling language for OUPMs, and our DSL for writing involutions for involutive MCMC on OUPMs.
 OUPM Modeling Language We have developed a new modeling language that is inspired by BLOG (Milch, 2006) for use in the Gen probabilistic programming system; for examples, refer to Figure 1 , Figure 5 , or Figure 7 . Our language extends one of Gen's built-in modeling languages in the following ways. We add type statements for declaring object types, property declarations for adding properties, and number declarations for adding possible origins. When writing world models with our system, users must define a special property O() with respect to which the model will take minimal self-supporting instantiations; they do this using an observation model statement. Property and number declarations are attached to function bodies which together define the contingent Bayesian network. In particular, a property statement declares the existence of a property P (τ 1 , . . . , τ n ), and defines a probabilistic generative process for the property's value. A number statement (τ, (τ 1 , . . . , τ n )) declares that (τ 1 , . . . , τ n ) is a permissible origin signature for objects of type τ , and declares the distribution over how many objects of type τ there are with each origin matching (τ 1 , . . . , τ n ). (So each property/number statement simultaneously serves as an object property declaration/object origin declaration, and declares the distribution over the corresponding property/number variables in the OUPM's CBN.) The bodies of number and property declarations are specified in an imperative probabilistic programming language that induces distributions over finite dictionaries, called traces. The language uses Julia syntax for defining functions, but may sample random variable values using x ∼ d statements. A program in the language defines a distribution over traces mapping each key x to the value sampled from the corresponding d in an execution of the function. The language is a built-in modeling language in Gen that was augmented with support for get(P (o 1 , . . . , o n )) statements to access the value of P (o 1 , . . . , o n ) in the world; this introduces an edge in the contingent Bayes net representing the model. Represented as imperative probabilistic programs, number variables must always have 0 or 1 keys in their traces, corresponding to either deterministically returning a number, or sampling a single random number. Properties may have more than 1 key in their trace (so long as the set of possible keys is countable), but when they do, the the property statement P must be understood as defining a separate object property declaration P => k for each k which can appear as a key in the trace. For simplicity, in what follows, we will assume that each P (o 1 , . . . , o n ) is itself a variable with only 0 or 1 keys in its probabilistic program's traces; however, the algorithms we give also hold when there can be multiple keys. We represent MSSIs as sets of pairs (P (o 1 , . . . , o n ), t), where P is a number or property probabilistic program whose type signature matches (o 1 , . . . , o n ), and t is a trace for this variable. OUPM Involution Programming Language We implement a new OUPM involution programming language to implement involutions on the space of pairs (x, y), where x is a world represented as described above, and y is a trace from a imperative probabilistic program. Involutions are written as imperative functions which may call special commands to modify state x in order to produce x , to access values in x and y, and to specify the new values for y . Specifically, the DSL provides support for the following. • Transforming the auxiliary randomness (y ). The user's code is responsible for computing a new trace y of Q that makes f into an involution. Intuitively, y must specify the proposal choices that would reverse the current move; in Figure 2 , the forward move that posits a new Event to explain a false positive is reversed by a move that deletes the newly created Event and reclassifies its sole detection as a false positive. Users can write to y using the syntax backward[a] = v.
 C.1. Object manipulation moves The involution programming language includes commands to create, delete, split, merge, and change the origins of objects in the world. It is clear that these moves should increment or decrements number variables in the world to change the number of objects hypothesized to exist. However, to enable us to delete any object with any index, or create an object at any index (needed for reversibility), we need some scheme for reindexing the other existing objects. (For example, when creating a new object 1, the system must "make room" for the new object 1, for example by incrementing the index of every existing object.) We describe the reindexing scheme we use. Reindexing. For any given origin tuple of objects, origin, a world contains N origin T objects of type T : {T (origin, 1), ..., T (origin, N origin T )}. Deleting the object T (origin, i) corresponds to a "vector deletion" which decrements the value of N origin T and decrements the index of every object T (origin, j) for j > i. Likewise, adding an object T (origin, i) is a "vector insertion" which increments N origin T and increments the index of every object T (origin, j) for j ≥ i. In a world model, "changing the index" of an object T (origin, j) corresponds to updating the world so that the trace for any property or number variable P [o 1 , ..., T (origin, j), ..., o n ] becomes the trace for P [o 1 , ..., T (origin, j + 1), ..., o n ] or P [o 1 , ..., T (origin, j − 1), ..., o n ]. Likewise, the update must change any object which has T (origin, j) in its origin to instead have T (origin, j + 1) or T (origin, j − 1) in its origin. While in a naive implementation, simple reindexing operations require copying many traces and greatly perturbing the model state, which causes extreme inefficiency when implementing split/merge and birth/death moves in PPLs like vanilla Gen or Stochaskell, the use of explicit open universe modeling constructs encodes enough structure for us to implement these moves very efficiently without copying data, using the object aliasing technique presented in Appendix D. Algorithm 2 Non-standard interpretation of f for Jacobian calculation procedure ProcessInvolution(f, (x, y)) Track continuous reads and writes, manipulation moves M , and property updates U (Rd, Wr, M, U, y ) ← {}, {}, [ ], {}, {} Execute f , but with each manipulation command m (create, delete, change, split, merge) . We do not detail the process of compiling object manipulation moves into update specifications; it is a fairly straightforward process of determining how much each number variable must be incremented, and changing object alias associations (which are described below). ≡ (M ← M ∪ {m}) "proposed[k]" ≡ (if y[k] is continuous: Rd ← Rd ∪ {y[k]}; y[k]) "set backward[k] = v" ≡ (if v
 D.2. Efficiently calculating the state ratio Because we use world models written using declarative get commands to mediate dependencies among variables in each world, our backend has access to information about which variables are conditionally independent in each state for any world model. Unlike in existing systems for programmable inference, which can only track dependency information in very simple models, this in principle enables us to efficiently calculate the state ratio p(x ) p(x) = v∈vars(x ) p(x [v]|x P a x (v) ) v∈vars(x) p(x[v]|x P ax(v) ) (6) To do this, we only need to consider variables which introduce terms to this ratio that do not cancel out. These are the variables which have been added to or deleted from x , variables whose traces have changed between x and x , and variables whose dependencies' values have changed. Complications vs updating regular Bayesian networks. While world models are similar to Bayesian networks in that they contain a dependency graph among variables, they are far more general, and present novel challenges for producing efficient updates. In queue as needed. However, complications arise due to the necessity of updating variables in a topological order of the dependency graph. Update order. The order in which variables are updated is critical for the correctness of UpdateWorld. [a] is not yet known. Thus, variables must be updated in the topological order induced by the graph of dependencies in the state x . However, we cannot know the topological order of x before the update, so we instead use the topological ordering of the old state x, with special-case logic to handle places where this order differs from that in x . This is justified by the fact that efficient updates are only helpful in transitions x → x producing fairly local changes, and thus we expect that updates we could implement efficiently will only change the world's topological order minorly. To implement this, the update queue Q in UpdateWorld is a priority queue indexed by the topological order of x. In practice, UpdateWorld must also update the topological order of x to one for x ; we elide these details, along with details of maintaining the children x lookup table (which gives the children of each variable in the CBN graph) and the details of implementing the prune function which removes variables which are not needed for a minimal self-supporting instantiation. We handle changes in variable order between x and x in the Execute procedure, which updates variable traces. When Execute observes that a variable v gets the value of a variable u which has not yet been updated, this means that in x, u was topologically later than v, but in x , it is topologically before v. In this situation, we recursively call Execute(u) to ensure that we have updated u to the proper value before it is used to update v. Aliased object representation. To efficiently implement object manipulation moves, which may change the origins and indices of objects, we use a special internal representation of worlds. If we stored a mapping from the string "G(o 1 , . . . , o n )" to traces in the world, then whenever an object o k = T (origin, j) had its origin or index change, we would need to update the entry G(o 1 , . . . , T (origin, j), . . . , o n ) for every property of this object. Instead, we assign each object a unique identifier by storing a lookup table from identifier i k to object o k = T (origin, j) with each world state. We then store traces in a dictionary from keys G(i 1 , . . . , i n ), where each i k is an identifier. Index and origin changes can thus be implemented in O(1) by updating entries in the lookup table, rather than O(n) in the number of properties of the updated object. v which are ancestral sampled in this move from x to x . This is straightforward for the update procedure to accumulate as it generates each of these values. The numerator of this fraction is the product of p v (x[v]|x P ax(v) ) terms for each variable v which is ancestralsampled in the reverse move. To properly account for this, then, the update procedure needs to know which properties will be ancestral-sampled in the reversing move. We can thus define this procedure's signature as (x , r f (x ,ỹ ) (x) r f (x,ỹ) (x ) ) = update(x, M, U, R) where R is the set of variables which will be regenerated in the reversing move. Involution language extension. To provide access to R, we extend the language from section C, adding the syntax backward[P (o 1 , . . . , o n )] = regenerated to specify that the reverse-direction proposal ancestral samples a value for P (o 1 , . . . , o n ). One can also write backward[properties of (o 1 , . . . , o n )] = regenerated to specify that all properties for any object tuple including o are regenerated by the reverse move. We also add a command regenerate P of o, to specify that the value for P (o) should be ancestral-sampled to produce x , rather than copying the value for this property currently in x. (Copying from x is the default behavior when P (o 1 , . . . , o n ) is present in x; ancestral sampling is the default behavior when it is not present in x.) One way to think about the need to specify the values ancestrally sampled in the reverse move is as follows. Although users do not specify a dictionary key for values in the full auxiliary randomness y which are generated by ancestral resampling, to ensure that the full f is a valid involution, f must still write the values of these variables to y in the reversing move. Because users don't specify a dictionary key, we provide a special syntax, set backward[P (o 1 , . . . , o n )] = regenerated to automatically set the regenerated value in y of variable P (o 1 , . . . , o n ) to equal this variable's current value in x. While the need to specify when a reverse move uses ancestral sampling adds a small cognitive burden to the user of our inference programming language, we provide dynamic error checks to ensure it is not a source of incorrectness. If users forget to include the proper backward[. . . ] = regenerated statements, we can dynamically detect this error by running the reverse move and seeing which values are actually regenerated. It is thus simple to report when users have forgotten to include these commands, making it a fairly painless debugging procedure to add the proper reverse-regenerate specifications. Figure1: An OUPM for seismic monitoring, inspired byArora et al. (2013), in which Detections are received at seismic monitoring Stations. Each Station receives some number of false-positive Detections, and for each Event, each Station has probability 0.8 of detecting it. Each Event has an amplitude, and a reading of a Richter-scale magnitude is recorded for each Detection, which is distributed around the underlying Event's magnitude when the Detection is not a false-positive.
 (b) An involutive MCMC kernel consisting of a proposal generative function and an involution. A pair of corresponding forward and reverse moves made by the MCMC kernel defined in (b).
 Figure 2 : 2 Figure 2: (a) An execution of a MCMC kernel transforming the state of the seismic monitoring model on the left to that on the right. The move, with random choices shown above the right arrow, posits a new event to explain a false positive detection.The involution sets the new event's amplitude to 10 r , converting Richter-scale magnitude r to an event amplitude, so the acceptance probability's ( d(µ•f −1 ) dµ (x, y)) term is log(10)10 r ; our system calculates this via automatic differentiation. The kernel can also make the reverse move (←). (b) The involutive MCMC kernel visualized in (a).
 Figure 3 : 3 Figure 3: An OUPM for auditory perception. (a) A waveform (left) is observed as a spectrogram in the frequency domain (center), from which we infer the number and type of constituent sound sources that together explain the observed data (right). (b) Convergence profiles of 4 MCMC kernels; the two data-driven iMCMC kernels outperform generic PPL and generic RJMCMC kernels. (c) Approximate posterior samples reflecting typical failure modes of non-data-driven kernels.
 Figure 4 : 4 Figure 4: Gaussian Mixture Model Inference Experiment Results
 type Cluster type Datapoint number Cluster() ~ poisson(λ) + 1 number Datapoint() = NUM\_DATAPOINTS # global constant property mean(::Cluster) ~ normal(ξ,1/κ) property var(::Cluster) ~ inverse\_gamma(α\_v, β\_v) property unnormalized\_weight(::Cluster) ~ gamma(α\_w, β\_w) property function cluster(::Datapoint) clust\_to\_un\_weight = Dict(c => get(unnormalized\_weight(c)) for c in get\_object\_set(Cluster())) cluster ~ unnormalized\_categorical(clust\_to\_un\_weight) return cluster end property function value(d::Datapoint) cluster = get(cluster(d)) value ~ normal(get(mean(cluster)), get(var(cluster))) return value end observation\_model function get\_datapoints() return [get(value(Datapoint with index i)) for i=1:get\_number(Datapoint()A region of the contingent Bayesian network for the model
 Figure 5 : 5 Figure5: Gaussian mixture model with an unknown number of components. Instead of imperatively sampling cluster weights w 1 , . . . , w n ∼ Dirichlet(δ1 k ), in our model, each cluster has an unnormalized cluster weight property sampled from a Gamma distribution; normalizing these then sampling clusters from the resulting distribution is equivalent to sampling clusters according to weights sampled from a Dirichlet.
 Figure 6 : 6 Figure6: Data-driven Gaussian mixture model split/merge kernel from Richardson and Green (1997) .
 A region of the contingent Bayesian network for the model
 Figure 7 : 7 Figure 7: Our OUPM for audio inference.
 Figure 8 : 8 Figure 8: Performance of different inference kernels, measured on 100 randomly-generated audio scenes with 3 underlying sounds.
 Figure 11 : 11 Figure11: The data-driven sound detection kernel inference kernel used in the audio example. The kernel uses an image-filtering edge-detection algorithm detect sounds (not shown) to detect noises and tones in the observed sound waves which are not explained by the currently hypothesized audio sources. Heuristic scoring functions birth score and death score (not shown) are used to score the value of adding detected sounds to the latents, or deleting sounds in the current latents. Based on these scores, either a currently inferred sound is selected to be deleted (a DeathAction), or a detected sound is selected to be created, with some noise added to the detected sound parameters (a "birth" move). To ensure reversibility, death moves must select which detected sound will be sampled during the reversing birth move. If no compatible sounds will be detected during a reversing birth, the death move will specify that the reversing birth should be "dumb" (non-data-driven) and create a sound generated from the prior.
 The commands create, delete, split, merge, and change add, remove, and change the relationships of objects in the possible world, updating the values of number variables as necessary. The behavior of each detailed below, and illustrated and described in Figure13. Commands that remove objects have the effect of deleting any traces for variables G(o 1 , . . . , o i , . . . o n ) of an object tuple including an o i slated for deletion. If the deleted object is the origin of other objects (e.g., if an Event with Detections is deleted), those objects are not automatically deleted: users may either manually remove them or change their origins using change.The command set G(o 1 , . . . , o n )[a] = v sets the sample at address a of a trace for G(o 1 , . . . , o n ) to v in the proposed state x .
 2Figure 13 : 13 Figure 13: The object manipulation moves, with examples illustrating how they change the space of objects in the seismic monitoring example. To construct references objects, for use in the commands, illustrated with the shapes in this diagram, users use the syntax  with origin  index .
 For instance, say b ∈ P a x (a) and a, b ∈ vars(U ). If we update b before we have updated a, it is impossible to calculate the factor p(x [b]|x P a x (b) ) = p(x [b]|x [a]) in the state ratio, because the value of x
 Runtime. The full algorithm which accounts for topological order updating runs in O((N + M )(log(N + M ) + T )), where N in the number of variables which are updated or impact the state ratio, M is the number of variables whose indices in the topological ordering change during the update, and T is the maximum runtime of updating a single variable in the world. 6 So long as N << |vars(x )| and M << |vars(x )| (both of which are true for most local updates), this algorithm is much faster than generating a new state x from scratch, which takes θ(|vars(x )|T ).
 • Querying the current model state (x). Users may query the current model state using the syntax get(P (o 1 , . . . , o n )[a]), which retrieves the sample at address a of the trace for the property P (o 1 , . . . , o n ). Similarly, get number(τ (o 1 , . . . , o n ))) retrieves the number variable value in x defining how many objects of type τ exist with origin (o 1 , . . . , o n ). Several higher-level commands are also provided to access higher-level discrtete information about the current state, including get object set(τ ), which gets the set of all existing objects of type τ in x.• Querying the auxiliary randomness (y). The syntax proposed[a] returns y[a],the value at address a in the random trace y of the proposal program Q.• Proposing the new model state (x ). The new model state is proposed via commands that imperatively modify the old state x. They can do this either by changing the structure of x (by adding or removing objects, and changing the origins or indices of objects), or by writing new values to object properties.
 is continuous: Wr ← Wr ∪ {y[k]}; y ← y ∪ {k → v}) "get(P (o1, . . . , on)[k])" ≡(v ← x[P (o1, . . . , on)][k]; if v is continuous: Rd ← Rd ∪ {v}; v) "set P (o1, . . . , on)[k] = v" ≡ (if v is continuous: Wr ← Wr ∪ {v}; U [P (o1, . . . , on)][k] ← v) J ← uninitialized |Rd| × |Rd| matrix for i in {1, . . . , |Wr|}: Execute f with reverse-mode AD to compute ∂Wr[i] ∂Rd[j] for each j ∈ {1, . . . , |Rd|} J[:, i] ← ∇ Rd (Wr[i]) U ← CompileManipulationMoves(U, M, x)Get variable updates to implement manipulation moves. return (U, y , |det J|) end procedure state x or reversing randomness y ; all unmentioned continuous values are simply copied without transformation. This enables us to calculate the determinant of the Jacobian matrix in O(1) in the size of x for many updates, rather than O(|x| 3 ). via nonstandard interpretation. Algorithm 2 shows how to use nonstandard interpretation of a world involution f to calculate the Jacobian correction term. Additionally, this interpretation tracks all object manipulation moves which are called, and all set commands. These are compiled into an object U which fully specifies the update x → x . U is a mapping from variable names G(o 1 , . . ., o n ) to partial traces U [G(o 1 , . . . , o n )], which map addresses to values. U specifies to update each trace x[G(o 1 , . . . , o n )] by overwriting addresses a in this trace with U [G(o 1 , . . . , o n )][a] Implementation
 . Milch et al. (2005b) 's formulation of contingent Bayesian networks does not support continuous random variables. See Appendix B for a more careful development of CBNs, and an extension (to our knowledge, novel) to the continuous-variable case.
 . An involution is a function that is its own inverse: f (f (x, y)) = (x, y).
 . The set of types and the set of object origin declarations can be countable without compromising any results, but existing formal languages for defining OUPMs, including ours, do not provide a way to declare models where either of these are infinite. It would be interesting to consider whether any natural applications would require this flexibility, and how languages might be designed to expose it.
 . See the following section for a similar but more involved extension to a more general case, where discrete variables can depend on continuous variables.
 . The log terms come from the need to sort variables to update in the priority queue. Future work on static analysis of inference programs may be able to perform this sorting at compile-time in some cases.

George Matheos
Alexander K. Lew
Matin Ghavamizadeh
Stuart Russell
Marco Cusumano-Towner
Vikash Mansinghka


Working together to face humanity’s greatest threats: Introduction to The Future of Research on Catastrophic and Existential Risk.

Introduction Ours is a resilient species. Around 70,000 years ago our total population may have fallen to between three and ten thousand individuals, possibly due to a supervolcanic eruption (Ambrose 1998) 1 . Yet our ancestors survived, squeezed through the bottleneck, and flourished. But this resilience cannot be taken for granted. We are interconnected and interdependent as never before; the power and scale of our technological capacities are unprecedented. We are in uncharted waters and thus our previous survival is no longer a reason to expect our continued survival (Bostrom 2013 ). As a result, it is urgent that we develop a systematic understanding of the nature and causes of catastrophic and existential risks. Human societies are increasingly technologically powerful; it is less certain whether we have developed the foresight and wisdom to steer towards safer futures. For the first time, we might be able to do something about disasters we were previously incapable of predicting, understanding or mitigating: technology and knowledge might free us from some of the natural shocks that human civilisations were once vulnerable to. But these new capabilities themselves generate unprecedented dangers. This calls for the development of research programmes that address the sources of, and possible responses to, such new threats. To do so requires work across academic spaces which is in meaningful dialogue outside of the university. This special issue reflects this aim: it includes new work across disciplines, career-stages and from within and outside academia. Our hope is that it will aid in growing the community of researchers engaged in understanding existential and catastrophic risk, and give a sense of the range of rigorous, fruitful, and urgent research that is being done-and remains to be done-in this area. Global catastrophic risks have the potential to cause serious harm on a planetary scale (Bostrom and Cirkovic, 2008) . A particularly severe category of global catastrophic risk is an existential risk: one that threatens the premature extinction of earth-originating intelligent life, or the permanent and drastic destruction of its potential for future development (Bostrom 2013) . The key difference is that existential catastrophes curtail the possibility of recovery and future development. Both existential and global catastrophic risks present unique challenges for research and analysis. They represent very rare or even unprecedented developments; therefore there can be little data to draw on, and little opportunity to learn from past events (Currie forthcoming). While some threats are entirely exogenous, many relate to human activity (e.g. climate change, catastrophic biodiversity loss) or the advent of powerful new technologies (e.g. nuclear weapons). The pace of technological progress, and the complexity of the interactions between technology and society more broadly, lead to threats which can be dynamic and difficult to predict (Ó hÉigeartaigh 2017). Early steps have been taken to tackle existential and global catastrophic risks at the policy level. Notable recent examples include a chapter on existential risk in the 2014 United Kingdom Chief Scientific Advisor's annual report (Walport & Craig, 2014) , and an existential risk report sponsored by the Finnish Government (Farquhar et al 2017) . The World Economic Forum launched an annual Global Risk report in 2007. Generally speaking there has been increased focus on emerging technological risks, as well as on climate change, environmental risks, and resource challenges (e.g. see Collins, A. et al, 2018) . Several academic groups, non-profits and policy think tanks, including the Garrick Institute for Risk Sciences, the Bulletin of Atomic Scientists and the Nuclear Threat Initiative, have broadened their scope to consider wider categories of global catastrophic risk. Additionally, there are separate, established research communities and centres concerned with particular global and existential risks, and communities focused on disaster response and resilience, risk analysis, risk communication, and risk governance. This expertise is a vital resource for existential risk research, required to understand which risks have the potential to be global in scope, placing individual threats within a global risk context, and understanding potential opportunities for intervention. However, there is a need for these connections to be strengthened, and for insights and expertise to be shared more extensively. The desire to broaden the scope of research in catastrophic and existential risk, and further its connections with other areas of expertise, was a key motivation for both the first Cambridge Conference on Catastrophic Risk and this special issue, brings together many papers originally presented at that conference. Below, we'll introduce the papers collected within, and in doing so draw together some common themes and lessons.
 Conceptualising and classifying catastrophic risk Views on how catastrophic and existential risks should be conceptualized differ. Existing research typically focuses on discrete 'knock out' events and the direct consequences of these events. Examples include asteroid impacts, supervolcanoes, pandemic outbreaks, the possibly catastrophic consequences of future physics experiments, and the development of artificial superintelligence. However, several papers argue that a narrow focus on 'knock outs' misses possible sources of existential catastrophe. Liu, Lauta & Maas (2018) emphasize boring apocalypses wherein our civilization ends not with a bang, but a drawn-out whimper: "There are also many other, slower and more intertwined ways in which the world might collapse, without being hit by spectacular hazards" (7). Similarly, Kareiva & Carranza (2018) stress our ignorance of how ecosystems collapse, "it is our ignorance about the dynamics of complex, tightly coupled, human-natural systems with interacting stresses and feedback loops that is the source of our greatest environmentally-dictated existential risk" (3). Indeed, research on mass extinctions suggests that reductions in the resilience of communities must have already occurred for apparent knock-outs (such as asteroid strikes or massive volcanism) to trigger existential catastrophes (see for instance Mitchell, Roopnarine and Angielczyk 2012) . This recognition of more subtle influences on existential and catastrophic risk has two upshots. First, it highlights the need to not only characterise individual shocks, but to better understand how these shocks, and more subtle stresses, affect the stability of the systems in which they occur. Second, it suggests a widening of the scope of existential risk to include smaller hazards (Liu, Lauta & Mass 2018) . Understanding existential risk at the systems-level requires systematic forms of categorization. The question of how best to categorize risks turns in part on our purpose in doing so. Avin et al (2018) develop a systematization aimed at the study and analysis of existential risks. By analysing risks from the perspective of systemic failure points and spread mechanisms, they sidestep some of our ignorance by identifying both weakness in the resilience of our systems, and points of overlap in pathways of impacts associated with the risks. They also emphasize the necessity of a multidisciplinary approach: "compiling a comprehensive list of plausible GCR [global catastrophic risk] scenarios requires exploring the interplay between many interacting critical systems and threats, beyond the narrow study of individual scenarios that are typically addressed by single disciplines" (2). In communicative contexts, different systematization may be called for. Turchin & Denkenberger (2018) systematize existential and global risks in order to communicate their dangers to policy makers. Such a tool requires abstraction from the details; the authors use a colour-coding system based on severity and probability. These alternative approaches to categorising and communicating risks are likely to be highly complementary.
 Catastrophic risk: communication and responsibility Turchin & Denkenberger's focus highlights the critical role communication within public and policy spheres play in shaping existential and catastrophic risk research: a common theme of the special issue. Kareiva & Carranza (2018) highlight challenges relating to the presentation of environmental catastrophes to the public: … popular culture regarding environmental catastrophes is important because it may lead society to look in the wrong places for existential risks. Movies constantly ascribe disasters to corporate greed and a flawed society. This narrative of either the "villain", or the need for social reform is standard movie fare. No big time Hollywood movie has ascribed an environmental disaster to ignorance about ecosystem dynamics or surprises. ( 10 ) Currie (2018) , too, considers how public and policy conceptions of emerging technology can affect technology's development. Reflecting on the wider repercussions of SPICE's cancelled geoengineering experiment, he argues that scientific governance cannot be divorced from social, political and technological consequences. … the consequences of governance measures should be considered in the context of science's 'ecosystem': the incentives and drivers which shape research… technological research is not separate from the social, economic and ecological consequences of its use. As our tech becomes increasingly powerful, it becomes increasingly pressing to reevaluate both how science is governed, and the role of the 'scientist' itself. ( 10 ) Jo Husband's (2018) discussion of bio-security challenges is also sensitive to science its social context. She is interested in tackling 'dual-use' research, research which despite its potential benefit might be misapplied or repurposed for harm. Husband argues that the issue should be framed in terms of 'responsible science'. On this view, as opposed to employing explicit legal frameworks, or taking worries concerning dual-use to be outside of the scope of science, the "potential risks of dual use research are framed as one part of the general social responsibility of science, along with other ethical issues… [this] makes scientists part of the solution, not part of the problem" (6). Just as avoiding plagiarism is standardly the scientist's responsibility, in many contexts consideration of research's potential for dual use should be too. A focus on the role of communication and framing also looms large in Claire Craig's (2018) reflections on risk communication. She provides an overview of the official British system of communication, drawing on the UK government's reaction to the Fukushima disaster. As she says, "Choice of language is at the heart of the challenge of engaging policy-makers and publics with risk, both mundane and extreme" (3). Her discussion is sensitive to tensions between human psychology, the aims of policymakers, and the aims of scientists: "politicians are concerned with avoiding the error of having not acted when they should, while scientists may be more concerned with the error of reporting a finding where the finding is not robust" (3). Navigating diverse aims is necessary not only for research into existential risk, but-as Craig shows-putting that research into effective use. Crowley, Shang & Dando (2018) are also concerned with how to influence and communicate, but the audience here shifts from scientists and the public to policy-makers. They describe work on emerging scientific developments which present new challenges for the chemical weapons convention, specifically focusing on the possible misuse of advances in neuroscience to develop novel forms of so-called 'nonlethal chemical incapacitating agents'. The paper highlights the fast pace of technological change, and the troubling limitations this puts on existing governance structures: "Such selective manipulations of the human machine may not have been possible then, but they may be implemented in the future if we are not careful" (5). Crowley et al (2018) and Binder (2018) both highlight that managing catastrophic risks has a legal dimension, and that legal mechanisms provide powerful levers for mitigating and avoiding tragedy. Where Crowley, Shang & Dando consider international governance, Binder considers the increasing use of criminal prosecution in disasters. This reflects a shifting conception of responsibility vis-à-vis disasters across public, legal and scientific spheres, and highlights the importance of developing dynamic governance from the local to the international level.
 Confronting the limits of our knowledge One central reason for adopting a dynamic and flexible approach to global catastrophic risk governance and response is that the second order effects of many risks remain poorly understood. This is a common theme in the special issue. John Halstead (2018) considers whether the end result of geoengineering research would be a world with increased or decreased existential risk. He draws on Hilary Greaves' notion of 'complex cluelessness' (2016). Such cluelessness manifests in circumstances where, concerning two future pathways, "there is a plausible case to be made in either direction and it is unclear how to weigh the competing considerations" (11). Kareiva and Carranza's paper explores a related concern: "What worries us is our ecological ignorance-especially our ignorance regarding positive feedbacks and interactions among stresses that amplify environmental perturbations in ways that surprise us" (9-10). We are not only in a situation where it is difficult to ascertain the probabilities of certain identified risks, we are also not sure what the nature and dynamics of the risks might be. As we've mentioned, one source of this ignorance is the unprecedented nature of our situation, as Halstead emphasizes for climate change: "Warming of >6 • C would bring temperatures that are far outside the experience of homo sapiens and its immediate ancestors, constituting a radical departure from the Holocene climate in which human civilization has thrived" (Halstead 2018, 3) . Shifting into such unprecedented circumstances requires a systematic but creative approach to understanding existential and catastrophic risk (Currie, forthcoming) . This systematic creativity is present in Denkenberger & Wade's (2018) discussion of the mitigation of supervolcanic eruptions. Many of the interventions evaluated are ambitious and untested, but a systematic assessment of the space of possible approaches is essential for such rare disasters. What risks, which sacrifices, and what mitigating actions are we willing to put up with, consider or condone? This leads us to consider how an existential risk perspective might change our approach to particular issues, and what lessons might be exportable from outside of the current boundaries of existential and catastrophic risk (porous as they may be) into those communities.
 A broader scope and methodological toolkit John Halstead's analysis of geoengineering from an existential risk perspective is an example of how considering questions from vis-à-vis their relevance to species-level threats can shed new light on existing questions. Other papers in the special issue demonstrate the value of taking lessons from other disciplines in order to understand catastrophic risk. Kim & Song (2018) look at how urban climate resilience has developed in light of a longer-term perspective: "in recent years, exogenous changes and risks, such as depopulation, aging society, climate change, and disasters, have been emerging, and thus it is important for urban planning to reflect the various components of the urban system" (2). The use and adaptation of novel methodologies, such as DELPHI techniques (Kim & Song 2018) and other horizon scanning exercises (Aicardi et al 2018) , has borne fruit in technological forecasting and urban planning. Even games can be useful tools for communication and debate (Craig 2018) 2 . These examples highlight the extent to which tools and methodologies developed in related fields and for related challenges may prove valuable for the study of existential and catastrophic risk. An emerging field grappling with uncertainty should be open to critiques of community focus, as illustrated by Aicardi et al (2018) 's discussion of the risks considered by the Human Brain Project: The growing amount of speculation about general Artificial Intelligence (with some suggesting that we will soon reach the 'singularity', the point at which machine intelligence overtakes human intelligence) is somewhat premature, and diverts our attention from more pressing social and ethical issues arising in connection to the proliferation and rapidlygrowing efficiency of not-so-intelligent machine intelligence-of specialized artificial intelligence, as opposed to general artificial intelligence. ( 3 ) Too strong a focus on certain kinds of risk potentially blinds us to others (a warning echoed in Kareiva & Carranza and Liu, Lauta & Maas) . This is an important lesson. However, consideration of different types of risk needn't be a zero-sum game. A thriving ecosystem of existential and catastrophic risk research can encompass slow-moving threats and cascading failures, as well as abrupt catastrophic events. It can also encompass well-defined near-term threats and longer-term, more theoretical scenarios. Moreover, engaging with the near-term development of emerging technologies may aid us in avoiding longer-term threats. It encourages a culture of democratic reflection on the development of technology, and drives us to ensure that both the right expertise, and an appropriate diversity of voices and stakeholders, are involved at every stage of the process. Embedding responsibility and accountability in the development of transformative technologies is likely to increase the probability of these technologies achieving their potential for global good, while also increasing the likelihood that potential catastrophic consequences are identified, given due attention, and averted. A critical place for such democratic reflection is the development of government institutions. Jones, O'Brien & Ryan (2018) survey initiatives to represent the interests of future generations in the governance of a range of nations, and adapt these to the UK context: "the issue of representing the rights and interests of future generations is not well articulated (if at all) in the UK political context. Simple awareness of these issues is an essential step towards their having an impact upon decision making" (2). The paper recommends the establishment of an All-Party Parliamentary Group on Future Generations, which the authors have since launched in January 2018. This body establishes existential risk and the rights of future generations as issues of crossparty interest, and may provide a useful stepping stone to the eventual institutionalisation of intergenerational justice in the UK Parliament.
 Shaping the future from the perspective of existential and catastrophic risk A broader conceptualisation of the challenges existential and catastrophic risk bring leads naturally to reflecting on how science and society should be organised in a world with powerful technological and scientific capabilities. Taking existential risk seriously requires fostering the kinds of institutions that will encourage a longer-term perspective, and working to avoid sleepwalking into catastrophic futures. It requires a much more dynamic conception of technological governance. As Craig puts it "society does not have to be the victim of technological determinism or of existing views of human nature" (7). It also poses the question: how broad should the scope of our interest be? Given that further catastrophic and existential risks remain to be discovered, and that engaging with both known and unknown risks requires dynamic policy and governance at multiple levels and on multiple timescales, it may be difficult to set strict bounds on the remit of existential risk as a field. We think there is a clear need for specific work focused on discrete events that might threaten humanity, as well as on the slower-moving or cascading sequences of events that could lead to the same result, and on the methodologies that allow us to predict and mitigate these risks. But we can also conceive of existential risk as a framework from which to analyse a range of developments and challenges. This would include assessing new technological developments via their influence on various aspects of global risk, as illustrated by Halstead's analysis of geoengineering. It would also include assessing the suitability of our scientific processes and our governmental institutions for a future in which we must be prepared to confront risks of this scale. Drawing on Jones, O'Brien & Ryan's institutionalized regard for future generations, as well as Husband's widening of scientific responsibility, we might conclude that a concern for the long-term, the catastrophic, and the existential ought to be a standard part of our technological and institutional development, incorporated into the portfolio of principles that should guide our progress. The future of research into catastrophic and existential risk, then, involves increasing multidisciplinarity, creativity and shifting to an applied footing. As we move from studying to mitigating existential and global catastrophic risks, there are many processes we need a deeper understanding of. Excellent work has been done to characterize discrete events that would result in a global catastrophe, although more work certainly remains to be done. However, many causes of global catastrophe may be slower-moving, or take the form of sequences of events that cascade into a global catastrophe. Understanding these more complex risks requires a combination of insights from different domains of risk and intellectual disciplines, as well as the development of specific methodologies. The difficulty of engaging with these complex risks may mean that they are understudied within this community compared to 'big bang' events. We also need to combine analysis and intervention. This requires understanding how to engage with policymakers, technology leaders, and the broader public on the necessary steps. Here too there is much to learn both from the successes and challenges of communities focused on individual global threats, as well as the lessons learned from engagement at different levels of risk. Papers within the special issue shed light on each of these challenges, drawing out crucial insights for those studying existential risks going forward. Recently, catastrophic and existential risks as a class have become a research target. In 2003 Martin Rees published Our Final Century? and the Future of Humanity Institute, which has generated foundational work in existential and global catastrophic risk, was established. It has been followed by the establishment of the Global Catastrophic Risk Institute (2011), the Centre for the Study of Existential Risk (2012), the Global Challenges Foundation (2012), Kyoto University's Global Survivability Institute (2013), the Future of Life Institute (2014), and the Freiburg Law and Governance of Existential Risk Group (2016), among others. Academic courses and workshops covering existential risk have begun at the University of Copenhagen, University of Gothenburg, University of Warwick, and Harvard University.
 Although both the timing and extent of the bottleneck, and the role of the Toba volcanic eruption in particular, remain controversial, see Williams (2012) .
 In addition to more traditional board games like Pandemic, some recent computer games have been designed specifically to raise issues about existential risk, including Frank Lantz's Universal Paperclips, and a mod for Civilization V which adds artificial intelligence developed under Shahar Avin's guidance.

Apollo-University Of Cambridge Repository