betaFeedback

WorksComputer Science

Localizing predictive concepts encoded in neural representations via hierarchical testing

Abstract

Understanding which regulatory sequence motifs a genomic deep learning model has learned, with statistical error guarantees, is essential for trusting its use in downstream tasks such as variant effect prediction. Existing approaches to identifying which units in a trained network encode human- understandable concepts fall into two groups. Exploratory methods rank and visualize units but offer no statistical guarantee that the selected units are associated with the prediction target across the population of inputs. Testing-based methods test only single units or one pre-defined set of them, and do not control the error across the many sets of units. We introduce CUTTIE (Cluster-tree Unit Top-down Testing of Independence with Error control), which clusters the units of each layer into a tree and tests the clusters top-down with conditional independence tests, localizing information about the target while controlling the family-wise error rate. Thereby, we identify clusters that carry information about the target beyond the rest of the layer. For the units in the identified clusters, conditional attribution maps then reveal what motifs they encode. In a controlled simulation, the procedure identifies the clusters whose concepts affect the target. We apply the procedure to a convolutional model predicting cell-type-specific chromatin accessibility from DNA sequence, where the concepts encoded in the identified clusters map onto known regulatory motifs.

Introduction

Concept-based explanations go beyond input attribution by relating a model’s internal representations to human-understandable concepts, either user-defined or discovered automatically, and by quantifying how much these concepts influence the model’s predictions. Deep neural networks that predict molecular readouts such as chromatin accessibility from DNA sequence are widely used to estimate variant effects, i.e., how a mutation changes the predicted activity. Trusting these estimates requires checking that the change is driven by the correct regulatory concepts, such as transcription factor binding motifs (short DNA patterns recognized by regulatory proteins), which in turn requires knowing how and where in the network such concepts are encoded. In computer vision, attribution maps of individual units can often be interpreted directly by visual inspection. In genomic models that predict DNA activity from sequence, however, attribution maps cannot be interpreted with biological concepts by visual inspection alone and require downstream analyses such as motif discovery. This makes it essential to narrow down which units are worth analyzing.

