Papers
Topics
Authors
Recent
Search
2000 character limit reached

21cmLSTM: Recurrent Emulator for 21 cm Signal

Updated 9 July 2026
  • The paper introduces 21cmLSTM, a recurrent neural network emulator that predicts the full 21 cm brightness-temperature sequence with sub-mK precision, ensuring unbiased Bayesian posteriors.
  • It exploits LSTM’s memory capabilities to capture temporal correlations across adjacent frequency bins, replacing computationally expensive semi-numerical simulators in inference pipelines.
  • Benchmark tests show an average mean error of ~0.22% and a per-signal evaluation time of 46 ms, establishing 21cmLSTM as the accuracy benchmark in global-signal emulation.

21cmLSTM is a neural-network emulator for the global, sky-averaged 21 cm cosmology signal that uses long short-term memory recurrent layers to predict the full brightness-temperature sequence as a function of frequency or redshift from a low-dimensional set of astrophysical and cosmological parameters. It was introduced to replace computationally expensive semi-numerical and semi-analytical simulators inside Bayesian inference pipelines that may require 10410^4–10610^6 likelihood evaluations, while keeping emulation error well below observational noise so that posterior constraints remain unbiased. In the subsequent literature, 21cmLSTM functions as the principal accuracy benchmark for global-signal emulation and is described as the most accurate emulator in the community, with later work comparing faster alternatives such as 21cmKAN against it rather than against earlier feedforward baselines (Jones et al., 2024, Jones et al., 15 Aug 2025).

1. Scientific object and problem setting

The quantity emulated by 21cmLSTM is the global 21 cm differential brightness temperature, denoted δTb(ν)\delta T_b(\nu), δTb(z)\delta T_b(z), T21T_{21}, or similar notation depending on the source. This signal traces the thermal and ionization history of the intergalactic medium through the Dark Ages, Cosmic Dawn, and the Epoch of Reionization. In the formulation summarized for 21cmLSTM, a standard expression is

T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},

where xHIx_{\mathrm{HI}} is the neutral hydrogen fraction, TsT_s the spin temperature, and TγT_\gamma the CMB temperature. The emulator does not derive these quantities from first principles; rather, it learns the mapping from model parameters θ\theta to the simulator-produced signal 10610^60 (Jones et al., 2024).

The methodological motivation is specific to global-signal inference. Semi-analytical and semi-numerical simulators are substantially cheaper than full hydrodynamical calculations, but they remain too slow for repeated evaluation in nested-sampling or MCMC analyses. The central requirement emphasized in the 21cmLSTM work is that emulator error must be much smaller than the observational noise, denoted 10610^61, otherwise Bayesian posteriors become biased. The paper reports that when emulator rms error is 10610^62–10610^63 of 10610^64, posterior constraints are unbiased; 21cmLSTM was designed to satisfy that condition even for optimistic noise levels such as 10610^65 mK (Jones et al., 2024).

This framing also explains the specific appeal of an LSTM. Earlier global 21 cm emulators treated the spectrum more like a static multivariate regression target, whereas 21cmLSTM treats it as a correlated sequence across adjacent redshift or frequency bins. That choice is physically motivated by the smooth, temporally correlated evolution of the absorption trough, heating transition, and reionization shoulder (Jones et al., 2024, Jones et al., 31 Aug 2025).

2. Signal representation and modeled parameter spaces

21cmLSTM maps a compact parameter vector to the full one-dimensional global-signal sequence over a fixed grid. The later comparative work summarizes the input dimensionality as typically 10610^66–10610^67 physical parameters, while the output is the global 21 cm brightness temperature sequence over 10610^68–10610^69 or δTb(ν)\delta T_b(\nu)0 MHz, with δTb(ν)\delta T_b(\nu)1. The 21cmGEM dataset uses δTb(ν)\delta T_b(\nu)2 bins and the ARES dataset δTb(ν)\delta T_b(\nu)3 bins (Jones et al., 15 Aug 2025).

The primary benchmark dataset in the original 21cmLSTM paper is the public 21cmGEM set. It varies seven parameters:

  • δTb(ν)\delta T_b(\nu)4: star formation efficiency; log-uniform in δTb(ν)\delta T_b(\nu)5
  • δTb(ν)\delta T_b(\nu)6: minimum circular velocity of star-forming halos; log-uniform in δTb(ν)\delta T_b(\nu)7 km sδTb(ν)\delta T_b(\nu)8
  • δTb(ν)\delta T_b(\nu)9: X-ray efficiency; log-uniform in δTb(z)\delta T_b(z)0
  • δTb(z)\delta T_b(z)1: CMB optical depth; uniform in δTb(z)\delta T_b(z)2
  • δTb(z)\delta T_b(z)3: slope of the X-ray spectral energy distribution; uniform in δTb(z)\delta T_b(z)4
  • δTb(z)\delta T_b(z)5: low-energy cutoff of the X-ray SED; uniform in δTb(z)\delta T_b(z)6 keV
  • δTb(z)\delta T_b(z)7: ionizing mean free path; uniform in δTb(z)\delta T_b(z)8 Mpc

For this dataset, the redshift range is δTb(z)\delta T_b(z)9 with T21T_{21}0, corresponding to T21T_{21}1–T21T_{21}2 MHz, and the physically motivated sampling constraint T21T_{21}3 at T21T_{21}4 is imposed. The split used in the original work is train T21T_{21}5, validation T21T_{21}6, test T21T_{21}7 (Jones et al., 2024).

A second benchmark family uses ARES, a semianalytical model with one-dimensional radiative transfer and no 3D volumes. In the comparative literature, the varied parameters are T21T_{21}8, T21T_{21}9, T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},0, T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},1, T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},2, T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},3, T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},4, and T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},5, with ranges given by the ARES training set; the signal coverage is T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},6–T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},7, T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},8, with T21(z)≈27 xHI(z)1+z10[1−Tγ(z)Ts(z)] mK,T_{21}(z) \approx 27\,x_{\mathrm{HI}}(z)\sqrt{\frac{1+z}{10}} \left[1-\frac{T_\gamma(z)}{T_s(z)}\right]\ \mathrm{mK},9 bins and the condition xHIx_{\mathrm{HI}}0 at xHIx_{\mathrm{HI}}1. The explicit split reported in the 21cmLSTM paper is train xHIx_{\mathrm{HI}}2, validation xHIx_{\mathrm{HI}}3, test xHIx_{\mathrm{HI}}4 (Jones et al., 15 Aug 2025, Jones et al., 2024).

These parameterizations encode the main astrophysical drivers of the global signal. In the 21cmGEM interpretation given by the original paper, xHIx_{\mathrm{HI}}5 and xHIx_{\mathrm{HI}}6 regulate when and how efficiently galaxies form, xHIx_{\mathrm{HI}}7, xHIx_{\mathrm{HI}}8, and xHIx_{\mathrm{HI}}9 regulate the timing and spectrum of X-ray heating, TsT_s0 constrains the integrated ionizing history, and TsT_s1 affects the morphology and percolation of H II regions during reionization (Jones et al., 2024).

3. Recurrent architecture, sequence modeling, and preprocessing

21cmLSTM is explicitly a recurrent, memory-based architecture. The later summaries characterize it as a network chosen for sequential modeling of TsT_s2 across redshift or frequency, using gated memory and backpropagation through time to capture temporal dependencies. In the original implementation, the core architecture consists of two stacked LSTM layers operating in many-to-many mode, followed by a final dense layer with linear activation that produces TsT_s3 for each channel. The implementation is in Python with Keras/TensorFlow, and the optimizer is Adam (Jones et al., 15 Aug 2025, Jones et al., 2024).

The LSTM recurrence is described in the later lunar-far-side overview by the standard gate equations

TsT_s4

TsT_s5

TsT_s6

This formulation is central to why 21cmLSTM differs from feedforward emulators: the hidden and cell states propagate information across the full sequence, so adjacent and widely separated bins are not predicted independently (Jones et al., 31 Aug 2025).

The input representation is also sequence-aware. The original paper states that the network input is a three-dimensional array of shape TsT_s7, where TsT_s8 is the batch size, TsT_s9 the sequence length, and TγT_\gamma0 the number of physical parameters plus one for the frequency value itself. For the 21cmGEM set, TγT_\gamma1; for ARES, TγT_\gamma2. Including frequency as a feature is intended to help the network learn the global trend (Jones et al., 2024).

Preprocessing is uniform across the emulator comparisons. Parameters sampled log-uniformly are transformed with TγT_\gamma3 before training: TγT_\gamma4, TγT_\gamma5, and TγT_\gamma6 for 21cmGEM; TγT_\gamma7, TγT_\gamma8, TγT_\gamma9, and θ\theta0 for ARES. Features and labels are then globally min–max normalized according to

θ\theta1

The signal labels are flipped to run from high θ\theta2 to low θ\theta3 during training, i.e. descending redshift and ascending frequency (Jones et al., 2024, Jones et al., 15 Aug 2025).

The training protocol reported in the original paper uses a batch-size schedule rather than learning-rate decay: θ\theta4 epochs with batch size θ\theta5, then θ\theta6 epochs with batch size θ\theta7, then θ\theta8 epochs with batch size θ\theta9. Total training time is reported as 10610^600 hr per trial on one NVIDIA A100 GPU with 10610^601 GB memory usage. Early stopping was not used in that work; the number of epochs was chosen empirically. A later overview notes that standard deep-learning stacks such as TensorFlow/Keras or PyTorch are supported in the public implementation, with validation splits and early stopping available in repository configurations (Jones et al., 2024, Jones et al., 31 Aug 2025).

4. Accuracy, error metrics, and benchmark performance

The principal training objective for 21cmLSTM is mean squared error,

10610^602

For test evaluation, the main metric is a relative rms error across the full frequency range,

10610^603

The paper also notes an alternative relative rms definition,

10610^604

but emphasizes the ratio of rms residual to signal amplitude for stability across diverse signals (Jones et al., 2024).

On the held-out 21cmGEM test set of 10610^605 signals, aggregated over 10610^606 independent training trials, 21cmLSTM achieves:

  • average mean relative rms error 10610^607
  • average median error 10610^608
  • average maximum error 10610^609

These correspond to 10610^610 mK 10610^611 mK in absolute units for the average mean error. The best trial reaches mean 10610^612 (10610^613 mK), median 10610^614 (10610^615 mK), and max 10610^616 (10610^617 mK) (Jones et al., 2024).

The same work reports a single-signal wall-clock evaluation time of 10610^618 ms, averaged across 10610^619 trials on the same hardware used for training, including preprocessing and de-normalization. Relative to earlier feedforward emulators on the same dataset, the reported comparisons are:

  • 21cmLSTM: 10610^620 ms, mean error 10610^621, max 10610^622
  • 21cmVAE: 10610^623 ms measured in that work, mean error 10610^624, max 10610^625
  • globalemu: 10610^626 ms, mean error 10610^627, max 10610^628
  • 21cmGEM: 10610^629 ms, mean error 10610^630, max 10610^631

The original paper therefore reports that 21cmLSTM reduces average mean error by 10610^632 and maximum error by 10610^633 relative to 21cmVAE, while remaining practically fast for inference (Jones et al., 2024).

Subsequent comparisons with 21cmKAN sharpen the interpretation of these results. On the 21cmGEM test set, 21cmLSTM remains slightly more accurate than 21cmKAN, with average mean relative rms error 10610^634 versus 10610^635 and average maximum error 10610^636 versus 10610^637. However, 21cmKAN evaluates in 10610^638 ms per signal and trains about 10610^639 faster than 21cmLSTM on the same A100 GPU. This later work therefore positions 21cmLSTM as the accuracy leader and 21cmKAN as the speed leader for low-dimensional global-signal emulation (Jones et al., 15 Aug 2025).

5. Bayesian parameter estimation and pipeline integration

A primary purpose of 21cmLSTM is direct insertion into Bayesian inference pipelines. The original validation uses seven-dimensional nested-sampling analyses with MultiNest, 10610^640 live points, default evidence tolerance and sampling efficiency, and priors matched to the 21cmGEM training ranges. Mock data are drawn from the test set and perturbed with white Gaussian noise at 10610^641 mK, 10610^642 mK, and 10610^643 mK (Jones et al., 2024).

The likelihood used in the comparative papers is Gaussian with diagonal covariance:

10610^644

or, equivalently in matrix form,

10610^645

Here 10610^646 is the observed spectrum, 10610^647 the emulator prediction or the full mean model, and 10610^648 the noise covariance, often taken as diagonal in the validation studies. The posterior is written as

10610^649

This establishes 21cmLSTM as a surrogate forward model rather than a standalone inference engine (Jones et al., 2024, Jones et al., 15 Aug 2025).

The reported posterior behavior is a central result. Across the three adopted noise levels, the posterior 10610^650 rms error on the recovered signals is consistently about three times smaller than 10610^651:

  • 10610^652 mK 10610^653 posterior 10610^654 rms 10610^655 mK
  • 10610^656 mK 10610^657 posterior 10610^658 rms 10610^659 mK
  • 10610^660 mK 10610^661 posterior 10610^662 rms 10610^663 mK

As 10610^664 decreases, the posterior mean residual approaches the emulator rms error, reported as 10610^665 mK in one example. Parameter posteriors are described as unbiased, with especially clear constraints for 10610^666, 10610^667, and 10610^668 at 10610^669 mK and improved constraints for 10610^670 and 10610^671 at 10610^672–10610^673 mK (Jones et al., 2024).

Later work broadens the pipeline context. It states that 21cmLSTM and 21cmKAN can be used with nested samplers such as MultiNest, PolyChord, UltraNest, and Dynesty, and that the emulator provides only the cosmological signal. Foreground and instrument terms must be added in the full likelihood, with nuisance parameters for beam chromaticity, bandpass structure, gain drifts, and related systematics. This is especially relevant for lunar far-side observational concepts such as LuSEE-Night and FarView, which benefit from the Moon’s radio-quiet environment but still require internal instrument modeling (Jones et al., 31 Aug 2025).

6. Comparative position, limitations, and reproducibility

Within the global 21 cm emulator literature, 21cmLSTM occupies a specific niche. It is the memory-based model that explicitly exploits temporal correlations across frequency or redshift bins and, in the cited comparisons, remains the most accurate emulator for the task. The later KAN paper is explicit that 21cmLSTM is the best choice when maximizing emulation accuracy is paramount and training or inference resources are available. By contrast, 21cmKAN is presented as preferable when emulator training would otherwise become the bottleneck, because it maintains similar accuracy while training about 10610^674 faster and predicting about 10610^675 faster (Jones et al., 15 Aug 2025).

Its limitations are correspondingly well defined. Because it is recurrent and trained with backpropagation through time, 21cmLSTM is slower to train and more memory intensive than fully parallel feedforward alternatives. The comparative papers also note a larger trainable-parameter count and heavier memory footprint than KAN, even though exact counts are not provided there. In the original validation, inference tests assume diagonal, frequency-independent Gaussian noise, and they do not include foregrounds, beam chromaticity, or instrument systematics in the likelihood; these omissions are identified as validation assumptions rather than claims about realistic end-to-end analysis (Jones et al., 2024, Jones et al., 15 Aug 2025).

Another limitation is domain specificity. As with all emulators, 21cmLSTM is guaranteed to be accurate only within the parameter domain represented by its training data. The later overview makes this explicit: extrapolation to unseen regimes or substantially different physics can degrade performance, so retraining is recommended when the forward model or parameterization changes. A related point is that emulator fidelity does not remove the need for careful treatment of foreground and instrumental degeneracies; the emulator supplies 10610^676, not a complete observational forward model (Jones et al., 31 Aug 2025).

The software and datasets were released for reproducibility and reuse. The public repository is listed as https://github.com/jdorigojones/21cmLSTM, and the associated Zenodo datasets are given as DOI 10.5281/zenodo.5084113 and DOI 10.5281/zenodo.13840725. The original paper emphasizes that the emulator, code, and datasets are publicly available so that 21cmLSTM can be independently tested, retrained, and applied to other 21 cm model families (Jones et al., 2024).

In that sense, 21cmLSTM is both a specific emulator architecture and a reference point in the methodological evolution of global-signal analysis. It established recurrent sequence modeling as a high-accuracy strategy for 10610^677 emulation, demonstrated that sub-mK average rms error is compatible with practical evaluation times, and provided a benchmark against which newer architectures such as 21cmKAN are now assessed (Jones et al., 2024, Jones et al., 15 Aug 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to 21cmLSTM.