AbstractThis paper describes the development of U-net++ models, a type of neural network that performs deep learning, to emulate the shortwave Rapid Radiative-transfer Model (RRTM). The goal is to emulate the RRTM accurately in a small fraction of the computing time, creating a U-net++ that could be used as a parameterization in numerical weather prediction (NWP). Target variables are surface downwelling flux, top-of-atmosphere upwelling flux (), net flux, and a profile of radiative-heating rates. We have devised several ways to make the U-net++ models knowledge-guided, recently identified as a key priority in machine learning (ML) applications to the geosciences. We conduct two experiments to find the best U-net++ configurations. In Experiment 1, we train on non-tropical sites and test on tropical sites, to assess extreme spatial generalization. In Experiment 2, we train on sites from all regions and test on different sites from all regions, with the goal of creating the best possible model for use in NWP. The selected model from Experiment 1 shows impressive skill on the tropical testing sites, except four notable deficiencies: large bias and error for heating rate in the upper stratosphere, unreliable for profiles with single-layer liquid cloud, large heating-rate bias in the mid-troposphere for profiles with multi-layer liquid cloud, and negative bias at lowzenith angles for all flux components and tropospheric heating rates. The selected model from Experiment 2 corrects all but the first deficiency, and both models run ~104 times faster than the RRTM. Our code is available publicly.