Most existing approaches to identifying these units are exploratory. Methods such as TCAV [1], ACE [2], and CRAFT [3] surface attribution maps or concept-activation scores that a human judges plausible, with no statement of statistical confidence. However, a unit can appear highly relevant to a prediction by chance alone. Establishing that it is genuinely connected to the prediction target therefore requires population-level evidence with explicit error control. A smaller line of work adds formal hypothesis testing, but each instance addresses only part of the problem. Bykov et al. [ [4] test whether a unit’s activations differ between concept-positive and concept-negative samples, but treat units independently and apply no multiple-testing correction (p-values are evaluated at a nominal 0.05). Teneggi and Sulam [ [5] test conditional independence between model predictions and a concept and do correct for multiple testing, but only across a small set of pre-specified concepts. Neither addresses which units or clusters of units in a layer carry predictive information, while controlling the error across the many candidates. Such error control across nested clusters of correlated variables is provided by hierarchical testing procedures [6, 7], but they were formulated for tests in linear models and have not been applied to network units, which are strongly correlated, come without a given hierarchy, and lack established hypotheses and test statistics. Since their error control only requires a hierarchy fixed in advance and a valid p-value for each cluster [8], these tests can be replaced, as Paillard et al. [ [9] do with conditional permutation importance for the inputs of a prediction model. We instead test units inside a network and allow any conditional independence test (CIT), a general class that includes such importance-based tests. We use the generalized covariance measure [10], which only requires flexible regressions rather than conditional sampling. Such tests have been successfully applied to fixed network representations [11 b], whose features are strongly correlated and depend nonlinearly on each other, but only to test a representation as a whole. Other hierarchical approaches for network inputs cluster them by their contribution to the network’s prediction, but without error control [e.g. 13].

We propose CUTTIE (Cluster-tree Unit Top-down Testing of Independence with Error control) – a hierarchical testing procedure for localizing information about the prediction target within the layers of a trained network while controlling the family-wise error rate (FWER). Per layer, we cluster units into a tree based on their scores, such as activations or relevance scores. Traversing the tree top-down, we apply conditional independence tests (CITs) to the target and the scores of the units in each cluster given the scores of the remaining units, and thereby identify which clusters carry information about the target beyond the rest of the layer. The procedure applies to activations, which identify units that encode predictive information, and to relevance scores from Concept Relevance Propagation (CRP) [Achitab et al., 2023], which identify units the model relies on for its predictions. Conditional attribution maps of the selected units then show which concepts they encode. To our knowledge, this is the first framework to combine formal, hierarchical error-rate control with concept-level attribution in neural networks.

We demonstrate CUTTIE in a challenging genomics setting, where concepts cannot be interpreted directly from visualizations, some motifs are universally active across cell types and can be spuriously associated with cell-type-specific outcomes, experimental noise is high, and only a limited number of units and their encoded motifs can be validated against a motif database. We apply CUTTIE to a sequence-to-activity (S2A) model trained to predict DNA activity from sequence across cell types of the zebrafish embryo. CUTTIE identifies non-redundant units that are predictive of DNA activity in individual cell types. Downstream analysis shows that these units correspond to known regulatory motifs, and that the model relies on them to distinguish between cell types: the motifs recovered from their attribution maps agree with the cell types in which they are reported to be active in the literature.

Our contributions are: (1) a hierarchical testing procedure that localizes predictive information in neural network layers with FWER control, for activation and CRP scores, together with a characterization of the hypotheses tested at each node for a fixed, trained network; (2) conditional independence tests suited to vector-valued responses and the strong correlations among units; and (3) a simulation with known ground truth and an application to a DNA sequence-to-activity model.

Method

We consider a neural network fθf_\theta fitted to predict YY from XX, where Y∈RKY \in\mathbb{R}^{K} is a vector of KK responses and X∈XX \in\mathcal{X}. In our application, X∈{0,1}4×pX \in\{0,1\}^{4 \times p} is a one-hot encoded DNA sequence of length pp, and YY contains its responses in KK cell types, which we refer to as classes. We formulate the method for this setting, i.e. for information about differences between the class responses. Since the procedure only requires a fixed network, unit scores and a valid test at each node, it applies to any input space X\mathcal{X} and, without centering (Subsection 2.2), to responses that are not compared across classes, including K=1K = 1. Fixing the fitted parameters θ^\hat{\theta}, we aim to find units and clusters of units of a layer whose scores carry information about these differences beyond the remaining units, with FWER control for a distribution PXYP_{XY} of (X,Y)(X,Y). To this end, we compute scores for each unit (Subsection 2.1), state the hypothesis for a cluster of units (Subsection 2.2), and organize the units of the layer in a tree of nested clusters, fixed before any p-value is computed (Subsection 2.4). A hierarchical procedure tests the nodes top-down, descending to a cluster’s children only if its hypothesis is rejected (Subsection 2.3), which controls the FWER at level α\alpha if each node test gives a valid p-value (Subsection 2.5). Subsections 2.6–2.8 localize the classes, interpret rejections and visualize the patterns detected by the units in rejected clusters.

The procedure is illustrated in Figure 1.

Figure 1. Overview of CUTTIE. The proposed procedure (top) and its reading in the application (bottom). (1) The network fθ^f_{\hat{\theta}} is fitted on a training sample and then fixed. (2) Each unit jj of layer ll receives as scores its activation Aj(X)A_j(X) (H=1H = 1) or its CRP relevance Rj(X,h)R_j(X,h) for each class hh (H=KH = K), collected in S~(X)\widetilde{S}(X). (3) On a clustering sample, complete linkage builds a tree TU\mathcal{T}_U over the units, in which units with strongly correlated scores form one cluster CC, and a tree TG\mathcal{T}_G whose nodes GG are clusters of classes. (4) On an inference sample, TU\mathcal{T}_U is tested top-down for each internal node GG of TG\mathcal{T}_G (orange: rejected), with FWER control at level α\alpha (Figure 2). The hypothesis H0,C,GH_{0,C,G}, shown for activations, states that the units in CC carry no information about differences between the classes in GG beyond the rest of the layer (Subsection 2.6). For CRP scores, with responses and scores centered within GG, it reads Y~c(G)⊥ ⁣ ⁣ ⁣⊥S~cC(G)∣S~cC‾(G)\widetilde{Y}^{(G)}_c \perp\!\!\!\perp\widetilde{S}^{(G)}_{c_C} \mid\widetilde{S}^{(G)}_{c_{\overline{C}}} for all c∈Gc \in G, where the index cc selects the response and the scores for class cc. For a rejected pair (C,G)(C,G), conditional attribution maps show which input patterns, here motifs, the units in CC detect.

Unit scores

For a fixed layer ll of width MlM_l, each unit j∈{1,…,Ml}j \in\{1,\ldots,M_l\} receives HH scalar scores Shj(X)S_{hj}(X), h∈{1,…,H}h \in\{1,\ldots,H\}, per input, where each ShjS_{hj} is a fixed function of the fitted network fθ^f_{\hat{\theta}}. The number HH depends only on the type of score: H=1H = 1 for class-independent scores such as activations, and H=KH = K for class-specific scores such as CRP scores, where hh indexes the class that is scored. We consider two scores:

Shj(X)={Aj(X),H=1(activation over sequence),Rj(X,h),H=K(CRP relevance class h).S_{hj}(X) = \begin{cases} A_j(X), & H = 1 \quad\text{(activation over sequence)},\\ R_j(X,h), & H = K \quad\text{(CRP relevance class }h\text{)}. \end{cases}

For activations, let Ajt(X)A_{jt}(X) denote the activation of unit jj at sequence position tt, and let Aj(X)=max⁡tAjt(X)A_j(X) = \max_t A_{jt}(X) be its strongest response to any window of the input. This score is defined independently of the pooling used in the network. Activations do not depend on the class, so each unit has a single score, and H=1H = 1. For CRP scores, we initialize the relevance at the output fθ^(X)hf_{\hat{\theta}}(X)_h, redistribute it to the units of layer ll, and sum the resulting relevance map of unit jj over the sequence to obtain Rj(X,h)R_j(X,h). Each input is attributed separately for every class h∈{1,…,K}h \in\{1,\ldots,K\}, so each unit has one score per class. Activations characterize what a unit detects in the input, whereas CRP scores additionally reflect how the downstream network uses the unit for each class.

For H=KH = K, we center the scores of each unit across classes, S~hj(X)=Shj(X)−K−1∑h′=1KSh′j(X)\widetilde{S}_{hj}(X) = S_{hj}(X) - K^{-1}\sum_{h'=1}^{K} S_{h'j}(X), which removes the component shared by all classes, as it carries no information about differences between them. For H=1H = 1, we do not center, omit the row index, and write S~j(X)=S1j(X)\widetilde{S}_j(X) = S_{1j}(X); when the scores are constant across classes, we also write S~j(X)=S~j(X)\widetilde{S}_j(X) = \widetilde{S}_{j}(X) for all classes cc. We collect the centered scores of layer ll in the matrix S~=(S~hj(X))h,j∈RH×Ml\widetilde{S} = (\widetilde{S}_{hj}(X))_{h,j} \in\mathbb{R}^{H \times M_l} and omit the argument XX when it is clear from the context. For a cluster of units C⊆{1,…,Ml}C \subseteq\{1,\ldots,M_l\} with complement C‾={1,…,Ml}∖C\overline{C} = \{1,\ldots,M_l\} \setminus C, we write S~C\widetilde{S}_C and S~C‾\widetilde{S}_{\overline{C}} for the columns of S~\widetilde{S} belonging to the units in CC and C‾\overline{C}, and S~cC\widetilde{S}_{c_C} and S~cC‾\widetilde{S}_{c_{\overline{C}}} for their entries for class cc.

Hypotheses

To detect units whose scores carry information about differences between the class responses, we center the responses across classes, Y~c=Yc−K−1∑c′=1KYc′\widetilde{Y}_c = Y_c - K^{-1}\sum_{c'=1}^{K} Y_{c'}, which removes the component shared by all classes. We write $\widetilde{Y} = (Y~1,…,Y~K)⊤∈RK(\widetilde{Y}_1,\ldots,\widetilde{Y}_K)^\top\in\mathbb{R}^K. If differences between the responses are not of interest, e.g. for K=1K=1, we do not center, i.e. then Y~=Y\widetilde{Y}=Y and S~hj=Shj\widetilde{S}_{hj}=S_{hj}.

For scores that do not depend on the class (H=1H=1), such as activations, we test

H0,C:Y~⊥ ⁣ ⁣ ⁣⊥S~C∣S~C‾ vs. H1,C:Y~⊥̸ ⁣ ⁣ ⁣⊥S~C∣S~C‾.(1)H_{0,C}: \widetilde{Y} \perp\!\!\!\perp\widetilde{S}_C \mid\widetilde{S}_{\overline{C}} \ \text{vs.}\ H_{1,C}: \widetilde{Y} \not\perp\!\!\!\perp\widetilde{S}_C \mid\widetilde{S}_{\overline{C}}. \tag*{(1)}

For scores that depend on the class (H=KH=K), such as CRP scores, we test

H0,C: Y~c⊥ ⁣ ⁣ ⁣⊥S~cC∣S~cC‾ for all c∈{1,…,K}vs.H1,C: Y~c⊥̸ ⁣ ⁣ ⁣⊥S~cC∣S~cC‾ for some c∈{1,…,K}.(2)\begin{aligned} H_{0,C}:&\ \widetilde{Y}_c \perp\!\!\!\perp\widetilde{S}_{cC} \mid\widetilde{S}_{c\overline{C}} \text{ for all } c \in\{1,\ldots,K\} \quad\text{vs.}\\ H_{1,C}:&\ \widetilde{Y}_c \not\perp\!\!\!\perp\widetilde{S}_{cC} \mid\widetilde{S}_{c\overline{C}} \text{ for some } c \in\{1,\ldots,K\}. \tag*{(2)} \end{aligned}

which relates the scores for each class only to the response of the same class.

Hierarchy and localization

To localize clusters and units whose scores carry information about the response differences, we apply the hierarchical testing procedure of Meinshausen [2008], Mandozzi and Bühlmann [2016] separately to each layer. For layer ll, we first remove units whose scores are constant on the clustering sample (see below), e.g. filters that never activate or units with zero relevance for all classes. Such units cannot be clustered (Subsection 2.4), and the hypotheses then refer to the remaining units, whose number we denote by MlM_l from here on. We then construct one binary tree TUT_U whose nodes C⊆{1,…,Ml}C \subseteq\{1,\ldots,M_l\} are clusters of units: the root is the whole layer, the leaves are single units, and any two nodes are either disjoint or one contains the other (cf. Figure 1 and Figure 2). At each node CC, we test equation 1 for activations and equation 2 for CRP scores, and denote its pp-value by pCp_C. We traverse TUT_U top-down and reject H0,CH_{0,C} iff the parent of CC was rejected (or CC is the root) and

Figure 2. Top-down testing over the unit tree TU\mathcal{T}_U and the class tree TG\mathcal{T}_G for K=4K = 4 classes and Ml=8M_l = 8 units, with one run over TU\mathcal{T}_U per internal node GG of TG\mathcal{T}_G. In the run for GG, the pair (C,G)(C, G) is rejected if the parent of CC was rejected in this run and min⁡(1,pCMl/∣C∣)≤αvG\min(1, p_C M_l/|C|) \leq\alpha v_G. The pair is skipped if (C,pa⁡(G))(C, \operatorname{pa}(G)) was not rejected, so the runs for {1,2}\{1, 2\} and {3,4}\{3, 4\} only test clusters rejected in the run for the root (middle). The weights are vG=1/2v_G = 1/2 at the root of TG\mathcal{T}_G and vG=1/4v_G = 1/4 at the other two internal nodes, and the global root is tested at level α\alpha (Appendix § 8.§ 3). The FWER over all (C,G)(C, G) is at most α\alpha. In this example, unit 1 is rejected for the differences among all four classes and also for the difference between classes 1 and 2, whereas no cluster is rejected for the difference between classes 3 and 4.

pCadj=min⁡(1,pCMl/∣C∣)≤α.p_C^{\mathrm{adj}}=\min(1,p_C M_l/|C|)\leq\alpha.

Hence, the root is tested at level α\alpha and a single unit at level α/Ml\alpha/M_l, with clusters in between. We call CC null if H0,CH_{0,C} holds and non-null otherwise. A false rejection is the rejection of a null CC. The FWER over the tree TUT_U is the probability of at least one false rejection. The procedure controls the FWER at level α\alpha if the FWER is at most α\alpha whichever clusters are null.

Meinshausen [2008] and Mandozzi and Bühlmann [2016] formulate the procedure for the coefficients of a linear model, but their proof of FWER control only uses that the tree is fixed in advance (Subsection 2.4) and that each pp-value is valid, i.e. P(pC≤u)≤uP(p_C \leq u) \leq u for all u∈[0,1]u \in[0,1] if H0,CH_{0,C} holds [see also Appendix § 8.§ 3 and Goeman and Solari, 2010]. The FWER is therefore controlled for any hypotheses H0,CH_{0,C} with valid pp-values, and asymptotically for asymptotically valid ones, so we can replace the linear model by conditional independence tests (CITs), which do not assume a linear relation between scores and responses.

In addition to the training sample of f^θ\hat{f}_{\theta}, we use two further samples. On a clustering sample, we construct TUT_U (Subsection 2.4). On an inference sample of i.i.d. copies (X1,Y1),…,(Xn,Yn)(X_1,Y_1),\ldots,(X_n,Y_n) of (X,Y)(X,Y), we compute the pp-values pCp_C (Subsection 2.5). For the ii-th pair, we write SiS_i, S~i\widetilde{S}_i and Y~i\widetilde{Y}_i for the scores, centered scores and centered responses, and S~i,C\widetilde{S}_{i,C}, S~i,C‾\widetilde{S}_{i,\overline{C}} for the columns of S~i\widetilde{S}_i belonging to CC and C‾\overline{C}. Only the inference sample has to be drawn from PXYP_{XY}; the training and clustering samples may come from any distribution, as long as they are independent of the inference sample. Given these two samples, the model and TUT_U are fixed, and FWER control holds conditionally on them.

Tree construction

Any tree constructed independently of the inference sample yields FWER control (Subsection 2.3), so the clustering only affects power and interpretation, and may, in general, be based on different unit scores than the tests.

We construct TUT_U on a clustering sample by complete-linkage clustering with distance 1−∣ρjk∣1-|\rho_{jk}| between units jj and kk, where ρjk\rho_{jk} is a correlation of their scores on the clustering sample. Complete linkage ensures that clusters low in the tree contain only mutually strongly correlated units, which are largely redundant with respect to their scores. Such units are hard to detect individually by conditional tests, whereas the cluster as a whole can still be detected [7].

For activation scores (H=1H=1), ρjk=Corr⁡(S~j,S~k)\rho_{jk}=\operatorname{Corr}(\widetilde{S}_j,\widetilde{S}_k) is the correlation of the two units’ activations across the clustering sample inputs. For CRP scores (H=KH=K), ρjk\rho_{jk} is the pooled within-class correlation of the scores (Appendix § 8.§ 1). Since the tests regress separately for each class (Subsection 2.5), units are redundant only if their scores co-vary across inputs within a class.

Tests at each node

If (Y~,S~)(\widetilde{Y}, \widetilde{S}) has an absolutely continuous distribution, no test that controls the type I error uniformly over the null has power greater than the level of the test against any alternative [10]. CITs with power therefore rely on assumptions that restrict the null hypothesis. We use the generalized covariance measure (GCM) of Shah and Peters [ [10], which is applicable to multivariate responses and scores. It regresses the responses and the scores of the units in CC on the scores of the remaining units, and tests whether the residuals are correlated. Its validity requires that these regressions estimate the conditional means sufficiently well, and it has power only if E[Cov⁡(Y~c,S~cj∣S~cC‾)]≠0\mathbb{E}[\operatorname{Cov}(\widetilde{Y}_c,\widetilde{S}_{cj}\mid\widetilde{S}_{c\overline{C}})] \ne0 for some class cc and unit j∈Cj \in C, i.e. if the residuals are correlated in expectation.

Residual products. For each class cc, the responses and the scores of the units in CC are regressed on the class-cc scores S~cC‾\widetilde{S}_{c\overline{C}} of the remaining units. For activations, these are the activations of the remaining units, which are the same for every class, i.e. S~cj=S~j\widetilde{S}_{cj}=\widetilde{S}_{j} for all cc. For CRP scores, equation 2 relates the response of each class only to the relevance for the same class, given the relevance of the remaining units for that class. We therefore regress only on the relevances S~cC‾\widetilde{S}_{c\overline{C}} for class cc. Any regression method can be used, e.g. post-lasso (Appendix § 9.§ 5). At the root, C‾=∅\overline{C}=\emptyset, and the regressions reduce to sample means. Let m^cY(S~cC‾)\widehat{m}^{Y}_{c}(\widetilde{S}_{c\overline{C}}) and m^cjS(S~cC‾)\widehat{m}^{S}_{cj}(\widetilde{S}_{c\overline{C}}) be estimates of E[Y~c∣S~cC‾]\mathbb{E}[\widetilde{Y}_{c}\mid\widetilde{S}_{c\overline{C}}] and E[S~cj∣S~cC‾]\mathbb{E}[\widetilde{S}_{cj}\mid\widetilde{S}_{c\overline{C}}]. For each class c=1,…,Kc=1,\ldots,K and unit j∈Cj\in C, we compute the residual product

Ticj=(Y~ic−m^cY(S~icC‾))(S~icj−m^cjS(S~icC‾)),T_{icj}=\left(\widetilde{Y}_{ic}-\widehat{m}^{Y}_{c}(\widetilde{S}_{ic\overline{C}})\right)\left(\widetilde{S}_{icj}-\widehat{m}^{S}_{cj}(\widetilde{S}_{ic\overline{C}})\right),

and collect these in Ti∈RK∣C∣T_i\in\mathbb{R}^{K|C|}. For activations, m^cjS(S~cC‾)\widehat{m}^{S}_{cj}(\widetilde{S}_{c\overline{C}}) does not depend on cc.

Test statistic. Let T‾=n−1∑i=1nTi\overline{T}=n^{-1}\sum_{i=1}^{n}T_i with entries T‾cj\overline{T}_{cj}, let σ^cj2\widehat{\sigma}^{2}_{cj} be the empirical variance of T1cj,…,TncjT_{1cj},\ldots,T_{ncj}, and let Γ^\widehat{\Gamma} be the empirical correlation matrix of T1,…,TnT_1,\ldots,T_n. Entries with σ^cj=0\widehat{\sigma}_{cj}=0 are removed. Under H0,CH_{0,C}, the standardized entries n T‾cj/σ^cj\sqrt{n}\,\overline{T}_{cj}/\widehat{\sigma}_{cj} are asymptotically jointly normal with mean zero and covariance Γ\Gamma, the correlation matrix of TiT_i [10]. We aggregate the standardized entries over classes c∈{1,…,K}c\in\{1,\ldots,K\} and units j∈Cj\in C by

WCmax⁡=max⁡c∈{1,…,K}, j∈Cn∣T‾cj∣σ^cj,W^{\max}_{C}=\max_{c\in\{1,\ldots,K\},\,j\in C}\frac{\sqrt{n}\lvert\overline{T}_{cj}\rvert}{\widehat{\sigma}_{cj}},

and obtain its p-value pCp_C by comparing WCmax⁡W^{\max}_{C} with the maximum absolute entry of BB independent draws from N(0,Γ^)N(0,\widehat{\Gamma}) [10 Section 3.2], cf. Appendix § 8.§ 2. WCmax⁡W^{\max}_{C} has most power if the signal is concentrated in few entries, i.e. few units and classes; an alternative quadratic statistic with more power against signals spread over many entries is given in Appendix § 10.

Localizing classes

Our procedure identifies clusters whose scores carry information about any difference between the class responses. To identify which classes this information corresponds to, we additionally construct a binary tree TGT_G whose nodes G⊂{1,…,K}G\subset\{1,\ldots,K\} are clusters of classes, by complete-linkage clustering on the clustering sample with distance 1−Corr⁡(Y~c,Y~c′)1-\operatorname{Corr}(\widetilde{Y}_{c},\widetilde{Y}_{c'}) so that classes whose responses vary together are grouped. The leaves of TGT_G are single classes, for which the centered responses below vanish, so we test only at the K−1K-1 internal nodes, the root and K−2K-2 others, and GG denotes an internal node in the following. For each GG and c∈Gc\in G, we center the responses and, for CRP scores, the scores within GG, Y~c(G)=Y~c−∣G∣−1∑c′∈GY~c′\widetilde{Y}^{(G)}_{c}=\widetilde{Y}_{c}-|G|^{-1}\sum_{c'\in G}\widetilde{Y}_{c'} and S~cj(G)=S~cj−∣G∣−1∑c′∈GS~c′j\widetilde{S}^{(G)}_{cj}=\widetilde{S}_{cj}-|G|^{-1}\sum_{c'\in G}\widetilde{S}_{c'j}, and test, analogously to equation 1 and equation 2,

H0,C,G: Y~(G)⊥ ⁣ ⁣ ⁣⊥S~C∣S~C‾(activation),H0,C,G: Y~C(G)⊥ ⁣ ⁣ ⁣⊥S~C(G)∣S~C‾(G)(CRP),\begin{aligned} H_{0,C,G}:&\ \widetilde{Y}^{(G)} \perp\!\!\!\perp\widetilde{S}_{C}\mid\widetilde{S}_{\overline{C}} &&\text{(activation)},\\ H_{0,C,G}:&\ \widetilde{Y}^{(G)}_{C}\perp\!\!\!\perp\widetilde{S}^{(G)}_{C}\mid\widetilde{S}^{(G)}_{\overline{C}} &&\text{(CRP),} \end{aligned}

where Y~(G)=(Y~c(G))c∈G\widetilde{Y}^{(G)}=(\widetilde{Y}^{(G)}_{c})_{c\in G}. At the root of TGT_G, these are hypotheses equation 1 and equation 2; for G={a,b}G=\{a,b\}, Y~a(G)=−Y~b(G)=(Ya−Yb)/2\widetilde{Y}^{(G)}_{a}=-\widetilde{Y}^{(G)}_{b}=(Y_a-Y_b)/2. As in Subsection 2.3, we call the pair (C,G)(C,G) null if H0,C,GH_{0,C,G} holds and non-null otherwise. A rejection of H0,C,GH_{0,C,G} means that the units in CC carry information about differences between the classes in GG beyond the rest of the layer.

We fix weights vG≥0v_G\ge0 with ∑GvG≤1\sum_Gv_G\le1 in advance and, for each GG, apply the procedure of Subsection 2.3 on TUT_U to H0,C,G∈TUH_{0,C,G}\in T_U, at level αvG\alpha v_G, except that we test the global root, i.e. the root of TUT_U paired with the root of TGT_G, at level α\alpha. We use vroot=1/2v_{\mathrm{root}}=1/2 and vG=1/(2(K−2))v_G=1/(2(K-2)) for the other internal nodes, so that the weights sum to one, but any other choice fixed in advance is valid; for K=2K=2, the root is the only internal node and vroot=1v_{\mathrm{root}}=1. To reduce the number of tests, we process the nodes GG top-down and, for a non-root GG, skip (C,G)(C, G) if (C,pa⁡(G))(C, \operatorname{pa}(G)) was not rejected, where pa⁡(G)\operatorname{pa}(G) denotes the parent of GG in TG\mathcal{T}_G. Figure 2 illustrates the procedure. The procedure controls the FWER over all pairs (C,G)(C, G) with C∈TUC \in\mathcal{T}_U and GG an internal node of TG\mathcal{T}_G at level $\alpha ({xref}Appendix A.3). Skipping preserves this control, but for CRP scores it can cost power ({xref}Appendix A.4`).

To test several layers l=1,…,Ll = 1, \ldots, L, we apply the procedure to layer ll at level αwl\alpha w_l, with weights wl≥0w_l \geq0, ∑lwl≤1\sum_l w_l \leq1, fixed in advance, e.g. wl=1/Lw_l = 1/L. This controls the FWER over all layers at level α\alpha, whereas testing each layer at level α\alpha controls it only at level LαL\alpha (Appendix § 8.§ 3).

Interpretation

A rejection is a population-level statement about the fixed network, the layer and PXYP_{XY}; a non-rejection is not evidence that (C,G)(C, G) is null, since the tests may lack power (Subsection 2.5). We state the interpretation for H0,CH_{0,C}; for H0,C,GH_{0,C,G}, the response differences are those between the classes in GG. For activations, a rejection of H0,CH_{0,C} means that the units in CC carry information about the response differences beyond the rest of the layer, whether or not the network uses them. For CRP scores, it means that the network uses the units in CC differently across classes, and that this difference carries information about the response differences beyond the relevance of the rest of the layer. Ranking units by relevance, in contrast, also selects units that the network uses but whose scores carry no information (§ 3). If (C,G)(C, G) is rejected but (C′,G)(C', G) for none of the children C′C' of CC, the children may lack power or be null although CC is non-null, e.g. if the units in CC are strongly correlated because they detect the same or co-occurring patterns, so that the information of each child is contained in the units outside it. Similarly, if (C,G)(C, G) is rejected but (C,G′)(C, G') for none of the children G′G' of GG, the information may concern differences between the two groups G′G' rather than within them.

A rejection does not by itself imply that the patterns detected by the units in CC drive the response differences. Since S~C\widetilde{S}_C is a function of XX, it implies that the input carries information about these differences beyond the patterns detected by the other units. If the scores of the layer capture all information in the input about the differences, i.e. Y~⊥X∣S~\widetilde{Y} \perp X \mid\widetilde{S}, the converse also holds, so that H0,CH_{0,C} is equivalent to Y~⊥X∣S~C\widetilde{Y} \perp X \mid\widetilde{S}_C; for CRP scores, this condition excludes additional information in units that the network does not use. That the patterns drive the differences further requires that no factor outside the input that affects the responses, such as a property of the genomic region, co-occurs with them.

Conditional attribution maps

For a rejected pair (C,G)(C, G), we visualize which input patterns the units in CC detect by conditional attribution maps [Achitvbat et al., 2023]. For an input XX and a class c∈Gc \in G, we initialize the relevance at the output fθ^(X)cf_{\hat{\theta}}(X)_c, propagate it to layer ll, set the relevance of all units outside CC to zero, and propagate the remaining relevance further to the input. The map assigns to each position and nucleotide the part of the prediction for class cc that passes through the units in CC. To summarize the maps of a unit over inputs, we use relevance-weighted nucleotide frequencies in the simulation (Appendix B.6) and TF-MoDISco tool [15] in the application (Appendix E).

The maps are descriptive. They are computed only for the selected clusters and summarize only the inputs with the largest relevance, so no error control is claimed for them. Whether the detected patterns drive the response differences requires the conditions in Subsection 2.7.

Simulation

We check FWER control and power where the ground truth is known. Details are given in Appendix B and the simulation design is illustrated in Figure 3.

Figure 3. Simulation design. (a) Motif mjm_j is inserted into XiX_i if Zij=1Z_{ij}=1; lines connect each motif to the class responses YcY_c it affects for δ=1\delta=1. In D2 and D3, arcs connect pairs of motifs with Corr⁡(Zij,Zij′)=ρ\operatorname{Corr}(Z_{ij}, Z_{ij'})=\rho. (b) The filter of unit jj is the one-hot encoding of mjm_j; in D1, it ignores one position (dashed). Lines connect each unit to the outputs fcf_c that use it.

Design

Data and network. In our baseline scenario D0, we draw nn random DNA sequences XiX_i of length 512 and M=32M=32 random 8-mers m1,…,mMm_1,\ldots,m_M, and insert motif mjm_j into XiX_i if Zij=1Z_{ij}=1, with Zij∼Ber⁡(0.3)Z_{ij}\sim\operatorname{Ber}(0.3) independently. The responses of the K=4K=4 classes are

Yic=δ(Zic+Zi,c+4+Zi,c+8+Zi,c+12)+εic,Y_{ic}=\delta\left(Z_{ic}+Z_{i,c+4}+Z_{i,c+8}+Z_{i,c+12}\right)+\varepsilon_{ic},

where εic∼iidN(0,1)\varepsilon_{ic}\overset{\mathrm{iid}}{\sim}N(0,1) independently of XiX_i, and δ∈{0,1}\delta\in\{0,1\}. The tested layer has one convolutional unit per motif, whose filter is the one-hot encoding of mjm_j, so that unit jj detects motif jj. A linear head maps the units to the outputs

fc(X)=1+∑j∈Uc∑tAjt(X),f_c(X)=1+\sum_{j\in U_c}\sum_t A_{jt}(X),

where Uc={c,c+4,c+16,c+20}U_c=\{c,c+4,c+16,c+20\} and Ajt(X)A_{jt}(X) is the activation of unit jj at position tt (Subsection 2.1). Hence the motifs of units 1–16 affect YY (real units) and the network uses units 1–8 and 17–24 (used units), which gives four groups of eight units: real & used, real & unused, shortcut, and null. Shortcut units mimic units a trained network relies on although their scores carry no information about YY beyond the real units [16], e.g. because the training sample was not drawn from PXYP_{XY}.

Scenario variations. Three variations of D0 mimic properties of trained networks (Appendix § 9.§ 3): filters that match their motif only approximately (D1), so that with probability q∈{0.1,0.25}q \in\{0.1, 0.25\} unit jj misses an occurrence of mjm_j or is activated by a variant that does not affect YY; shortcuts whose motifs co-occur with real ones (D2); and redundant units that detect co-occurring motifs (D3). In D2 and D3, pairs of motifs have Corr⁡(Zij,Zij′)=ρ\operatorname{Corr}(Z_{ij}, Z_{ij^\prime}) = \rho (Figure 3a). D2 (ρ=0.5\rho= 0.5) pairs the shortcuts 17–20 with the real & used units 1–4 and the shortcuts 21–24 with the real & unused units 9–12, and the null units 25–28 with 29–32. D3 (ρ=0.9\rho= 0.9) pairs units 1–4 with 5–8.

Ground truth. Let A\mathcal{A} be the set of units whose scores carry information about Y~\widetilde{Y} given the scores of all other units. In all scenarios, CC is non-null iff C∩A≠∅C \cap\mathcal{A} \ne\varnothing (Appendices § 9.§ 2 and § 9.§ 3). For δ=0\delta= 0, A=∅\mathcal{A} = \varnothing. For δ=1\delta= 1, A\mathcal{A} contains the real units for activations and the real & used units for CRP scores, and, for CRP scores in D2, also the shortcuts 21–24, as proxies of units 9–12, which are removed before testing.

Procedure and baselines. For n∈{200,400,800,2000,4000}n \in\{200, 400, 800, 2000, 4000\} and 200 replications, we build the tree on one half of the data (Subsection 2.4) and traverse it top-down on the other half with the max GCM at α=0.05\alpha= 0.05 (Subsection 2.5), only for the root of TGT_{\mathcal{G}}, i.e. hypotheses equation (1) and equation (2), separately for activation and CRP scores, estimating the conditional means by post-lasso regressions with the R package comets [17]. We compare with three baselines that consider only single units. The flat conditional and the marginal test apply the max GCM to each single unit jj, given all other units and given no units, respectively, and reject if Mlp{j}≤αM_l p_{\{j\}} \le\alpha (Bonferroni). Top-k, without error control, selects on the inference sample the kk units with the largest mean absolute score, summed over classes for CRP scores, with k=16k = 16 for activation and k=8k = 8 for CRP scores. Except for CRP scores in D2, where ∣A∣=12|\mathcal{A}| = 12, this gives k=∣A∣k = |\mathcal{A}| for δ=1\delta= 1, which favours top-k.

Metrics. The FWER is the proportion of replications with at least one false rejection. For δ=0\delta= 0, it equals the rejection rate of the root; for δ=1\delta= 1, it also counts false rejections below the root. Following Meinshausen [ [6], the power for a class II of cluster sizes is the proportion of non-null clusters CC with ∣C∣∈I|C| \in I that are rejected, pooled over replications (Appendix § 9.§ 4). For top-k, we treat selecting unit jj as rejecting H0,{j}H_{0,\{j\}}, so its FWER is the proportion of replications in which it selects a unit outside A\mathcal{A}, and its power is that for single units.

Results

Figures 5–8 in Appendix § 9 show all results. In all scenarios, for both scores and both values of δ\delta, the hierarchical max GCM keeps the FWER close to α\alpha (Monte Carlo standard error ≈0.015\approx0.015). In D0, its power increases with nn and with the cluster size, and approaches 1 for n≥2000n \ge2000. It is lowest for single units, which are tested at level α/Ml\alpha/M_l and only after all their ancestors are rejected. With activations, the procedure detects the real & used and the real & unused units, and with CRP scores only the real & used units. Top-k selects a unit outside A\mathcal{A} in almost every replication, so its FWER is close to 1. Its power stays near 1/21/2 for all nn, since the mean absolute scores do not depend on YY and are exchangeable across the units in the tree. The conditional attribution maps of the units rejected for CRP scores in D0 recover the motifs of the real & used units, whereas top-k also selects shortcuts with equally clean motifs (Figure 7). Since all motifs are random 8-mers, the maps alone cannot separate shortcuts from real & used units; the test does.

Figure 7. Motifs recovered in one replication (n=2000n = 2000, δ=1\delta= 1, in D0). Each panel shows the relevance-weighted nucleotide frequencies of one unit (Subsection 2.8), titled by the unit and its group. Top: the true motifs m1,…,m8m_1, \ldots, m_8 of the real & used units. Middle: the units rejected by the hierarchical max GCM on CRP scores, here units 1–8, each recovering its motif. Bottom: the eight units selected by top-kk, five of which are shortcuts.

In D1, power decreases with qq, since the imperfect filters reduce the information that the scores carry about the motifs; for q=0.25q = 0.25, it approaches 1 only for n≥2000n \ge2000. In D2, the marginal test rejects the shortcuts correlated with real units, and its FWER approaches 1, whereas the hierarchical max GCM keeps it close to α\alpha. For CRP scores and n≥2000n \ge2000, the hierarchical max GCM also rejects the shortcuts 21–24, which are in A\mathcal{A} as proxies of the real & unused units 9–12. As discussed in Subsection 2.7, such a rejection does not imply that their motifs drive YY. In D3, each unit of a pair carries little information beyond the other, so single units are reliably detected only for n≥2000n \ge2000 (activations) or n=4000n = 4000 (CRP). Since the hierarchical and the flat conditional procedure both test single units at level α/Ml\alpha/M_l, the hierarchy cannot increase their power. It localizes the information to the pair instead: it rejects a cluster within almost every pair for all nn, whereas the flat conditional test needs n≥2000n \ge2000.

Application

We apply the procedure to a convolutional sequence-to-activity (S2A) network trained to predict DNA activity across cell types. CRP scores every unit and input window but does not say which units matter; instead of ranking hundreds of correlated units by relevance, we test, with error control, whether the relevance of a unit or cluster of units carries information about the cell-type responses beyond the other units of the layer. A rejected unit is thus cell-type-specific and non-redundant, and the class tree TGT_{\mathcal{G}} ties it to the cell types it is relevant for.

Data, model, and interpretability target

The CNN maps a 512-bp one-hot-encoded zebrafish DNA sequence to pseudobulk ATAC-seq accessibility in 12 cell types, as a multivariate regression with one output per cell type (Appendix § 11). We apply the procedure to CRP relevance scores of the units in each convolutional layer, computed as described in Appendix § 11.§ 4. The natural concept for such a model is a transcription factor (TF) motif, a short DNA sequence that a TF binds to regulate nearby genes. Curated resources provide position weight matrices for numerous TFs and annotate which TFs are active in which cell types [18], so we expect the patterns of selected units to match the motifs of TFs active in the corresponding cell types (Appendix § 12). For evaluation, we use a reference set of 18,000 held-out windows, the 1,500 most cell-type-specific windows for each of the 12 cell types (Appendix § 11).

Results

Applied to the trained S2A model, our method selects 112 of 352 units across the five convolutional layers (Figure 4a), narrowing the network to a small set of units that can be inspected individually. First-layer units are mostly specific to a single cell type, whereas units in layers 2–4 are often shared among cell types that are adjacent on the cell type tree (e.g., the neural group), reflecting the lineage structure of the data.

Figure 4. Hierarchical testing localizes cell-type-specific concepts across layers. (a) Units selected per layer, with selected/total units in parentheses. Each layer is tested at level 0.005 (Subsection 2.6), so the FWER over all five layers is at most 0.025. Rows are cell types ordered by lineage tree; dot size shows mean absolute relevance and color the contribution sign. (b) Example first-layer units with best-matching motif and CRP attribution map. (c) Motif families matched by each cell type’s top patterns; dot size is the number of unit-motif pairs (n per cell type) and color is log⁡2\log_{2} enrichment relative to the family’s overall rate.

We matched a learned pattern for each selected unit, derived from its conditional attribution maps, to the core JASPAR motif database [18]. First-layer units match TFs with known roles in the corresponding cell types, for example GATA2 for Endoderm, TFAP2E for Neural crest and TP73 for Epidermal, and the attribution maps place the pattern at the matched position (Figure 4b). Across cell types, the enriched motif families follow the cell type tree (Figure 4c): SOX in neural cell types, HOX/CDX and T-box in posterior mesoderm, and GATA, ETS and FOX in Endoderm and LM. As no motif information was given to the model during training, this agreement with known biology provides an independent check that the selected units capture meaningful concepts.

Conclusion

We proposed a hierarchical testing procedure to localize predictive information in the representations of a neural network with error control. Within a layer of a fixed trained network, it identifies the units and clusters of units whose scores carry information about the response differences between classes beyond the rest of the layer. The procedure controls the FWER over the whole hierarchy. Applying the procedure to activations and to CRP scores separates two questions: which units encode information about the responses, and which of these the network relies on. In the simulation, our procedure controlled the FWER in all scenarios and, with CRP scores, detected the units that are both informative and used by the network. Unlike testing single units conditionally with Bonferroni correction, it localized the information to clusters when correlated units could not be separated individually, whereas testing them marginally or ranking them by relevance also selected shortcuts that carry no information beyond the real units.

In the application to a sequence-to-activity model of zebrafish DNA accessibility, the procedure selected a set of units small enough to inspect one by one, whose patterns are consistent with known transcription factor motifs. The error control applies to the selection of units; the attribution maps and the motif matching are descriptive.

A rejection in our procedure is a statement about the fixed network, the layer and the distribution of the inference sample. It does not by itself imply that the detected input patterns drive the responses (Subsection 2.7). Power depends on how well the GCM regressions estimate the conditional means and on the tree, and strongly correlated units may only be detected jointly as a cluster. We evaluated the procedure only on DNA sequence models and for differences between class responses, although it applies to any input space and to responses that are not compared across classes (§ 2). The most natural extension is to test all layers jointly with error control that exploits their dependence, rather than a union bound over layers. Further directions are controlling the FDR instead of the FWER, and replacing units by other components of a representation, such as directions in activation space.

Acknowledgments

M. Simnacher, J. Berend, W. Samek, C. Lippert, S. Greven and U. Ohler were supported by DFG research unit DeSBI (KI-FOR 5363). V. Huryn was supported by a graduate fellowship in the Helmholtz International Berlin Research School for Data Science (HEIBRiDS).

AI use statement

In this work, we used generative AI tools for help develop theoretical models or conceptual frameworks; refine hypotheses; design or provide feedback on research methodology or experiments; implement methods; interpret results. We have not used generative AI tools to generate synthetic data sets; clean and reformat datasets; support qualitative and thematic data analysis; discover research topics or identify gaps. Additionally, we used generative AI tools for create or modify scientific figures or images; suggest experimental parameters; create or edit software code; draft parts of a research paper; summarize or analyze existing literature; identify relevant literature;. We have reviewed all AI-assisted work by proofreading and editing generated code, text, and images. We have personally read and verified every paper cited in this work. We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.

Appendix

Method details

Correlation of CRP scores

For CRP scores (H=KH = K), we correlate the scores over all inputs and classes after subtracting from S~hj\widetilde{S}_{hj} its mean over inputs for each class hh,

ρjk=∑h=1KCov⁡(S~hj,S~hk)∑h=1KVar⁡(S~hj)∑h=1KVar⁡(S~hk)\rho_{jk} = \frac{\sum_{h=1}^{K} \operatorname{Cov}(\widetilde{S}_{hj},\widetilde{S}_{hk})}{\sqrt{\sum_{h=1}^{K} \operatorname{Var}(\widetilde{S}_{hj})\sum_{h=1}^{K} \operatorname{Var}(\widetilde{S}_{hk})}}

with (co)variances over the inputs of the clustering sample. Without subtracting the means over inputs, units with similar mean relevance per class would be correlated even if their scores vary independently across inputs, although such units are not redundant for the tests. For K=2K = 2, ρjk\rho_{jk} reduces to the correlation of the class contrasts Rj(X,a)−Rj(X,b)R_j(X,a) - R_j(X,b) and Rk(X,a)−Rk(X,b)R_k(X,a) - R_k(X,b).

Monte Carlo p-value of the max GCM

Let Ξ(1),…,Ξ(B)\Xi^{(1)}, \ldots, \Xi^{(B)} be independent draws from N(0,Γ^)N(0,\widehat{\Gamma}), with entries Ξcj(b)\Xi_{cj}^{(b)} indexed like those of TiT_i. The p-value of node CC is

pC=1B+1(1+∑b=1B1{max⁡c∈{1,…,K}, j∈C∣Ξcj(b)∣≥WCmax⁡})p_C = \frac{1}{B+1}\left(1+\sum_{b=1}^{B}\mathbb{1}\left\{\max_{c\in\{1,\ldots,K\},\,j\in C}\left|\Xi_{cj}^{(b)}\right| \ge W_C^{\max}\right\}\right)

[10 Section 3.2]. Since ∑cY~c=0\sum_c \widetilde{Y}_c = 0, the entries of TiT_i can be linearly dependent, e.g. for activations, where all classes are regressed on the same scores, so Γ^\widehat{\Gamma} can be singular. This affects neither the draws nor WCmax⁡W_C^{\max}, since neither requires inverting Γ^\widehat{\Gamma}.

FWER control over the unit and class trees

All probabilities are conditional on the training and clustering samples, so both trees are fixed. For fixed GG, the run over TUT_U is the procedure of Subsection 2.3 at level αvG\alpha v_G, which controls the FWER over H0,C,GH_{0,C,G}, C∈TUC \in T_U, at level αvG\alpha v_G if the p-values are valid [6, 8]. Skipping only adds a condition for rejection and can therefore only remove rejections. Let C0C_0 and G0G_0 be the roots of TUT_U and TGT_G. If (C0,G0)(C_0,G_0) is non-null, rejecting it is not an error, and the bound for the run for G0G_0 is unchanged by testing it at level α\alpha, since the bound depends only on the levels at which null pairs are tested. By the union bound over GG, the FWER is then at most ∑GαvG≤α\sum_G \alpha v_G \le\alpha. If (C0,G0)(C_0,G_0) is null, every other pair is tested only after (C0,G0)(C_0,G_0) is rejected: within a run, (C,G)(C,G) is tested only after (C0,G)(C_0,G), and for G≠G0G \ne G_0, (C0,G)(C_0,G) only after (C0,pa⁡(G))(C_0,\operatorname{pa}(G)). The FWER is then at most the probability of rejecting (C0,G0)(C_0,G_0), i.e. at most α\alpha. Neither case uses relations between the hypotheses, so the result holds for activation and CRP scores alike, and asymptotically for asymptotically valid p-values. For several layers tested at levels αwl\alpha w_l, the union bound over layers gives FWER control at level ∑lαwl≤α\sum_l \alpha w_l \le\alpha, and at level LαL\alpha if each layer is tested at level α\alpha.

Nesting of the hypotheses and power

Nesting affects only power. By the weak union property of conditional independence, H0,C,GH_{0,C,G} implies H0,C′,GH_{0,C',G} for C′⊂CC' \subset C, so the ancestors in TUT_U of a non-null pair are non-null. For activations, the hypotheses are also nested in GG, since Y~(G′)\widetilde{Y}(G') is a function of Y~(G)\widetilde{Y}(G) for G′⊂GG' \subset G, so skipping never discards a non-null pair. For CRP scores, which are also centered within GG, (C,G′)(C,G') can be non-null although (C,pa⁡(G′))(C,\operatorname{pa}(G')) is null, and skipping it then costs power.

Simulation details

Data-generating mechanism

We draw sequences of length p=512p = 512 with nucleotides drawn uniformly from {A,C,G,T}\{A,C,G,T\}, one-hot encoded as Xi∈{0,1}4×pX_i \in\{0,1\}^{4 \times p}, and M=32M = 32 random 8-mers m1,…,mMm_1,\ldots,m_M. If Zij=1Z_{ij}=1, motif mjm_j is inserted into XiX_i at a randomly drawn position that does not overlap other inserted motifs. If a sequence contains a motif elsewhere by chance, it is redrawn. The responses are generated as in § 3.

Network and ground truth

We describe the network and the ground truth for D0; Appendix § 9.§ 3 gives the changes for D1–D3. We specify a CNN with a single convolutional layer of MM units, ReLU activation, global average pooling, and a linear head. The filter of unit jj has width 8, no padding, bias −7-7, and weights given by the one-hot encoding of motif mjm_j. Writing Lt∈{A,C,G,T}L_t \in\{A,C,G,T\} for the letter at position tt of XX, unit jj computes, for t=1,…,p−7t=1,\ldots,p-7,

Ajt(X)=max⁡(0,∑s=181{Lt+s−1=mjs}−7).A_{jt}(X)=\max\left(0,\sum_{s=1}^{8}\mathbf{1}\{L_{t+s-1}=m_{js}\}-7\right).

The sum counts the positions in the window starting at tt that agree with mjm_j, so Ajt(X)=1A_{jt}(X)=1 if the window equals mjm_j and 0 otherwise. Since sequences containing a motif by chance are redrawn, motif jj occurs in XiX_i exactly once if Zij=1Z_{ij}=1 and not at all otherwise. Hence the activation score of Subsection 2.1 is Aj(Xi)=max⁡tAjt(Xi)=ZijA_j(X_i)=\max_t A_{jt}(X_i)=Z_{ij}, i.e. unit jj indicates exactly whether motif jj occurs in XiX_i, and global average pooling outputs Zij/(p−7)Z_{ij}/(p-7) for unit jj. The linear head has weight p−7p-7 from each unit j∈Uc={c,c+4,16+c,20+c}j \in U_c=\{c,c+4,16+c,20+c\} to output cc, zero weights otherwise, and bias 1, so that

fc(Xi)=1+∑j∈UcZij.f_c(X_i)=1+\sum_{j\in U_c}Z_{ij}.

Since the head is linear, the relevance of unit jj for class cc, summed over positions, equals its contribution to fcf_c, Rj(X,c)=1{j∈Uc}∑tAjt(X)R_j(X,c)=\mathbf{1}\{j\in U_c\}\sum_t A_{jt}(X), up to a factor κ≈0.9995\kappa\approx0.9995 in our implementation (Appendix § 9.§ 5).

For δ=1\delta=1 and activations, Y~\widetilde{Y} depends on XX only through Zi1,…,Zi16Z_{i1},\ldots,Z_{i16}, the scores of units 1–16, each with a nonzero coefficient, and the ZijZ_{ij} are independent. Hence, given S~C‾\widetilde{S}_{\overline{C}}, Y~\widetilde{Y} depends on S~C\widetilde{S}_C iff CC contains one of units 1–16, so A={1,…,16}\mathcal{A}=\{1,\ldots,16\}. For CRP scores, units 9–16 and 25–32 have Rj≡0R_j\equiv0 and are removed before testing (Subsection 2.3), so the CRP-based trees contain the 16 used units, with centered scores S~cj=(1{j∈Uc}−1/K)Zij\widetilde{S}_{cj}=(\mathbf{1}\{j\in U_c\}-1/K)Z_{ij}. The part of Y~c\widetilde{Y}_c not determined by these scores depends only on Zi9,…,Zi16Z_{i9},\ldots,Z_{i16} and εi\varepsilon_i, which are independent of the scores of all used units. Hence, given S~C‾\widetilde{S}_{\overline{C}}, Y~\widetilde{Y} depends on S~C\widetilde{S}_C iff CC contains one of units 1–8, so A={1,…,8}\mathcal{A}=\{1,\ldots,8\}. In both cases, H0,CH_{0,C} is false iff C∩A≠∅C\cap\mathcal{A}\ne\varnothing. For δ=0\delta=0, Y~\widetilde{Y} is independent of XX, so every H0,CH_{0,C} holds.

Scenario variations

Scenarios D1–D3 modify the data-generating mechanism of Appendix § 9.§ 1 and, in D1, the filters of Appendix § 9.§ 2. The responses YicY_{ic}, the linear head and the procedure are as in D0, and indicators ZijZ_{ij} not mentioned below are independent as in D0.

D1: imperfect filters. For each unit jj, we draw a position uju_j uniformly from {1,…,8}\{1,\ldots,8\} once for each value of qq, the same for all nn, δ\delta and replications, and set the filter weights at position uju_j to zero and the bias to −6-6, so that

Ajt(X)=max⁡(0,∑s≠uj1{Lt+s−1=mjs}−6)A_{jt}(X)=\max\left(0,\sum_{s\ne u_j}\mathbf{1}\{L_{t+s-1}=m_{js}\}-6\right)

equals one iff the window starting at tt agrees with mjm_j at all positions except uju_j. For s∈{1,…,8}s\in\{1,\ldots,8\}, a variant of mjm_j in position ss is mjm_j with its letter at position ss replaced by one of the three other letters, drawn uniformly. Let Dij,Eij∼Ber⁡(q)D_{ij},E_{ij}\sim\operatorname{Ber}(q) be independent of each other and of all other variables. If Zij=1Z_{ij}=1 and Dij=1D_{ij}=1, we insert, instead of mjm_j, a variant of mjm_j in a position drawn uniformly from {1,…,8}∖{uj}\{1,\ldots,8\}\setminus\{u_j\}. If Eij=1E_{ij}=1, we additionally insert a variant of mjm_j in position uju_j. The responses depend on ZijZ_{ij} as in D0, so the first variant affects YY as mjm_j does, whereas the second does not affect YY. Sequences in which a filter fires at a window not covered by an inserted motif or variant are redrawn. Hence

Aj(Xi)=max⁡{Zij(1−Dij),Eij},A_j(X_i)=\max\{Z_{ij}(1-D_{ij}),E_{ij}\},

with P(Aj(Xi)=0∣Zij=1)=q(1−q)P(A_j(X_i)=0\mid Z_{ij}=1)=q(1-q) and P(Aj(Xi)=1∣Zij=0)=qP(A_j(X_i)=1\mid Z_{ij}=0)=q.

D2 and D3: correlated units. For a pair (j,j′)(j,j') of units, ZijZ_{ij} is drawn as in D0 and

Zij′=Vij′Zij+(1−Vij′)Zij′′,Z_{ij'}=V_{ij'}Z_{ij}+(1-V_{ij'})Z'_{ij'},
Vij′∼Ber⁡(ρ),Zij′′∼Ber⁡(0.3),V_{ij'}\sim\operatorname{Ber}(\rho),\quad Z'_{ij'}\sim\operatorname{Ber}(0.3),

with Vij′V_{ij'} and Zij′′Z'_{ij'} independent of each other and of all other variables. Then Zij′∼Ber⁡(0.3)Z_{ij'}\sim\operatorname{Ber}(0.3) as in D0 and Cov⁡(Zij,Zij′)=ρ⋅0.3⋅0.7\operatorname{Cov}(Z_{ij},Z_{ij'})=\rho\cdot0.3\cdot0.7, so Corr⁡(Zij,Zij′)=ρ\operatorname{Corr}(Z_{ij},Z_{ij'})=\rho. D2 (ρ=0.5\rho=0.5) pairs units 1–4 with 17–20, 9–12 with 21–24, and 25–28 with 29–32, each in order (e.g., 1 with 17), and D3 (ρ=0.9\rho=0.9) pairs units 1–4 with 5–8.

Ground truth. In D1, the CRP scores of unit jj sum the relevance over positions and are therefore proportional to the number of windows at which unit jj fires, Nij=Zij(1−Dij)+EijN_{ij}=Z_{ij}(1-D_{ij})+E_{ij}. Both Aj(Xi)A_j(X_i) and NijN_{ij} are functions of (Zij,Dij,Eij)(Z_{ij},D_{ij},E_{ij}), which are independent across jj, and both carry information about ZijZ_{ij}, since P(Aj(Xi)=1∣Zij=1)−P(Aj(Xi)=1∣Zij=0)=(1−q)2>0P(A_j(X_i)=1\mid Z_{ij}=1)-P(A_j(X_i)=1\mid Z_{ij}=0)=(1-q)^2>0 and E[Nij∣Zij=1]−E[Nij∣Zij=0]=1−q>0E[N_{ij}\mid Z_{ij}=1]-E[N_{ij}\mid Z_{ij}=0]=1-q>0. Hence, given the scores of all other units in the tree, the scores of unit jj carry information about Y~\tilde Y iff ZijZ_{ij} enters Y~\tilde Y, i.e. A={1,…,16}A=\{1,\ldots,16\} for activations and A={1,…,8}A=\{1,\ldots,8\} for CRP scores.

In D2 and D3, Aj(Xi)=ZijA_j(X_i)=Z_{ij} as in D0, but the indicators of a pair are dependent. Since Vij′V_{ij'} and Zij′′Z'_{ij'} are independent of all other variables, a unit j′j' whose indicator does not enter Y~\tilde Y, i.e. a shortcut or null unit in D2, carries no information about Y~\tilde Y beyond its partner jj if jj is in the tree. A real unit carries information beyond its partner, since its indicator enters Y~\tilde Y and ρ<1\rho<1. For activations, all 32 units are in the tree, so A={1,…,16}A=\{1,\ldots,16\}. For CRP scores, units 9–16 and 25–32 have Rj≡0R_j\equiv0 and are removed before testing. In D2, the partners 9–12 of the shortcuts 21–24 are therefore not in the tree. Since Zi,c+8Z_{i,c+8} enters Y~c\tilde Y_c and is correlated with Zi,20+cZ_{i,20+c}, the scores of unit 20+c20+c carry information about Y~c\tilde Y_c given the scores of all other used units. Hence A={1,…,8,21,…,24}A=\{1,\ldots,8,21,\ldots,24\} in D2 and A={1,…,8}A=\{1,\ldots,8\} in D3. In all scenarios, given S~A\tilde S_A, the scores of the units outside AA depend only on variables that are independent of (Y~,S~A)(\tilde Y,\tilde S_A): their own (Zij,Dij,Eij)(Z_{ij},D_{ij},E_{ij}), which do not enter Y~\tilde Y, and, in D2, (Vij′,Zij′′)(V_{ij'},Z'_{ij'}) and the indicator of the partner, which either does not enter Y~\tilde Y or is determined by S~A\tilde S_A. Hence Y~⊥ ⁣ ⁣ ⁣⊥S~Aˉ∣S~A\tilde Y\mathbin{\perp\!\!\!\perp}\tilde S_{\bar A}\mid\tilde S_A, where Aˉ\bar A denotes the units in the tree outside AA (for CRP scores, for the scores of each class cc), and by weak union H0,CH_{0,C} holds iff C∩A=∅C\cap A=\varnothing.

Performance measures

Let Rl\mathcal R_l be the set of rejected clusters and TU,l\mathcal T_{U,l} the unit tree in replication l=1,…,200l=1,\ldots,200. For top-kk, Rl={{j}:j selected}\mathcal R_l=\{\{j\}:j\text{ selected}\}. With Dl(I)={C∈TU,l:∣C∩I∣, C∩A≠∅}\mathcal D_l(I)=\{C\in\mathcal T_{U,l}:|C\cap I|,\,C\cap A\ne\varnothing\}, the non-null clusters of size in II,

FWER^=1200∑l=12001{∃C∈Rl:C∩A=∅},\widehat{\mathrm{FWER}}=\frac{1}{200}\sum_{l=1}^{200}\mathbb{1}\{\exists C\in\mathcal R_l:C\cap A=\varnothing\},
Power⁡^(I)=∑l∣Dl(I)∩Rl∣∑l∣Dl(I)∣.\widehat{\operatorname{Power}}(I)=\frac{\sum_l|\mathcal D_l(I)\cap\mathcal R_l|}{\sum_l|\mathcal D_l(I)|}.

Since top-kk selects only single units, we report its power only for I={1}I=\{1\}.

Implementation

At node CC, we use B=max⁡{999,⌈20Ml/(α∣C∣)⌉}B=\max\{999,\lceil20M_l/(\alpha|C|)\rceil\} draws in the pp-value of Appendix A.2, so that about 20 draws fall into the rejection region at the level α∣C∣/Ml\alpha|C|/M_l at which CC is tested (Subsection 2.3). This gives B=999B=999 at the root and 12,800 (activations, Ml=32M_l=32) or 6,400 (CRP, Ml=16M_l=16) at the leaves. The lasso penalty is chosen by cross-validation (λmin⁡\lambda_{\min} of CV⋅glmnet\mathrm{CV}\cdot\texttt{glmnet} [19]), and the residuals are those of least-squares refits on the selected scores.

CRP scores are computed with the code of the application, which uses zennit [20] and its CRP extension [14]. We apply LRP-0 [21, 22], i.e. zennit’s ε\varepsilon-rule with ε=0\varepsilon=0, and sum the relevance of each unit over positions. The stabilizer of zennit’s rule for average pooling scales all relevances by κ=(1/505)/(1/505+10−6)≈0.9995\kappa=(1/505)/(1/505+10^{-6})\approx0.9995, so Rj(X,c)=κ1{j∈Uc}∑tAjt(X)R_j(X,c)=\kappa\mathbb{1}\{j\in U_c\}\sum_t A_{jt}(X). Since the tree and the tests are invariant to rescaling the scores, κ\kappa does not affect the results.

Figure 5. FWER of the hierarchical max GCM and the three baselines for activation scores (top) and CRP scores (bottom) in scenarios D0–D3 (columns), each estimated from 200 replications. Line style and colour indicate the method (legend); within each method, the lighter shade is δ=0\delta= 0 and the darker shade δ=1\delta= 1. For δ=0\delta= 0, all units are null, so top-kk has FWER 1 by construction. The horizontal line marks α=0.05\alpha= 0.05.

Figure 6. Power for δ=1\delta= 1 for activation scores (top) and CRP scores (bottom) in scenarios D0–D3 (columns), each estimated from 200 replications. For the hierarchical max GCM, each curve is the proportion of non-null clusters CC with ∣C∣∈I\lvert C\rvert\in I that are rejected, for I∈{{1},{2},{3,4},{5,…,8},{9,…,16},{17,…,32}}I \in\{\{1\}, \{2\}, \{3,4\}, \{5,\ldots,8\}, \{9,\ldots,16\}, \{17,\ldots,32\}\}. For the three baselines, it is the proportion for single units. Since unused units are removed before testing CRP scores, the CRP trees contain 16 units, and I={17,…,32}I = \{17,\ldots,32\} is shown only for activations.

Detailed results

Figures 5, 6 and 8 show the FWER and the power for all nn and cluster sizes, each estimated from 200 replications. To summarize the conditional attribution maps (Subsection 2.8) of a unit jj over inputs, we align the input windows with the largest relevance in the map of {j}\{j\} and compute the relevance-weighted nucleotide frequencies per position. For the first-layer units of the simulation, these approximate the motif each filter matches. Figure 7 shows the motifs recovered by the conditional attribution maps (Subsection 2.8) in one replication of D0 with n=2000n = 2000, δ=1\delta= 1 and CRP scores (§ 3.2).

Additional tests at each node

In addition to the max GCM from Subsection 2.5, we provide alternative CITs for our setting below. All results in Sections 3 and 4 use the max GCM; we include these tests as alternatives within the same procedure but do not evaluate them here. At a node (C,G)(C, G) of Subsection 2.6, each test is applied to the responses Y~c(G)\widetilde{Y}_c^{(G)}, c∈Gc \in G, and, for CRP scores, to the scores S~(G)\widetilde{S}^{(G)}, with KK replaced by ∣G∣|G|.

Quadratic GCM

Alternatively, the residual products of Subsection 2.5 can be aggregated by WC=nT‾⊤Σ^−1T‾W_C = n\overline{T}^{\top}\widehat{\Sigma}^{-1}\overline{T}, where Σ^\widehat{\Sigma} is the empirical covariance matrix of T1,…,TnT_1,\ldots,T_n, with p-value from the χqC2\chi^2_{q_C} distribution [17]. Since Σ^\widehat{\Sigma} must be invertible, we drop the entries of class KK, so that qC=(K−1)∣C∣q_C = (K - 1)|C|. For activations, WCW_C then does not depend on which class is dropped if the regressions are linear in the response. For CRP scores, the test has no power against violations of equation 2 only in class KK; with a linear network after layer ll, the entries of class KK are linear combinations of the others, and nothing is lost. Inverting Σ^\widehat{\Sigma} is unstable if qCq_C is large relative to nn, which can inflate the type I error.

Wald-type test

Linear model. We restrict to a linear model for the conditional mean of the responses. Writing S~ihC∈R∣C∣\widetilde{S}_{ihC} \in\mathbb{R}^{|C|} for the hh-th row of S~iC\widetilde{S}_{iC}, we assume for c=1,…,K−1c = 1, \ldots, K - 1

Y~ic=β0c+∑h=1HBch,C⊤S~ihC+∑h=1HBch,C‾⊤S~ihC‾+ϵic,(3)\widetilde{Y}_{ic} = \beta_{0c} + \sum_{h=1}^{H} B_{ch,C}^{\top}\widetilde{S}_{ihC} + \sum_{h=1}^{H} B_{ch,\overline{C}}^{\top}\widetilde{S}_{ih\overline{C}} + \epsilon_{ic}, \tag*{(3)}

with ϵi=(ϵi1,…,ϵi,K−1)⊤\epsilon_i = (\epsilon_{i1}, \ldots, \epsilon_{i,K-1})^{\top}, E[ϵi∣S~i]=0\mathbb{E}[\epsilon_i \mid\widetilde{S}_i] = 0 and Cov⁡(ϵi)=Ω∈R(K−1)×(K−1)\operatorname{Cov}(\epsilon_i) = \Omega\in\mathbb{R}^{(K-1)\times(K-1)}. Under H0,CH_{0,C}, the conditional mean of Y~\widetilde{Y} does not depend on S~C\widetilde{S}_C, so all coefficients Bch,CB_{ch,C} of the units in CC vanish, which is the hypothesis we test. The intercepts β0c\beta_{0c} are not attributed to any unit.

Figure 8. Leaf rejection in D2 (left) and pair detection in D3 (right) for δ=1\delta= 1, for activation scores (top) and CRP scores (bottom), each estimated from 200 replications. Left: proportion of replications and units of a group (marker) for which the single unit {j}\{j\} is rejected, or selected by top-kk. Units 1–4 are paired with the shortcuts 17–20, units 9–12 with the shortcuts 21–24, and units 25–28 with 29–32. Rejections of units 17–20 and 25–32 are false, and so are rejections of units 21–24 for activation scores. For CRP scores, units 9–16 and 25–32 are removed before testing. Right: proportion of replications and of the four redundant pairs {j,j+4}\{j, j + 4\}, j=1,…,4j = 1,\ldots,4, for which a rejected cluster lies within the pair, i.e. the pair or one of its units is rejected, or, for top-kk, a unit of the pair is selected.

Activation scores (H=1H = 1). With AiC=S~i1CA_{iC} = \widetilde{S}_{i1C}, the model has class-specific coefficients,

Y~ic=β0c+βc,CTAiC+βc,C‾TAiC‾+εic,\widetilde{Y}_{ic} = \beta_{0c} + \beta_{c,C}^{\mathsf{T}} A_{iC} + \beta_{c,\overline{C}}^{\mathsf{T}} A_{i\overline{C}} + \varepsilon_{ic},

and the null hypothesis considered instead of the null hypothesis in equation (1) is

H0,Clin:β1,C=⋯=βK−1,C=0.H_{0,C}^{\mathrm{lin}} : \beta_{1,C} = \cdots= \beta_{K-1,C} = 0.

CRP scores (H=KH = K). The response of class cc is regressed on the relevance for class cc only, with coefficients common to all classes, i.e. Bch,C=1{h=c} βCB_{ch,C} = \mathbb{1}\{h = c\}\,\beta_C and Bch,C‾=1{h=c} βC‾B_{ch,\overline{C}} = \mathbb{1}\{h = c\}\,\beta_{\overline{C}} in equation (3), so that the sum over hh reduces to the term h=ch = c,

Y~ic=β0c+βCTS~icC+βC‾TS~icC‾+εic,\widetilde{Y}_{ic} = \beta_{0c} + \beta_C^{\mathsf{T}}\widetilde{S}_{icC} + \beta_{\overline{C}}^{\mathsf{T}}\widetilde{S}_{ic\overline{C}} + \varepsilon_{ic},

with considered null hypothesis H0,Clin:βC=0H_{0,C}^{\mathrm{lin}} : \beta_C = 0. For K=2K = 2, both models reduce to a regression of the response contrast on the activations or on the relevance contrasts Rj(X,a)−Rj(X,b)R_j(X,a) - R_j(X,b), respectively.

Estimation and test. We write both models as Y~i=Ziθ+ϵi\widetilde{Y}_i = Z_i\theta+ \epsilon_i, with

Zi=IK−1⊗(1,Ai⊤C‾,Ai⊤C)(activations),Z_i = I_{K-1} \otimes\left(1, A_i^\top\overline{C}, A_i^\top C\right) \quad\text{(activations)},
Zi=[IK−1 S~iC‾[K−1] S~iC[K−1]](CRP),Z_i = \left[I_{K-1}\ \widetilde{S}_{i\overline{C}}^{[K-1]}\ \widetilde{S}_{iC}^{[K-1]}\right] \quad\text{(CRP)},

where S~[K−1]\widetilde{S}^{[K-1]} omits row KK, and write θC\theta_C for the qCq_C coefficients of the units in CC (qC=(K−1)∣C∣q_C = (K-1)|C| for activations, qC=∣C∣q_C = |C| for CRP). We estimate θ\theta by feasible generalized least squares,

θ^=Q−1∑iZi⊤Ω^−1Y~i,Q=∑iZi⊤Ω^−1Zi,\widehat{\theta} = Q^{-1}\sum_i Z_i^\top\widehat{\Omega}^{-1}\widetilde{Y}_i,\qquad Q = \sum_i Z_i^\top\widehat{\Omega}^{-1}Z_i,

where Ω^\widehat{\Omega} is the empirical covariance of pooled least-squares residuals. For activations, this coincides with equation-wise least squares. With the cluster-robust covariance V^=Q−1(∑iZi⊤Ω^−1ϵ^iϵ^i⊤Ω^−1Zi)Q−1\widehat{V} = Q^{-1}\left(\sum_i Z_i^\top\widehat{\Omega}^{-1}\widehat{\epsilon}_i\widehat{\epsilon}_i^\top\widehat{\Omega}^{-1}Z_i\right)Q^{-1}, the Wald statistic WC=θ^C⊤V^CC−1θ^CW_C = \widehat{\theta}_C^\top\widehat{V}_{CC}^{-1}\widehat{\theta}_C is asymptotically χqC2\chi^2_{q_C}-distributed under H0,ClinH_{0,C}^{\mathrm{lin}} and yields the pp-value pCp_C used in Subsection 2.3.

Zebrafish DNA Accessibility Model

Data

We used a published dataset on DNA accessibility [Kim et al., 2024] that profiled by single-cell ATAC-seq across a zebrafish developmental time course spanning six stages (0–30 somites), yielding 94,562 cells. Cells were pseudobulked into 12 embryonic cell types used for model training: Differentiating Neurons, Endoderm, Epidermal, Lateral Mesoderm, Muscle, Neuromesodermal progenitors (NMPs), Neural Anterior, Neural Crest, Neural Posterior, Notochord, Presomitic Mesoderm (PSM), and Somites. An additional Adaxial Cells pseudobulk (390 cells) was excluded for insufficient depth, and an unassigned population was excluded throughout.

We used such cell type abbreviations in figures: Mus, muscle; Som, somites; Noto, notochord; NMPs, neuromesodermal progenitors; PSM, presomitic mesoderm; Endo, endoderm; LM, lateral mesoderm; DN, differentiating neurons; NA/NP, neural anterior/posterior; Epi, epidermal; NC, neural crest.

Consensus accessible regions were called from the pooled Tn5 insertion data, giving 640,834 peaks (median width 576 bp) against the danRer11 zebrafish genome assembly. Fixed-width 512 bp windows were tiled around each peak summit without overlaps, each window was assigned to its nearest summit. This yielded 887,999 labelled windows. For each window and cell type, the regression target is the raw Tn5 insertion count summed over the window, normalized by that cell type’s genome-wide sequencing depth (counts per million) and log⁡(1+x)\log(1+x)-transformed.

Cell-type specificity of each sequence ii was quantified with the τ\tau index [Yanai et al., 2004],

τi=1K−1∑c=1K(1−Y‾i,c),Y‾i,c=Yi,cmax⁡jYi,j,\tau_i = \frac{1}{K-1}\sum_{c=1}^{K}(1-\overline{Y}_{i,c}),\qquad\overline{Y}_{i,c} = \frac{Y_{i,c}}{\max_j Y_{i,j}},

where Yi,cY_{i,c} is the CPM-normalized signal (linear scale) for sequence ii in cell type cc, Y‾i,c\overline{Y}_{i,c} is Yi,cY_{i,c} divided by the maximum signal across cell types for that sequence, j∈{1,…,K}j \in\{1,\ldots,K\} indexes the cell types over which the maximum is taken, and K=12K = 12 is the number of cell types. τi\tau_i ranges from 0 for sequences with equal signal in all cell types to 1 for sequences with signal in a single cell type. Sequences with zero signal in all cell types were excluded.

Sequences were one-hot encoded (A,C,G,T→R4A, C, G, T \to\mathbb{R}^4; ambiguous bases mapped to the zero vector) and extracted from the reference FASTA at training time. During training, each window was reverse-complemented with probability 0.5 (accessibility is strand-agnostic, so the target is unchanged); validation windows were always read on the forward strand. Chromosomes 1–21 and 24–25 were used for training and chromosomes 22–23 for validation, split at the chromosome level to prevent sequence leakage between windows derived from the same genomic region.

For method evaluation, we assembled a reference set of n=18,000n = 18,000 windows restricted to the held-out validation chromosomes (22–23). These chromosomes were not used for gradient updates, but they were used to select the best checkpoint based on validation metrics. Each window ii was assigned to the cell type ci∗=arg⁡max⁡cYi,cc_i^* = \arg\max_c Y_{i,c} with the highest measured target signal. Within each cell type cc, windows with ci∗=cc_i^* = c were ranked by the cell-type specificity index τ\tau (higher = more specific), and the top 1,500 were kept. The union over the K=12K = 12 cell types yields the final set of 18,000 windows. Therefore, the set is class-balanced and enriched for cell-type-specific sequences.

Model Architecture

Sequence-to-activity prediction uses a compact, fully convolutional CNN chosen to stay directly compatible with layer-wise relevance propagation under zennit/CRP: no max-pooling and no flatten+dense readout, since both break clean relevance conservation. The network has five 1-D convolutional blocks over the one-hot input (4×512)(4 \times512), each consisting of a convolution, ReLU, and (except the final block) 2×2\times average pooling:

LayerChannelsKernelPoolλ\lambda
112821×2\times20.0
2645×2\times20.01
3643×2\times20.01
4645×2\times20.01
5325−-0.01

Table 1.

No batch normalization is used (found empirically to distort CRP relevance attribution); an ℓ1\ell_1 penalty (λ=0.01\lambda= 0.01) is instead applied to the post-activation feature maps of layers 2–5 to encourage a sparse code at the depth where combinatorial, cell-type-specific concepts are expected to emerge. The resulting receptive field is 148 bp (29% of the 512 bp input). Global average pooling over the positional axis of the final feature map (32 channels) yields a 32-dimensional vector. A single linear layer maps this vector to 12 outputs, one per cell type. The full model has 95,468 trainable parameters.

Training Procedure

The loss combines three terms on the log1p-transformed targets YY and predictions Y^\hat{Y}, each window-and-cell-type vector of length 12:

L=wmseMSE⁡(Y^,Y)+wcos(1−cos⁡(Y^,Y))+wspecMSE⁡(Y^c,Yc),\mathcal{L} = w_{\mathrm{mse}} \operatorname{MSE}(\hat{Y},Y) + w_{\mathrm{cos}}(1-\cos(\hat{Y},Y)) \\ + w_{\mathrm{spec}} \operatorname{MSE}(\hat{Y}_{c},Y_{c}),

where Y^c,Yc\hat{Y}_{c},Y_{c} are each window’s prediction/target after subtracting its own cross-cell-type mean. The MSE term rewards correct absolute accessibility magnitude, the cosine term rewards correct relative shape of the 12-cell-type profile, and the centered-MSE term isolates the cell-type-specificity residual directly, since the first two terms are dominated by the ∼94%\sim94\% of signal shared across cell types (mean-predictor Pearson r=0.94r = 0.94, specificity r≈0r \approx0). Entries with y<1y < 1 (log1p scale; accessibility near the detection floor) receive 2×2\times the squared-error weight in the MSE term, since such entries are rare but otherwise contribute negligible gradient.

Training used a two-stage curriculum, both stages with the same low-target upweighting (y<1⇒2×y < 1 \Rightarrow2\times squared-error weight) and reverse-complement augmentation described above. (1) Pretraining on all 887,999 windows regardless of specificity with the MSE term weighted most heavily (wmse=10w_{\mathrm{mse}} = 10, wcos=1w_{\mathrm{cos}} = 1, wspec=1w_{\mathrm{spec}} = 1) so the model first learns overall accessibility, using AdamW with lr =10−3= 10^{-3} and effectively no weight decay (10−2010^{-20}). (2) Fine-tuning of the full network initialized from the stage-1 checkpoint (no layers frozen) on the 419,572 windows with the high specificity (τ>0.52\tau> 0.52), with the loss re-weighted toward shape and specificity (wmse=0.5w_{\mathrm{mse}} = 0.5, wcos=10w_{\mathrm{cos}} = 10, wspec=5w_{\mathrm{spec}} = 5) using AdamW with lr =3×10−3= 3 \times10^{-3} and weight decay 10−410^{-4}. Both stages used cosine-annealing learning-rate decay and batch size 256.

On the held-out validation chromosomes (22–23, 26,174 windows), the fine-tuned model reaches a mean per-cell-type Pearson correlation of 0.62 and a mean cell-type-specificity Pearson correlation (computed on cell-type-centered predictions/targets) of 0.55 — exceeding a kk-mer-count ridge-regression baseline (r=0.44r = 0.44 raw, r=0.25r = 0.25 specificity) on both axes.

Concept relevance propagation and conditional attribution maps

Relevance propagation. We explained the trained CNN with Concept Relevance Propagation (CRP) [Achitab et al., 2023], using zennit v0.4.6 and zennit-crp v0.6.0. CRP extends layer-wise relevance propagation (LRP) by restricting the backward pass to a chosen subset of channels (“concepts”) of an intermediate layer, which yields relevance maps conditional on those concepts. Each convolutional filter (unit) is treated as one concept: the channel axis of each Conv1d output is the concept axis, and relevance is summed over positions when a scalar per unit is needed.

The first convolutional layer, which acts on the one-hot input, used the Flat rule. All subsequent convolutional layers and the linear head used LRP-0 (ε=0\varepsilon= 0), which is fully conservative and has no free hyperparameter. All attributions were computed with the model in evaluation mode.

Class–unit relevance. For a cell type cc, relevance was initialised at the corresponding output fc(X)f_c(X) and propagated back to the output of convolutional layer ll. For a window XX, this gives the relevance of unit uu,

Ru←c(l)(X)=∑tru,t(l)(X),R^{(l)}_{u\leftarrow c}(X) = \sum_t r^{(l)}_{u,t}(X),

where tt indexes positions. Relevances are signed: positive values mean that unit uu pushes the prediction for cell type cc up, negative values that it pushes it down.

Conditional attribution maps. To obtain base-resolution maps for an individual unit, we used CRP conditioning: for window XX, layer ll and unit uu, all other channels of layer ll were masked during the backward pass, so that relevance reaches the input only through unit uu. With relevance seeded at the output for cell type cc, the resulting class-conditional map shows which bases feed unit uu on its way to cell type cc. Computing such maps for every cc on a shared set of windows allows the same unit to be compared across cell types. Where a map should describe what a unit detects irrespective of cell type, we instead seeded relevance at the raw activation of unit uu (an activation-seeded map), so that nothing downstream of the unit enters the map. The motif analysis uses class-conditional maps. Because the input is one-hot, we take the relevance on the observed nucleotide at each position as the per-base contribution and set it to zero on the other three nucleotides.

Assigning TF motifs to units

The class-tree test selects units that are specific to a cell type, but it does not say what a unit encodes. We assign motifs to each selected (unit, cell type) pair (u,c)(u,c), called a pair below, in four steps (Figure 9). A cell type is assigned to a unit only if it lies within one of the unit’s narrowest rejected nodes of the cell-type tree; a rejection of the root node alone is not used. A unit assigned to several cell types is analysed once per cell type, and each analysis is independent.

Figure 9. Motif to unit matching pipeline.

1. Window pool. For a pair (u,c)(u,c), we start from the reference windows with dominant cell type cc (Appendix § 11). We rank them by the signed CRP relevance Ru←c(l)(X)R^{(l)}_{u\leftarrow c}(X) of unit uu for cell type cc and keep the top 500.

2. Conditional attribution. For each kept window, we compute the class-conditional map of unit uu for cell type cc (Appendix § 11.§ 4). This gives one attribution map of shape 4×5124 \times512 (nucleotide ×\times position) per window. It applies to all layers, so units in deeper layers are also described through their effect on the input sequence.

3. Pattern discovery. We run TF-MoDISco-lite v2.4.0 [15] on the one-hot sequences and the per-base contributions of each pair. It extracts seqlets (window 15 bp, flank 5 bp) from the attributions, clusters them, and reports consolidated patterns (FDR 0.05). Each pattern is a contribution weight matrix (CWM) with a seqlet count, reported separately for positive and negative attribution. We cap the number of seqlets per metacluster at 20,000. For display, a CWM is trimmed to the positions whose summed absolute contribution is at least 30% of the maximum, plus 4 bp of padding on each side. This is the “learned pattern” in Figure 4b.

4. Motif matching. We match each pattern to the JASPAR CORE vertebrate 2025 collection; 1,019 motifs) with the TOMTOM-lite matcher implemented in TF-MoDISco-lite, which ranks database motifs by Euclidean distance between position-weight matrices. A match with lowest p-value is reported.

References

  1. [1]Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, and Rory Sayres. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). 2017. doi:10.48550/ARXIV.1711.11279. URL https://arxiv.org/abs/1711.11279.
  2. [2]Amirata Ghorbani, James Wexler, James Zou, and Been Kim. Towards automatic concept-based explanations, 2019. URL https://arxiv.org/abs/1902.03129.
  3. [3]Thomas Fel, Agustin Picard, Louis Bethune, Thibaut Boissin, David Vigouroux, Julien Colin, Rémi Cadène, and Thomas Serre. Craft: Concept recursive activation factorization for explainability. 2022. doi:10.48550/ARXIV.2211.10154. URL https://arxiv.org/abs/2211.10154.
  4. [4]Kirill Bykov, Laura Kopf, Shinichi Nakajima, Marius Kloft, and Marina Höhne. Labeling neural representations with inverse recognition. Advances in Neural Information Processing Systems, 36:24804–24828, 2023.arxiv.org/abs/2311.13594
  5. [5]Jacopo Teneggi and Jeremias Sulam. Testing semantic importance via betting. Advances in Neural Information Processing Systems, 37:76450–76499, 2024.DOI
  6. [6]Nicolai Meinshausen. Hierarchical testing of variable importance. Biometrika, 95(2):265–278, 2008.DOI
  7. [7]Jacopo Mandozzi and Peter Bühlmann. Hierarchical testing in the high-dimensional setting with correlated variables. Journal of the American Statistical Association, 111(513):331–343, 2016.
  8. [8]Jelle J Goeman and Aldo Solari. The sequential rejection principle of familywise error control. The Annals of Statistics, pages 3782–3810, 2010.DOI
  9. [9]Joseph Paillard, Antoine Collas, Denis A Engemann, and Bertrand Thirion. Hierarchical variable importance with statistical control for medical data-based prediction. In International Conference on Information Processing in Medical Imaging, pages 79–93. Springer, 2025.DOI
  10. [10]R. Shah and J. Peters. The hardness of conditional independence testing and the generalised covariance measure. The Annals of Statistics, 48(3):1514–1538, 2020.
  11. [11]Marco Simnacher, Xiangnan Xu, Hani Park, Christoph Lippert, and Sonja Greven. Deep nonparametric conditional independence tests for images. Journal of Machine Learning Research, 27(96):1–73, 2026a.
  12. [13]Chandan Singh, W. James Murdoch, and Bin Yu. Hierarchical interpretations for neural network predictions. In International Conference on Learning Representations (ICLR), 2019. URL https://openreview.net/forum?id=SkEqrO0CtQ.arxiv.org/abs/1806.05337
  13. [14]Reduan Achibat, Maximilian Dreyer, Ilona Eisenbraun, Sebastian Bosse, Thomas Wiegand, Wojciech Samek, and Sebastian Lapuschkin. From attribution maps to human-understandable explanations through concept relevance propagation. Nature Machine Intelligence, 5(9):1006–1019, 2023. ISSN 2522-5839. doi:10.1038/s42256-023-00711-8. URL http://dx.doi.org/10.1038/s42256-023-00711-8.
  14. [15]Avanti Shrikumar, Katherine Tian, Ziga Avsec, Anna Scherbina, Abhimanyu Banerjee, Mahfuza Sharmin, Surag Nair, and Anshul Kundaje. Technical note on transcription factor motif discovery from importance scores (tf-modisco) version 0.5.6.5, 2018. URL https://arxiv.org/abs/1811.00416.
  15. [16]Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A. Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673, 2020.DOI
  16. [17]Lucas Kook and Anton Rask Lundborg. Algorithm-Agnostic Significance Testing in Supervised Learning With Multimodal Data. Briefings in Bioinformatics, 25(6), 2024. doi:10.1093/bib/bbae475.DOI
  17. [18]Damla Ovek Baydar, Ieva Rauluskeviciute, Dina R Aronsen, Romain Blanc-Mathieu, Ine Bonthuis, Herman de Beukelaer, Katalin Ferenc, Alice Jegou, Vipin Kumar, Roza Berhanu Lemma, Jérémy Lucas, Mathis Pochon, Chang M Yun, Vivekanandan Ramalingam, Salil Sanjay Deshpande, Aman Patel, Georgi K Marinov, Austin T Wang, Alejandro Aguirre, Jaime A Castro-Mondragon, Damir Baranasic, Jeanne Chéneby, Sveinung Gundersen, Morten Johansen, Aziz Khan, Marieke L Kuijjer, Eivind Hovig, Boris Lenhard, Albin Sandelin, Klaas Vandepeole, Wyeth W Wasserman, François Parcy, Anshul Kundaje, and Anthony Mathelier. Jaspar 2026: expansion of transcription factor binding profiles and integration of deep learning models. Nucleic Acids Research, 54(D1):D184–D193, December 2025. ISSN 1362-4962. doi:10.1093/nar/gkaf1209. URL http://dx.doi.org/10.1093/nar/gkaf1209.
  18. [19]Jerome Friedman, Trevor Hastie, and Robert Tibshirani. Regularization paths for generalized linear models via coordinate descent. Journal of Statistical Software, 33(1):1–22, 2010. doi:10.18637/jss.v033.i01.DOI
  19. [20]Christopher J Anders, David Neumann, Wojciech Samek, Klaus-Robert Müller, and Sebastian Lapuschkin. Software for dataset-wide xai: from local explanations to global insights with zennit, corelay, and virelay. PloS one, 21(1):e0336683, 2026.DOI
  20. [21]Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015.DOI
  21. [22]Grégoire Montavon, Alexander Binder, Sebastian Lapuschkin, Wojciech Samek, and Klaus-Robert Müller. Layer-wise relevance propagation: an overview. Explainable AI: interpreting, explaining and visualizing deep learning, pages 193–209, 2019.DOI

Paper details

vlnc:W_wq8xv7t8
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 11

downloads · 1

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents