dataesr/scientific-paragraphs-categorization huggingface dataset:
We take this also as the resource target for the variants of RL-GST explored here. We examine 4 possibilities for the choices of L (i) s in RL-GST: (1) fixed L (i) = 32; (2) fixed L (i) = 64; (3) fixed L (i) = 128; (4) choose L (i) uniform-randomly from the list {8, 16, 32, 64, 128}. To attain the resource cost of about 48,150 operations, we choose 1416, 730,370, and 187 circuits, respectively, for the four options, together with a null circuit for each case. Altogether, these choices correspond to 48,146, 48,182, 48,102, and 48,248 (expected) operations, respectively. The actual number of circuits and operations used in the simulations are often a little fewer, as we discard, without replacement, any duplicate circuits generated in the random drawing. The GST comparison is done with help of the pygsti Python package.
measure the Pauli X, Y , Z observables) outcomes. The germs we make use of are those suggested by the GST Python package: 1, g x , g y , g y g x , and g y g x g x ; each germ is repeated for k values taking values 2 0 , 2 1 ,. , and 2 7. The maximum value of 2 7 is chosen to ensure L 1 for our simulated noise strength, while the powers-of-2 increments are suggested by the Python package. In addition, we also include circuits of the form F j + F i for different i, js, corresponding to taking a "null" germ. Duplicate circuits are removed. Altogether, we have 1,120 circuits, involving a total of 48,149 operations. As an added angle for exploring the importance of the germ design in GST, we retain the F i and F j state preparation and measurement fiducial sequences in the GST circuits, but replace the middle GST-prescribed germ k by a uniform-randomly chosen sequence, each of fixed length L (i) = 2 7 , of gates from the gate set.
We use 10 different random gate sequences altogether. We also include, as before, circuits with the structure F j + F i. Altogether, we have 384 circuits (after eliminating duplicates), with a total of 48,133 operations. Linear inversion, as described in our RL-GST procedure earlier, is used to obtain the estimators for all the variants of RL-GST differing in the choice of C. For the GST circuits, we compute the estimators from the optimization carried out by the GST Python package, with or without the CP option (both estimators are TP). For added comparison, we use our linear inversion procedure for the data obtained from the GST tomographic circuits (labeled L-GST in Fig. 2 ). The results are given in Figs. 2a  and b. Figure  2a  plots the AGsI estimates for the gate set; Fig. 2b  gives the prediction errors for 1000 test circuits (as in the incomplete gate set example), randomly chosen from the gate set and of lengths {10, 50, 100, 200, 500, 1000}.
The test circuits in Fig. 2b  are for a single randomly chosen set of true noise parameters with AGsI= 1. 1 × 10 -4. From the plots, our four RL-GST variants, with different L (i) choices have comparable performance, though the shorter circuits have larger scatter in the AGsI predictions. The one with varying L (i) lengths has the smallest prediction error, but the difference is small, suggesting a robustness against the specific choice of L (i). All four do somewhat worse than GST, but one should note the much lower time cost for nearly the same performance: For each run of the protocol (getting the estimate e from one set of tomographic circuits), RL-GST tomography procedure took under 1 second to complete on a regular laptop. The GST procedure, either the TP or the CPTP options provided by the Python package, took about 30 seconds on the same laptop for the GST-prescribed circuit set.
We repeat the entire simulation experiment for a different single-qubit gate set, {1, H, T }, where H is the Hadamard gate H ≡ |+ 0| + |-1|, and T ≡ |0 0| + e iπ/4 |1 1|. In this case, the GST fiducial sequences are chosen as F i ∈ {I, H, HT 4 H, T 2 H, T 4 H, T 6 H} and F j ∈ {I, H, HT 4 H, HT 6 , HT 4 , HT 2 }. Both again generate the 6-state preparation and measurement as used for the {1, g x , g y } gate set, but the preparation and measurement sequences are different here since T † = T 7 = T. The germs, as prescribed by the GST Python package, are I, T , H, HT 3 , T I 4 , T 2 HI 3 , HT HI 3 , H 4 T , T HT 3 I, and HT H 2 T 2. As before, we pick our RL-GST random circuits to match the number of operations used in the GST-prescribed set. The results are given in Figs. 2c  and d. From the two gate sets, we draw the conclusion that RL-GST offers a quick estimate of the noise, providing comparable-though slightly worse-results as GST, but in a much shorter time.
ACKNOWLEDGMENTS This work is supported by the  Ministry of Education, Singapore  (through grant number  MOE2016-T2-1-130 ). HKN also acknowledges support by a  Centre for Quantum Technologies (CQT) Fellowship. CQT is a  Research Centre of Excellence  funded by the  Ministry of Education  and the  National Research Foundation of Singapore. We acknowledge the use of the IBM Quantum Experience Platform for this work. The views expressed are those of the authors and do not reflect the official policy or position of IBM or the IBM Quantum team. We thank  My Duy Hoang Long  for useful discussions throughout the project.
We present a system for inductive program synthesis called DreamCoder, which inputs a corpus of synthesis problems each specified by one or a few examples, and automatically derives a library of program components and a neural search policy that can be used to efficiently solve other similar synthesis problems. The library and search policy bootstrap each other iteratively through a variant of łwake-sleepž approximate Bayesian learning. A new refactoring algorithm based on E-graph matching identifies common sub-components across synthesized programs, building a progressively deepening library of abstractions capturing the structure of the input domain. We evaluate on eight domains including classic program synthesis areas and AI tasks such as planning, inverse graphics, and equation discovery.
Many success stories in inductive synthesis rely on specialized dsls designed specifically for one task domain (e. g. FlashFill  [20] ). Even general-purpose synthesis tools such as Synquid  [41]  require the user to provide a carefully targeted library of components in order to restrict search. The expertise required to design such libraries and dsls limits the applicability of inductive synthesis in novel real-world domains, and also limits its scalability as a means of general-purpose learning in AI. Here we present DreamCoder, a program synthesizer which learns its own structure hypothesis in the form of a library of components. DreamCoder follows the learningto-synthesize paradigm  [2, 13] , where a corpus of synthesis Given initial primitives (left), DreamCoder iteratively builds a library of more advanced functions (middle) and uses this library to solve problems too complex to be solved initially.
The resulting system has wide applicability. We describe applications to eight domains including classic program synthesis challenges, more creative visual drawing and building problems, and finally, library learning that captures the basic languages of recursive programming, vector algebra, and physics (Fig. 1A ). All of our tasks involve inducing programs from very minimal data, e. g. ,  5 -10 examples of a new concept or function, or a single image or scene depicting a new object. The learned languages span deterministic and probabilistic programs, and programs that act both generatively (e. g. , producing an artifact like an image or plan) and conditionally (e. g. , mapping inputs to outputs). In total, we contribute the following:  (1)  a new approach to mining reusable program components based on E-graph matching; (2) a new system that learns a library and a recognition model from a corpus of synthesis problems; and (3) an evaluation across 8 domains.
Background and Overview This section provides a high-level overview of DreamCoder. We largely follow the architecture of the EC 2 system  [14] , which DreamCoder's structure is based on. In this section, such structure is shared unless otherwise noted. DreamCoder inputs a training corpus of synthesis problems and a base language. The base language should be lowlevel yet expressive enough to solve all the training problems, at least in principle. The corpus should contain problems with varying degrees of difficulty, ranging from problems that can be solved with very small programs in the base language to problems that require more complex programs. The programs in the corpus should also make up a consistent domain, meaning that the same abstractions should be useful in solving problems across the difficulty spectrum.
The DreamCoder Algorithm DreamCoder is inspired by the original wake-sleep algorithm of Hinton, Dayan and colleagues  [23]  (hence the name DreamCoder). Traditional wake-sleep learning is an unsupervised method for training latent variable generative models. It iterates between wake and sleep phases: waking trains the generative model by proposing latent variables via an auxiliary neural net called a recognition network, while sleeping trains this recognition network on samples from the generative model. Porting this idea to program synthesis, our generative model is a probability distribution over programs (the latent variables), while the recognition network learns to map from specifications to programs. Concretely, the waking phase of DreamCoder uses the current dsl (generative model) and neural search policy (recognition network) to solve as many problems from the corpus as it can.
Abstraction Sleep: Growing the Library The key novelty in this paper is the abstraction sleep phase which discovers common components that can be used to more succinctly represent the programs discovered during the waking phase. The challenge is illustrated in Fig. 2. In this example, two different recursive solutions to two different tasks (expressed using the Y combinator) appear to have very few meaningful common subexpressions. However, DreamCoder uses a new data structure based on equivalence graphs  [11]  and constructed via dynamic programming which can summarize a large number of possible refactorings to the original programs. One of those refactorings exposes a common sub-expression that corresponds to the function Objective: For each task x in X, find best program ρx solving x under current prior (D, θ).
Dream Sleep: Training a Recognition Model During dreaming, the system trains its recognition model, which later guides the search for programs during waking. Like EC 2 , DreamCoder trains a recognition network on (program, task) pairs drawn from two sources of self-supervised data: replays of programs discovered during waking, and fantasies, or random programs assembled from members of the learned library. Replays ensure that the recognition model is trained on the actual tasks it needs to solve, and does not forget how to solve them, while fantasies provide a large and highly varied dataset to learn from, and are critical for data efficiency: becoming a domain expert is not a few-shot learning problem, but nor is it a big data problem. The input corpus to DreamCoder typically contains 100-200 tasks, which is too few examples for a high-capacity neural network.
Efficient Refactoring We tame the combinatorial explosion associated with refactoring using machinery that draws primarily on the ideas of an E-graph and a version space. A version space is a data structure that compactly represents a large set of programs and supports efficient set operations like union, intersection, and membership checking. An E-graph, in turn, is a data-structure that leverages sharing to compactly represent many alternative versions of the same program. The two ideas are quite closely related, and in fact, prior systems such as FlashFill have used E-graph-like representations to represent version spaces compactly  [20]. Version space. The purpose of a version space is to compactly represent a set of programs. Our basic language will be -calculus with some additional primitives.
Dream Sleep Our dream phase works differently from a conventional wake-sleep  [23]  dream phase in the following way: we think of dreaming as creating an endless stream of random problems, which we then solve during sleep, and train the recognition network to predict the solution conditioned on the problem. Evaluating L Fantasy involves drawing programs from the current library, running them to get their outputs, and then training  to regress from the input/outputs to the program. Since these programs map inputs to outputs, we need to sample the inputs as well. We simply sample the inputs from the empirical observed distribution of inputs in. The L MAP Fantasy objective also involves finding the MAP program solving a task drawn from the library. To make this tractable, rather than sample programs as training data for L MAP Fantasy , we enumerate programs in decreasing order of their prior probability, tracking, for each dreamed task , the set of enumerated programs maximizing P[,  |D,  ] (Appendix Algorithm 3).
The system is initialized with functional programming primitives (map, fold, cons, car, cdr, if, length, index, =, +, -, 0, 1, cons, car, cdr, nil, and is-nil) and numerical routines (mod, *, >, is-square, and is-prime). • Text editing: in the style of FlashFill  [20] , testing on 108 2017 SyGuS problems  [1]  and training on text editing problems from  [14]. This system is initialized with the same functional programming primitives as above but also including character and string constants. • LOGO graphics: inverse graphics where each synthesis problem is specified by a raster image, and solved by synthesizing a program in LOGO Turtle  [54]  graphics. These programs control a simulated 'pen' as it moves over a canvas. The base language includes 'for' loops, a stack for saving/restoring the pen state, and arithmetic on angles and distances.
We compare with two other baselines: Neural Program Synthesis, which trains RobustFill  [13]  on samples from the initial library; and Enumeration, which performs type-directed enumeration  [17]  for 24 hours per task, generating up to 400 million programs for each task. In every domain, our model always solves at least as many problems as the best alternative approach on that domain (Fig. 7A-B ). It also generally solves these problems in the least time (mean 54. 1sec; median 15. 0sec; Appendix Fig. 20 ). These results establish that each of DreamCoder's core components ś library learning in the sleep-abstraction phase, and recognition model training in the sleep-dreaming phase ś contributes significantly to its overall performance. The synergy between these components is especially clear in the more creative, generative structure building domains, LOGO graphics and tower building, where neither ablation ever solves more than 60% of held-out tasks while Dream-Coder learns to solve nearly 100% of them (Fig.
From Learning Libraries to Learning Languages Our experiments up to now study how DreamCoder grows from a łbeginnerž state given basic domain-specific procedures, such that only the easiest problems have simple, short solutions, to an łexpertž state with concepts allowing even the hardest problems to be solved with short, meaningful programs. Now we ask whether it is possible to learn from a more minimal starting state, without even basic domain knowledge: Can DreamCoder start with only highly generic programming and arithmetic primitives, and grow a domainspecific language with both basic and advanced domain concepts allowing it to solve all the problems in a domain? Motivated by classic work on inferring physical laws from experimental data  [28, 45, 49] , we first task DreamCoder with learning equations describing 60 different physical laws and mathematical identities taken from AP and MCAT physics łcheat sheetsž, based on numerical examples of data obeying each equation (Appendix Tbl.
1). The full dataset includes many well-known laws in mechanics and electromagnetism, which are naturally expressed using concepts like vectors, forces, and ratios. Rather than give DreamCoder these mathematical abstractions, we initialize the system with a much more generic basis Ð just a small number of recursive sequence manipulation primitives like map and fold, and arithmetic Ð and test whether it can learn an appropriate mathematical language of physics. After 8 wake/sleep cycles DreamCoder can solve 93. 3% of the laws and identities in the dataset (best of five runs, mean 84. 3%). 3 It first learns the building blocks of vector algebra, such as inner products, vector sums, and norms (Fig. 11A ). These operations have many algebraic symmetries, and accordingly our symmetrybreaking recognition model gives a slight edge over EC 2 , which solves up to 86.
6% of the tasks (best of three runs, mean 81. 1%; compute limits restricted us to 3 runs). After acquiring these vector operations, DreamCoder then uses this mathematical vocabulary to construct concepts underlying multiple physical laws, such as the inverse square law schema that enables it to learn Newton's law of gravitation and Coulomb's law of electrostatic force, or the quadratic form underlying equations of ballistic motion and angular motion time, effectively undergoing a 'change of basis' from the initial recursive sequence processing language to a physics-style basis. Could DreamCoder also learn this recursive sequence manipulation language? We initialized the system with a minimal subset of 1959 Lisp primitives (if, =, >, +, -, 0, 1, cons, car, cdr, nil, and is-nil, all present in some form in McCarthy's 1959 Lisp  [33] ), and asked it to solve 20 basic programming tasks, like those used in introductory computer science classes (Figure  19 ).
11B ). All these routines are expressible in terms of the higher-order function fold and its dual unfold, which, in a precise formal manner, are the two most elemental operations over recursive data ś a discovery termed łorigami programmingž  [19]. Dream-Coder retraced the origami style: first reinventing fold, then unfold, and then defining all other recursive functions in terms of folding and unfolding. In contrast, EC 2 uses a simpler library learning method. When run on this data set, it fails to uncover the origami basis: instead, it builds a bigger library (14 functions vs. 11 w/ DreamCoder) of less generic operators, and cannot solve the harder 'zipping' tasks. As with our list processing domain (Fig. 7B ), sophisticated refactoring proves valuable for skillful functional programming.
Discussion Related work. Existing neural program synthesis systems pair a fixed DSL to a learned neural network that guides program search  [4, 15, 18, 38, 42]. All such systems predict a distribution over programs conditioned on a specification, ranging from unigram distributions  [34] , to bigram-like ones  [29, 30] , to neural autoregressive models  [12]. We build on these ideas by showing that a bigram distribution, trained correctly, suffices to break many syntactic symmetries in the domain-specific language, which is especially valuable when that language grows over time, as in DreamCoder. Recent works for learning DSLs or libraries function by inferring reusable pieces of code  [10, 14, 31, 32]  (c. f. predicate invention in ILP  [36]  and ADFs in genetic programming  [40] ). These systems typically work through either memoization (caching reused subtrees, i.
e. [10, 32] , or reused command sequences, as an  [29] ), or antiunification (caching reused tree-templates that unify with program syntax trees, i. e. [14, 21, 24, 47] ). Our abstraction sleep algorithm works through automatic refactoring, discovering and incorporating into the library syntax trees which are not present in the surface form of programs available to the learner. Conceptual connections exist between DreamCoder and the cognitive science literatures on dual-process models  [16] , and human expertise  [5, 6]. These models partition expertise into declarative and procedural knowledge. Declarative concepts have explicit, symbolic structure: i. e. , for a programmer, concepts such as depth-first-search or sorting. Human experts also possess implicit procedural skill in deploying those concepts to quickly solve new problems.
Acknowledgments We thank  L. Schulz ,  J. Andreas ,  T. Kulkarni ,  M. Kleiman-Weiner ,  J. M. Tenenbaum ,  M. Bernstein ,  S. Tenka ,  N. Fijalkow ,  P. Bielik ,  E. Spelke , and our anonymous reviewers for comments that greatly improved the manuscript. Supported by grants from the  Air Force Office of Scientific Research , the  Army Research Office , the  NSF  under Grant No. 1918839  and  NSF-funded Center for Brains, Minds, and Machines , the  MIT-IBM Watson AI Lab, Google, Microsoft and Amazon , and  NSF  graduate fellowships to  K. Ellis  and  M. Nye. Opinions  and findings in this material are those of the authors and do not necessarily reflect the views of the NSF.
The simulation is implemented over a software platform; in our case, we rely on Repast Simphony, a Java-based modeling system for interacting agents. This simulation tool establishes some constraints we had to meet in the definition of the software counterpart of each biological component. For the purpose of this paper, the agent-based modeling did not require a mathematical description of its components, because, for engineering the model on the Repast framework, it is sufficient to describe the agent behavior by using a meta-model. For this reason, the system has been designed following the PASSI (Process for Agent Societies Specification and Implementation) methodology  (Cossentino, 2005)  (see Figure  3 ). In the Supplementary Information, we provide the diagrams that describe the agents' behavior and some of their interactions.
Perinephric Fat Immune Cells + 25% Percentage increase of the number of immune cells in obese patients, excluding pDCs, mast cells, and NK cells (for which the number is calculated directly). Volume (mL) 10 -5 Value used to compute the dimension of the simulation grid. They are used along with the experimental values for cellular densities reported in Table  2. T cells varies among studies; we used as reference the value obtained by  Li et al. (2020)  of 84 cells per mm 2. To obtain the density of the other immune cells, we used the immune cell type absolute fraction data for ccRCC from the Cancer Immunome Atlas (TCIA) database (data available at https://tcia. at/cellTypeFractions). We inferred the number of immune cells per mm 3 by applying the formula proposed by  Erdag et al. (2012) , that is: cells/mm 3 = number cells/mm 2 × (1/cell diameter (in mm)).
Context. The X-ray spectra of X-ray binaries are dominated by emission of either soft or hard X-rays which defines their soft and hard spectral states. While the generic picture is relatively well understood, little is known about the interplay of the various media at work, or about the reasons why some sources do not follow common behavior. Cygnus X-3 is amongst the list of X-ray binaries that show quite complex behavior, with various distinct spectral states not seen in other sources. These states have been characterized in many studies. Because of its softness and intrinsic low flux above typically 50 keV, very little is known about the hard X/soft gamma-ray (100-1000 keV) emission in Cygnus X-3. Aims. Using the whole INTEGRAL data base, we aim to explore the 3-1000 keV spectra of Cygnus X-3.