Unsupervised Learning of Neurosymbolic Encoders
Authors: Eric Zhan
Jennifer J. Sun
Ann Kennedy
Yisong Yue
Swarat Chaudhuri
Venue: Accepted by TMLR ()

Abstract: We present a framework for the unsupervised learning of neurosymbolic encoders, which are encoders obtained by composing neural networks with symbolic programs from a domain-specific language. Our framework naturally incorporates symbolic expert knowledge into the learning process, which leads to more interpretable and factorized latent representations compared to fully neural encoders. We integrate modern program synthesis techniques with the variational autoencoding (VAE) framework, in order to learn a neurosymbolic encoder in conjunction with a standard decoder. The programmatic descriptions from our encoders can benefit many analysis workflows, such as in behavior modeling where interpreting agent actions and movements is important. We evaluate our method on learning latent representations for real-world trajectory data from animal biology and sports analytics. We show that our approach offers significantly better separation of meaningful categories than standard VAEs and leads to practical gains on downstream analysis tasks, such as for behavior classification.


Published in Transactions on Machine Learning Research (11/2022)
Unsupervised Learning of Neurosymbolic Encoders
Eric Zhan
cahan@callech.commmmm edu
California Institute of Technology
Jennifer J. Sun*
jjsun@caltech. edu
California Institute of Technology
Ann Kennedy
Northwesterr University Feinberg School of Medicine
Yisong Yue
California Institute of Technology
Swarat Chaudhuri
University of Tezos at Austin
Equal contribution
Reviewed on OpenReview:
Abstract
We present framework for the unsupervised learning of neurosymbolic encoders, which are encoders obtained by composing neural networks with symbolic programs from domain- specific language. Our framework naturally incorporates symbolic expert knowledge into the learning process, which leads to more interpretable and factorized latent representations compared lo fully neural encoders. We integrale modern program synthesis techniques with the variational autoencoding (VAE) framework, in order to learn neurosymbolic encoder in conjunction with standard decoder. The programmatic descriptions from our encoders can benefit many analysis workflows, such as in behavior modeling where interpreting agent actions and movements is important. We evaluate our method on learning latent representations for real-world trajectory data from animal biology and sports analytics. We show that our approach offers significantly better separation of meaningful categorics than standard VAEs and leads to practical gains on downstream analysis tasks, such for behavior classification. Code can be found at https::/gi tiugthhh..... com ezhan9//
1 Introduction
Advances in unsupervised learning have enabled the discovery of latent structures data from a variety of domains, such as image data (Dupont 2018), sound recordings (Calhoun et al. 2019), and tracking data (Luxem et al.) 2020). For instance, a common approach is to use encoder-decoder frameworks, such variational autoencoders (VAEs) (Kingina & Welling 2014h, to identify low-dimensional latent representation from the raw data that could contain disentangled factors of variation (Dupont) 2018) semantically meaningful clusters (Luxem et al. 2020). Such approaches typically employ complex mappings based on neural networks, and explaining how the model assigns inputs to latent representations can be challenging [Zhang et al. 2020
In this paper, we introduce unsupervised neurosymbolic representation learning, which allows part of a representation to be computed using symbolic encoder programs written a predefined domain-specific language (DST.). (The rest of the representation computed using neural network.) The of such

---

Published in Transactions on Machine Learning Research (11/2022)
neurosymbolic encoders can offer two key benefits over purely neural approach. First, since DSL reflects structured domain knowledge, neurosymbolic encoders can often produce representations that are human- interpretable (Verma et al.) 2018 Shah et al. 2020). Second, as observed in studies that used hand-crafted programmatic encoders (Zhan et al. 2020j, these representations can potentially be more factorized or well-separated into meaningful categories than purely neural representations.
Our learning algorithm is grounded in the VAE framework (Kingma & Welling, 2014 Mnih & Gregor 2014
and aims to discover a neurosymbolic encoder coupled with standard neural decoder A key challenge here is that the space of programs in DSL is combinatorial. We tackle this problem by assuming programs to be differentiable and by tightly integrating standard VAE training with modern program synthesis methods (Chaudhuri et al. 2021 Shah et al.] 2020). We further show how to incorporate ideas from adversarial information factorization (Creswell et al.] 2017) and enforcing capacity constraints (Burgess et al., 2017 Dupont 2018 order to mitigate issues such as posterior and index collapse in the learned representation.
Programmalic descriptions from neurosymbolic encoders are especially useful in behavior analysis (Segalin et al. 2020 Sun et al., 2021b), where domain experts routinely interpret clusters of behaviors part of an experimental evaluation focuses on this setting. By integrating domain knowledge using program synthesis, we demonstrate that our clusters are inherently interpretable and better aligned with human-annotated labels across multiple behavior analysis datasets. To validate the end-to-end practicality for analysis workflows, we integrate our automatically learned programs into a state-of-the behavior analysis framework, Task Programming (Sun et al., 2021b), that typically relies on expert-crafted programs, and demonstrate competitive performance using our automatically synthesized programs.
analysis workflow. Accordingly,
To summarize, our contributions are:
We propose a neurosymbolic approach to representation learning, in which part of the latent representation produced by an interpretable encoder program, while the rest is computed using a neural network.
We realize the approach via a learning algorithm that combines VAE training and program synthesis.
We show that our approach can significantly outperform purely neural encoders in extracting semantically meaningful representations of behavior, as measured by standard unsupervised metries.
We further explore the flexibility of our approach, by showing that performance can be robust across different DSL designs by domain experts.
We showcase the practicality of our approach on downstream tasks, by incorporating our approach into a state-of-the-ar sulf-supe learning approach for behavior analysis (Sun et al., 2021b).
2 Background
2.1
Variational Autoencoders
We build on VAEs (Kingma & Welling 2014 Mnih & Gregor 2014 a latent variable modeling framework
shown to learn effective latent representations (also called encodings/ encodings/embeeding)) (Higgins et al. 2016 Zhao Yingzhen & Mandt 2018) and can capture the generative process (Oord et al.) 2017 Vahdat &
et al.
2017
Zhan et al. (020). VAEs introduce a latent variable z, an encoder 4s decoder pa, and prior distribution on z. & and 0 are the parameters of the q and p respectively, often instantiated with neural networks. The learning objective is to maximize the evidence lower bound (ELBO) of the data log-likelihood: Dx L (x))))((())) < logp(x).
Kautz 2020
ELBO =
Eqa(tix)
The first term in Eq. I is the log-density assigned to the data, while the second term is the KL-divergence between the prior and approximate posterior of z. Latent representations z are often continnous and modelod with a Gaussian prior, but z can be modeled to contain discrete dimensions as well (Kingma et al. 2014
Some prior work have studied the complementary problem of learning Feinman & Lake 2020 See Section 5 for more discussion.
decoders (e.g.. Ellis et 2018
2

---

Published in Transactions on Machine Learning Research (11/2022)
Hu et al. trajectories, and so in practice we utilize a trajectory variant of VAFs (Co-Reyes et al. 2018 Zhan et al.) Sun et al. 2021b). described in Section 3.5
2017:
Dupont 2018
Our experiments are focused on behavioral tracking data in the form of
2020
One challenge with VAEs (and deep encoder-decoder models in general) that while the model is expressive, it is often difficult. to interpret what encoded the latent representation z. Common approaches include taking traversals in the latent space and visualizing the resulting generations (Burgess al. 2017), or post-processing the latent variables using techniques such clustering (Luxem et al. 2020). Such techniques are post-hoc and thus cannot guide (in interpretable way) the encoder to be biased towards family of structures. Some recent work have studied how to impose structure in the form of graphical models or dynamics in the latent space (Johnson et al., 2016 Deng et al.) 2017], and our work can be thought of as a first step towards imposing structure in the form of symbolic knowledge encoded in a domain specific programming language.
2.2 Synthesis of Differentiable Programs
Our approach utilizes recent work on the synthesis of differentiable programs (Chaudhuri et al. 2021 Shah ct al. 2020; Valkov et al.] 2018), where one learns both the discrete structure of the symbolic program (analogous to the architecture of neural network) as well as the differentiable parameters within that structure. Our formulation closely follows that of Shah al. (2020). We use a domain-specific programming language (DSL), generated with a context-free grammar (see Figure 3 for an example). A program is represented as pair (a, 4), where a is discrete program architecture and & are its real-valued parameters. We denote P the space of symbolic programs (i.e. programs with complete archilectures). The semantics of program (a, 1)) is given by a function [z][ vi) that is guaranteed to be differentiable in both æ and v.
Like Shah et al. (2200) we pose the problem learning differentiable programs as search through a directed program graph G. The graph 9 models the top-down construction program architectures a through the repeated firing of rules of the DSL grammar, starting with an empty architecture Og (represented by the "start" nonterminal of the grammar). The leaf nodes of G represent programs with complete architectures (no nonterminals). Thus, P is the set of programs in the leaf nodes of G. The other nodes in & contain programs with partial architectures (has at least one nonterminal). We interpret program in a non-leaf node as being neurosymbolic, by viewing its nonterminals as representing neural networks with free parameters. The root node in G is the emply architecture co, interpreted as fully neural program. An edge (a,a') exists in G if one can obtain a' from a by applying a rule in the DSL that replaces a nonterminal in a.
Program synthesis in this problem setting equates to scarching through G find the optimal complete program architecture, and then learning corresponding parameters vb, i.e., to find the optimal (a, that minimizes a combination of standard training loss (e.g., classification error) and structural loss (preferring "simpler" a's). Shah et al. (2020) evaluate multiple strategics for solving this problem and finds informed search using admissible neural heuristics to be the most efficient strategy (see appendix). Consequently, we adopt this algorithm for our program synthesis task.
3 Neurosymbolic Encoders
The structure of our neurosymbolic encoder is shown in the right diagram of Figure The latent representation z 1 ()) is partitioned into neurally encoded 2 and programmatically encoded ((a,))- This approach boasts several advantages:
The symbolic component of the latent representation is programmatically interpretable.
The neural component can encode any residual information not captured by the program, which maintains the model's capacity compared deep encoders (see synthetic experiment in Section 4.2
By incorporating a modular design, we can leverage state-of the-rrrrttttttt learning algorithms for both differentiable encoder-decoder training and program synthesis.
3

---

Published in Transactions on Machine Learning Research (11/2022)
Step 1: Optimize with at fixed
Step 2: Update symbolic encoder (a, v)) + (a),
Repeat steps & until Kan,ei is fully symbolic, Optimize with complete a
Symbolic Encoder: Fully neural to start
Reconstructed Input
Reconstructed Input
Input
Input
Input
Fully symbolic
Symbolic Encoder: Program depth
((,a))
((a,s)
((or w/) Z(a,,))
P8
P8
c
Neural Decoder
Z
Neural Decoder
Encoder
Neural
X
Neural Encoder
Figure 1: Learning Neurosymbolic Encoders: Sketch of Algorithm I (Section 3.1j. The symbolic
encoder is initially fully neural. We alternate between VAE training with the program architecture fixed (Step as in Eq. 2), and supervised program learning to increase the depth of the program by (Step 2 as in Eq. 3 Once we reach a symbolic program, we train the model one last time to learn all the paramcters. The color (in terms lightness) of the symbolic encoder corresponds to the encoder becoming more symbolic over time.
We denote le and ((),)) as the neural and symbolic encoders respectively (see Figure where 2. ~ 2 (x) and 2(a,)) ~ ())))) Ts is instantiated with neural network, but ka,,) is a differentiable program with architecture a and parameters &p in some program space P defined by a DSL. Given unlabeled training set of x's, our neurosymbolic- VAE (ns-vae) learning objective becomes:
max (.)))))
Lue-vae (0, v)
log (x ((,))))
(o,)))
(o x)((a (2(x))))x))
(2)
recoustruction loss
DKL (x
-DL (9(a,)) (Z(a.w) (x)
regularization for noural latent
regularization for symholic latent
Compared to the standard VAE objective in Eq. for single neural encoder, Eq. 2 has separate KL-divergence terms for the neural and programmatic encoders.
3.1 Learning Algorithm
The challenge with solving for Eq. 2 is that while (6,35,0 0) can be optimized via back-propagation with a fixed, optimizing for a is discrete optimization problem. Since it is difficult to jointly optimize over both continuous and discrete spaces, we take an iterative, alternating optimization approach. We start with a fully neural program (one with empty architecture og as described in Section (.2) trained using standard differentiable optinization (Figure [ Step 1). We then gradually make more symbolic (Figure Step 2) by finding program that is child of the current. program in (more symbolic by construction of 9) that. outputs as similar to the current latent representations possible:
min a':(a,a')EG, *" Lsupervised (1(.,) Ma (x)))
(3)
which can be viewed as form of distillation (from less symbolic more symbolic programs) via matching the input/output bohavior. We solve Eq. 3 by enumcrating over all child programs of the current scarch tree and selecting the best one, which is similar to one iteration of iteratively-deepenee depth-first search in [Shah] et al. (2020) (more details in Section 3.2) We alternate between optimizing Eq. 2 and Eq. 3 until we obtain complete program. Algorithm [ outlines this procedure and is guaranteed to terminate if G is finite by specifying maximum program depth.
We chose this optimization procedure for two reasons. First, it maximally leverages state-of the---r-tth--tttt tools in both differentiable latent variable modeling (VAE-style training) and supervised program synthesis (for distillation), leading to tractable algorithm design. Second, this procedure never makes a drastic change the program architecture, leading to relatively stable learning behavior across iterations.
4

---

Published in Transactions on Machine Learning Research (11/2022)
Algorithm Learning neurosymbolic encoder
Algorithm 2 Learning neurosymbolic encoder with programs
1: Imput: program space P, program graph 9
2: initialize @, v, 0 og (empty architecture)
1: Input: program space P. program graph G, k
3: while is not complete do
2: for i= 1.. do
th, optimize Eq. with a fixed
3: fix programs {Man .h)............................. ....... K(o -.:;))
5: (a, (+) + optimize Eq. 3
4: execute Algorithm to learn ((y
6: end while
5: remove ((rw)) from P to avoid redundancies
7: 0. 4,,0 optimize Eq. 2 with complete
6: end for
8: Return: encoder (().))
7: Return: encoder {gas (ar..).......................... ((a,.
3.2 Program Synthesis via NEAR
Our strategy for solving Eq. 3 utilizes the setup in Shah et al. 2020 We summarize the key points below.
Program graph 9. Shah et al. 2020)) learns programs a supervised learning setting that minimizes a structural cost 8 (deeper programs are more costly) and a prediction error Ç:
(a", w²*) = arg min(s(a) + <(a, 1)))
(4)
(a.v)
Shah et al. (020)) construct a program graph & such that solving Eq. equates to finding a leaf node with the minimum path cost. on G. We include a copy of their illustration for g in Figure 2 Our problem definition in Eq. is very similar so we utilize the same program graph. The difference that our labels are not ground-truth but rather the labels assigned by the current neurosymbolic encoder.
Neural heuristic h. Shah et al. 2020) solve Eq. 4 by introducing hcuristic a neural admissible relaxation (NEAR for short). Leveraging fully differentiable DSL, they use neural networks to fill in for nonterminals in programs and show that the performance of such neurosymbolic programs are underestinates of the total path costs of descendent leaf nodes and thus, can be used as an admissible heuristic. This allows them integrate their heuristic with several graph search algorithms, of which they adopt A scarch and iterativelyddeepened depth-first-seacch with branch- and-bound (IDS-BB). We use IDS-BB in our work.
mmppprafix Ox hs
add|fO.0 OJ 0.3
+0.05-007-8775
140,05 10.05
addffmuifO.O Ol) h- 0.75
sutffselsa(O)sseee=(())) h 0.06
IDS-BB. The full algorithm for LDS-BB& is described in Algorithm in Shah et al. 2020 In our work, this reduces to the following:
t:0 1:000003.000003---
1. For the current program, enumerate its children in g.
C = 0.5
2. We compute the heuristic for each child in g by replacing any nonterminals with neural networks.
Figure 2: Figure 4 from Shah al. 22200) Structural costs s are in red, heuristic values h in black, and prediction errors C in blue. O refers to nonterminals.
3. We commit to the most promising child (with respect to the heuristic) and update the program, which can be viewed one iteration of the full IDS-BB algorithm.
One key difference is that the original IDS-BB algorithm maintains a frontier ordered by the best heuristics encountered so far. However, our label distributions can change between iterations (since the symbolic component of the encoder is updated and thus, the labels it assigns), which invalidates the heuristics computed from previous iterations. This leaves a very interesting direction for future work.
3.3 Learning Multiple Programs
The interpretabllity of latent representations induced by symbolic encoders K(.)) ultimately depends on the DSL. For instance, program that encodes to one of ten classes may not be very interpretable if it involves
5

---

Published in Transactions on Machine Learning Research (11/2022)
matrix multiplication within the program. Instead, learn binary programs that encode sequences into one of two classes (using binary cross-entropy for Lompervised: uniform prior on 2-dimensional (() and Gumbel-Softmax (Jang et al. 2017) to sample ((a,)) from the posterior). Figures 5a & 5b depict learned binary programs that encode mice trajectories and their interpretations.
To encode more than two classes, we simply learn multiple binary programs by extending Eq. 2 sum over Caupervised for k symbolic programs (1)...)):.... (...:)))....aa...a))) ((..va) and corresponding latent representations (Maan.)))..... (an))))) This results 2 classes and solution space that now scales exponentially (e.g. (PI*). Algorithm outlines our groedy solution that rouses Algorithm by itcratively learning one symbolic program at a time. We leave the exploration of more sophisticated search methods as future work.
3.4 Dealing with Posterior and Index Collapse
Deep latent variable models, especially those with discrete latent variables, are notoriously prone to both posterior (Bowman et al. 2015 Chen et al.) 2016b; Oord et al.) 2017) and index (Kaiser et al. 2018) collapse. Since our algorithms optimize for such models repeatedly, they can be susceptible to these failure modes. Below, we summarize two strategies that we found to work well in our setting ?
Adversarial information factorization. Index collapse is the phenomenon which all data encoded into one class, resulting in a discrete latent variable ((a,v) that effectively meaningless. Creswell al. (017 counteracts index collapse by introducing adversarial network A and maximizing the adversarial loss below to ensure that the adversary A cannot successfully predict z(a,)) from 2
max Liueld, a, 0)
(.(),))
(x + min Ladv (zØ), ((, (.(0.)) 5o(2a1x)9 (1))))
max
E
(5)
adversary
-xL
(x0(2)/x))ll x))pp(())) DKL (H (Z)a.)) ( ())((()))
Channel capacity constraint. Posterior collapse is the phenomenon in which the posterior trivially matches the prior exactly (a KL-divergence of 0) but the latent variables are unused by the decoder. Burgess et al. (2017) and Dupont 2018)) instead force the KL-divergence terms to match capacities Co and C(a,)), which are hyperparameter (see appendix). Since the KI-ddivegeence is an upper bound on the mutual information between latent variables and the data (Kim Mnih 2018 Dupont 2018), this encourages the latent variables encode information and aims to prevent posterior collapse.
max $.(0,))..
Leap (Ø, a, 0)
max +.)
E anlnal x0 (1)))
po (x/ 2(or,s)))
(6)
% DEL (go (z (x)pxx)))(z)) - Col Mo.ss) DEL (Z
((((())))) (x) Clawol
In our alms, we augment our initial objective in Eq. 2 with Eq. 5 and Eq. G
max 1,
(nd-val at sh 0) + Arao a, 1b, 0) + Aeap (0) a, 1/
(7)
where Atac >eap in experiments.
3.5 Instantiation for Sequential Domains
The objective in Eq. 2 describes a general problem that applicable to any domain. our experiments, we focus on sequential trajectory data. Trajectory data is often used scientific applications where interpretabiliity is desirable, such behavior discovery (Luxem et al. 2020 Hsu & Yttri 2020). The ability to casily explain the learned latent representation using programs can help domain experts better understand the structure in their data. Trajectory data is also often relatively low dimensional, which helps experts encode domain
knowledge into the DSL more casily (Shah et al. 2020 Sun ct al. 2021b Zhan et al. 2020).
There many approaches available for tackling both these issues, but emphasize that these contributions are orthogonal ours; as techniques for preventing posterior and index collapse improve, so will the robustness of our algorithm.

