  Upcoming 21cm surveys will map the spatial distribution of cosmic neutral
hydrogen (HI) over unprecedented volumes. Mock catalogues are needed to fully
exploit the potential of these surveys. Standard techniques employed to create
these mock catalogs, like Halo Occupation Distribution (HOD), rely on
assumptions such as the baryonic properties of dark matter halos only depend on
their masses. In this work, we use the state-of-the-art magneto-hydrodynamic
simulation IllustrisTNG to show that the HI content of halos exhibits a strong
dependence on their local environment. We then use machine learning techniques
to show that this effect can be 1) modeled by these algorithms and 2)
parametrized in the form of novel analytic equations. We provide physical
explanations for this environmental effect and show that ignoring it leads to
underprediction of the real-space 21-cm power spectrum at $k\gtrsim 0.05$ h/Mpc
by $\gtrsim$10\%, which is larger than the expected precision from upcoming
surveys on such large scales. Our methodology of combining numerical
simulations with machine learning techniques is general, and opens a new
direction at modeling and parametrizing the complex physics of assembly bias
needed to generate accurate mocks for galaxy and line intensity mapping
surveys.
