A principled way to tell cause from effect is to ask which direction makes the data easier to compress. If $X$ causes $Y$, describing $X$ first and then the mechanism that turns $X$ into $Y$ should take fewer bits than the reverse. This idea is called minimum description length (MDL) causal inference. One clean version scores a candidate causal graph by its prequential code length. Prequential means "predict, then learn": the model sees the samples one at a time, predicts each new sample from the earlier ones, and pays $-\log p$ for that prediction before updating. Graphs with the wrong parents predict badly when data is scarce, so the score has a built-in Occam's razor and needs no sparsity knob. The obstacle is cost. Computing this score properly with neural networks means retraining after every sample. The best neural attempt therefore used coarse retraining blocks and binned continuous variables into histograms, and it stopped at 11-variable graphs.
This note proposes computing that score with a linear-attention layer instead. Linear attention is a Transformer attention variant whose cost grows linearly with sequence length, because it can be run as a recurrence that updates a fixed-size matrix memory, or "fast weights," one token at a time. The central observation is that a particular fast-weight update, a Sherman–Morrison rank-one write paired with a precision matrix, is exactly sequential Bayesian linear regression. Its per-token losses are therefore an exact, continuous-valued prequential code, with no binning, no blocks, and no gradient steps at scoring time. A frozen "slow" network, meta-trained only to compress generic regression streams, supplies the features the fast weights regress on. Scoring a candidate parent set then costs one linear-attention pass, $O(nd^2)$ for $n$ samples and feature width $d$. That makes MDL-based order search affordable at the hundreds-of-nodes scale where TOPIC currently operates.
Core Claim
Prequential MDL causal scoring can be made exact per sample and continuous by using a fast-weight recurrence whose write rule is the Bayesian posterior update. Learning the feature map that feeds this recurrence, by meta-training on compression of synthetic mechanisms with no causal labels, should give shorter and more discriminative codes than fixed random features at small sample sizes. In particular, it should give larger gaps between the true and reversed direction. The second clause is the falsifiable part of the novelty. The first clause is close to an engineering identity, but nobody has exploited it for causal discovery.
Where This Sits
The proposal builds most directly on prequential MDL for causal structure learning. That work scores DAGs by cumulative one-step-ahead log-loss with neural conditionals and reports SHD 16 on Sachs against 22 for NOTEARS. It approximates the online code with expanding training blocks and discretizes continuous data, and the authors flag continuous calibration as future work. We keep its score and replace its estimator.
The companion paper on sequential neural training for prequential MDL plays a constraining role. It shows that continual gradient updating loses plasticity, so that at large compute, retraining from scratch compresses better. Our design avoids this tension rather than studying it: at scoring time no slow weights change, and the fast-weight posterior update is exact, so there is nothing to lose plasticity.
The mechanism comes from the linear-attention literature. Irie et al. establish that causal linear attention is a fast weight programmer: a slow network writes outer products into a matrix memory. They also show that additive writes cannot reset memory, while delta-rule writes can. Our Bayesian write is a preconditioned delta rule, and a forgetting factor on it gives the reset behaviour needed under regime shifts. BASED contributes a negative result and a hardware lesson. The negative result is that pure linear states have recall bounded by state size. We do not need associative recall: a sufficient statistic for a regression posterior has fixed size by construction. The hardware lesson is that recurrences must be fused IO-aware kernels to be fast, and we reuse that design so that thousands of candidate parent sets are scored in parallel.
On the MDL side, SLOPE and COMIC define the bivariate bar. SLOPE uses hand-chosen function classes with Gaussian residual codes. COMIC uses a variational Bayesian neural network whose non-convex ELBO can trap code-length comparisons in local optima; our posterior is closed-form given features. TOPIC supplies the search procedure: MDL-guided topological ordering with cubic-spline scores. We swap in our scorer unchanged. CASCADE and SPACETIME motivate the temporal extension, since both handle event or non-stationary data with MDL but rely on bespoke model classes. Transformer-based temporal discovery methods, namely CausalFormer, CUTS / CUTS+, and the supervised Transformer approach, use attention as a predictor plus attribution, sparsity penalties, or causal labels. None of them computes a description length, and the last requires interventional ground truth that we never use.
Research Program
The scorer works as follows. For a node $j$ with candidate parents $P$, a frozen slow network maps each sample's parent values to keys $\phi_t \in \mathbb{R}^d$. The fast state holds a weight vector $w_t$ and an inverse-precision matrix $A_t^{-1}$. Each sample is first predicted and then written:
$$L_j(P) = \sum_{t=1}^{n} -\log \mathrm{St}\big(x_{tj};\ w_{t-1}^\top \phi_t,\ s_{t-1}^2(1+\phi_t^\top A_{t-1}^{-1}\phi_t),\ \nu_{t-1}\big),$$
$$A_t^{-1} = A_{t-1}^{-1} - \frac{A_{t-1}^{-1}\phi_t\phi_t^\top A_{t-1}^{-1}}{1+\phi_t^\top A_{t-1}^{-1}\phi_t}, \qquad w_t = w_{t-1} + A_t^{-1}\phi_t\,(x_{tj} - w_{t-1}^\top \phi_t).$$
Here $\mathrm{St}$ is the Student-t predictive that arises from a normal-inverse-gamma prior, which accounts for the unknown noise scale. Its scale $s_t^2$ and degrees of freedom $\nu_t$ are updated by running sums of squared residuals and counts. The second line is a delta-rule write with a learned-free, exactly Bayesian step size. The graph score is $\sum_j L_j(P_j)$, including the marginal code for root nodes, for which $P=\emptyset$ and the keys are a learned constant-input density basis. Because the posterior is exact, $L_j$ is a genuine code length, the log marginal likelihood. Its only ordering dependence comes from the features. We average over $k$ random sample orders for i.i.d. data and keep the natural order for time series.
For heteroscedastic, location–scale mechanisms, we add a second fast-weight regression on log squared residuals. This step is no longer exactly Bayesian, so it is reported as an ablation rather than a core claim.
The slow network is meta-trained on compression only. It sees streams of (input, output) pairs drawn from a broad prior over mechanisms: random MLPs, splines, sinusoids, products, and multiplicative noise, with varied input dimension. Its loss is the prequential code length above, backpropagated through the recurrence. No causal labels are used, and the network never sees which variable generated which. The real concern is that the learned prior could make reversed conditionals look as simple as forward ones, or alternatively bake in a direction bias. We test this directly with a variant meta-trained on symmetrized data that includes anticausal conditionals of the same synthetic pairs. If identification depends on excluding those conditionals, we report that the method inherits an assumption on the mechanism class, which is exactly what SLOPE's function class encodes, and we quantify it.
For search, the scorer is plugged into TOPIC's select / add / prune loop. All candidate parent sets for a node at one step are batched as independent recurrences inside one fused kernel. For time series, keys include lagged parents, and the write includes a forgetting factor $\gamma$, chosen by minimizing code length itself. This lets the posterior discard a pre-changepoint mechanism, which is the delta-rule reset property that Irie et al. show additive linear attention lacks.
Baselines
The naive reference is a "do nothing" coder: each variable is encoded with its own marginal under the same Student-t machinery. Any edge must beat this code to be accepted. On the Tübingen pairs the naive reference is a coin flip.
The strongest bivariate competitor is SLOPE, which reports 82.4% accuracy on Tübingen and 100% on its 32 most confident pairs (Marx et al.). COMIC reports roughly 0.80 average accuracy and about 0.84 bidirectional AUROC (Tran et al.), and ranked second only to a costly GPLVM across 12 synthetic suites. We run both with their published settings on identical pair sets and weighting. Beating them means accuracy above 82.4% with weighted pairs, or matching it while also winning on COMIC's location–scale and non-separable suites, where SLOPE's Gaussian residual code is mis-specified.
For graphs, the strongest MDL baseline on small real networks is block-wise prequential MDL, which reports Sachs SHD 16 versus 22 for NOTEARS and 19 for DAG-GNN (Bornschein et al.). We rerun it with its original binning and split points, and also with a matched GPU-hour budget equal to ours, so any gain is not just compute. Beating it means SHD below 16 on Sachs, together with a measured wall-clock speedup at fixed graph size. At scale the baseline is TOPIC with cubic splines, which reports F1 0.5 on 500-node REGED within 48 hours (Xu et al.). We use the same search code and change only the score. Success means F1 above 0.5 within the same 48-hour budget, or equal F1 in a fraction of the time.
The ablation that isolates the key ingredient is the same recurrence with frozen random Fourier features in place of the meta-trained slow network, with feature width and bandwidth tuned on the same synthetic validation suites. A second ablation removes the exact Bayesian write and substitutes plain additive linear attention trained by gradient descent online. This separates "linear attention as a fast density estimator" from "linear attention as an exact posterior." On time series we compare against SPACETIME and CUTS under its stated settings. CUTS reports AUROC 0.9705 on Lorenz-96 with 60% random missingness (CUTS); we report this only as context, since our scorer does not impute. For fully observed Lorenz-96 there is no reported result found on Lacuna, so we run CUTS ourselves.
Why not just…?
Why not just use SLOPE or an additive-noise model? For bivariate pairs this is the bar to clear, and we may lose to SLOPE on Tübingen. SLOPE's function class is hand-picked and its residual code is Gaussian, and it does not extend to multivariate parent sets or lagged dynamics. Our claim rests on the 12 synthetic suites, especially location–scale and non-separable mechanisms, and on graph-level benchmarks. If we only tie SLOPE on pairs, that is acceptable. If we also fail to beat it on non-Gaussian synthetic suites, the learned-feature claim is wrong.
Why not just do Bayesian linear regression on fixed random features? This is the most serious threat, because it already yields an exact closed-form prequential code at the same $O(nd^2)$ cost. In fact our recurrence is that method once the features are fixed. We therefore made it the central ablation rather than arguing around it. The proposal's value beyond an efficient exact scorer is entirely the claim that meta-learned features shorten codes and widen the forward/backward gap at small $n$, where Bornschein et al. argue the prequential score does its discriminating work. We will plot code-length gap against sample size for both feature maps. If the curves coincide, we report the scorer with random features as the contribution and drop the meta-learning.
Why not just run a softmax Transformer in context, TabPFN-style, with FlashAttention-2? Softmax attention is more expressive. However, its per-step predictions are not a coherent sequential posterior, so the summed losses are not guaranteed to be a valid code. Its cost also grows quadratically, and it needs a growing key–value cache. BASED reports 24x higher generation throughput than FlashAttention-2 for linear attention (Arora et al.). We include a meta-trained softmax in-context predictor as an extra arm on bivariate and Sachs data, matched in parameters. This shows whether expressiveness buys accuracy that offsets its cost and its non-code status.
Why not just use NOTEARS, Granger tests, or CUTS? These methods need a tuned sparsity penalty and, for Granger-style methods, a time lag. On Sachs, NOTEARS reaches SHD 22 against prequential MDL's 16 (Bornschein et al.). Lag-based methods cannot orient instantaneous effects, whereas our i.i.d. score can. We run them, but they are not the question this proposal answers.
Proposed Experiments
The first decisive check is exactness. On small synthetic streams, the fast-weight code length must match a reference implementation that computes the log marginal likelihood by batch inversion, to numerical precision. Its runtime must scale linearly in $n$, with a measured crossover against block-wise retraining.
The second check is identification. We run the 12 bivariate synthetic suites and Tübingen. We report accuracy and bidirectional AUROC, plus the forward-minus-reverse code gap in bits as a function of $n$, for learned versus random features and for the symmetrized meta-training control.
The third check is graph recovery. We measure SHD on Sachs and on Bornschein's 3- and 5-node chains and potpourri set, where they report 80% Markov equivalence class recovery and SHD 1.9. We then measure F1 and wall-clock time on REGED inside TOPIC, against the spline score.
The fourth check concerns regime shifts. We use synthetic multivariate time series in which mechanisms switch at hidden changepoints, plus the river discharge and FLUXNET data used by SPACETIME. We measure edge F1 and code length with and without the forgetting factor, and against SPACETIME. The prediction from Irie et al.'s reset results is that the forgetting variant recovers post-shift edges that the non-forgetting variant misses.
The proposal fails cleanly if exact codes with learned features neither beat random features on the code gap nor beat block-wise prequential MDL on Sachs at matched compute.
References
- Prequential MDL for Causal Structure Learning with Neural Networks
- Sequential Learning of Neural Networks for Prequential MDL
- Practical Computational Power of Linear Transformers and Their Recurrent and Self-Referential Extensions
- Simple linear attention language models balance the recall-throughput tradeoff
- Telling Cause from Effect Using MDL-Based Local and Global Regression
- Identifying Causal Direction via Variational Bayesian Compression
- Information-Theoretic Causal Discovery in Topological Order
- Causal Discovery from Event Sequences by Local Cause-Effect Attribution
- SPACETIME: Causal Discovery from Non-Stationary Time Series
- CausalFormer: An Interpretable Transformer for Temporal Causal Discovery
- CUTS: Neural Causal Discovery from Irregular Time-Series Data
- CUTS+: High-Dimensional Causal Discovery from Irregular Time-Series
- Learning domain-specific causal discovery from time series