---

Published in Transactions on Machine Learning Research (11/2022)
:= Φ (a(ai....,.u I (e(ea.....,
if 01 then 02 elsc 0g sels x mapaverago (fun x1.a1) x
Figure Our DSL for sequential domains, similar the one used in Shah al. (2020). I, @ and @y represent inputs, basic algebraic operations, and parameterized library functions, respectively. fun x.e(x) represents function that evaluates an expression e(x) over the input sels selects subset S of the dimensions of the imput mapaverage g I applies the function g to every element of the sequence z and returns the average of the results. We employ a differentiable approximation of the if-then balee construct.
In this domain, x is a trajectory of length T: (T)). We then factorize the log-density in Eq.
product of conditional probabilities:
T
log po (x Zg, ((),)))
Σ
log (= Zo. ((a,0))
(8)
When de and pe are instantiated with recurrent noural networks (RNN), the model is more commonly known 88 trajectory-VAE (TVAE) (Co-Reyes al., 2018
As the symbolic encoder ((a,))) maps sequences to vectors, we adopt a DSL (Figure 3 previously used for sequence classification (Shah et al. 2020). Our DSL is purcly functional and contains both basic algebraic operations and parameterized library functions. Domain experts can easily augment the DSL with their own functions, such as selection functions that select subsets of features that they deem potentially important. We ensure that all programs in our DSL are differentiable by utilizing a smooth approximation of the if-then-else 5b depict example programs (full details in the appendix).
construct (Shah al. 2020 Figures 5a
4 Experiments
We take a multi-faceted approach to evaluate our unsupervised learning approach using synthetic data and real-world data from animal behavior and sports analytics. We also show the end-to-end practicality of our programs by applying them to downstream behavior classification framework. Our research questions are:
Q1: Are the clusters created with our programs meaningful? (Section 4.2 We evaluate this aspect both qualitatively and quantitatively by comparing with the truth generative process synthetic datasets, as well by comparing to human annotated labels on real-world datasets.
Q2: How sensitive is our approach to different DSL choices? (Section 4.3) We compare programs learned in our framework from three different DSLs designed by three domain experts for studying animal behavior. The three DSLs (DSL 1, DSL 2, DSL 3) mainly differ in the behavioral features chosen by experts, and are described in Appendix Section C.
Q3: Are the programs useful for downstream tasks? (Section 4.4 Ultimately, the practicality of these methods must be validated by their usefulness in downstream tasks such as those used in scientific analyses. We apply our unsupervised programs to behavior classification framework called task programming (Sun et al. 2021b). This framework uses hand-crafted programs for self-supervision, which we replace with our automatically learned programs.
4.1 Experimental Setup
4.1.1 Datasets
We summarize the datasets used in our experiments, and provide full details in the appendix.
Synthetic. We generate synthetic trajectories by sampling initial positions and velocities from a Gaussian distribution and introducing 2 ground-truth factors of variation as large external forces in the positive positive/negative negative x/y directions that affect velocity, totaling discrete classes. Vclocitios are sampled and fixed for the entire trajectory, but we also sample small Gaussian noise at each timestep. We generate 10k/2k/20 22 trajectories of length 25 for train/ validation/tess Figure 4a shows 50 trajectories from the training set. This dataset.

---

Published in Transactions on Machine Learning Research (11/2022)
1/56,11 sel PemaiXFoositoonn T]
1p38,99| sel PelaaYYooooiiion LF
(a) 50 synthetic trajectories
(b) learned programs (c) 2 0 programs
(d) Ze. program
(e) 2o. 2 programs
Figure 4: Synthetic dataset experiments. (a) Trajectories in synthetic training set. Initial /ninaal/final /final positions are indicated in green/blue. Red lines delineate ground-truth classes, based on final positions. (b) h 2 learned binary programs using our algorithm. The first program (top) thresholds the final x- x-position while the second program (bottom) thresholds the final y-position. (c, d, e) Neural latent variables reduced to 2 dimensions. Top/bottom rows are colored by final x/y-positions respectively (green/yellow is resitive/negattive.. (c) Clusters in TVAE neural latent space correspond to 4 ground-truth classes. (d) After learning the first program, the neural latent space contains clusters only based on the final y-position. (e) After learning the second program, all 4 ground-truth classes have been extracted as programs and the remaining neural latent space contains no clear clustering.
is useful because we can evaluate whether our algorithm can learn programs that match the ground-truth factors of variation (such ground-truth information is not available in real-world datasets).
CalMS21. Our primary real-world dataset is the CalMS21 dataset (Sun et al., 2021a), containing trajectories of socially interacting mice captured for neuroscience experiments. Each frame contains 7 tracked keypoints for each of two mice. The dataset has one set of unlabeled tracking data, which we use to train our neurosymbolic encoder, and another set annotated with 4 labels at cach frame by human experts (frame-level behaviors), which we use to evaluate our programs. These labels consists of three behaviors-of-ntteres between mice (attack, mount, investigation), and a label corresponding to all other behaviors (other), with a more detailed description in Sun et al. (2021a). Specifically, our evaluation uses labels from the test split of the CalMS21 classification task. We have 231k 231k/52k/ /5kk/262k trajectories of length 21 for train/val /val/vestt...... /tst.. The features in our DST are selected by a domain expert. based on the attributes from Segalin et al. (022))
Basketball. We use the same basketball dataset as in Shah al. 2020 and Zhan et al. 2020 that tracks professional basketball players. Each trajectory is of length 25 over 8 seconds and contains the zyypositions of 10 players. We split trajectories by grouping offensive and defensive players (5 each), effectively doubling the dataset size. We evaluate our algorithm and the baselines with respect to the labels of offensive offensive/defeesiiee /deensiie players. Our DSL includes additional domain features like player speed and distanco-to-baskett In total, we have 177k/31k/272 trajectories for train/val/test.
4.1.2 Quantitative Evaluation Setup
The quantitative evaluations are used to compare our neurosymbolic encoders with baseline unsupervised learning methods on the real-world datasets.
Baselines. We compare our model containing a neurosymbolic encoder against other approaches based on VAEs. In particular, we compare against JointVAE (Dupont 2018), which also has both discrete and continuous latent representations, and can be viewed as fully neural version of our neurosymbolic encoder. Other baselines include VAE, VAE with K-means loss (Ma et al. 2019 Luxem et al. 2020 and Beta-VAE (Burgess et al. 2017). These models have a fully neural encoder and learn continuous latent representations, which we can then use to produce clusters with K-means clustering (Lloyd 1982) We additionally compare against VQ-VAFs (Oord et al.) 2017), which produce discrete latent clusters. We use the TVAE version of all baselines (details included in the appendix).
Metrics. Unlike in the synthetic setting, we do not have ground truth programs in the real-world datasets. We thus evaluate our programs quantitatively using (1) standard cluster metrics relative to human-defined
8

---

Published in Transactions on Machine Learning Research (11/2022)
mapaverage (fun It.
1 - 7
multiply (RessientSjeed.Affeee.... 66.3) (.)(),), (xx))
Nose TuilDistA 9.) To0t) x
(a) Program learned using CalMS21 DSL 1, resulting NMI 0.428, Since speed posilive, the first term always negative, One cluster thus generally consists of trajectories where the mice are further apart, such that the second term is positive, the negative product is less than the threshold. The other cluster generally occurs when the mice are close together, the second term is negative, and the product will be positive.
mapaverage (fun Iz. add (ResidenlA Aaiio Bounding BowTOOAOOffaaaa. -0
(12), x
[2-5.7]
(b) Program learned using CalMS21 DSL 2, resulting NMI 0.320. The axis ratio is the ratio of major axis length and minor axis length of an ellipse fitted the mouse keypoints. The second term measures the bounding box overlap between mice, and is zero when the mice are far apart. It follows that one cluster generally contains trajectories when the mice has larger bounding box overlaps if the resident axis ratio is large. The other cluster thus contains trajectories where the mice bounding boxes do not overlap, and resident body is compact.
Figure 5: Learned programs CalMS21. The subscripts represents the learned weights (in brackets) and biases (after the brackets) for the affine transformation followed by the bias.
CalMS21
Basketball
Model
Purity
NMI
RI
Purity
NMI
RI
Table 1: Evaluating clusters from baseline and our neurosymbolic encoders on human-annotated la- bels. Modian purity, NMI, and RI CalMS21 and Basketball compared to human-annotated labels (3 runs).
Random assignment
.597
.000
.366
.500
.000
.500
TVAE
.598
.089
.564
.501
.001
.500
TVAE STAE+KMeans KMeans loss
.605
.118
.573
.501
.001
.500
Joint VAE
.597
.019
.537
.560
.034
.507
VQ-TVAE
.601
.144
.588
.572
.016
.511
Beta-TVAL
.616
.115
.589
.565
.013
.509
Experiment hyperparameters are in-
Ours (1 program)
.706
.423
.694
.596
.027
.518
cluded in the appendix.
Ours (2 programs)
.725
.320
.6418
.561
.033
.507
Ours (3 programs)
.756
.314
.633
.544
.022
.514
labels, and (2) average precision for behavior classification when integrating our programs into downstream tasks. For cluster metrics, use Purity (Schütze et al. 2008), Normalized Mutual Information (NMT) (Zhang et al. 2006), and Rand Index (RI) (Rand] 1971). We report the median of three runs. More details, including the standard deviation and the ELBO, are in the appendix.
4.2 Q1: Are the clusters created with our programs meaningful?
Synthetic dataset experiments. Our synthetic dataset consists of trajectory data with 4 ground truth classes, corresponding to positive/negative x/y directions. The goal to learn symbolic programs that capture the ground-truth classes, while leaving the neural latent space to capture any residual information, such as the random initial velocity. We visualize the 2 dimensions of the neural latent space of TVAE along with 0, 1, and learned programs in Figures 4c contains& 4 clusters corresponding to the 4 ground-truth classes in Figure 4c After algorithm learns the first program that thresholds the final x-position, the resulting latent space in Figure 4d factor of variation as 2 clusters corresponding to the final y-positions. Lastly, when our algorithm learns a second program that thresholds the final y-position, the resulting latent space in Figure 4e no longer contains any clear clustering, showing that our approach has successfully extracted the ground-truth classes.
1e The initial neural latent space of the TVAE
captures the other
Real-world datasets experiments. We compare clusters produced by our neurosymbolic encoder with fully neural autoencoding baselines (Table I. measured against human-annotated behaviors. For CalMS21,
9

---

Published in Transactions on Machine Learning Research (11/2022)
CalMS21
(DSL 1)
CalMS21 (DSL 2)
CalMS21 (DSL. 3)
Model
Purity
NMI
RI
Purity
NMT
RI
Purity
NMI
RI
Ours (1 program)
.706
.423
.694
.689
.364
.681
.649
.325
.616
Ours (2 programs)
.725
.320
.648
.715
.359
.673
.664
.324
.634
Table 2: Effect of varying DSLs CalMS21 for neurosymbolic encoders. Median purity, NMI, and RI on CalMS21 of our algorithms with DSLs selected by three domain experts compared to human-annotated
labels (3 runs). DSL1 corresponds to Table
Table 3: Effect of encoding
CaIMS21
Basketball
Model
Purity
NMI
RI
Purity
NMI
RI
DSL features into baselines.
Median purity, NMI, and RI on
TVAE
.98
.099
.564
.501
.001
.500
CalMS21 and Basketball com-
TVAE (w/ features)
.597
.103
.570
.565
.012
.508
pared to human-amnotated labels
VQ-TVAE
.001
.124
.588
.571
.016
.511
VQ-TVAE (w/ features)
6088
.114
.601
.525
.002
.501
(3 runs) for baseline with trajec-
Beta-TVAE Beta-TVAE (w/ features)
.616
.115
.589
.566
.013
.509
tory inputs only, and bascline
.612
.996
.571
.563
.011
.508
with trajectory features added.
we observe that our method consistently outperforms the baselines in all three cluster metrics. We note that purity increases as the number of programs (thus clusters) increase, while NMT and RT decrease. This implies our method with two clusters best correspond to CalMS21 behaviors, but the other clusters found by our method may still be useful for domain experts. For Basketball, our method improves slightly with respect to purity, but is overall comparable with the baselines.
Qualitative interpretation of our clusters. We further study the programs and clusters produced by our algorithu for the CalMS21 dataset, through a qualitative study with a behavioral neuroscientist. Here, the behavioral neuroscientist analyzes the programmatic clusters produced from the symbolic representation of our neurosymbolic encoder for one, two, and three programs, resulting in two, four, and cight clusters respectively. The CalMS21 dataset is originally manually annotated with 4 classes corresponding to "attack", "investigation" (smiff), "mount", and "other" labels. "Other" corresponds to when no Selaviors-of-interre is occuring, and is typically when the mice are not interacting.
In the single program case, our prograis correspond to two discovered clusters. These clusters were classified by domain experts as referring to (1) when the mice are interacting and (2) when there are no interactions. They noted that this is based on distance between the mice, which is consistent with our program (Figure 5a using distance between nose of resident and tail of intruder. For two programs, there are total of four discovered clusters, with two clusters each corresponding to no interaction and interaction. For the interaction clusters, the domain expert was further able to identify smiff tail behavior as one of the clusters. In this case, the programs found were based on intruder head body angle, resident nose and intruder tail distance, and resident nose and intruder nose distance. The domain expert found the three program case to be more difficult to interpret, but was able identify clusters corresponding sniff tail, resident exploration, interaction facing the same direction (ex: mounting), and interaction facing opposite directions (ex: face-to-face sniffing).
4.3
Q2: How sensitive is our approach to the DSL?
Choice of DSL. To study the effect of DSL choices, we worked with three domain experts to construct three different DSLs used to learn our programmatic representations. These DSLs contained 8 to 10 different. behavioral features for studying mouse social behavior on CalMS21, in addition to common sequential operations (Figure A full list of features selected by domain experts are in the appendix.
While there is some variability, our approach consistently outperforms the baselines that contain fully neural encoders for all three DSLs (Table 2. Comparing some learned programs from two DSLs (Figures 5a. 5b), both contain term that correlates with whether the mice are interacting (distance and bounding box overlap), and another term that correlates with resident speed (mice tends be more stretched when they are moving quickly).
10

---

Published in Transactions on Machine Learning Research (11/2022)
Task Programming with Program Variations
2 10
20-
Features
Features
2x10-1
TREBA
(10 expert progs]
10-
(Log
Features
10
TREBA
(ours, 1 prog)
10
Features
TREBA
(ours, 2 progs)
102x10-1
10
10-1
10a
Training Fraction (Log Scale)
Figure 6: Applying symbolic encoders for self-suporvision. "Features" is bascline w/o self-uupervisinn. "TREBA" " is a self-supervised approach in the Task Programming paradigın (Sun el al.] (021b), using either expert-crafted programs or our symbolic encoders as the weak-supervision rules, The shaded region std dev over 9 repeats. The std dev for approach (not shown) is comparable. Based on Sun et al. (022bb) the error is computed using 1.0 - Mean Average Precision.
DSL features as input. Lastly, we experiment with using the same DSL features introduced by domain experts as additional features for input trajectories instead (Table 3 For both CalMS21 and Basketball, the baselines using the additional features have comparable performance using input trajectory data alone. In contrast, by using the features more explicitly as part of the DSL in our neurosymbolic encoders, to produce clusters with better separation between behavior classes based on cluster metrics (see Table 1
able
4.4 Q3: Are the programs useful for downstream tasks?
We apply our programs to frame-level behavior classification (Segalin et al. 2020 Eyjolfsdottir et al. 2016: Burgos-Artizuu et al. 2012), where the goal is to automatically quantily behavior based on expert annotations, We are motivated by the observation that manual behavior annotation time-consuming and expensive (Anderson & Perona 2014), often boing bottlenock the analysis workflow. Our unsupervised programs have the potential reduce annotation effort and help accelerate behavioral studies, through the task programming framework. Task programming (Sun et al., 2021b) uses hand-crafted programs self-supervision to improve behavior classification data efficiency; however, hand designing programs still requires human effort. Here, we show that unsupervised programs learned using our ncurosymbolic encoders performs comparably to expert-designed programs on CalMS21.
We integrate the learned programs from our neurosymbolic encoder into the task programming framework (i.c., use them as a source of self-supervision instead of the expert-crafted programs), and compare to the classification performance using expert programs (Figure 6). The classification performance computed using Mean Average Precision the behavvors-of-interest in CalMS21 (attack, investigation, mount). Using only one program found using our approach, we are able to achieve comparable performance to 10 expert-writlen programs on the behavior classification task studied in Sun et al. (2021b). Importantly, we note that we automatically learned the self-supervision tasks from a DSL, instead of hand-crafting them as in (unn et al. (2021b). This demonstrates that programs found by our approach can be applied effectively to downstream behavior analysis tasks such as lask programming.
5 Other Related Work
Interpretable latent variable models. Latent representations, especially those that are human- interpretable, can help us understand the structure of data. These models may learn disentangled fac-
tors Higgins et al. 2016 Chen et al. 2016a Ma et al. 2020) or semantically meaningful clusters (Mal ee al. 2019) using unsupervised learning approaches. These approaches are often grounded in the VAE framework Kingma & Welling 2014). Some of these approaches, such as Joint VAE (Dupont 2018 Discrete VAE (Rolfc) 2016), Moided-VVEE (Ding et al., 2020), and VQ-VAE (Oord al., 2017). learn discrcte latent representations (in particular, VAE learns a combined discrete-contimuons representation, just like our approach). However, these approaches use fully neural encoders. To our knowledge, work is the first. to
11

---

Published in Transactions on Machine Learning Research (11/2022)
propose neurosymbolic encoders, where the symbolic component produces symbolic program that produces an low-dimeensioall encoding of the input data.
Neurosymbolic programming. Neurosymbolic programming (Chaudhuri et al.
2021 1 has seen much
activity in the recent past. Existing approaches here are often trained in a supervised fashion Gulwann 2011
Wang et al. 2017 Shah et al. 2020; Cui & Zhu 2021), or within (generative) policy learning context with
an explicit reward function Chen et al. 2018 Verma al.) 2018 2019 Bastani et al. 2018 Inala al,,
2020: Feinman & Lake
2020 Trivedi et al.
2021). Prior work unsupervised program synthesis has mostly
addressed generative modeling, iee. the synthesis of programs that can generate the training data (Tian ct al. 2018 Ellis et al., 2018
Feinman & Lake 2020). This task is analogous to learning symbolic decoder rather than a symbolic encoder. Studying how to incorporate such methods into our framework can be an interesting future direction.
Representation learning for behavior analysis. Representation learning has been applicd to a variety of rewnstream lasks for behavior analysis, such as discovering behavior motifs (Berman et al. 2014; Singh et al. 2021), identifying internal states (Calhoun et al.) 2019). and improving sample-efficinnyy (Sun et al. 2021b Studies in this area have used methods such as VAE (Kingma & Welling 2014). AR-HMM (Wiltschko et al. 2015 forecasting or predicting future behaviors (Liang et al. 2020) Gao et al. 2020). and Umap (McInnes
eet al. 2018) to better understand the latent structure of behavior. Similar to a few other representation learning methods (Luxem et al., 2020: Sun et al. 2021b we also use an encoder-decoder setup on trajectory data. However, our work learns a neurosymbolic encoder whereas existing works in this area have fully neural encoders. Our work can aid behavior analysis by learning more interpretable latent representations and can be applied to downstream tasks, such as behavior classification.
6 Discussion
We present a novel approach for unsupervised learning of neurosymbolic encoders. Our approach integrates the VAE framework with program synthesis and results in a learned reprosentation with both neural and symbolic components. Experiments on trajectory data from behavior analysis demonstrate that our programmatic descriptions of the latent space result in more meaningful clusters relative to human-defined behaviors, compared to purely neural encoders. Additionally, we show the practicality of our approach by applying our learned programs to achieve comparable performance to expert-construeted tasks in self-supervised lcarning approach for behavior classification.
Problem Scope. We explore unsupervised learning of neurosymbolic encoders for the first time, and here, our neurosymbolic encoders tackle domains consisting of lower dimensional spatiotemporal data. These types of domains covers a wide range of application areas; from behavioral data (animal behavior and sports analytics in our experiments), markers. In many of these domains, there are existing domain expertise that can be leveraged to create the DSL for our neurosymbolic encoders. For example, we use the behavioral features from Segalin et al. (2020) in our work. One direct application of learning semantically meaningful programs is that it can be used to improve learning pipelines, such as task programming, as we have demonstrated.
control systems for rigid-body systems, to biomarkers or socioeconomic
Limitations. One limitation of our current approach scalability of the program search process. While our program search is parallelizable, such that learning additional programs would not incur significant additional time, the symbolic encoder update does increase the runtime over a purely neural solution. Here, we have explored our approach on settings where shorter programs are beneficial. Future work have the potential to further expand the applications of these models to larger, more complex systems. Furthermore, our approach requires programs that are differentiable with respect to its paramcters. We note that there are incrcasingly more differentiable DSLs, such as Shah el al. (2020); Cui & Zhu (2021); Valkov el al. (2018); Gaunt et al. ways to make differentiable approximations
(2016); Bunel et al. (2016), and there are Hammonly-adoptee to more established non-differentiable DSLs (for example, in (Shhh et al. (2020), the authors use a smooth differentiable approximation of the non-differentiable if-then-else statement). These common challenges in
using neurosymbolic learning in science is further discussed in Sun et al. 2022
12

---

Published in Transactions on Machine Learning Research (11/2022)
Future Directions. There many future directions to explore for neurosymbolic encoders based work. Scalability is one important area as discussed above. Another direction is to extend this work to other domains such as image and text data, in order to learn interpretable symbolic latent representations. Neurosymbolic encoders on images would require a DSL for pixel data as well as architecture changes, such as using convolutional VAEs. Furthermore, one can improve upon our greedy approach in Algorithm 2 for finding the optimal set of symbolic programs, e.g- by performing local coordinate ascent program space, similar to algorithms for large-scale neighborhood search (Ahuja et al. 2002). Lastly, while practically-oriented extensions of VAEs such as our own have yielded great practical benefit, they often lead to sub-optimal results from a pure likelihood (or ELBO) perspective. One final direction is to rigorously formulate a learning extensions of VAEs.
objective from the ground up that formally encapsulates practically-orieng
Acknowledgements. The authors are grateful to the anonymous reviewers for their helpful comments. This work was funded in part by NSF # 1918865, and a gift from Amazon.
References
Ravindra K Ahuja, Özlem Ergun, James B Orlin, and Abraham P Punnen. A survey of very large-scale neighborhood search techniques. Discrele Applied Malhemalics, 123((-3):75-1022 2002.
David J Anderson and Pietro Perona. Toward science of computational ethology. Newron, 84(1):18 31, 2014.
Osbert Bastani, Yewen Pu, and Armando Solar-Lezama. Verifiable reinforcement learning via policy extraction. In Advances in Neural Information Processing Systems, 2018.
Gordon J Berman, Daniel M Choi, William Bialek, and Joshua W Shaevitz. Mapping the stereotyped behaviour of freely moving fruit flies. Journal of The Royal Society Interface, 20194427, 2014.
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Józefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.063.4 2015.
Rudy R Bunel, Alban Desmaison, Pawan K Mudigonda, Pushmeet Kohli, and Philip Torr. Adaptive neural compilation. Aduances Neural Information Processing Systems, 29, 2016.
Christopher P. Burgess, Irina Higgins, Arka Pal, Loie Matthey Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in 3-vae. In Neural Information Processing Systems Disentanglement Workshop, 2017.
Xavier P Burgos-Artizzu, Piotr Dollár, Dayu Lin, David J Anderson, and Pictro Perona. Social behavior recognition in continuous video. In 2012 IEEE Conference Computer Vision and Pattern Recognition, pp. 1329. TEEE, 2012.
Adam J Calhoun, Jonathan W Pillow, and Mala Murthy. Unsupervised identification of the internal states that shape natural behavior. Nature neuroscience, 22(12):2040 2049, 2019.
Swarat Chaudhuri, Kevin Ellis, Oleksandr Polozov, Rishabh Singh, Armando Neurosymbolic programming. Foundations and Trends0 in Programming Languages, 7(3):188 243, 2021.
Yisong Yue, et al.
Xi Chen, Yan Duan, Roin Houthooft, John Schulman, Tlya Sutskever, and Picter Abbeel. Infogan: Inter- pretable representation learning by information maximizing generative adversarial nets. arXiv preprint arXiv: NVK:::666.0655,, 2016a.
Xi Chen, Diederik Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Tlya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXw::1611.02791, 2016b.
Xinyun Chen, Chang Liu, and Dawn Song. Towards syuthesizing complex programs from input-output examples. In International Conference Learning Representations, 2018.
13

---

Published in Transactions on Machine Learning Research (11/2022)
John Co-Reyes, YuXuan Liu, Abhishek Gupta, Benjamin Eysenbach, Picter Abbeel, and Sergey Levine. Self-consistent trajectory autoencoder: Hierarchical reinforcement learning with trajectory embeddings. In International Conference on Machine Learning, 2018.
Antonia Creswell, Yumnah Mohamied, Biswa Sengupta, and Anil A Bharath. Adversarial information factorization. arXiv preprint arXiv:7711.05173 2017.
Guofeng Cui and He Zhu. Differentiable syuthesis of program architectures. Advances in Newral Information Processing Systems, 34:11123-11135, 2021.
Zhiwei Deng, Rajitha Navarathna, Peter Carr, Stephan Mandt, Yisong Yue, Iain Matthews, and Greg Mori. Factorized variational autoencoders for modeling audience reactions to movies. In IEEE conference on computer vision and pattern recognition, 2017.
Zheng Ding, Yifan Xu, Weijian Xu, Gaurav Parmar, Yang Yang, Max Welling, and Zhuowen Tu. Guided variational autoencoder for disentanglement learning. In Proceedings of the IEEE/CV Conference on Computer Vision and Pattern Recognition, pp. 7920 7929, 2020.
Emilien Dupont. Learning disentangled joint continuous and discrete representations. In Neural Information Processing Systems, 2018
Kevin Ellis, Daniel Ritchie, Armando Solar-Lezama, and Joshua Tenenbaum. Learning to infer graphics programs from hand-drawn images. In Advances in Neural Information Processing Systems, 2018
Eyrun Eyjolfsdottir, Kristin Branson, Yisong Yue, and Pietro Perona. Learning recurrent representations for hierarchical behavior modeling. arXiv preprint 1rx 1.00094, 2016.
Reuben Feinman and Brenden M Lake. Learning task-general representations with generative neuro-symbolic modeling. In International Conference on Learning Representations, 2020.
Jiyang Gao, Chen Sun, Hang Zhao, Yi Shen, Dragomir Anguelov, Congcong Li, and Cordelia Schmid. Vectornet: Encoding hd maps and agent dynamics from vectorized representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognation, pp. 11525-11533, 2020.
Alexander L Gaunt, Marc Brockschmidt, Rishabh Singh, Nate Kushman, Pushmect Kohli, Jonathan Taylor, and Daniel Tarlow. Terpret: A probabilistic programming language for program induction. arXiv preprinl 2XXi::608.04422 2016.
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. ACM Sigplon Notices, ((1)3337-330, 2011.
Irina Higgins, Loie Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations, 2016.
Alexander I Hsu and Eric A Yutri. B-soid: An open source unsupervised algorithu for discovery of spontaneous behaviors. bioRziv, pp. 770271, 2020.
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In International Conference on Machine Learning, 2017.
Jeevana Priya Inala, Osbert Bastani, Zenna Tavares, and Armando Solar-Lezama. Synthesizing programmatic policies that inductively generalize. In International Conference on Learning Representations, 2020.
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.0114,, 2017.
Matthew J Johnson, David Duvenaud, Alexander B Wiltschko, Sandeep Datta, and Ryan Adams. Composing graphical models with neural networks for structured representations and fast inference. In Advances in Newral Information Processing Systems, 2016.
14

---

Published in Transactions on Machine Learning Research (11/2022)
Lukasz Kaiser, Samy Bengio, Aurko Roy, Ashish Vaswani, Niki Parmar, Jakob Uszkoreit, and Noam Shazeer. Fast decoding in sequence models using discrete latent variables. Tn International Conference on Machine Learning, 2018.
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, 2018.
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiu::1 121.11121000 12269880 2014.
Diederik Kingma and Max Welling. Auta-encoding variational bayes. International Conference on Learning Representations, 2014.
Diederik P Kingma, Danilo Rezende, Shakir Mohamed, and Max Welling, Semi-supervised learning with deep generative models. arXiv preprint arXie:1466.5222 2014.
Ming Liang, Bin Yang, Rui Hu, Yun Chen, Renjie Liao, Song Feng, and Raquel Urtasun. Learning lane graph representations for motion forecasting. Puropean Conference on Computer Vision, pp. 541-556. Springer, 2020.
Stuart Lloyd. Least squares quantization in pem. IEEE transactions on information theory, 28(2):129 137, 1982.
Kevin Luxem, Falko Fuhrmann, Johannes Kürsch, Stefan Remy, and Pavol Bauer. Identifying behavioral structure from deep variational embeddings of animal motion. bioRwiv, 2020.
Jianxin Ma, Chang Zhou, Hongxia Yang, Peng Cui, Xin Wang, and Wenwu Zhu. Disentangled self sule-vuperviiion sequential recommenders. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Dala Mining, pp. 483 491, 2020.
Qianli Ma, Jiawei Zheng, Sen Li, and Gary W Cottrell. Learning representations for time series clustering. Advances in neural information processing systems, 32:3781-3791, 2019.
Leland Mclnnes, John Healy, and James Melville. Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.0$44 03426, 2018.
Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In International Conference on Machine Learning, 2014.
Aaron van den Oord, Oriol Vinyals, and Koray Kavukeuoglu. Neural discrete representation learning. In Advances in Neural Information Processing Systems, 2017.
William M Rand. Objective criteria for the evaluation of clustering methods. Journal of the Americon Statistical association, 06(336):846-856 1971.
Jason Tyler Rolfe Discrete variational antocncoders. Xr preprint arXie: 10X::00009.02000, 2016
Hinrich Schützo, Christopher D Manning, and Prabhakar Raghavan. Introduction to information retricval, volume 39. Cambridge University Press Cambridge, 2008
Cristina Segalin, Jalani Williams, Tomomi Karigo, May Hui, Moriel Zelikowsky, Jemnifer J Sun, Pietro Perona, David J Anderson, and Ann Kennedy. The mouse action recognition system (mars): software pipeline for automated analysis of social behaviors in mice. bioRziv, 2020.
Ameesh Shah, Eric Zhan, Jennifer J Sun, Abhinav Verma, Yisong Yue, and Swarat Chaudhuri. Learning differentiable programs with admissible neural heuristics. In Newral Information Processing Systems, 2020.
Satpreet H Singh, Steven M Peterson, Rajesh PN Rao, and Bingni W Brunton. Mining naturalistic human behaviors in long-term video and neural recordings. Journal of Newroscience Methods, 2021.
15

---

Published in Transactions on Machine Learning Research (11/2022)
Jennifer J Sun, Tomomi Karigo, Dipam Chakraborty, Sharada P Mohanty, David Anderson, Pietro Perona, Yisong Yue, and Ann Kennedy. The multi-agent. behavior dataset: Mouse dyadic social interactions. ar preprint arXic:2104.00710 2021a.
Jennifer J Sun, Ann Kennedy, Eric Zhan, David J Anderson, Yisong Yue, and Pietro Perona. Task programming: Learning data efficient behavior representations. In Conference Computer Vision and Pollern Recognilion, 2021b.
Jennifer J Sun, Megan Tjandrasuwita,, Atharva Schgal, Armando Solar-Lezama, Swarat Chaudhuri, Yisong Yue, and Omar Costilla-Reyes. Neurosymbolic programming for science. arxiv preprinl or Xiu:2210.0500 2022.
Yonglong Tian, Andrew Luo, Xingyuan Sun, Kevin Ellis, William Freeman, Joshua B Tenenbaum, and Jiajun Wu. Learning infer and execute 3d shape programs. In International Conference on Learning Representations, 2018.
Dweep Trivedi, Jesse Zhang, Shao-Hua Sun, and Joseph Lim. Learning to synthesize programs as interpretable and generalizable policies. Advances in neural information processing systems, 34:25146- 25163, 2021.
Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. In Advances in Neural Information Processing Systems, 2020.
Lazar Valkov, Dipak Chaudhari, Akash Srivastava, Charles Sutton, and Swarat Chaudhuri. Houdini: Lifelong learning as program synthesis. In Advances in neural information processing systems, 2018.
Abhinav Verma, Vijayaraghavan Murali, Rishabh Singh, Pushmeet Kohli, and Swarat Chaudhuri. Pro- grammatically interpretable reinforcement learning. In International Conference on Machine Learning, 2018.
Abhinav Verma, Hoang M Le, Yisong Yue, and Swarat Chaudhuri. Imitation pentattoo-projected programmatic reinforcement learning. In Advances Neural Information Processing Systems, 2019.
Xinyu Wang, Isil Dillig, and Rishabh Singh. Program synthesis using abstraction refinement. Proceedings of the ACM on Programming Languages, 2017.
Alexander B Wiltschko, Matthew Johnson, Giuliano Turilli, Ralph E. Peterson, Jesse M Katon, Stan L. Pashkovski, Victoria E Abraira, Ryan P Adams, and Sandeep Robert Datta. Mapping sub-sccond structure in mouse behavior. Newron, 88(6):1121-131 1135, 2015.
Li Yingzhen and Stephan Mandt. Disentangled sequential autoencoder. In International Conference on Machine Learning, 2018.
Eric Zhan, Albert Tseng, Yisong Yue, Adith Swaminathan, and Matthew Hausknecht. Learning calibratable policies using programmatic style-consistency. In International Conference on Machine Learning, 2020.
Hui Zhang, Tu Bao Ho, Yang Zhang, and M-S Lin. Unsupervised feature extraction for time series clustering using orthogonal wavelet transform. Informatica, 30(3), 2006.
Yu Zhang, Peter Tiño, Ales Leonardis, and Ke Tang. A survey on neural network interpretability. arXiv preprint 2r1:::2012.4420 14261, 2020.
Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. In International Conference on Machine Learning, 2017.
16

---

Published in Transactions on Machine Learning Research (11/2022)
A
Additional Results
Table !
contains the standard deviations of the results in Table of of the main paper.
Table 5 contains the median ELBO our baselines and our neurosymbolic encoders. We find that our symbolic encoders are comparable with our baselines. This is expected: since we are imposing additional constraints the encoder (a program with a bounded depth), we would not expect the variational approximation be better than encoder without these constraints (fully-neural encoder). In general, obtaining better more come at the cost of smaller ELBO, For example, find
semantically- meaningful cluster assignments that introducing clustering loss to the TVAE can result in better metrics, but in lower ELBO as well.
CalMS21
Basketball
Model
Purity
NMI
RI
Purity
NMI
RI
TVAE
.002
.011
.001
.049
.012
.008
TVAE+KMeans loss
.001
.002
.001
.006
.001
.001
Joint VAE
.000
.003
.022
.037
.020
.004
VQ-TVAE
.005
.004
.016
.042
.022
.014
Beta- TVAE
.001
.001
.001
.124
.140
.088
Ours (1 program)
.026
.056
.035
.039
.014
.001
Ours (2 programs)
.017
.051
.019
.053
.020
.018
Ours (3 programs)
.088
.075
.030
.007
.002
.002
Table 4: Standard deviation of purity, NMI, and RI on CalMS21 and Basketball compared human-annotated
labels (3 runs). Random assignment metrics have standard deviation close 0.
Model
CalMS21
Basketball
TVAE
1120
895
TVea+K loss
1079
893
Joint
1090
902
VQ-TVAE Beta-TVAE
971
911
1110
898
Ours (1 program
1075
894
Ours (2 programs)
1073
893
Ours (3 programs)
1079
899
Table 5: Median ELBO of CalMS21 and Basketball across 3 runs.
B Implementation Details
The hyperparameters for approach in Tables and the hyperparameters for baselines are in Table 8 We used the Adam Kingma & Ba (2014) optimizer for all training runs. Specifically, Contains pyperparameters for program learning. Our use of the hyperparannetess during the program learning process are the same as those from NEAR Shah et al. (020).. Table 7 contains the hyperparameters for training the VAE component of our model, including the hyperparameters we used for capacity.
epochs
epochs
frontier size
penalty
max depth
Ir
batch size
Synthetic CalMS21
10
10
30
0.01
2
0.0002
32
6
10
8
0.01
5
0.001
256
Basketball
8
8
30
0.01
3
0.002
128
Table 6: Hyperparameters for program learning. epochs and epochs represent the number of neural and symbolic epochs respectively, where the neural epoch is for the neural heuristic. Ir is the learning rate.
17

---

Published in Transactions on Machine Learning Research (11/2022)
epochs
2 dim
dim
RNN dim
adv. dim
disc. cap.
cont. cap.
Synthetic
50
4
16
16
8
0.6
0.0002
CalMS21
30
8
256
256
8
0.69
10
0.0001
Basketball
20
8
128
128
8
0.6
4
0.02
Table 7: Hyperparameters for VAE training.
The batch size is the same as the ones for program learning in
Table
JAE
VQ-TVAE
RVta-TVAE
weight
disc. cap
cont. cap
# embed- dings.
weight
cap
cap iter
CalMS21
100
0.69
10
4
100
20
10k
Basketball
10
0.6
4
2
10
20k
Table 8: Hyperparameters for baseline models. On CalMS21, the z dim for all baselines are 32 and trained for 200 epochs.
B.1
Baseline Details
variation of the VAE where the inputs trajectory data, called TVAE Co-Reyes et al. 20188; ; Zhan et al. (2020); Sun et al. (2021b). Here, the neural encoder qs and decoder pa are instantiated with recurrent neural networks (RNN), where z (-(1x).. In this domain, x is trajectory of length T:
E. We
x = (.1...., JT). The TVAE objective is:
T
Ciaae
Egg
logllona 2)) + Dx Dxo((o(24)x)]ppp
1=1
All other baselines are variations of the TVAE, based on variations of VAE studied in recent works.
TVAE + KMeans loss. A few works Ma et al. 2019); Luxem et al. (020)) have studied adding loss to the VAE framework to encourage clustering in the latent space, called the K-means loss. Given a data matrix z E pdxN the K-means objective is:
Ck-means Tr z) Tr z''zA,,,A, zA),
(10)
where A E NNk is called the cluster indicator matrix. We optimize this loss using the implementation in Luxem et al. (2020), where A is updated by computing the k-first singular values of vz'z. The K-means loss is trained jointly with the TVAE loss (Eq as one of our baselines.
Joint VAE. Joint VAE Dupont (0018) is a variation of VAE that jointly optimizes discrete (c) and continuous (z) latent variables. The JointVAE objective encourages the KL divergence terms match capacities C, and
Ca that gradually increases during training. The objective is:
Ciointwae = By [x c)] - D (2) (l)(()))) -2ll~ - (o)) Cal. (11)
where y is a constant. Since the capacities of the discrete and continuous variables are controlled separately, the model is forced to encode information using both channels. Here, we use the trajectory formulation of Joint VAE, where:
T log (x Σ 1og c).
(12)
VQ-TVAE. VQ-VAE Oord et al. 2017 combines vector quantization with VAEs. These models produce discrete latent encodings that are used to index an embedding table (or codebook). z, the continuous output of the encoder, is mapped to a discrete encoding based on its nearest neighbor in the codebook, then the indexed encoding Zg is used as input to the decoder. During training, the model learns the codebook, as well as the assignments. The objective is:
CVqvee log sl/gz. - ell2 Bllz. sgiell..
(13)
where embeddings from the codebook, and sg represents the stopgradient operator.
18

---

Published in Transactions on Machine Learning Research (11/2022)
Beta-TVAB. Beta-VAEs Higgins et al. (2016): Burgess al. (2017) have been shown to learn disentangled representations from the image domain. As originally proposed, an adjustable hyperparameter / is used to
weigh the KL term in the VAE objective. We use the version of beta-vae training objective with gradually increasing capacity C' proposed in Burgess et al. 2017). This object is: Chotavae
Egg [log po (x 2) - 7 D (2x(xx)))))) - Cl,
(14)
where 7 constant. Here, we apply the beta-VAB objective to trajectory data using the factorization
shown in Eq 8
B.2 Metrics Definition
We evaluate our programs quantitatively using standard cluster metrics relative to human-defined labels. The metrics
are Purity (Schütze et al. 2008), Normalized Mutual Information (NMT) (Zhang et al.
2006), and Rand Index (RI) (Rand] 1971 These metrics have also been used by other works for evaluating
clustering Ma et al. 2019 Luxem et al.
2020 The definition of purity is:
Purity
Σ max lu eel
(15)
VEV
weD
where U is the set of human-defined labels, V is the set of cluster assignments from the algorithm, and is the total number of trajectories.
The NMT is defined as:
NMI Eney Evev Ie Junell log
12 relunoo Tallel
(16)
Eueu |u] log lul Ever |1| log Jul
RT is defined
RI TP+ TN
(17)
n(n 1)/2
where TP are the number of trajectory pairs correctly placed into the same cluster, TN are the number of trajectory pairs correctly placed into different clusters, and is the total number of trajectories. For all metrics, value closer to 1 indicates clusters that more closely match the human-defined labels.
C Dataset and DSL Details
Synthetic. We generate trajectories with the following steps:
Sample initial position x1 ~ ([10,, 10), [1, 1]).
2. Sample velocity from == [Ue, my] ~ N(O,, 0), [1, 1]) such that 0.05 < ||1||| < 0.4.
3. Sample force in x-direction e, Bernoulli and update vy U, + 0.4 (2c, 1).
Sample force in y-direction ey ~ Bernoulli(O.5) and update of 02 + 0.4 (2c, - 1).
5. Generate trajectory with d++1 = + + + 0.2 c,, where ~ NOO, 1).
o' fixed for an entire trajectory. (cz, cy) defines a label for each trajectory (one of 4). The ground-truth decoder is linear with respect to U, Cay Cy. The DSL for the synthetic dataset includes library functions that threshold the final x and y positions, used to demonstrate that the ground-truth can be learned and the information can be extracted from the neural latent space (Figure 4h. Experiments were run locally with an Intel 3.6-GHz 17-7700 CPU with 4 cores and an NVIDIA GTX 1080 Ti GPU with 3584 CUDA cores.
CaIMS21. The CalMS21 dataset [un et al. 2021aa consists of trajectory data from a mouse tracker Segalin ct al. (2020), where each mouse is tracked by seven body keypoints from an overhead camera. The two mice are engaging in social interaction, where an intruder mouse introduced the cage of the resident mouse. The dataset contains unlabelled split which we use for training and validation, and the test split of
19

---

Published in Transactions on Machine Learning Research (11/2022)
Task in CalMS21 for testing. Each frame of the test split is annotated by domain expert with one of four labels: attack, mount, investigation, other. We use these annotated behavior labels for comparison with clusters produced by our algorithm. This dataset is available under the CC-BY-NC-SA license.
The feature selects in the CalMS21 DSL are based on behavior attributes computed on trajectory data from domain experts this area Segalin et al. (2020). In particular, we asked three domain experts independently select features from Segalin et al. (2020) to be part of the DSL. The time it takes domain experts to do this step is on the timescale of minutes. A full list of all features use in the DSLs are as follows:
Features in DSL head body angle (resident and intruder), social angle (resident and intruder), speed (resident and intruder), distance between nose of resident and tail of intruder, distance between nose of resident and nose of intruder.
Features in DST. 2: distance between head mice, distance between body of mice, distance between head of resident to body of intruder, resident acceleration, resident nose speed, resident axis ratio of fitted ellipse, intersection over union of mice bounding boxes, resident social angle, distance between nose of resident and tail of intruder, distance between nose of resident and nose of intruder.
Features DSL 3: head body angle (resident and intruder), area of ellipse fitted to body keypoints (resident and intruder), acceleration (resident and intruder), distance between nose of resident and tail of intruder, distance between nose of resident and nose of intruder.
Note that unless otherwise stated, the CalMS21 experiments uses the features from DSL 1.
The experiments are ran on Amazon EC2 with an Intel 2.3 GHz Xeon CPU with 4 cores equipped with a NVIDIA Tesla M60 GPUs with 2048 CUDA cores.
Basketball. The basketball dataset was also used in Shah et al. 22020 Zhan al. (0020) and tracks the my-positions of players from real NBA games. The positions centered on the left half-court. Both (5) offensive and (5) defensive players are tracked, as well as the ball (excluded in our experiments).
The DSL for basketball contains library functions that compute the speed, acceleration, final positions, and distance-to-basket of players and take the maximum, minimum, or average over the players. We did not consult a domain expert for this DSL, but these functions were used as labeling functions in Zhan et al.] 2222)). Basketball experiments were run locally with an Intel 3.6 GHG i7-7700 CPU with 4 cores and an AVIDIA GTX 1080 Ti GPU with 3584 CUDA cores.
20


