Automatic Statistical Test for Rationally Expressible Algorithms by Selective Inference, with Applications to Feature Selection

Teruyuki Katsuoka, Tomohiro Shiraishi, Shuichi Nishino, Ichiro TakeuchiarXiv 2026

TL;DR

AutoSI is a new framework that automates selective inference, allowing researchers to compute statistically valid $p$-values for data-driven hypotheses without manual mathematical derivations. By tracking primitive array operations as rational functions, it expands exact selective inference from simple linear constraints to complex algorithms like cross-validated Lasso.

What Problem Does This Paper Address?

In modern data science, it is common practice to use the same dataset both to discover a pattern (e.g., selecting the most important features via an algorithm) and to test its statistical significance. This practice, known as "double dipping," severely biases statistical tests, leading to an inflation of false positives (Type I errors).

Selective Inference (SI) solves this by conditioning the statistical test on the "selection event"—the exact set of datasets that would cause the algorithm to make the same choice. However, implementing SI has traditionally been a bottleneck: it required human experts to manually derive the selection event for every single algorithm. Furthermore, existing exact methods were strictly limited to simple algorithms that produce linear or quadratic inequalities. More realistic workflows, like tuning a model using cross-validation, remained entirely out of reach.

Methods

The authors introduce AutoSI, a framework that automatically constructs selection events directly from ordinary, NumPy-like code.

Instead of manipulating raw numbers, AutoSI represents every array element as a rational function (a ratio of two polynomials) of a single scalar parameter, $z$, which represents the line along which the dataset is varied. As the user's algorithm runs, AutoSI tracks every data-dependent decision—such as comparisons (>), absolute values (abs), maximums (argmax), or sorting (argsort).

Each decision is automatically converted into a polynomial inequality. AutoSI then uses numerical root-finding (specifically, computing the real eigenvalues of a companion matrix) and parametric programming to sweep across the data space. This allows it to map out the exact "truncation region" where the algorithm's output remains unchanged, which is then used to compute a valid, post-selection $p$-value via a truncated normal distribution.

Overview of the AutoSI framework turning ordinary code into a valid selective p-value

Datasets

The framework was evaluated using both synthetic and real-world data:

  • Synthetic Data: Generated from a linear model ($y = X\beta + \epsilon$) with $d = 20$ features and sample sizes $n \in \{100, 200, 300, 400\}$, tested under both independent and highly correlated covariate structures.
  • Real-World Data: Seven regression benchmarks from the UCI Machine Learning Repository: Airfoil, Concrete, Energy (heating), Energy (cooling), Real estate, Wine (red), and Wine (white).

Key Insights and Ideas

  • Granularity Shift: Previous automation attempts tried to build SI rules for macro-components (like an entire imputation or feature selection module). AutoSI operates at the level of primitive operations (addition, multiplication, comparison), removing the need for any hand-derived macro rules.
  • Breaking the Quadratic Barrier: By embracing rational functions, AutoSI can handle polynomial inequalities of arbitrary degrees. For example, a Lasso tuned by a 3-fold cross-validated $R^2$ score induces degree-12 polynomial inequalities, which AutoSI resolves easily via standard root-finding.

Key Results

  • Exact Error Control: Across all synthetic experiments (marginal screening, standard Lasso, and cross-validated Lasso), AutoSI successfully controlled the Type I error rate exactly at the nominal $\alpha = 0.05$ level.
  • High Statistical Power: Traditional workarounds like the Bonferroni correction proved to be overly conservative, yielding very low power. Data splitting controlled errors under independent data but failed entirely when features were correlated. AutoSI consistently maintained the highest statistical power among all valid methods.
  • Real-World Utility: On the UCI datasets, AutoSI achieved the highest rejection rates for the cross-validated Lasso, demonstrating its superior ability to detect genuine data-feature associations in practice.

Limitations and Future Work

The primary limitation of AutoSI is its computational cost. Because multiplication adds the degrees of polynomials, the complexity of the selection event grows with the depth and complexity of the algorithm. For highly complex iterative algorithms, this degree growth can significantly slow down the root-finding process.

The authors note that future work will focus on optimizing this computational aspect and extending the framework to cover other previously unreachable selection algorithms.

Summary updated

BibTeX
@misc{katsuoka2026automatic,
  author = {Teruyuki Katsuoka and Tomohiro Shiraishi and Shuichi Nishino and Ichiro Takeuchi},
  title = {{Automatic Statistical Test for Rationally Expressible Algorithms by Selective Inference, with Applications to Feature Selection}},
  year = {2026},
  eprint = {2608.04667},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.04667},
}
Figure