Publication
FastRerandomize in SoftwareX (2026)
FastRerandomize pairs accelerated hardware with a minimal software interface, making rigorous rerandomization feasible for large-scale experiments without extra complexity.
The paper documents three advances: accelerated balance checks, key-only storage, and design-respecting inference. The package uses a two-layer design: an R front-end for ergonomics and a JAX/XLA backend for batched kernels on CPU, GPU, or TPU.
Access the full manuscript on arXiv; the formal SoftwareX citation is listed below for reference.
What is rerandomization?
Rerandomization is a design-stage procedure: repeatedly draw treatment assignments and keep only those that meet a pre-specified covariate-balance rule.
For example, one rule accepts an assignment when the distance, M, between treatment and control covariate means is below a cutoff, a: accept if M ≤ a.
The acceptance probability q is the fraction of random assignments that would pass this rule; smaller q means more stringent balance.
Design-aware inference
Design changes the randomization distribution, so inference must match the design.
- Design: choose covariates + a balance rule (e.g., M ≤ a, equivalently q).
- Generate: draw many candidate assignments and keep the accepted set.
- Infer: randomization tests must resample from the accepted set, not from all possible assignments.
Features
FastRerandomize is designed for clarity and speed across experimental scales.
Sharper balance, better precision
Keep only assignments passing a balance threshold (M ≤ a), improving precision when covariates predict outcomes. The stronger the covariate–outcome relationship (higher R²), the larger the precision gain.
Practical at modern scale
Handles large samples and high-dimensional covariates so rerandomization remains usable in real-world, data-rich experiments.
Accelerated balance checks
Evaluate balance for large batches efficiently (CPU/GPU/TPU) via batched, auto-vectorized kernels with just-in-time compilation. This makes stringent q (very selective acceptance) feasible even at large scale.
Technical detailsKey-only storage
Store compact PRNG keys and regenerate full assignments on demand—dramatically reducing memory requirements. This allows massive accepted pools without memory blowups.
Performance
CPU vs GPU scaling
Benchmark results from the FastRerandomize paper, highlighting accelerated performance as sample sizes grow.
In a representative benchmark (n = 100, d = 100, 2×105 draws), the GPU backend completes pool generation in about 5 s versus about 112 s for a baseline R workflow (about 24x faster). At n = 1000 and d = 1000, GPU time drops from about 91 s (CPU) to about 7 s (GPU), a ~96% reduction, and peak speedups reach ~42x in high-dimensional, stringent settings.
Minimal API example
Acceptance probability q sets stringency (how selective the acceptance rule is; lower q is more stringent). Holding q fixed, drawing more candidates does not change expected balance (the rule hasn't changed). It mainly (i) increases the size of the accepted pool used for design-respecting inference and (ii) yields finer p-value resolution because randomization-test p-values are discrete when based on a finite accepted set.
At q = 1%, 105 draws yields about 1,000 accepted assignments (min p about 0.0010), while
2×105 draws yields
about 2,000 accepted (min p about 0.0005). Use diagnose_rerandomization() to choose q based
on n, d, R², σ, and a target effect size.
Citation
How to cite FastRerandomize
Connor T. Jerzak, Rebecca Goldstein, Aniket Kamat, and Fucheng Warren Zhu. FastRerandomize: An R Package for Fast Rerandomization Using Accelerated Computing. SoftwareX, 2026. Also available on arXiv.
@article{jerzak2025fastrerandomize,
title={FastRerandomize: An R Package for Fast Rerandomization Using Accelerated Computing},
author={Jerzak, Connor T. and Rebecca Goldstein and Aniket Kamat and Fucheng Warren Zhu},
journal={SoftwareX},
year={2026}
}
Try fastrerandomize:
This interactive capsule reproduces the paper's workflow and performance comparisons in a browser-friendly environment. It mirrors the same accelerated backend used in the package.