# Numerical simulations of the Tayler-Spruit dynamo in proto-magnetars

Paul Barrère1 , Jérôme Guilet1, Raphaël Raynaud2 and Alexis Reboul-Salze3
1Université Paris-Saclay, Université Paris Cité, CEA, CNRS, AIM, 91191, Gif-
sur-Yvette, France
2Université Paris Cité, Université Paris-Saclay, CNRS, CEA, AIM, F-91191 Gif-
sur-Yvette, France
3Max Planck Institute for Gravitational Physics (Albert Einstein Institute),
14476 Potsdam, Germany<EMAIL_ADDRESS>
(Accepted XXX. Received YYY; in original form ZZZ)

###### Abstract

The Tayler-Spruit dynamo is one of the most promising mechanisms proposed to
explain angular momentum transport during stellar evolution. Its development
in proto-neutron stars spun-up by supernova fallback has also been put forward
as a scenario to explain the formation of very magnetized neutron stars called
magnetars. Using three-dimensional direct numerical simulations, we model the
proto-neutron star interior as a stably stratified spherical Couette flow with
the outer sphere that rotates faster than the inner one. We report the
existence of two subcritical dynamo branches driven by the Tayler instability.
They differ by their equatorial symmetry (dipolar or hemispherical) and the
magnetic field scaling, which is in agreement with different theoretical
predictions (by Fuller and Spruit, respectively). The magnetic dipole of the
dipolar branch is found to reach intensities compatible with observational
constraints on magnetars.

###### keywords:

stars: magnetars – supernovae: general – MHD – instabilities – magnetic fields

††pubyear: 2023††pagerange: Numerical simulations of the Tayler-Spruit dynamo
in proto-magnetars–Numerical simulations of the Tayler-Spruit dynamo in proto-
magnetars

##  1 Introduction

Magnetars are a class of neutron stars that exhibit magnetic fields whose
dipolar component reaches $10^{14}$–$10^{15}$ G, which makes them the
strongest fields observed in the Universe. Their dissipation are thought to
power a wide variety of emissions like giant flares (Evans et al., 1980;
Hurley et al., 1999, 2005; Svinkin et al., 2021), fast radio bursts (CHIME/FRB
Collaboration et al., 2020; Bochenek et al., 2020), and short chaotic X-ray
bursts (Gotz et al., 2006; Coti Zelati et al., 2018; Coti Zelati et al.,
2021). Combined with a millisecond rotation, they may produce
magnetorotational explosions, which are more energetic than standard
supernovae explosions (Burrows et al., 2007; Dessart et al., 2008; Takiwaki et
al., 2009; Kuroda et al., 2020; Bugli et al., 2020; Bugli et al., 2021; Bugli
et al., 2023; Obergaulinger & Aloy, 2020, 2021, 2022). The origin of these
magnetic fields is therefore a crucial question to understand magnetars and
their association to extreme events such as gamma-ray bursts or fast radio
bursts. Two classes of scenarios can be distinguished for magnetar formation:
(i) the merger of a neutron star binary, which may explain the plateau phase
and the extended emission in X-ray sources associated with short gamma-ray
bursts (Metzger et al., 2008; Lü & Zhang, 2014; Gompertz et al., 2014). These
events are interesting for their multimessenger signature but are expected to
be too rare to be the main formation channel of Galactic magnetars, (ii) the
core-collapse of a massive star, which is confirmed by the observation of
Galactic magnetars associated with supernova remnants (Vink & Kuiper, 2006;
Martin et al., 2014; Zhou et al., 2019). In the latter case, the amplification
of the magnetic field may be due either to the magnetic flux conservation
during the collapse of the iron core of the progenitor star (Ferrario &
Wickramasinghe, 2006; Hu & Lou, 2009; Schneider et al., 2020) or to a dynamo
action in the newly born proto-magnetar. Indeed, two dynamo mechanisms have
already been studied by numerical simulations: the convective dynamo (Thompson
& Duncan, 1993; Raynaud et al., 2020, 2022; Masada et al., 2022; White et al.,
2022) and the magnetorotational instability (MRI)-driven dynamo (Obergaulinger
et al., 2009; Mösta et al., 2014; Reboul-Salze et al., 2021, 2022; Guilet et
al., 2022). They have been shown to produce magnetar-like magnetic fields for
millisecond rotation periods of the proto-magnetar, especially for periods
$P\lesssim 10\,$ms for the convective dynamo (Raynaud et al., 2020, 2022).
These scenarios rely on the hypothesis that the rotation of the proto-magnetar
is determined by the rotation of the progenitor core. However, it is still
uncertain whether there are enough fast rotating progenitor cores to form all
the observed magnetars in the Milky Way, which represent
$\sim$10\text{\,}$-$40\text{\,}\%$$ of the Galactic neutron star population
(Kouveliotou et al., 1994; Woods & Thompson, 2006; Gill & Heyl, 2007;
Beniamini et al., 2019).

In Barrère et al. (2022), we developed a new magnetar formation scenario in
which the rapid rotation rate of the proto-magnetar is not determined by the
progenitor core but by the ejected matter that remains gravitationally bound
to the proto-magnetar and eventually falls back on the proto-magnetar surface
$\sim 5-10\,$s after the core-collapse. Since the accretion is asymmetric, the
fallback matter transfers a significant amount of angular momentum to the
surface (Chan et al., 2020; Janka et al., 2022), which makes the surface
rotate faster than the core. In Barrère et al. (2022), we argue that this
spin-up triggers the amplification of the magnetic field through the Tayler-
Spruit dynamo mechanism. This dynamo mechanism can be described as a loop: (i)
a poloidal magnetic field is sheared into a toroidal one ($\Omega$–effect),
(ii) the toroidal field becomes Tayler unstable after reaching a critical
value (Tayler, 1973; Pitts & Tayler, 1985), and (iii) the Tayler instability
regenerates a poloidal field (Fuller et al., 2019; Skoutnev et al., 2022; Ji
et al., 2023).

Figure 1: Left: Bifurcation diagram of the time and volume averaged Elsasser
number (and root mean square magnetic field) versus the Rossby number.
Distinct dynamo branches are represented: dipolar (red), quadrupolar (mauve),
hemispherical (green), and kinematic (black) whose respective thresholds are
$Ro^{c}_{\rm D}\sim 0.19$, $Ro^{c}_{\rm Q}\sim 0.7$, $Ro^{c}_{\rm H}\sim
0.37$, and $Ro^{c}_{\rm W}\sim 0.62$. The hydrodynamic instability is
triggered for $Ro^{c}_{\rm hyd}>0.177$. Dark green circles are stationary
hemispherical dynamos and light green ones display parity modulations. Black
crosses indicate failed dynamos, empty circles metastable solutions. Arrows
attached to circles indicate the initial condition of the associated
simulation. The black half empty circle specifies that the solution was found
to be metastable in a simulation and stable in another. The error bars
indicate the standard deviation. Right: snapshots of the magnetic field lines
and surface radial fields associated to the different main dynamo branches at
$Ro=0.75$: dipolar (top), hemispherical (middle), and kinematic (bottom).

The Tayler-Spruit dynamo was first modelled by Spruit (2002) to explain the
angular momentum transport in stellar radiative zones. Fuller et al. (2019)
provided a revised description, which tackles the previous critics of Spruit’s
model (see Denissenkov & Pinsonneault, 2007; Zahn et al., 2007) and yields
different predictions. Their analytical results are now often included in
stellar evolution codes (see e.g. Eggenberger et al., 2005; Cantiello et al.,
2014; Eggenberger et al., 2019b; Eggenberger et al., 2019a; den Hartogh et
al., 2020; Bonanno et al., 2020). Though this dynamo has long been debated in
direct numerical simulations (Braithwaite, 2006; Zahn et al., 2007),
Petitdemange et al. (2023) recently reported a dynamo solution sharing many
characteristics with the Tayler-Spruit model. Their numerical simulations
modelled a stellar radiative zone, where the shear is negative, that is, the
rotation rate decreases in the radial direction. In this Letter, we
demonstrate that the Tayler instability can sustain different dynamo branches
in the presence of positive shear, which gives strong support to the magnetar
formation scenario of Barrère et al. (2022).

##  2 Numerical setup

We perform three-dimensional (3D) direct numerical simulations of a stably
stratified and electrically conducting Boussinesq fluid with the pseudo-
spectral code MagIC (Wicht, 2002; Gastine & Wicht, 2012; Schaeffer, 2013). The
fluid has a constant density
$\rho=$3.8\text{\times}{10}^{14}\text{\,}\mathrm{g}\,\mathrm{c}\mathrm{m}^{-3}$$
(which corresponds to a proto-neutron star mass of
$M=$1.4\text{\,}\mathrm{M}_{\odot}$$) and evolves between two concentric
spheres of radius $r_{i}$ and $r_{o}=$12\text{\,}\mathrm{k}\mathrm{m}$$,
rotating at the angular frequencies $\Omega_{i}$ and $\Omega_{o}=2\pi\times
100\,{\rm rad\,s^{-1}}$, respectively. The imposed differential rotation is
characterized by the Rossby number $Ro\equiv 1-\Omega_{i}/\Omega_{o}>0$, which
is varied between 0.125 and 1.2. This spherical Taylor-Couette configuration
with positive shear prevents the development of the MRI and allows us to study
the system in a statistically steady state. We impose no-slip and insulating
boundary conditions at the inner and outer spheres. In all the simulations, we
keep fixed the other dimensionless control parameters: the shell aspect ratio
$\chi\equiv r_{i}/r_{o}=0.25$, the thermal and magnetic Prandtl numbers
$Pr\equiv\nu/\kappa=0.1$ and $Pm\equiv\nu/\eta=1$, respectively, the Ekman
number $E\equiv\nu/(d^{2}\Omega_{o})=10^{-5}$, and the ratio of the Brunt-
Väisälä to the outer angular frequency $N/\Omega_{o}=0.1$. The coefficients
$\nu$, $\kappa$, $\eta$, and $d\equiv r_{o}-r_{i}$ are respectively the
kinematic viscosity, the thermal diffusivity, the resistivity, and the shell
width. The magnetic energy is measured by the Elsasser number $\Lambda\equiv
B_{\rm rms}^{2}/(4\pi\rho\eta\Omega_{o})$. The simulations are initialized
either from a nearby saturated state, or with a weak ($\Lambda=10^{-4}$) or a
strong ($\Lambda=10$) toroidal axisymmetric field with a given equatorial
symmetry;it can be either dipolar (i.e. equatorially symmetric with $l=2,m=0$)
or quadrupolar (i.e. antisymmetric with $l=1,m=0$). We define a turbulent
resistive time $\bar{\tau}_{\eta}=\left(\pi
r_{o}/\bar{\ell}\right)^{2}/\eta\sim 0.2d^{2}/\eta$, where $\bar{\ell}=10$ is
the typical value of the average harmonic degree of the time-averaged magnetic
energy spectrum. In the following, we will term a solution _metastable_ when a
steady state is sustained for a time interval $\Delta
t>0.3\bar{\tau}_{\eta}$,and _stable_ for $\Delta t\geqslant\bar{\tau}_{\eta}$
(up to $5.7\bar{\tau}_{\eta}$ for the simulation at $Ro=0.2$).

##  3 Results