Reviews:
[{"review_id": "imyp4hb1YI", "reviewer": "Reviewer_rHaE", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths\n- The work provides an interesting extension/application of the prior work Shah et al 2020 by applying it to the variational autoencoder setting.\n- The paper is honest about limitations in the experimental results.\n- The usefulness of the method is shown through multiple evaluation methods.\n\nWeaknesses\n- There is no longer a graph search, unlike Shah et al. 2020, and instead the program appears to be learned in a more greedy manner. \n- DSL requires full differentiability of all operations, so it may be hard to extend.\n- The stated algorithm requires many rounds of training to produce the symbolic encoder, and thus may be less practical for larger or more complicated datasets.\n- The generated programs may not necessarily be particularly interpretable, as there is no constraint/cost to encourage interpretability.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The paper proposes a method to learn a neurosymbolic encoder within a variational autoencoder framework. The authors instantiate the symbolic portion of the encoders as (potentially incomplete) programs in a functional domain-specific language, following the approach in Shah et al 2020. These programs can have unexpanded nonterminals; the computations for these holes are done using neural networks instead. The proposed algorithm trains the encoder using a coordinate descent procedure where the depth of the program is extended in each step (thus reducing the role of the unexpanded nonterminals). The paper demonstrates the value of the method with experiments on trajectory datasets, showing that it creates more meaningful clusters compared to baselines, works with different DSLs, and is useful for the downstream application of Task Programming.", "claims_and_evidence_yn": "", "claims_explanation": "", "audience_yn": "", "audience_explanation": "", "requested_changes": "Critical changes:\n- Explain further about the impacts of adversarial information factorization and channel capacticy constraint, for example by providing an ablation study where they are not used.\n- The work is largely about creating symbolic encoders, but there is also an unstructured neural encoder used alongside it.\n  - What happens if you don't have these latent variables from the neural encoder?\n  - In the channel capacity constraint, how are $\\gamma_\\phi$, $C_\\phi$, $\\gamma_{(\\alpha, \\phi)}$, and $C_{(\\alpha, \\phi)}$ set?\n\nNot critical:\n- In Section 3.1, there is a reference to $\\alpha_0$ of Section 2.2, but Section 2.2 doesn't explicitly mention $\\alpha_0$.\n- In the caption of Figure 2, \"different approximation\" should be \"differentiable approximation\"\n- Various citations should use `\\citep` but do not, for example directly below equation 6. Others use `\\citep` instead of `\\citet`, for example at the end of the second-to-last paragraph of page 6.\n- It is not completely clear how equations 4 and 5 are used to augment equation 2. It would be better to show the complete augmented equation separately.\n\n", "broader_impact_concerns": "I have no particular concerns about broader impact. There may be objectionable applications made possible by this work, but its focus is not on any such applications, as is with most other machine learning papers.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "BSSCwljrj0", "reviewer": "Reviewer_BbGj", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths:\n- Results on the synthetic data is very convincing and demonstrates well how the model works.\n- Authors show results on real world datasets and demonstrate that their model outperforms (CaLMS21) or performs as well as baselines (Basketball).\n- When learning to solve down-steam tasks, authors also show that their learned programs give a similar boost to performance as 10 hand-crafted ones.\n\nWeaknesses:\n- There is significant dependancy on domain expertise to define the DSL's and appears to only work for low dimensional data with well defined features.\n- The methods section of the paper is very unclear and assumes a deep understanding of Shah et al. \n- It is hard to interpret the results on down stream tasks because (a) it is not clear which dataset is used and (b) classification performance is not reported only error.\n- Part of the motivation for this work is that the symbolic programs are more interpretable, however, the authors note that \"The domain expert found the three program case to be more difficult to interpret\".\n\n\nGeneral comments and questions:\n\n1. What do the authors mean by “our approach offers significantly better separation”?\n2. The following statement is vague, “these representations can potentially be more factorized or well-separated”\n3. What is the relation to inverse graphics? e.g. [1], [2].\n4. Section 2.2 assumes comprehensive knowledge of Shah et al. and this section is hard to understand without first reasoning Shah et al. first.\n5. Why is phi not fixed when optimising Eqn 3? Is this because a’ may require different parameters?\n6. Thought Figure 4 does convey the essence of the learned programs, its not clear what the individual functions are or what form they take.\n7. In “Synthetic dataset experiments” should the reference be to Figures c-e rather than b-d?\n8. Figure 3 is very interesting. It’s very nice to see that the neural part of the representation really does only learn what the symbolic part has not learned. This is very impressive. \n9. How much do the results in Figure 3 depend on the regularisation described in Section 3.3?\n10. It is not clear how the regularisers in Section 3.3 are incorporated? Are the extra terms simply added? Is there a co-efficient. It would be nice to see this in the appendix and a brief discussion in the main text.\n11. In Figure 3(b) can you please explain the threshold values? Why are these values not closer to zero? Would that not be the optimal solution?\n12. In “Synthetic dataset experiments” please make clear that TVAE refers to the neural component of the representation.\n13. DSL 1 and DSL 2 are not introduced in the main text before being referenced in Figure 4. It would be helpful to point to the appendix (possibly when introducing Q2 in Section 4).\n14. To aid interpretation of results on the CalMS21 dataset (Figure 4) it would be helpful to list the four behaviours of the mice. Without referring to the Appendix it is very hard to interpret the results in Figure 4. The interpretation of the program in 4(a) also only makes sense in the context of understanding what the four behaviours are.\n15. For all Tables please highlight the best result in bold.\n16.  To be clear in \"Qualitative interpretation of our clusters” are experts analysing the neural clusters? Please make this clear. It could be helpful to show these clusters (possibly in the appendix) along with some figures showing the examples of trajectories which domain experts consider typical for the cluster.\n17. “In the single program case, the domain expert classified the discovered clusters as when the mice are interacting and when there are no interaction” This sentence is hard to parse. I would suggest something of the form. “In the single program case our model discovers two clusters. These clusters were classified by domain experts as referring to …”\n18. Why is is that case that 1 program results in two clusters while 2 programs result in 4?\n19. It is not clear to me how you obtain z_{a, \\phi} from q(a, \\phi). Is it just the output of the program (a, \\phi)? What are its dimensions?\n20. In Section 4.4 what is meant by frame level behaviour?\n21. Down steam tasks: It’s very encouraging that a few learned programs performs as well as 10 hand-crafted programs. \n22. Is Figure 5 reporting test error? Why not show classification performance?\n23. Which dataset is used to obtain results in Figure 5? Why are there not results for both CaLMS21 and Basketball?\n24. It's interesting in Table 1 that scores tend to be better for a single program than for three programs. Could the authors please comment further on why this may be the case?", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The authors propose representing data using a representation that has both a neural and a symbolic component. To obtain the symbolic component they closely follow the implementations of Shah et al. . The authors demonstrate their model initially on a toy dataset. They show how the neural part of the model learns factors of variation that the symbolic part of the model has not learned.\n\nImpressively, they show results on two real world datasets: Mouse trajectories and basketball. They show good clustering performance and use domain experts to classify the clusters.\n\nFinally, they demonstrate their programs being used in down steam tasks. Showing similar performance to expert crafted programs.", "claims_and_evidence_yn": "", "claims_explanation": "", "audience_yn": "", "audience_explanation": "", "requested_changes": "1. Please improve the clarity of the methods section\n - What are the dimensions of z_{a, \\phi}?\n - How is z_{a, \\phi} obtained from q(a, \\phi)\n - Reduce dependancy on Shah et al.\n - How are the losses from Section 3.3 combined?\n - Provide an improved description of the CaLM21 task.\n\n2. Improve clarity of the \"Qualitative interpretation of our clusters” section.\n\n3. Report accuracy on both the down-steam CaLM21 and Basketball tasks.", "broader_impact_concerns": "n/a", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "MVslAw4j0c", "reviewer": "Reviewer_Hvn1", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths\n\n1. To my knowledge, this is the first work proposing to learn neurosymbolic encoders in the unsupervised setting. This is a promising direction for learning interpretable representations.\n\n2. The authors demonstrate good results on several behavior analysis benchmarks. In particular, the learned programs perform comparably to expert-annotated programs for task programming.\n\nWeaknesses\n\nMy main concern of this work is about the efficiency, scalability and applicability of the proposed approach.\n\n1. How does the training time of neurosymbolic encoders compare to standard neural encoders? I feel that the update of the symbolic encoder imposes a large overhead.\n\n2. For classification tasks, does increasing the number of programs reduce the error? For example, in Figure 5, will 10 learned programs outperform expert-crafted programs?\n\n3. While the neurosymbolic encoder outperforms standard encoders on CalMS21, there is no much gain on Basketball benchmarks. Although the framework has potential to extend to different domains, currently it is unclear in which scenarios the approach would help. For more complicated learning problems, I think more programs and more complicated DSLs are needed, and it will require more scalable training algorithms.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "This paper proposes neurosymbolic encoders, where the encoder contains both a pure neural component and a symbolic component. The symbolic encoder learns latent representation as symbolic programs defined in domain-specific languages. To train the neurosymbolic encoder, they initiate the encoder with a pure neural one; then in each iteration, they greedily select a grammar rule in their DSL to replace a nonterminal, so that it remains similar to the current latent representation. They integrate the neurosymbolic encoder into the VAE framework for unsupervised learning. They evaluate their approach on a synthetic benchmark, CalMS21 benchmark containing trajectories of mice behavior, and a basketball benchmark containing trajectories of basketball players. They demonstrate that their neurosymbolic encoder achieves better clustering performance, and the learned programs have comparable performance to expert-crafted programs on behavior classification, when they are integrated into the task programming framework.", "claims_and_evidence_yn": "", "claims_explanation": "", "audience_yn": "", "audience_explanation": "", "requested_changes": "1. Please provide a comparison of training time between neurosymbolic encoders and baselines.\n\n2. Please provide more discussion on the effect of different number of programs for downstream tasks. For example, in Figure 5, will 10 learned programs outperform expert-crafted programs?\n\n3. Please provide more discussion on the scalability and applicability of the approach; i.e., in which scenarios and problem scopes that the approach will be beneficial.", "broader_impact_concerns": "No ethical concerns.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: This paper presents an approach for learning neural symbolic encoders that can encode data into programmatic latent representations within domain specific languages.  The proposed approach learns these encoders in an unsupervised way, through a VAE framework.  The work is an extension of Shah et al., 2020 with a few innovations, most notably the VAE framework and the corresponding learning algorithms.

All reviewers are leaning accept after the discussion, hence I’m also recommending an accept.

There are however a few common concerns raised by the reviewers that the authors can consider addressing further, in particular the programs being generated are small and toy-ish in this paper, which may have its place in some applications but scaling up to larger more complex programs with more complicated control flow seems to be a big challenge.  Also, the approach requires the program semantics to be fully differentiable with respect to the parameters, which also seems to be strong limitation.

The paper presents some discussions in Section 6, but could benefit from discussing some of the limitations a bit more, a journal paper is a good place to do this as you have more pages to work with.
Decision: Accept (poster)