Polymer membranes perform innumerable separations with far-reaching environmental implications. Despite decades of research on membrane technologies, design of new membrane materials remains a largely Edisonian process. To address this shortcoming, we demonstrate a generalizable, accurate machine-learning (ML) implementation for the discovery of innovative polymers with ideal separation performance. Specifically, multitask ML models are trained on available experimental data to link polymer chemistry to gas permeabilities of He, H2, O2, N2, CO2, and CH4. We interpret the ML models and extract chemical heuristics for membrane design, through Shapley Additive exPlanations (SHAP) analysis. We then screen over nine million hypothetical polymers through our models and identify thousands of candidates that lie well above current performance upper bounds. Notably, we discover hundreds of never-before-seen ultrapermeable polymer membranes with O2 and CO2 permeability greater than 104 and 105 Barrer, respectively, orders of magnitude higher than currently available polymeric membranes. These hypothetical polymers are capable of overcoming undesirable trade-off relationship between permeability and selectivity, thus significantly expanding the currently limited library of polymer membranes for highly efficient gas separations. High-fidelity molecular dynamics simulations confirm the ML-predicted gas permeabilities of the promising candidates, which suggests that many can be translated to reality.