  Machine learning (ML) is playing an increasingly important role in scientific
research. In conjunction with classical statistical approaches, ML-assisted
analytical strategies have shown great promise in accelerating research
findings. This has also opened up a whole new field of methodological research
focusing on integrative approaches that leverage both ML and statistics to
tackle data science challenges. One type of study that has quickly gained
popularity employs ML to predict unobserved outcomes in massive samples and
then uses the predicted outcomes in downstream statistical inference. However,
existing methods designed to ensure the validity of this type of
post-prediction inference are limited to very basic tasks such as linear
regression analysis. This is because any extension of these approaches to new,
more sophisticated statistical tasks requires task-specific algebraic
derivations and software implementations, which ignores the massive library of
existing software tools already developed for complex inference tasks and
severely constrains the scope of post-prediction inference in real
applications. To address this challenge, we propose a novel statistical
framework for task-agnostic ML-assisted inference. It provides a
post-prediction inference solution that can be easily plugged into almost any
established data analysis routine. It delivers valid and efficient inference
that is robust to arbitrary choices of ML models, while allowing nearly all
existing analytical frameworks to be incorporated into the analysis of
ML-predicted outcomes. Through extensive experiments, we showcase the validity,
versatility, and superiority of our method compared to existing approaches.