We find in our set of simulations several dynamo branches represented by
different colours in the bifurcation diagram shown in Fig. 1. When the
differential rotation is low, the flow can not amplify a weak magnetic field
(black crosses), but when $Ro>Ro^{c}_{\rm W}\sim 0.62$, the magnetic field
grows exponentially to reach a metastable or a stable saturated dynamo state
(black dots). This kinematic dynamo is driven by an hydrodynamic instability
of the Stewartson layer whose threshold is $Ro^{c}_{\rm hyd}\sim 0.175$
(dashed vertical black line), which is in agreement with Hollerbach (2003).
When $Ro\gtrsim 0.8$, the kinematic growth is followed by a non-linear growth
and the system transitions directly to another branch with a larger magnetic
energy (green circles). Restarting from a nearby saturated solution or a
strong toroidal field with quadrupolar symmetry (mauve dashed arrows), we find
that the stability of this branch extends to Rossby number as low as
$Ro^{c}_{\rm H}\sim 0.37<Ro^{c}_{\rm W}$, which indicates that this dynamo is
subcritical. By starting from a strong toroidal field with dipolar symmetry,
we observe that this subcritical branch is in bistability with another one
which presents even stronger saturated magnetic fields $B_{\rm
rms}\in[$4\text{\times}{10}^{14}\text{\,}$,$1.1\text{\times}{10}^{15}\text{\,}$]\,$G
(red circles). This branch is also subcritical since it can be maintained for
Rossby numbers as low as $Ro>Ro^{c}_{\rm D}\sim 0.19$. Moreover, the two
subcritical branches do not only differ by their magnetic field strength but
also by their equatorial symmetry, as seen in the 3D snapshots and the surface
maps of the magnetic field in Fig. 1. Indeed, the magnetic field shows a
dipolar symmetry on the stronger dynamo branch, whereas it is hemispherical on
the weaker one. The latter can be interpreted as the superposition of modes
with opposite equatorial symmetry (Gallet & Pétrélis, 2009), which is
consistent with the fact that we do find quadrupolar solutions (mauve circles
in Fig. 1). These are only metastable for $Ro>Ro^{c}_{\rm Q}\sim 0.7$ and
transition to a stable dipolar or hemispherical solution. Finally, we note
that the hemispherical dynamos with $Ro\gtrsim 0.8$ (light green circles in
Figs 1 and 2) display parity modulations (i.e. the solution evolves between
hemispherical, dipole, and quadrupole symmetric states). This behaviour is
reminiscent of the so-called Type 1 modulation identified in other dynamo
setups (Knobloch et al., 1998; Raynaud & Tobias, 2016) and likely results from
the coupling of modes with opposite parity as the equatorial symmetry breaking
of the flow increases at larger Rossby numbers.

The difference between the three dynamo branches is also clear in Fig. 2,
where we see that the hemispherical branch saturates below the equipartition,
with an energy ratio increasing with $Ro$ from $\sim$0.014$$ up to
$\sim$0.56$$. By contrast, the dynamos of the dipolar branch are in a super-
equipartition state ($E_{b}/E_{k}>1$) and follow the magnetostrophic scaling
$E_{b}/E_{k}\propto Ro^{-1}$ characteristic of the Coriolis-Lorenz force
balance (Roberts & Soward, 1972; Dormy, 2016; Aubert et al., 2017; Dormy et
al., 2018; Augustson et al., 2019; Seshasayanan & Gallet, 2019; Raynaud et
al., 2020; Schwaiger et al., 2019). This is also confirmed by force balance
spectra shown in Fig. S1 in the Supplemental Materials.

Figure 2: Time-averaged ratio of the magnetic energy to the kinetic energy
densities as a function of the Rossby number. The error bars indicate the
standard deviation.

Both subcritical dynamos show magnetic fields concentrated along the rotation
axis, which differs significantly from the subcritical solutions found with a
negative shear by (Petitdemange et al., 2023) ; this is also strikingly
different from the magnetic field generated on the equatorial plane by the
kinematic dynamo (see 3D snapshots of Fig. 1). This suggests that the dipolar
and hemispherical dynamos are driven by a different mechanism. We argue that
they are driven by the Tayler instability according to the following
arguments. First, the axisymmetric toroidal magnetic component is clearly
dominant since it contains $53-88\,\%$ of the total magnetic energy. Second,
the simulations show a poloidal magnetic field with a dominant $m=1$ mode (see
Supplemental Materials Figs S2 and S3), which is the most unstable mode of the
Tayler instability (Zahn et al., 2007; Ma & Fuller, 2019). In the azimuthal
cut of the magnetic field component $B_{s}$ in Fig. 3, the Tayler mode also
appears clearly close to the poles, where it is expected to develop for a
toroidal field generated by the shearing of a poloidal field (Goossens et al.,
1981). This is also consistent with the 3D snapshots of the dipolar and
hemispherical branches in Fig. 1 where the toroidal magnetic field seems prone
to a kink instability.

Figure 3: Snapshots of the azimuthal slices of the angular velocity (left) and
the magnetic field along the cylindrical radius $s\equiv r\sin{\theta}$
(right) of the dipolar dynamo at $Ro=0.75$.

Third, as in Petitdemange et al. (2023), the system bifurcates from the
kinematic to the hemispherical branch in the vicinity of the threshold of the
Tayler instability (Spruit, 1999, 2002)

$\Lambda^{c}_{\phi}\equiv\frac{{B^{c}_{\phi}}^{2}}{4\pi\rho\eta\Omega_{o}}\sim\frac{\chi}{1-\chi}\frac{N}{\Omega_{o}}\sqrt{\frac{Pr}{E}}\sim
3.3\,.$ (1)

Indeed, if we focus on the stable and metastable kinematic solutions found at
$Ro=0.75$, we see in Fig. 4 that the _local_ maximum of the toroidal
axisymmetric field is in both cases close to the critical value above which it
is expected to become unstable. The bifurcation from the kinematic toward the
hemispherical branch that is observed for the metastable solution appears
hence as the result of turbulent fluctuations departing far enough above the
threshold of the Tayler instability.

Figure 4: Time series of the maximum along the cylindrical radius $s$ of the
axisymmetric toroidal magnetic energy measured locally at $z=0.45r_{o}$, for
stable (black) and metastable (green) kinematic dynamos at $Ro=0.75$. The
dashed red line indicates the analytical threshold of the Tayler instability
(equation 1). Dark lines show a running average and dotted green lines around
$t\sim$20\text{\,}\mathrm{s}$$ indicate missing data.

Finally, we compare our numerical results to the theoretical predictions
regarding the saturation of the Tayler-Spruit dynamo. Note that these
predictions assume the scale separation $\omega_{A}\ll\Omega_{o}\ll N$, where
the Alfvén frequency is defined by $\omega_{A}\equiv B_{\phi}/\sqrt{4\pi\rho
r_{o}^{2}}\sim 12.1\left(B_{\phi}/10^{15}\,{\rm
G}\right)$\mathrm{H}\mathrm{z}$$. Our numerical models assume
$N/\Omega_{o}=0.1$ to limit the computational costs, whereas for a typical PNS
spun up by fallback to a period of $1-10$ ms we expect $N/\Omega_{o}\sim
1-10$. On the other hand, the achieved magnetic field follows the right scale
separation with $\omega_{A}/\Omega_{o}\lesssim 0.02$, which is expected to
determine the saturation mechanism of the Tayler instability (Ji et al.,
2023). Figure 5 displays the axisymmetric toroidal and poloidal magnetic
fields (top), the dipole field (middle) and the Maxwell torque (bottom) as a
function of an effective shear rate $q$ measured locally in the saturated
state of the dynamo (see Supplemental Materials Fig. S4). For the dipolar
branch (red), we find that the power laws $B^{m=0}_{\rm tor}\propto q^{0.36\pm
0.05}$ and $B^{m=0}_{\rm pol}\propto q^{0.62\pm 0.07}$ fit the saturated
magnetic field, while we find $B_{s}B_{\phi}\propto q^{1.0\pm 0.02}$ or
$B_{s}^{m=0}B_{\phi}^{m=0}\propto q^{1.1\pm 0.04}$, depending on whether we
take into account non-axisymmetric contributions to compute the Maxwell torque
$T_{\rm M}$. The scaling exponents are thus in good agreement with the
theoretical predictions of Fuller et al. (2019) $B^{m=0}_{\rm tor}\propto
q^{1/3}$, $B^{m=0}_{\rm pol}\propto q^{2/3}$ and $T_{\rm M}\propto q$ (red
dotted lines in Fig. 5). Contrary to their prediction, however, our torque is
not dominated by the axisymmetric magnetic field, which may be related to
their assumption of a stronger stratification. Interestingly, the
hemispherical branch (green) does not follow the same scalings: for $q>0.2$,
we find $B^{m=0}_{\rm tor}\propto q^{2.1\pm 0.31}$ and $B^{m=0}_{\rm
pol}\propto q^{2.0\pm 0.28}$ for the magnetic field, and $B_{s}B_{\phi}\propto
q^{2.7\pm 0.40}$ or $B_{s}^{m=0}B_{\phi}^{m=0}\propto q^{3.8\pm 0.70}$ for the
Maxwell torque. These results globally support Spruit’s predictions (Spruit,
2002) $B^{m=0}_{\rm tor}\propto q$, $B^{m=0}_{\rm pol}\propto q^{2}$ and
$T_{\rm M}\propto q^{3}$ (green dotted lines), despite some tension concerning
the scaling of the toroidal magnetic field. If we focus on the dipole field,
we find the following power laws: $B_{\rm dip}\propto q^{0.66\pm 0.03}$ and
$B_{\rm dip}\propto q^{1.1\pm 0.4}$, for the dipolar and hemispherical
branches, respectively. The dipole field on the strong branch therefore
follows the same scaling as the axisymmetric poloidal field and is only $\sim
33\%$ weaker.

Figure 5: Root mean square (RMS) toroidal and poloidal axisymmetric magnetic
fields (top), RMS magnetic dipole (middle), and RMS magnetic torque (bottom)
as a function of the time-averaged shear rate measured in the steady state,
for the dipolar (red) and hemispherical (green) dynamo branches. Dotted lines
shows the best fits obtained with Fuller’s (red) and Spruit’s (green)
theoretical scaling laws, respectively.

##  4 Conclusions

To conclude, we show that the Tayler-Spruit dynamo also exists in the presence
of positive shear. We demonstrate for the first time the existence of two
subcritical branches of this dynamo with distinct equatorial symmetries,
dipolar and hemispherical. Moreover, the former follows Fuller’s theoretical
predictions, while the latter is in overall agreement with Spruit’s model.
Compared to the study of Petitdemange et al. (2023) that use a negative shear,
our results present a similar dynamical structure, with a bifurcation diagram
characterized by a bistability between kinematic and subcritical dynamo
solutions. The magnetic field of their Tayler-Spruit dynamo is, however,
different since it is characterized by a smaller scale structure localized
near the inner boundary in the equatorial plane, and induces a torque scaling
according to Spruit’s prediction. Our study shows a magnetic field geometry
concentrated near the pole in agreement with the expectation of the Tayler-
Spruit dynamo and a more complex physics, with the existence of two different
branches that can not be captured by a single scaling law. Extended parameter
studies will be needed to further assess the impact of the resistivity and the
stratification on this dynamo instability and better constrain its
astrophysical implications.

Our results are of particular importance for stellar evolution models by
confirming the existence of the Tayler-Spruit dynamo and by deepening our
physical understanding of its complex dynamics. They also give strong support
to the new magnetar formation scenario proposed by Barrère et al. (2022),
which relies on the development of a Tayler-instability driven dynamo in the
presence of a positive shear. We validate the assumption that the magnetic
dipole is a significant fraction of the poloidal magnetic field and follows
the same scaling. Extrapolating our results for the dipolar branch to $q\sim
1$ as expected in Barrère et al. (2022), we obtain a magnetic dipole intensity
of $\sim$3.2\text{\times}{10}^{14}\text{\,}\mathrm{G}$$ and an even stronger
axisymmetric toroidal field of
$\sim$2.1\text{\times}{10}^{15}\text{\,}\mathrm{G}$$. These orders of
magnitude are similar to those found in Barrère et al. (2022) for the same
rotation period of $P_{o}\equiv
2\pi/\Omega_{o}=$10\text{\,}\mathrm{m}\mathrm{s}$$, and fall right in the
magnetar range (Olausen & Kaspi, 2014).

## Acknowledgements

We thank F. Daniel, C. Gissinger and L. Petitdemange and F. Marcotte for
fruitful discussions and for sharing the manuscript Petitdemange et al. (2023)
before its publication. We also thank A. Igoshev for valuable comments. This
work was supported by the European Research Council (MagBURST grant 715368),
and the PNPS and PNHE programs of CNRS/INSU, co-funded by CEA and CNES.
Numerical simulations have been carried out at the CINES on the Jean-Zay
supercomputer (DARI project A130410317).

## Data Availability

The data underlying this article will be shared on reasonable request to the
corresponding author.

## References

  * Aubert et al. (2017) Aubert J., Gastine T., Fournier A., 2017, Journal of Fluid Mechanics, 813, 558
  * Augustson et al. (2019) Augustson K. C., Brun A. S., Toomre J., 2019, Astrophys. J., 876, 83
  * Barrère et al. (2022) Barrère P., Guilet J., Reboul-Salze A., Raynaud R., Janka H. T., 2022, Astron. Astrophys., 668, A79
  * Beniamini et al. (2019) Beniamini P., Hotokezaka K., van der Horst A., Kouveliotou C., 2019, Mon. Not. Astron. R. Soc., 487, 1426
  * Bochenek et al. (2020) Bochenek C. D., Ravi V., Belov K. V., Hallinan G., Kocz J., Kulkarni S. R., McKenna D. L., 2020, Nature, 587, 59
  * Bonanno et al. (2020) Bonanno A., Guerrero G., Del Sordo F., 2020, MEMSAI, 91, 249
  * Braithwaite (2006) Braithwaite J., 2006, Astron. Astrophys., 449, 451
  * Bugli et al. (2020) Bugli M., Guilet J., Obergaulinger M., Cerdá-Durán P., Aloy M. A., 2020, Mon. Not. Astron. R. Soc., 492, 58
  * Bugli et al. (2021) Bugli M., Guilet J., Obergaulinger M., 2021, Mon. Not. Astron. R. Soc., 507, 443
  * Bugli et al. (2023) Bugli M., Guilet J., Foglizzo T., Obergaulinger M., 2023, Mon. Not. Astron. R. Soc., 520, 5622
  * Burrows et al. (2007) Burrows A., Dessart L., Livne E., Ott C. D., Murphy J., 2007, Astrophys. J., 664, 416
  * CHIME/FRB Collaboration et al. (2020) CHIME/FRB Collaboration et al., 2020, Nature, 587, 54
  * Cantiello et al. (2014) Cantiello M., Mankovich C., Bildsten L., Christensen-Dalsgaard J., Paxton B., 2014, Astrophys. J., 788, 93
  * Chan et al. (2020) Chan C., Müller B., Heger A., 2020, Mon. Not. Astron. R. Soc., 495, 3751
  * Coti Zelati et al. (2018) Coti Zelati F., Rea N., Pons J. A., Campana S., Esposito P., 2018, Mon. Not. Astron. R. Soc., 474, 961
  * Coti Zelati et al. (2021) Coti Zelati F., et al., 2021, Astrophys. J. Lett., 907, L34
  * Denissenkov & Pinsonneault (2007) Denissenkov P. A., Pinsonneault M., 2007, Astrophys. J., 655, 1157
  * Dessart et al. (2008) Dessart L., Burrows A., Livne E., Ott C. D., 2008, Astrophys. J. Lett., 673, L43
  * Dormy (2016) Dormy E., 2016, J. Fluid Mech., 789, 500
  * Dormy et al. (2018) Dormy E., Oruba L., Petitdemange L., 2018, Fluid Dyn. Res., 50, 011415
  * Eggenberger et al. (2005) Eggenberger P., Maeder A., Meynet G., 2005, Astron. Astrophys., 440, L9
  * Eggenberger et al. (2019a) Eggenberger P., Buldgen G., Salmon S. J. A. J., 2019a, Astron. Astrophys., 626, L1
  * Eggenberger et al. (2019b) Eggenberger P., den Hartogh J. W., Buldgen G., Meynet G., Salmon S. J. A. J., Deheuvels S., 2019b, Astron. Astrophys., 631, L6
  * Evans et al. (1980) Evans W. D., et al., 1980, Astrophys. J. Lett., 237, L7
  * Ferrario & Wickramasinghe (2006) Ferrario L., Wickramasinghe D., 2006, Mon. Not. Astron. R. Soc., 367, 1323
  * Fuller et al. (2019) Fuller J., Piro A. L., Jermyn A. S., 2019, Mon. Not. Astron. R. Soc., 485, 3661
  * Gallet & Pétrélis (2009) Gallet B., Pétrélis F., 2009, Phys. Rev. E, 80, 035302
  * Gastine & Wicht (2012) Gastine T., Wicht J., 2012, Icarus, 219, 428
  * Gill & Heyl (2007) Gill R., Heyl J., 2007, Mon. Not. Astron. R. Soc., 381, 52
  * Gompertz et al. (2014) Gompertz B. P., O’Brien P. T., Wynn G. A., 2014, Mon. Not. Astron. R. Soc., 438, 240
  * Goossens et al. (1981) Goossens M., Biront D., Tayler R. J., 1981, Astrophys. Space Sci., 75, 521
  * Gotz et al. (2006) Gotz D., et al., 2006, The Astronomer’s Telegram, 953, 1
  * Guilet et al. (2022) Guilet J., Reboul-Salze A., Raynaud R., Bugli M., Gallet B., 2022, Mon. Not. Astron. R. Soc., 516, 4346
  * Hollerbach (2003) Hollerbach R., 2003, J. Fluid Mech., 492, 289
  * Hu & Lou (2009) Hu R.-Y., Lou Y.-Q., 2009, Mon. Not. Astron. R. Soc., 396, 878
  * Hurley et al. (1999) Hurley K., et al., 1999, Nature, 397, 41
  * Hurley et al. (2005) Hurley K., et al., 2005, Nature, 434, 1098
  * Janka et al. (2022) Janka H.-T., Wongwathanarat A., Kramer M., 2022, Astrophys. J., 926, 9
  * Ji et al. (2023) Ji S., Fuller J., Lecoanet D., 2023, Mon. Not. Astron. R. Soc., 521, 5372
  * Knobloch et al. (1998) Knobloch E., Tobias S. M., Weiss N. O., 1998, Mon. Not. Astron. R. Soc., 297, 1123
  * Kouveliotou et al. (1994) Kouveliotou C., et al., 1994, Nature, 368, 125
  * Kuroda et al. (2020) Kuroda T., Arcones A., Takiwaki T., Kotake K., 2020, Astrophys. J., 896, 102
  * Lü & Zhang (2014) Lü H.-J., Zhang B., 2014, Astrophys. J., 785, 74
  * Ma & Fuller (2019) Ma L., Fuller J., 2019, Mon. Not. Astron. R. Soc., 488, 4338
  * Martin et al. (2014) Martin J., Rea N., Torres D. F., Papitto A., 2014, Mon. Not. Astron. R. Soc., 444, 2910
  * Masada et al. (2022) Masada Y., Takiwaki T., Kotake K., 2022, Astrophys. J., 924, 75
  * Metzger et al. (2008) Metzger B. D., Quataert E., Thompson T. A., 2008, Mon. Not. Astron. R. Soc., 385, 1455
  * Mösta et al. (2014) Mösta P., et al., 2014, Astrophys. J. Lett., 785, L29
  * Obergaulinger & Aloy (2020) Obergaulinger M., Aloy M. Á., 2020, Mon. Not. Astron. R. Soc., 492, 4613
  * Obergaulinger & Aloy (2021) Obergaulinger M., Aloy M. Á., 2021, Mon. Not. Astron. R. Soc., 503, 4942
  * Obergaulinger & Aloy (2022) Obergaulinger M., Aloy M. Á., 2022, Mon. Not. Astron. R. Soc., 512, 2489
  * Obergaulinger et al. (2009) Obergaulinger M., Cerdá-Durán P., Müller E., Aloy M. A., 2009, Astron. Astrophys., 498, 241
  * Olausen & Kaspi (2014) Olausen S. A., Kaspi V. M., 2014, Astrophys. J.s, 212, 6
  * Petitdemange et al. (2023) Petitdemange L., Marcotte F., Gissinger C., 2023, Science, 379, 300
  * Pitts & Tayler (1985) Pitts E., Tayler R. J., 1985, Mon. Not. Astron. R. Soc., 216, 139
  * Raynaud & Tobias (2016) Raynaud R., Tobias S. M., 2016, J. Fluid Mech., 799, R6
  * Raynaud et al. (2020) Raynaud R., Guilet J., Janka H.-T., Gastine T., 2020, Sci. Adv., 6, eaay2732
  * Raynaud et al. (2022) Raynaud R., Cerdá-Durán P., Guilet J., 2022, Mon. Not. Astron. R. Soc., 509, 3410
  * Reboul-Salze et al. (2021) Reboul-Salze A., Guilet J., Raynaud R., Bugli M., 2021, Astron. Astrophys., 645, A109
  * Reboul-Salze et al. (2022) Reboul-Salze A., Guilet J., Raynaud R., Bugli M., 2022, Astron. Astrophys., 667, A94
  * Roberts & Soward (1972) Roberts P. H., Soward A. M., 1972, Annual Review of Fluid Mechanics, 4, 117
  * Schaeffer (2013) Schaeffer N., 2013, Geochemistry, Geophysics, Geosystems, 14, 751
  * Schneider et al. (2020) Schneider F. R. N., Ohlmann S. T., Podsiadlowski P., Röpke F. K., Balbus S. A., Pakmor R., 2020, Mon. Not. Astron. R. Soc., 495, 2796
  * Schwaiger et al. (2019) Schwaiger T., Gastine T., Aubert J., 2019, Geophysical Journal International, 219, S101
  * Seshasayanan & Gallet (2019) Seshasayanan K., Gallet B., 2019, J. Fluid Mech., 864, 971
  * Skoutnev et al. (2022) Skoutnev V., Squire J., Bhattacharjee A., 2022, Mon. Not. Astron. R. Soc., 517, 526
  * Spruit (1999) Spruit H. C., 1999, Astron. Astrophys., 349, 189
  * Spruit (2002) Spruit H. C., 2002, Astron. Astrophys., 381, 923
  * Svinkin et al. (2021) Svinkin D., et al., 2021, Nature, 589, 211
  * Takiwaki et al. (2009) Takiwaki T., Kotake K., Sato K., 2009, Astrophys. J., 691, 1360
  * Tayler (1973) Tayler R. J., 1973, Mon. Not. Astron. R. Soc., 161, 365
  * Thompson & Duncan (1993) Thompson C., Duncan R. C., 1993, Astrophys. J., 408, 194
  * Vink & Kuiper (2006) Vink J., Kuiper L., 2006, Mon. Not. Astron. R. Soc., 370, L14
  * White et al. (2022) White C. J., Burrows A., Coleman M. S. B., Vartanyan D., 2022, Astrophys. J., 926, 111
  * Wicht (2002) Wicht J., 2002, Physics of the Earth and Planetary Interiors, 132, 281
  * Woods & Thompson (2006) Woods P. M., Thompson C., 2006, in , Vol. 39, Compact stellar X-ray sources. pp 547–586, doi:10.48550/arXiv.astro-ph/0406133
  * Zahn et al. (2007) Zahn J. P., Brun A. S., Mathis S., 2007, Astron. Astrophys., 474, 145
  * Zhou et al. (2019) Zhou P., Vink J., Safi-Harb S., Miceli M., 2019, Astron. Astrophys., 629, A51
  * den Hartogh et al. (2020) den Hartogh J. W., Eggenberger P., Deheuvels S., 2020, Astron. Astrophys., 634, L16


# SocialGenPod: Privacy-Friendly Generative AI Social Web Applications with
Decentralised Personal Data Stores

Vidminas Vizgirda<EMAIL_ADDRESS>0000-0002-5085-9513 University of
EdinburghEdinburghUK ,  Rui Zhao<EMAIL_ADDRESS>0000-0003-2993-2023
University of OxfordOxfordUK and  Naman Goel<EMAIL_ADDRESS>0000-0002-5106-5889 University of OxfordOxfordUK

(2024)

###### Abstract.

We present SocialGenPod, a decentralised and privacy-friendly way of deploying
generative AI Web applications. Unlike centralised Web and data architectures
that keep user data tied to application and service providers, we show how one
can use Solid — a decentralised Web specification — to decouple user data from
generative AI applications. We demonstrate SocialGenPod using a prototype that
allows users to converse with different Large Language Models, optionally
leveraging Retrieval Augmented Generation to generate answers grounded in
private documents stored in any Solid Pod that the user is allowed to access,
directly or indirectly. SocialGenPod makes use of Solid access control
mechanisms to give users full control of determining who has access to data
stored in their Pods. SocialGenPod keeps all user data (chat history, app
configuration, personal documents, etc) securely in the user’s personal Pod;
separate from specific model or application providers. Besides better privacy
controls, this approach also enables portability across different services and
applications. Finally, we discuss challenges, posed by the large compute
requirements of state-of-the-art models, that future research in this area
should address. Our prototype is open-source and available at:
https://github.com/Vidminas/socialgenpod/.

Retrieval Augmented Generation; Decentralised Web; Privacy; Solid

††journalyear: 2024††copyright: rightsretained††conference: Companion
Proceedings of the ACM Web Conference 2024; May 13–17, 2024; Singapore,
Singapore††booktitle: Companion Proceedings of the ACM Web Conference 2024
(WWW ’24 Companion), May 13–17, 2024, Singapore, Singapore††doi:
10.1145/3589335.3651251††isbn: 979-8-4007-0172-6/24/05††submissionid:
de9269††ccs: Information systems Collaborative and social computing systems
and tools††ccs: Information systems Data management systems

##  1\. Introduction

Many Web applications using generative AI like large language models (LLMs)
(Zhao et al., 2023) and diffusion models (Yang et al., 2023) have emerged
recently. Applications like ChatGPT, DALL-E, Perplexity, Maket.ai, Synthesia,
WriteSonic, Jasper are plentiful in domains such as search, writing, music,
and design. Such applications usually manage the data of their users in a
centralised way. For example, in a chat application, data from different users
(such as user queries and answers generated by an LLM) are managed by the chat
application provider, usually using a centralised database. Users have little
control over how this personal data is used by the application provider (La
Malfa et al., 2023). Centralised storage of sensitive user data also raises
other privacy concerns. For example, in March 2023, a technical glitch in
ChatGPT allowed some users to see parts of other users’ conversations (Derico,
2023).

Other than control and privacy concerns, another drawback of centralised and
application-specific data management is that users cannot easily re-use their
data from one application in another (also known as the vendor lock-in
problem). For example, a user may not be able to use their data easily from an
application for conducting background research in another application for
writing or preparing graphics. Ideally, people should be able to use their
data in the best applications available in the market, without unnecessary
obstructions. This is illustrated in Figure 1.

Figure 1. Centralised architecture (left) makes it difficult for users to have
control over their data and use their data across applications. Decentralised
architecture (right) decouples data from applications, giving users control
over their data and making it easier for them to use their data across apps.

[Side by side graphics depicting databases, apps, users, and arrows between
them]Side by side architecture illustrations. On the left, a user uses 3
different apps, each of which has its own data storage. The user cannot access
these data stores directly, and the apps cannot access different apps’ data.
On the right, 3 different apps all communicate with a Solid Pod via the user.

To address these issues, we demonstrate a decentralised and privacy-friendly
way of deploying generative AI Web applications. The key idea in this work is
to use decentralised personal data stores for managing user data as
illustrated on the right of Figure 1. Specifically, we use Solid (Mansour et
al., 2016; Sambra et al., 2016), a decentralised Web specification based on
standard, open, and interoperable data formats and protocols. It allows users
to store their data in their Web-accessible Pods (Personal Online Data Stores)
and configure granular access control for applications and other Pod/WebID
owners. Solid also handles secure transmission of data for authorised
requests. To support data portability, Solid apps and services read and write
data to the users’ Pods instead of siloed app backends. Users can transfer
their data from one Pod service provider to another, or even host one
themselves. But there are also several technical challenges in using Solid
with generative AI models. One challenge is the large computation power
required for running these models, which makes an entirely decentralised and
privacy guaranteeing implementation difficult. While user queries and
generated responses can be stored in a user’s Pod, large AI model inference
cannot run locally (for example, in browser) with reasonable performance on
typical end-user devices. Another challenge for RAG (Retrieval Augmented
Generation) — a technique which uses personal documents stored in user Pods
for grounding the responses — is that similarity search is required to pick
out relevant documents. Existing Solid server implementations do not offer any
support for similarity search, neither with vector embedding techniques nor
other frequently used approaches, like Okapi BM25.

In the paper, we discuss how we overcome some of these challenges for building
our prototype and future research directions that will be of interest to the
attendees of TheWebConf. Attendees will also be able to interact with the
prototype. Interested community members can also contribute to further
development of the open-source prototype.

##  2\. Related Work

There are several related approaches for decentralised and privacy-friendly
deployment of generative AI models. These include training highly capable
small models (e.g., models with fewer parameters, distilled models, quantised
models, etc) that can run with less compute and making the models openly
available. Examples include the LLaMA models from Meta (Touvron et al., 2023),
MoE models from Mistral AI (Jiang et al., 2024), and many others available on
the open-source hub HuggingFace.

Several emerging applications rely on local generative AI models to limit data
privacy concerns with retrieval augmented generation. For example, Rewind
gathers sensitive user data, such as screen recordings, emails, and meeting
summaries, to enable searching past user activity. Their approach is to
minimise data that leaves the user’s computer by using local device resources
for AI model inference (Bejcek, 2024). Similar ideas are also used by projects
such as WebLLM, PrivateGPT and ChatDocs. However, running models locally is
often infeasible on end-user devices due to the high compute requirements of
large AI model inference. Local models are also not sufficient in use cases
that require data sharing between users.

We also note the “AI gateway” approach, such as the one implemented by llm-
gateway. AI gateways act as a proxy between users and hosted models,
intercepting user data before it is sent to external models, and scrubbing
personal information or performing other security checks. This approach also
avoids vendor lock-in by providing a unified API for interacting with
different services. While there is an overlap in the motivation, the AI
gateway approach focuses on single-user single-application functionalities,
without features for collaboration between applications and users.

Tim Berners-Lee recently published a design note (Berners-Lee, 2023). There
are some similarities in the ideas proposed in his design note and
SocialGenPod. But, to the best of our knowledge, SocialGenPod is the first
concrete implementation of RAG using Solid.

##  3\. Overview of SocialGenPod

Example Scenario: Let us consider an example use-case scenario (Figure 2) that
requires Retrieval Augmented Generation (RAG) and user data sharing. Suppose
there are two friends or collaborators: Alice and Bob. Alice stores personal
documents, such as her notes on a particular project, in her Solid Pod. She
then configures a virtual “personal AI assistant” to have read access to this
data. The virtual personal assistant is a Web app with Alice’s configuration
and is powered by an embeddings model for retrieval and a Large Language Model
(LLM). The models may be running either on Alice’s machine or on an external
service. Bob can chat with this virtual assistant (using the Web app) and
learn from Alice’s project notes (potentially avoiding scheduling an
unnecessary meeting), without ever getting a copy of the full documents. Alice
could also configure access permissions so only a specific set of friends or
users could interact with her personal AI assistant. 3(b) shows SocialGenPod
prototype using RAG with private data.

In the above example, the defining feature of Alice’s personal AI assistant is
Alice’s configuration of the chatbot Web app, i.e., which service providers it
uses and where it sources Alice’s documents from. The AI models themselves are
not necessarily personalised — it is access to Alice’s documents that makes it
a personal assistant. The Web app itself could run anywhere (for example,
Alice could host it or share the source code for others to run or point to a
trusted public app provider, run by, e.g., a government or union).

Figure 2. Example Web application data flow in SocialGenPod. Alice allows Bob
to interact with or query her personal data through a Web app. The app uses a
retrieval service to find permitted documents in Alice’s Solid Pod that are
most relevant to Bob’s query. The app then uses one of the available
generative AI models to generate a contextualised response for Bob.

[Data flow graphic]Data flow graphic that depicts Bob (with note “authorised
by Alice”) interacting with a Web app. The Web app interacts with a Retrieval
Service (with note “read-access to Alice’s data) which obtains documents from
Alice’s pod. The Web app also interacts with GenAI Model 1 and GenAI Model 2.

The above use-case example can be generalised to other domains where private
data sharing is relevant, for example, commercial consulting, financial
advice, medical advice, career advice, meeting scheduling, or personalised
feedback. It does not have to be restricted to just language generation either
— the same scenario could apply to multi-modal models too. The data stored in
Solid Pods can also include also other kinds of data such as chat history
between two users, chat history between a user and an LLM, etc. Solid Pods
store all these data in a privacy-friendly and user-centric manner, and
subject to user specified preference, can be used by various innovative and
useful generative AI applications (personal AI assistants being one example).

##  4\. Design and Usage Details

(a) Without RAG

(b) With RAG

Figure 3. RAG with private data in SocialGenPod. A chatbot without RAG (top)
is unable to answer a user’s query. The same chatbot with RAG (bottom)
produces a better response.

[Stacked screenshots of 2 chats]Stacked screenshots of 2 SocialGenPod chats.
In the top one labelled “Without RAG”, the user wrote “Hi there… Can you
remind me what our meeting in mid-January was about?” and the chatbot
responded “I’m sorry, but I need more context to provide a helpful answer.
Could you please specify what you are referring to?”. In the bottom screenshot
labelled “With RAG”, the user wrote “Let us try again with context. Can you
remind me what our meeting in mid-January was about?” and the chatbot
responded “The meeting in mid-January was about the name of a new
decentralised web project that we were going to launch soon. We had a
discussion about it and eventually decided to call it SocialGenPod.”

SocialGenPod is built using Solid, leveraging its mechanisms for access
control, user authentication, and data discovery. As shown in Figure 2,
SocialGenPod contains several modular components: a Web application, a
retrieval service, and one or more Generative Artificial Intelligence (GenAI)
models. These components are all generic and substitutable. We provide
demonstrable implementations of all these components in an end-to-end
prototype. In practice, Web app developers and service providers would develop
their own respective Apps or services that integrate easily with other
components in the ecosystem.

In SocialGenPod, the user interacts with a Web app, which establishes the
user’s identity using Solid-OIDC. The app retrieves and stores user data such
as configuration and chat history in their Solid Pod. The user may manually
configure the app to select their preferred providers for retrieval and
generative AI models.

The retrieval and generative AI services may run externally. The generative AI
services do not have direct access to the Web app user’s Pod. This allows the
user to easily switch between different service providers. We expect these
services to be similar to Solid Pod services – a marketplace of public or
private, free or paid, fast or slower but high-accuracy services for the user
to choose from (or self-host), depending on the quality of service,
reputation, and trust.

On the other hand, based on the use case, the retrieval service will require
access to the Pod it sources data from (which may or may not be the Web app
user’s Pod). This is subject to user-specified preferences such as which
services can be used to access their data, which data, and for what purpose.

Restricted (e.g., private or paid subscription) model services can
authenticate users using Solid-OIDC, which eliminates the need for self-
developed account management mechanisms. For example, the model service can
maintain an internal list of allowed users or read lists of trusted users from
Solid Pods. It allows features like paid subscription and delegation of usage
rights to friends.

While service providers could be deployed on any suitable infrastructure, it
would be sensible for Solid Pod providers to offer such services alongside Pod
hosting. As Solid Pod providers are already trusted by their users to store
their data securely, this would eliminate the need to trust another third
party. It would also boost performance, by potentially allowing data to be
transferred between services running on the same host with low latency.

Although external services may cache user data for performance, this should be
ephemeral and securely isolated. Since the service providers are expected to
not store user data permanently, it is easier to establish trust and identify
dishonest behaviours, thus encouraging trustworthy services.

###  4.1. The Web App

Figure 4. Login and configuration menu in SocialGenPod.

[Screenshot with login button and configuration form prompting to reuse an
existing configuration or configure your chatbot service]2 step screenshot.
Step 1 shows the app sidebar with the label “Options”, a dropdown for Solid ID
Provider with “https://solidcommunity.net/” selected, and a big button with
the label “Login with Solid”. Step 2 shows the user already logged in. On the
right, there is a form prompting to reuse an existing configuration or
configure your chatbot service. In the configuration options, the user can
choose an API type for both a retrieval service provider and LLM provider –
currently “Demo” is selected for both. For each provider, the user can also
input a service provider URL – currently “http://localhost:5000/”. Below,
there is an optional text field to enter a location to source documents from.

Figure 5. Full chat interface in SocialGenPod, showing chat threads and
available models.

[SocialGenPod sidebar and chat window]A screenshot of SocialGenPod. On the
left, a sidebar shows that the current user is logged in and there is a log
out button. Below, there is a section called “Chats” with a selected button
labelled “Hi, how are”. There is also a delete button and a “Start new
conversation” button. Further below, it says Demo embeddings provider
http://localhost:5000/ and Demo LLM provider http://localhost:5000/ and there
is a button labelled “Review configuration”. Finally, there are radio buttons
for embedding models and LLMs. On the right, a chat window shows a user
question “Hi, how are you today?” and an AI response “I’m doing well, thank
you for asking. How can I assist you today?”

Our SocialGenPod implementation uses an embeddings model provider as the
retrieval service and a Large Language Model provider as the generative AI
model service.

Upon opening the SocialGenPod Web app, the user logs in using their Solid
credentials (Step 1 in Figure 4). Then, they can set up the service providers
to use (or reuse a previous configuration) for retrieval and generation (Step
2 in Figure 4). Once the app is configured, as shown in the left sidebar in
Figure 5, the user can choose to start a new conversation thread or continue
an existing conversation. Chat threads and messages are stored in the user’s
Pod. Available models from selected providers are also shown in the sidebar,
so the user can quickly switch between different models at any time, even mid-
conversation.

The Web app handles data retrieval and updates from/to the user’s Pod, and the
language model service only receives conversation data from the Web app. When
sending requests to external endpoints, the Web app sends Solid-OIDC
authentication headers as well, so both the Solid Pod and the external
services can confirm the identity of the requestor. In this way, the services
can perform _user_ (but not _account_) management, such as only allowing a
predefined set of users to use the service.

Optionally, in the configuration step, the user may provide a Solid Pod
location to source documents from for Retrieval Augmented Generation. If
provided, the specified retrieval service gets relevant documents, which are
sent together with user queries to the language model service. An alternative
design choice could have been for the Web App to retrieve documents and send
them to the retrieval service for similarity search, however, our chosen
approach supports advanced social sharing, as discussed in subsection 4.2.

###  4.2. Social Sharing

Besides individual use cases, SocialGenPod supports social sharing of both
service providers and personal documents.

The retrieval service can use Solid-OIDC for user identity verification. This
way, Alice can selectively allow only Bob to read data from her Pod _using a
particular retrieval service_ , independently of which front-end Web app Bob
uses. Since the generative AI model provider is decoupled from the retrieval
service provider, Bob could use any generative AI model in this workflow,
self-hosted or remote.

The advantage of this micro-services-oriented plugin architecture is that it
keeps services minimal and substitutable. Service providers do not need to
maintain account management systems nor associated controlled data storage. As
briefly discussed above, this reduces the complexity and vulnerability of
these services, and could improve trust between service providers and end
users.

##  5\. Limitations and Future Work

With SocialGenPod, we demonstrated how one can build privacy-friendly
generative AI Web applications using Solid. In future work, it would be useful
add more personalisation features, such as fine-tuning on personal data and
deploying personalised models in a decentralised way. The main challenges to
address are delegating fine-tuning computation and inference on personalised
models.

Another potential direction for future research could be addressing challenges
related to document retrieval by relevance. Currently, SocialGenPod relies on
a retrieval service provider copying personal documents for local
computations, which requires trusting that the provider will handle data
securely.

It would also be interesting to explore private inference techniques (Hao et
al., 2022), for improved privacy protection when using untrusted model
providers. Other privacy and security risks related to personal AI assistants
and methods to mitigate those risks should also be investigated in future
work. For example, a malicious actor with access to a personal AI assistant
could potentially attempt to retrieve the full contents of user’s personal
documents by prompting the assistant many times.

###### Acknowledgements.

This work was partially supported by Oxford Martin School’s programme on
“Ethical Web and Data Architectures in the Age of AI”. We thank Tim Berners-
Lee and Nigel Shadbolt for providing valuable feedback.

## References

  * (1)
  * Bejcek (2024) Brett Bejcek. 2024.  Who has access to my data?  https://help.rewind.ai/en/articles/6526621-who-has-access-to-my-data.  Accessed: 2024-02-05.
  * Berners-Lee (2023) Tim Berners-Lee. 2023.  Inference from Private Data.  https://www.w3.org/DesignIssues/PrivateData.html.  Accessed:2024-02-05.
  * Derico (2023) Ben Derico. 2023.  ChatGPT bug leaked users’ conversation histories.  https://www.bbc.co.uk/news/technology-65047304.  Accessed: 2024-01-24.
  * Hao et al. (2022) Meng Hao, Hongwei Li, Hanxiao Chen, Pengzhi Xing, Guowen Xu, and Tianwei Zhang. 2022.  Iron: Private inference on transformers.  _Advances in Neural Information Processing Systems_ 35 (2022), 15718–15731.
  * Jiang et al. (2024) Albert Q Jiang, Alexandre Sablayrolles, Antoine Roux, Arthur Mensch, Blanche Savary, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Emma Bou Hanna, Florian Bressand, et al. 2024\.  Mixtral of experts.  _arXiv preprint arXiv:2401.04088_ (2024).
  * La Malfa et al. (2023) Emanuele La Malfa, Aleksandar Petrov, Simon Frieder, Christoph Weinhuber, Ryan Burnell, Raza Nazar, Anthony G Cohn, Nigel Shadbolt, and Michael Wooldridge. 2023.  Language Models as a Service: Overview of a New Paradigm and its Challenges.  _arXiv e-prints_ (2023), arXiv–2309.
  * Mansour et al. (2016) Essam Mansour, Andrei Vlad Sambra, Sandro Hawke, Maged Zereba, Sarven Capadisli, Abdurrahman Ghanem, Ashraf Aboulnaga, and Tim Berners-Lee. 2016.  A demonstration of the solid platform for social web applications. In _Proceedings of the 25th international conference companion on world wide web_. 223–226.
  * Sambra et al. (2016) Andrei Vlad Sambra, Essam Mansour, Sandro Hawke, Maged Zereba, Nicola Greco, Abdurrahman Ghanem, Dmitri Zagidulin, Ashraf Aboulnaga, and Tim Berners-Lee. 2016.  Solid: a platform for decentralized social applications based on linked data.  _MIT CSAIL & Qatar Computing Research Institute, Tech. Rep._ (2016).
  * Touvron et al. (2023) Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023\.  Llama: Open and efficient foundation language models.  _arXiv preprint arXiv:2302.13971_ (2023).
  * Yang et al. (2023) Ling Yang, Zhilong Zhang, Yang Song, Shenda Hong, Runsheng Xu, Yue Zhao, Wentao Zhang, Bin Cui, and Ming-Hsuan Yang. 2023.  Diffusion models: A comprehensive survey of methods and applications.  _Comput. Surveys_ 56, 4 (2023), 1–39.
  * Zhao et al. (2023) Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, et al. 2023\.  A survey of large language models.  _arXiv preprint arXiv:2303.18223_ (2023).


# Light curve’s recovery with Rubin-LSST:
II. UnVEiling the darknesS of The gAlactic buLgE (VESTALE) with RR Lyrae

Di Criscienzo,M.  INAF – Osservatorio Astronomico di Roma, Via Frascati 33,
I-00078 Monte Porzio Catone, Roma, Italy  Leccia, S  INAF-Osservatorio
Astronomico di Capodimonte, Salita Moiariello 16, 80131 Naples, Italy  Braga,
V  INAF – Osservatorio Astronomico di Roma, Via Frascati 33, I-00078 Monte
Porzio Catone, Roma, Italy  Musella, I  INAF-Osservatorio Astronomico di
Capodimonte, Salita Moiariello 16, 80131 Naples, Italy  Bono, G  Department of
Physics, Universitá di Roma Tor Vergata, Via della Ricerca Scientifica 1,
00133 Roma, Italy  Dall’Ora  INAF-Osservatorio Astronomico di Capodimonte,
Salita Moiariello 16, 80131 Naples, Italy  Fiorentino, G  INAF – Osservatorio
Astronomico di Roma, Via Frascati 33, I-00078 Monte Porzio Catone, Roma, Italy
Marconi, M  INAF-Osservatorio Astronomico di Capodimonte, Salita Moiariello
16, 80131 Naples, Italy  Molinaro, R  INAF-Osservatorio Astronomico di
Capodimonte, Salita Moiariello 16, 80131 Naples, Italy  Ripepi, V  INAF-
Osservatorio Astronomico di Capodimonte, Salita Moiariello 16, 80131 Naples,
Italy  Girardi, L  Osservatorio Astronomico di Padova – INAF, Vicolo
dell’Osservatorio 5, I-35122 Padova, Italy  Mazzi, A  Universita di Bologna
Pastorelli, G  Dipartimento di Fisica e Astronomia Galileo Galilei,
Universit‘a di Padova, Vicolo dell’Osservatorio 3, I-35122 Padova, Italy
Trabucchi, M  Dipartimento di Fisica e Astronomia Galileo Galilei, Universit‘a
di Padova, Vicolo dell’Osservatorio 3, I-35122 Padova, Italy  N. Matsunaga
Department of Astronomy, School of Science, The University of Tokyo, 7-3-1
Hongo, Bunkyo-ku, Tokyo 113-0033, Japan  Monelli, M  Instituto de Astrofísica
de Canarias, Calle Via Lactea s/n, 38205 La Laguna, Tenerife, Spain  Saha, A
National Optical Astronomy Observatory, 950 N. Cherry Avenue, Tucson, AZ
85719, USA  Vivas, K. A  Cerro Tololo Inter-American Observatory/NSF’s
NOIRLab, Casilla 603, La Serena, Chile  Zanmar Sanchez, R  INAF-Osservatorio
Astronomico di Capodimonte, Salita Moiariello 16, 80131 Naples, Italy

###### Abstract

This work is part of VESTALE, a project initiated within the LSST Cadence
Strategy Optimization Process (Bono et al. 2018). Its goal is to explore the
potential of Rubin-LSST observations aimed at the Galaxy’s bulge (Bulge) for
studying RR Lyrae stars (RRL). Observation and analysis of RR Lyrae stars in
the Bulge are crucial for tracing the old population of the central part of
our galaxy and reconstructing the history of Bulge formation. Based on
observations conducted with CTIO/DECam by Saha et al. (2019) towards the Baade
Window, our simulations demonstrate that early Rubin-LSST observations will
enable the recovery of RR Lyrae light curves at Galactic center distances with
sufficient precision. This will allow us to utilize theoretical relations from
Marconi et al. (2022) to determine their distances and/or metallicity,
following the REDIME algorithm introduced in Bono et al. (2019). We show how
reddening and crowding affect our simulations and highlight the importance of
considering these effects when deriving pulsation parameters (luminosity
amplitudes, mean magnitudes) based on the light curves especially if the goal
is to explore the opposite side of the Bulge through the observation of its
RRL. The simulations discussed in this investigation were conducted to support
the SCOC’s decision to observe this important sky region since it has only
recently been decided to include part of the Bulge as a target within the LSST
main survey.

##  1 introduction

Although detailed photometric investigations of the Bulge date back to more
than one century ago thanks to the pioneering works of Shapley and Baade, its
formation and evolution remain a debated topic (Kunder et al. 2022).
Old, metal-poor stars in the inner Galaxy need to be adequately accounted for
when discussing processes that gave rise to the formation of the Galactic
bar/bulge. In general, RRL can be easily recognized among these old stars due
to the coupling between the shape of the light curve and the pulsation period
and for this reason, they are often used as tracers of old stellar populations
in different Galactic and extragalactic environments.
Even if the Bulge is a challenging environment due to the effect of high
reddening and stellar crowding, several studies successfully investigated the
RRL’s light curves in the last decade. We can mention for example MACHO, EROS
and OGLE, optical surveys dedicated to microlensing, which discovered
thousands of variable stars in the Bulge (Alcock et al. 1998; Renault et al.
1997; Soszynski et al. 2019) or the VVV survey (Contreras Ramos et al. 2018)
which, working in the near-infrared bands, has the advantage of being less
sensitive to reddening than those in the optical passbands and indeed, they
discovered one thousand new RRL in the Galactic Centre (GC).
Recent studies based on these large samples (see Kunder et al. 2022, for a
complete review) show that the Bulge RRL have a metallicity distribution
function centered around [Fe / H] $\sim$ -1.4 , but covering a very broad
range in iron abundance (Terndrup & Walker 1994; Savino et al. 2020). This
means that RRL are solid tracers to investigate the early chemical enrichment
of the Bulge (Debattista et al. 2023). As for the kinematic properties, there
still needs to be a consensus as to whether the Bulge RRL spatially trace out
the bar or if they are more consistent with a more spheroidal bulge
population. In particular different RRL photometric surveys in different
wavelengths present differing results. To further complicate the situation
many of the results from current investigations are affected by several
limitations: i) deep and homogeneous optical investigations have been limited
to low reddening windows; ii) the Bulge, and in particular the inner part, are
among the densest Galactic stellar fields. This means that both optical and
NIR seeing limited observations are hampered by two limitations: i) even
relatively bright sources are affected by blending; ii) the limiting magnitude
is quite shallow, due to the confusion limit. This paper will focus on what
the soon-to-start Rubin Legacy Survey of Space and Time (Rubin-LSST) can do
for the RRL observation in the Bulge. In particular in Marconi et al. (2022)
we have derived new theoretical Color-Color and Period–Luminosity–Metallicity
relations for RRL in the Rubin-LSST filters based on a recently computed
extensive set of nonlinear convective pulsation models for RRL stars, covering
a broad range of metal content. As demonstrated in Bono et al. (2019), these
relationships offer an important tool for deriving the metallicity, distance,
and reddening of these stars from the recovery of their light curves. However,
an accurate recovery of RRL light curves is necessary to precisely determine
pulsational parameters and thus fully exploit the Marconi et al.
relationships. As a part of the VESTALE (unVEil the darknesS of The gAlactic
buLgE) project (Bono et al. 2018), in this paper we will simulate Rubin-LSST
observations of RRL in the Bulge direction, to examine the level of accuracy
we can expect in the recovery of light curves and to understand how deep into
the darkness we can go. This provides an exceptional opportunity to determine
the density profile of old stellar populations in the direction of the Bulge.
We remember that this particular footprint was only recently included in the
main survey as a result of the cadence strategy optimization process and in
response to the pressure from the scientific community interested in this
important part of the Galaxy (Street et al. 2023).
To understand how much the decisions made at the end of Phase 2 of the Cadence
Strategy Optimization Process will impact the accuracy in the recovery of
Bulge RRL, in this paper we will use both tools released by LSST collaboration
and our own.
The structure of the paper is the following. In Section 2, we will review the
decisions made by the Survey Cadence Optimization Committee (SCOC) that impact
the Bulge, as summarized in baseline_v3.3_10yrs.db.
In section 3, we show the Rubin-LSST simulations of RRL’s light curves (LC)
discovered and studied by Saha et al. (2019) with CTIO/DECam. We analyze LC
recovery in function of time to understand how much better Rubin-LSST will be
able to perform and when the first useful results for studies of Bulge
formation will begin to be obtained.
Section 4 investigates the effect of crowding on the recovery of RRL light
curves and discuss the importance of including crowding-related errors as data
products in each release of Rubin-LSST data.
Considering that, in addition to extending Saha’s work to a much broader sky
area towards the Bulge, the survey will probe much deeper than any other
survey of its kind in Section 5, we displace Saha’s templates further away and
repeat the LC recovery to understand the extent of LSST’s capabilities.
The Conclusions close the paper.

##  2 The inner part of the Galactic Bulge in Rubin-LSST Opsim simulations

The first released simulations produced by the Operations Simulator (OpSim)
within the Metrics Analysis Framework (MAF) omitted the consideration of the
Bulge/Inner disk (and the Magellanic Clouds) in the primary survey due to
issues related to crowding. Instead, these specific sky regions were
encompassed by a series of ad hoc mini-surveys, each comprising approximately
one-fourth the number of visits projected by the main survey.
Thanks to the pressure of the scientific community (see e.g. Olsen et al.
2018), the SCOC in its final document (Phase 2 document,
PSTN-055111https://pstn-055.lsst.io/) added the suggestion to include part of
the Bulge and Plane in the main survey called Wide, Fast and Deep (WFD)
survey. In particular, the recommended footprint implemented in the last
version of the Baseline (baseline_v3.0_10yrs.db) included a $\sim$ 10$\%$ area
increase, extending the WFD into low-dust extinction regions for extragalactic
science, and expanded WFD-level coverage into high-priority regions for
Galactic science — the Galactic Bulge and the Magellanic Clouds. The proposed
solution is to cover the Galactic plane in two parts: WFD-level regions near
the Bulge and other regions of interest (that are still to be decided in a
definitive manner) and a lower level of coverage in the rest of the regions.
The median number of visits per pointing in these areas over the lifetime of
the survey (in any filter) is $\sim$ 800 visits per pointing in WFD-level
areas and $\sim$ 250 in the high dust extinction (low coverage) Galactic plane
regions. Actually there’s still a preference for a distribution of visits in
the rizy bands (20% in each of these bands), while $\sim$ 7% and 10% of the
visits will be in the u and g bands respectively.
Nevertheless, a few outstanding points remain open for further exploration and
refinement. A new task force that formed immediately after the conclusion of
Phase 2 of the Cadence Strategy Optimization process, is currently working to
provide input on the final design of the coverage of areas of the Galactic
Plane/Bulge. In particular the 4th Survey Cadence Optimization Workshop (
https://www.youtube.com/watch?v=Z97ZTagYd8I) has just concluded, and one of
the requests from the SCOC at the margin of the meeting was to provide
feedback on the latest simulations, especially from teams that refer to Stars,
Milky Way & Local Volume (SMWLV) science collaboration interested in
reconstruct the shape and evolution of Galaxy and its components with LSST
data. This work partially aims to address this request.
In addition, this work provides us with the opportunity to explore, for the
first time, the new simulations constructed considering the triple silver
coating of the telescope’s mirrors. We recall that the sensitivity has notably
improved in grizy photometric bands between baseline version 3.0 (described in
phase2 document ) and 3.3 and decreased by approximately 0.4 mag the u-band
sensitivity.

##  3 LSST recovery of RR Lyrae observed by Saha et al. 2019 in Baade Window

To simulate LSST observations of Bulge’s RRL we use PulsatingStarRecovery
(PSR) metric (Di Criscienzo et al. 2023) that we build within the Cadence
Survey Optimization process to analyze the recovery of the LSST simulated
light curves.
We start from the area centered on the well-known Baade’s Window ((l, b) =
(1.02, -3.92) deg) which has the advantage of being close to the direction of
the Galactic center while remaining relatively transparent to dust. The
further advantage of this area is that ugriz observations at different epochs
with DECam imager on the Blanco 4m telescope at CTIO are available. DECam not
only has similar filters, but also has a pixel scale very similar to LSSTCam.
Saha et al. (2019) observed a single DECam field (FoV=3 deg2) in Baade’s
Window, obtaining between 70-90 epochs per band. According to the last Opsim
version (baseline_v3.3_10yrs.db) Baade’s Window region will be observed by the
main survey which means that it will receive an average of 800 visits over the
10 years of the survey in all the photometric bands.
Using these data Saha et al. (2019) confirmed and analyzed almost 500 RRL,
almost all ab-type. For each of the confirmed RRL the authors provided the
best template taken from the library of light curve templates set up from
Sesar et al. (2020). We use those curves as starting points to derive the
simulated LSST light curves .
From the Saha’s sample we only removed stars that have, in at least one
photometric band, an average magnitude brighter than the saturation magnitude
of Rubin-LSST (see Science book, https://www.lsst.org/scientists/scibook). As
a result, the number of RRL that we simulated decreased from 474 to 439 stars.
We begin analyzing the recovery of RRL as they would appear if the LSST
cadence followed one of the latest baselines released by SCOC (namely
baseline_v3.3_10yrs.db).

Figure 1: Simulated LSST observations during the first 4 years in ugriz colors
(colored points) for two RR Lyrae in Saha’s sample. Star 3087315 is the
faintest in their sample. The orange light curve is Saha’s template.
Photometric errors (<0.001 mag) derived from Opsim and used in the
thissimulation are too small to be shown.

In Figure 1, we exhibit two out of the simulated time series obtained in all
available filters after 4 years of LSST observations, phase-aligned using the
periods derived by Saha (orange curve). It should be noted that unfortunately
the Saha observations are missing the Y-band and for this reason, we did not
simulate the observations in the Rubin-LSST y-band. The star ID3087315 is the
faintest among the Saha’s that, nevertheless, falls within Rubin detection
capabilities ( single-visit 5-sigma magnitudes are 23.3, 24.4, 23.8, 23.6, and
22.9 in u,g,r,i,z filters respectively). We have started selecting 4 years of
the survey as the starting point for our investigation because according to
the simulated LSST observational strategy, it is after this duration that, on
average, the total number of visits will be comparable to those obtained by
Saha ($\sim$ 250/300 phase points if all the bands are considered and $\sim$
60/70 in the ’i’ band). Coincidentally, this is also the average number of
visits expected for the low coverage of the Galactic Plane regions (see
Subsection 3.1).

Figure 2: Relative difference (in percentage) between recovered and template
periods (upper), mean magnitude (middle), and amplitude (bottom) in function
of r mean brightness for the 439 RRL from Saha’s sample. In the middle and
upper panels the vertical bar reports the accuracy of the recovery of the
period.

In the upper panel of Figure 2, we present the comparison between the periods
derived by PSR metric on 4-year LSST simulated time series and Saha’s periods.
We remember that our metric use Gatspy software (VanderPlas $\&$ Ivezic 2015)
to derive periods. In particular we use the MultibandLombScargle option that
performs a Lomb-Scargle (Lomb 1976; Scargle 1982) period search, by using
simultaneously the information from all the available filters. After 4 years,
we found that the period is recovered excellently: within 0.005$\%$ for all
the stars and within 0.001$\%$ for more than the 50$\%$ of star’s sample. The
middle and bottom panels of Figure 2, display the trend with the template’s
mean magnitude of the difference between the recovered and template mean
magnitudes (in r-band) after the phased light curve was fitted by our metric.
The PSR metric’s version used in this work differs from the one published in
Di Criscienzo et al. (2023) as it autonomously computes the required numbers
of harmonics, thus reducing the degrees of freedom in the fit. Our analysis
demonstrates that in the WFD survey after 4 years, LSST will recover Saha’s
light curves with such precision that it provides very accurate mean
magnitudes and peak-to-peak amplitudes ($\sim$ 0.001 mag). It’s crucial to
note that these quantities, especially periods and mean magnitudes go in the
Period-Luminosity (PL) relations that are used to determine distance and/or
metallicity. Thus, the high precision of the recovered parameters also implies
extremely reliable distance and metallicity determinations. Insteed amplitude
is less important for distances but it is relevant to study the properties of
the RRL population through for example, a Bailey diagram (Fiorentino et al.
2015, 2022).
The only error we have considered at this stage on the individual visit
magnitude is the photometric error derived from the 5-sigma limiting magnitude
given by Opsim at each position in the sky, which, notably, for the magnitudes
involved, is exceedingly small (less than 0.006/0.007 mag in all the
photometric bands). This factor also explains why our light curve exhibits
much less dispersion around the template compared to Saha’s light curve that
exhibits a 0.03/0.04 mag mean scatter around the template in the griz
photometric bands and up to 0.09 mag in the u (see their Figure 1).
We didn’t take into consideration the crowding effect on the template assuming
that Saha et al. (2019) accurately deblended their stars during their
photometry. The effect of the crowding will be discussed in detail in Section
4.

Figure 3: Precision distribution in the recovery of period and average
magnitude of RRL in the Saha sample after 1, 2, 3, and 4 years.The analysis of
the second panel shows that starting from the second year, the precision in
the r band remains below 0.04 mag.

###  3.1 Early Science: Unveiling Key Insights from the very first releases

To investigate the LSST recovery of RRL light curves from the very first
release, in Figure 3, we show the differences between recovered and true
periods/mean magnitudes after 1, 2, 3, and 4 years.
Despite the first data release being expected six months after the survey’s
start, we didn’t consider this release in the figure because in that case the
number of visits strongly depends on the type of rolling conducted during the
first part of the year a matter that, even though fundamental in defining
LSST’s early science and extensively discussed in the Phase2 Document, falls
beyond the scope of this work.
As expected, our simulations show that the accuracy in recovering the light
curve increases with the number of visit, but it is enough for doing early
science even after one year. Entering in more detail, we will recover periods
with a precision smaller 0.005% for almost half of the sample, while, in
general, they will all remain below 0.05% (that translates in about 4sec for a
typical RRL ) from the first year.
Figure 3 also shows that from the first year, r-average magnitudes will be
recovered within 0.04 mag. Instead, the same precision in the g-band will be
achieved by more than 90% of the stars in the Saha sample only starting from
the second year, while the number of visits in the u-band is too small (<7
phase points) to allow a good fit of the data.
Starting from the very first release, light curve templates (LCTs) can be
adopted in this case to estimate accurate mean magnitudes (Braga et al. 2024,
in prep.). LCTs can be used both by anchoring them on a single phase point
(but this requires the knowledge of the reference epoch) or as fitting
functions, for which at least three/four-phase points are needed, but only the
pulsation period is required. This tool will be mostly useful during the first
two years of the survey—when a precise fitting of the light curve will not be
possible due to the small number of phase points—thus allowing the
exploitation of the early scientific data from LSST. In conclusion, with
Rubin-LSST we will obtain light curves at least as accurate as those derived
by Saha et al. (2019) from the early years of the Rubin-LSST survey, and
additionally, over a wider and deeper footprint with the large advantage of
exploring a much larger portion of the Bulge. For example, setting the
threshold at 0.04 mag on the mean magnitude, which is the constraint imposed
by Bono et al. (2019) for the use of the REDIME method to simultaneously
measure individual distances, reddening and metallicities of RRL, our
simulations show that these are achieved from the first year in the riz(and
y), and from the second year in the g band. The visits in the u band within
the first 4 years, however, are too few to allow for an adequate fit, and in
that case, the use of templates will be necessary.
The analysis just described is also useful for understanding the problems
related to the recovery of RRL’s light curves located in the inner Disk
region, which will be observed by LSST only in a low-density mode according to
the last Opsim. Specifically, in 10 years of LSST, this region will receive
only 250 visits, coincidentally the same number of visits after 4 years of
WFD. If the filter balance remains the same as in the Wide Fast Deep survey,
in the inner/bulge areas observed with a low density cadence we can expect
that observations in the u-band for fitting the light curve will be
practically useless even after 10 years. This makes it necessary to use
templates in the u-band throughout the entire duration of the survey.

##  4 Crowding effect on light curves

So far, we have used Saha’s templates from Sesar et al. (2020) and analyzed
their recovery without considering the effect caused by crowding.
Extending the analysis beyond the Baade Window and gooing deeper than the
Saha’s variables, which are the two main advantages of Rubin-LSST, also means
having to tackle complicated issues such as crowding and reddening. In the
upcoming sections, we will address these previously overlooked questions.
It is well known that photometry in a crowded field could lead to inaccurate
measurement of the flux at each visit. In general, if the star is not well
deblended from the neighboring stars, at each visit the measured flux will
also include the flux from the surrounding stars. Naturally, this effect
depends on both the density of stars in the field under consideration and the
types (luminosity and color) of the blending stars. To show the impact of
crowding on the recovery of light curves during LSST, we used a TRILEGAL
simulation of the Galaxy described by Dal Tio et al. (2022) that are made
available at the NOIRLab Astro Data Lab (Olsen et al. 2018) .

Figure 4:  Comparison in ugriz bands between the Saha’s light curve
corresponding to the RRL star ID392 and the one obtained by adding the flux of
5 nearby stars according to TRILEGAL (see text). The difference between the
average magnitudes and the amplitudes is reported in each panel.

In Figure 4, for example, we show the light curve of one of our sample’s
templates together with that obtained adding to each visit the flux of the
stars falling within a radius equal to the LSST pixel scale. In particular,
for the RRL shown in this figure (ID392) TRILEGAL finds 5 very faint stars
with r-band magnitudes ranging from 21.35 mag and 26.68 mag. In the worst-case
scenario222Albeit unlikely because any photometry software would recognize
these blending stars., where the brightness of nearby stars is detected as the
brightness of the RRL the effect would be to have light curves brighter by
approximately 0.04 mag in r-band (see Figure 4). Another important effect is
that the crowding decreases the RRL amplitude, due to its greater fractional
contribution at minimum vs. maximum light.

Figure 5: Histogram of photometric errors $\sigma_{crowd}$ due to stellar
crowding derived using CrowdingMagUncertMetric.py for the RRL of the Saha
sample in the labeled band.

By doing the same exercise for all the other stars in Saha’s sample, which,
being in different positions have different blending stars, the differences
between recovered and template mean magnitudes remain for the investigated
bands of the same order of magnitude, although they can reach up to one-tenth
of a magnitude in cases where blending stars are very luminous.
Obviously, providing a precise measure of the error due to crowding is a much
more complex operation that requires Artificial Star Tests (AST), where fake
stars are added to the observed images and then recovered using the same
pipeline used for the original images. Fortunately, approximate methods exist
for determining the error function from simulations. One of this method is
described by Olsen et al. (2003) and suggests that the photometric errors due
to stellar crowding, $\sigma_{crowd}$, depend on an integral of the brightness
distribution of stars fainter than the faintest one being observed. This
method is actually used in the MAF metric CrowdingMagUncertMetric developed by
Girardi and collaborators and described in Dal Tio et al. (2022). In Figure 5,
we present the values obtained with this metric taking into account positions
and magnitudes (in the labeled bands) for the objects in the Saha’s sample.
It’s noteworthy that not only that these errors are of the same order of
magnitude as the scatter observed in Saha’s light curves, but also that they
are larger than the precision on the average magnitudes we obtained from the
recovery of the simulated light curves. These computed crowding errors should
be considered as errors on the zero point of the recovered light curve (in the
brighter direction). Therefore these errors should be associated to the mean
magnitude obtained from the light curve fitting together with $\Delta$MeanMag
derived by PSR metric.
LSST Data Release is not planning to include estimates of incompleteness and
photometric errors due to crowding (see LSST Data Products Definition Document
( https://lse-163.lsst.io/). As demonstrated in this section these estimates
are essential to understand the uncertainty obtained in the recovery of light
curves of pulsating stars, but more generally these estimates are necessary to
transform star counts into absolute quantities such as stellar volume
densities and lifetimes in different phases of the stellar evolution, and to
be able to fit the physical models to the stellar data. For this reason, we
strongly suggest that crowding errors are a solid added value to be associated
with LSST Data Releases.

##  5 Probing the far side of the Bulge with LSST

Figure 6: Distance of the template’s average magnitude from the limiting
magnitude derived from Opsim for different template distances expressed as
factors between new distance and original distance derived from Saha color-
coded by the $\sigma_{crowd}$ value. The points below the horizontal line are
unlikely to be observed by LSST according to the most recent simulations.

So far, we have explored how Rubin-LSST will be able to recover Saha’s LC RRL
over time and the level of precision that will be achieved with each release,
aware that the advantage of Rubin-LSST will be that of extending Saha’s work
to a much larger portion of the sky than that observed by DECam. In this
section instead, we investigate to which photometric depth can RRL be
observed/recovered. This is a crucial information for understanding our
ability to reconstruct the geometry and formation history of the bulge using
LSST data.
To this purpose, we take star ID392 that according Saha’s computations is
located at $d_{saha}$=9.09Kpc and has a color excess E(r-z)=0.86 mag, and
while staying within the Baade Window, we move the star away using different
ratios of $d_{saha}$ which thus becomes our distance unit. To account for the
increase in reddening an additional color excess had to be added to each new
distance to derive the simulated light curve. This additional color excess
takes into account the high probability to encounter a significant amount of
dust in the other side of the bulge Specifically, for all the distances larger
than $d_{saha}$ we assumed that the additional excess is equal to the quantity
calculated by Saha using the minimum light curve method (Sturch 1966) on our
side. This assumption is based on the spherical symmetry of the dust around
the Galactic center, with a drop to zero when radius R=$d_{saha}$. We
acknowledge that this is only an approximation but without access to models of
dust distribution beyond the bulge333For example, we verified that the 3D dust
Bayestar-maps (Green et al. 2018) saturate at distances greater than the
Galactic center in the direction of ID392, it is the only plausible approach.
Actually, the awareness of this uncertainty makes still more evident the
importance of multi-wavelength LSST observations of RR Lyrae stars towards the
Bulge, will help to derive reddening maps, either using the appropriate
combination of theoretical relations from Marconi et al. (2022) as suggested
by the REDIME method (Bono et al. 2019), or directly from RRL LCs, as done by
Saha et al. (2019), using the color at minimum light of the RRL. Figure 6
separately shows, for each band, the ratio between the limiting magnitude
(derived from Opsim) and the ID392’s mean magnitude as the distance of the
star increases. Obviously, due to the increased reddening in the u-band444In
particular we adopt the A${}_{X}/$E(r-z) ratios as given in Equations
(22)–(26) of Saha et al. (2019) this limit in the bluest available photometric
band is reached at shorter distances with respect of the others. In
particular, for the considered extra reddening in the specific case, doubling
the distance already brings the magnitudes below the photometric threshold.
For the other bands, however, the figure shows that in principle it is
possible to observe stars up to four times the original distance, roughly up
to just under $\sim$40 kpc. However, at these distances, the so-called
crowding limit (the brightness below which the incompleteness caused by
crowding becomes significant, assuming values above approximately 50$\%$) is
reached. As reported by Dal Tio et al. (2022) this closely corresponds to the
point where the near-infrared magnitude will first reach $\sigma_{crowd}$
$\sim$ 0.25 mag. This limit also depends on the instantaneous value of the
seeing, in particular, for the case in question, we used the minimum seeing in
the first four years of simulations (0.51") and for this reason, the values
plotted in the figure represent a lower limit. This is true especially for the
near-infrared bands riz (and y when it will be available), while in the case
of the g-band, this limit is reached before, and in particular at three times
the distance of Saha.
For all distances between the true distance of the template and the limit
distance due to the crowding, LSST provides valuable data for discovering new
RR Lyrae stars. The time series of these newly discovered variables will allow
us to achieve excellent accuracy on the period (up to $\Delta$P=10-6days). We
are also able to reconstruct the shape of the light curve and hence to derive
its zero-point representing the mean magnitude. But for the errors on this
value, as stressed in the previous section, we cannot consider only those
coming from the fitting procedure, but we have to take into account the larger
uncertainties due to the effect of crowding on the zero-point of the light
curve. In our test case, for example, $\sigma_{crowd}$ ranges from 0.2 mag in
the g-band to 0.1 mag in the z-band aiming to make the mean magnitudes
brighter. If these errors are not properly taken into account we would derive,
on average, smaller distances of those RRL observed in the opposite side of
the Bulge that are brighter than the crowding limit, leading to an incorrect
reconstruction of the shape of the Bulge. Unfortunately, even at 1.5 times the
distance of Saha ($\sim$13.5 kpc), the errors are still significant even if
they drop below 0.1mag in our reddest band z, and presumably remain equally
small even in y band, which we are currently not simulating because we lack
the corresponding Saha’s template. Therefore, we confirm that these two bands
will be crucial for the first kpc beyond the Bulge to characterize their LC
and derive the RRL pulsation parameters such as periods and mean magnitudes.
Unfortunately, having mean magnitudes in only two bands means that it won’t be
possible to use the REDIMI method to simultaneously derive distance,
metallicity, and reddening. Different methods based on the shape of the light
curve, such as $\phi$31 –[Fe/H] relations, could be used in these cases
(Ripepi et al. in preparation)

##  6 Conclusions

In Di Criscienzo et al. (2023), we employed the tool PulsationalStarRecovety
developed by our team during the Survey Strategy Optimization process to
simulate Rubin- LSST observations of RRL in selected Local Group dwarf
galaxies and quantified the recovery of their light curves. We found that the
observing cadence will not have a major impact on the detection and
characterization of individual RRL, however, it will affect the number of RRL
measured with the required photometric accuracy for properly utilizing Marconi
et al. (2022) relations to derive their distances and metallicities from
observational quantities such as period and mean magnitudes.
In this paper, our focus shifted towards a significantly more complex
footprint: the Bulge, which was only recently included in Rubin-LSST main
survey and for which there are still many uncertainties regarding both the
choice of the exact size of the footprint and the observational strategy to be
used.
In this work, we have shown that high reddening and crowding of this part of
the sky will affect photometric measurements during each survey visit and pose
challenges to the recovery of pulsating stars’ light curves, significantly
increasing the error budget on pulsation parameters especially on average
magnitudes and amplitudes.
The same considerations can obviously be extended to observations of other
crowded fields such as globular clusters or the central parts of dwarf
galaxies studied in Di Criscienzo et al. (2023).
As a reference point for this work, we relied on Saha’s observations with
CTIO/DECam towards the Bulge. In Saha et al. (2019) the authors used these
observations to reconstruct the spatial distribution of RRL population around
the Galactic center and at the same time derived detailed reddening maps.
Furthermore, these observations can be combined with Marconi et al. (2022)
relations to determine the metallicity distribution of observed RRL using the
REDIME method by Bono et al. (2019) (Braga et al. in preparation) or reddening
maps based on the color at minimum light of RRL. Currently this is possible
only in a limited area towards the Bulge observed by DECam, whereas Rubin-LSST
will give the opportunity to perform similar analysis over a much broader and
deeper area providing homogeneous material for future studies of the Bulge
structure, the first step in reconstructing its formation history.
In particular, our simulations show that although it will be necessary to use
variable templates to accurately derive observables such as mean magnitude and
amplitude, especially in undersampled photometric bands like u and g during
the very early releases, using the period derived from the most sampled bands,
on the contrary for the redder bands starting from DR1 the precision achieved
in the LC recovery will be much higher than that obtained by Saha and
collaborators. Instead, in the case of Bulge/Disk regions covered by the WFD
survey we will have to wait for the data release at the end of the second year
to achieve the same precision even in the u and g bands without using
templates and even the end of the survey in the case of areas not included in
the main survey.
Using TRILEGAL’s simulated Galaxy by Dal Tio et al. (2022) we have analyzed
the effect of crowding on the recovery of RRL light curves emphasizing that if
not appropriately treated, we recover light curves that are brighter and with
smaller amplitude. In particular the need for a measure of crowding error
starting from the early releases has been emphasized, in order to properly
utilize the provided magnitudes appropriately.
We finally explored the possibilities of observing RR Lyrae stars in the
opposite side of the Bulge with respect to the Galactic center. Obviously, the
results depend heavily on the reddening model adopted for the dark side of the
Bulge. Specifically, by making the very approximate assumption of a uniform
radial distribution that decreases to zero after a radius R=$d_{saha}$, we
have demonstrated that: 1) observations in the u band fall below the
photometric limit even before reaching R=2$d_{saha}$, therefore before
reaching virtually the point symmetrically opposite to us, 2) in the infrared
photometric bands, the crowding limit is reached before the photometric limit,
and this occurs at around 4 times the distance of the test star we used. In
this case, the recovery of light curves, although it will provide very precise
periods and equally good light curve shapes, will give average magnitudes that
will be heavily influenced by the crowding limits (between 0.1mag and 0.2
mag).
Among the investigated bands the only one to obtain distance estimates
accurate enough to investigate the shape and fine structure of the Bulge/Bar
regions well beyond the galactic center is the z-band. Additionally, we note
that the y-band will play a crucial role in early science, especially in
crowded and reddened regions like the inner bulge. However, constraining the
photometric accuracy in this band requires further refinement.
In general, early Rubin-LSST observations will be able to trace the edge
between the Bulge/Bar and the thin Disk, which is a very promising indication.
Additionally, these observations will help in tracing the transition between
the Bulge/Bar and the thin disk. In a recent investigation by our group
(D’Orazi et al. 2024), a significant sample of field RRL with disk kinematics
was identified. Despite their similarity to typical thin Disk stars, these
objects exhibit systematic under abundance in $\alpha$ and neutron capture
elements compared to typical thin Disk stars. Once confirmed, if these
findings hold true, they could pave the way for a new approach to constrain
the early formation of the Galactic spheroid, particularly the early coupling
between the Bulge/Bar and the Thin disk, using the same stellar tracer. In
conclusion, we strongly support the inclusion of Bulge/Inner Disk observations
in the WFD because LSST observations of this part of the sky, despite the
limitations discussed in this paper, will be crucial for reconstructing the
oldest component of the Bulge, thanks to the RR Lyrae stars that will be
discovered and analyzed during the survey.

This work was supported by: “Preparing for Astrophysics with the LSST Program"
funded by the Heising-Simons Foundation, and administered by Las Cumbres
Observatory with a grant for the publication and with the Kickstarter grant
“Period and shape recovery of light curves of pulsating stars in different
Galactic environments (KSI-8)”; Mini grant INAF 2022 “MOVIE@Rubin-LSST:
enabling early science" (PI: Di Criscienzo, M.); Project PRIN MUR 2022 (code
2022ARWP9C) “Early Formation and Evolution of Bulge and HalO (EFEBHO)" (PI:
Marconi, M.), funded by European Union – Next Generation EU; Large grant INAF
2023 MOVIE (PI: M. Marconi). VB and RC thank the Rubin-LSST inkind ITA-
INAF-S22 for the support. M.M. acknowledges support from Spanish Ministry of
Science, Innovation and Universities (MICIU) through the Spanish State
Research Agency under the grants "RR Lyrae stars, a lighthouse to distant
galaxies and early galaxy evolution" and the European Regional Development Fun
(ERDF) with reference PID2021-127042OB-I00 and from the Severo Ochoa Programe
2020-2023 (CEX2019-000920-S).

## References

  * Alcock et al. (1998) Alcock, C., Allsman, R. A., Alves, D. R., et al. 1998, ApJ, 492, 190
  * Bono et al. (2018) Bono, G. et al. 2018, https://arxiv.org/pdf/1812.03124.pdf
  * Bono et al. (2019) Bono, G., Iannicola, G., Braga, V. F., et al. 2019, ApJ, 870, 115. doi:10.3847/1538-4357/aaf23f
  * Debattista et al. (2023) Debattista, V. P., Liddicott, D. J., Gonzalez, O. A., et al. 2023, ApJ, 946, 118
  * D’Orazi et al. (2024) D’Orazi, V., Storm, N., Casey, A. R., et al. 2024, MNRAS. doi:10.1093/mnras/stae1149
  * Contreras Ramos et al. (2018) Contreras Ramos, R.; Minniti, D.; Gran, F.; Zoccali, M.;Alonso-García, J.; Huijse, P.; Navarro, M. G.; Rojas-Arriagada, Á.; Valenti, E., 2018, ApJ, 863, 79C
  * Dal Tio et al. (2022) Dal Tio, P. et al., 2022, ApJS, 262, 22
  * Di Criscienzo et al. (2023) Di Criscienzo, M., Leccia, S., Braga, V., et al. 2023, ApJS, 265, 41
  * Fiorentino et al. (2015) Fiorentino, G., Bono, G., Monelli, M., et al. 2015, ApJ, 798, L12. doi:10.1088/2041-8205/798/1/L12
  * Fiorentino et al. (2022) Fiorentino, G., Bono, G., Braga, V. F., et al. 2022, Mem. Soc. Astron. Italiana, 93, 47. doi:10.36116/MEMSAIT_93N4.2022.47
  * Gadotti et al. (2022) Gadotti, D., Valenti, E., Fragkoudi, F., et al. 2022, The Messenger, 188, 47. doi
  * Green et al. (2018) Green, G. M., Schlafly, E. F., Finkbeiner, D., et al. 2018, MNRAS, 478, 651
  * Kunder et al. (2022) Kunder, A., 2022, Universe, vol. 8, issue 4, p. 206
  * Lomb (1976) Lomb, N. R. 1976, Ap&SS, 39, 447
  * Scargle (1982) Scargle, J. D. 1982, ApJ, 263, 835
  * Marconi et al. (2022) Marconi, M.; Molinaro, R.; Dall’Ora, M. et al.2022, ApJ, 934,29M
  * Renault et al. (1997) Renault, C., Afonso, C., Aubourg, E., et al. 1997, A&A, 324, L69
  * Saha et al. (2019) Saha, A. et al., 2019, ApJ, 874, 30, 28
  * Savino et al. (2020) Savino, A., Koch, A., Prudil, Z., et al. 2020, A&A, 641, A96
  * Sesar et al. (2020) Sesar, B., Ivezić, Ž., Grammer, S. H., et al. 2010, ApJ, 708, 717.
  * Street et al. (2023) Street, R. A., Li, X., Khakpash, S., et al. 2023, ApJS, 267, 15
  * Sturch (1966) Sturch, C. 1966, ApJ, 143, 774. doi:10.1086/148557
  * Soszynski et al. (2019) Soszyński, I., Udalski, A., Wrona, M., et al. 2019, Acta Astron., 69, 321
  * Terndrup & Walker (1994) Terndrup, D. M. & Walker, A. R. 1994, AJ, 107, 1786
  * Olsen et al. (2003) Olsen, K. A. G., Blum, R. D., & Rigaut, F. 2003, AJ, 126, 452
  * Olsen et al. (2018) Olsen, K., Di Criscienzo, M., Jones, R. L., et al. 2018, arXiv:1812.02204. doi:10.48550/arXiv.1812.02204
  * Olsen et al. (2019) Olsen, K., Bolton, A., Juneau, S., et al. 2019, BAAS, 51, 61
  * VanderPlas $\&$ Ivezic (2015) VanderPlas J. T. and Ivezic Z, 2015 ApJ812 18