11institutetext: Max Planck Institute for Astronomy, Königstuhl 17, 69117,
Heidelberg, Germany
11email<EMAIL_ADDRESS><EMAIL_ADDRESS>22institutetext: Leibniz-Institut für
Astrophysik Potsdam (AIP), An der Sternwarte 16, 14482 Potsdam, Germany
33institutetext: Institut für Physik und Astronomie, Universität Potsdam,
Karl-Liebknecht-Str. 24/25, 14476 Potsdam, Germany 44institutetext: Faculty of
Mathematics and Physics, University of Ljubljana, Jadranska 19, 1000
Ljubljana, Slovenia 55institutetext: INAF, Osservatorio di Padova, Vicolo
Osservatorio 5, 35122, Padova 66institutetext: Department of Astronomy,
Stockholm University, AlbaNova University Centre, Roslagstullsbacken, 106 91
Stockholm, Sweden 77institutetext: ELTE Eötvös Loránd University, Gothard
Astrophysical Observatory, 9700 Szombathely, Szent Imre H. st. 112, Hungary
88institutetext: MTA-ELTE Lendület ”Momentum” Milky Way Research Group,
Hungary 99institutetext: INAF–Osservatorio Astronomico di Padova, Vicolo
dell’Osservatorio 5, I-35122 Padova, Italy 1010institutetext: Institute for
Advanced Studies, Technische Universität München, Lichtenbergstraße 2a,
D-85748 Garching bei München, Germany 1111institutetext: National Research
Council Herzberg Astronomy & Astrophysics, 4071 West Saanich Road, Victoria,
BC, Canada 1212institutetext: Institute of Theoretical Physics and Astronomy,
Vilnius University, Sauletekio av. 3, 10257, Vilnius, Lithuania
1313institutetext: Dipartimento di Fisica e Astronomia, Università di Bologna,
Via Gobetti 93/2, I-40129 Bologna, Italy

# Beyond _Gaia_ DR3:
tracing the $[\alpha/\text{M}]-[\text{M}/\text{H}]$ bimodality
from the Inner to the outer Milky Way disc
with _Gaia_ RVS and Convolutional Neural-Networks

G. Guiglion 11 S. Nepal 22 3 3 C. Chiappini 22 S. Khoperskov 22 G. Traven 44
A. B. A. Queiroz 22 M. Steinmetz 22 M. Valentini 22 Y. Fournier 22 A.
Vallenari 55 K. Youakim 66 M. Bergemann 11 S. Mészáros 7788 S. Lucatello
991010 R. Sordo 55 S. Fabbro 1111 I. Minchev 22 G. Tautvaišienė 1212 Š.
Mikolaitis 1212 J. Montalbán 1313

(Received … ; accepted …)

###### Abstract

Context. Launched in 2013 by ESA, _Gaia_ DR3 has provided the community with
about one million spectra from the Radial Velocity Spectrometer covering the
CaII triplet region. In the next _Gaia_ data releases, we anticipate the
number of RVS spectra to successively increase from several 10 million spectra
to eventually more than 200M spectra. Thus, stellar spectra are produced on an
„industrial scale“ with numbers well above those for current and anticipated
ground based surveys. However, many of these spectra have low S/N (from 15 to
25 per pixel), such that they pose problems for classical spectral analysis
pipelines and therefore alternative ways to tap into these large datasets need
to be devised.

Aims. We aim to leverage the versatility/capabilities of machine learning
techniques for supercharged stellar parametrization, by combining _Gaia_ RVS
spectra with the full set of _Gaia_ products and high-resolution, high-quality
ground based spectroscopic reference data sets.

Methods. We develop a hybrid Convolutional Neural-Network (CNN) which combines
the _Gaia_ DR3 RVS spectra, photometry (G, Bp, Rp), parallaxes, and XP
coefficients to derive atmospheric parameters ($\textit{T}_{\text{eff}}$,
$\text{log}(\textit{g})$, and overall $[\text{M}/\text{H}]$) and chemical
abundances ($[\text{Fe}/\text{H}]$ and $[\alpha/\text{M}]$). We trained the
CNN with a high-quality training sample based on APOGEE DR17 labels.

Results. With this CNN, we derived homogeneous atmospheric parameters and
abundances for 841 300 stars, that show remarkable precision and accuracy
compared to external data-sets (such as GALAH and asterosiesmology). The CNN
is robust against noise in the RVS data, and very precise labels are derived
down to S/N=15. We managed to characterize the
$[\alpha/\text{M}]-[\text{M}/\text{H}]$ bimodality from the inner regions to
the outer parts of the Milky Way, which has never been done using RVS spectra
or similar datasets.

Conclusions. This work is the first to combine machine–learning with such
diverse datasets, and paves the way for large scale machine-learning analysis
of _Gaia_ -RVS spectra from future data releases. Large, high-quality datasets
can be optimally combined thanks to CNN, thereby realising the full power of
spectroscopy, astrometry, and photometry.

###### Key Words.:

Galaxy: stellar content - stars: abundances - techniques: spectroscopic -
method: data analysis

##  1 Introduction

Precise stellar chemical abundances are crucial to constrain the formation and
evolution of the Milky Way and its neighboring galaxies, as it allows to
employ stars as fossil records of past star formation events, to disentangle
stellar populations, or to trace accreted stars and stellar streams (e.g.
Matteucci 2021; Helmi 2020). The elemental abundances, coupled with astrometry
from the _Gaia_ space mission (e.g. Gaia Collaboration et al. 2016; Lindegren
et al. 2018, 2021) are the chemo-dynamical process that shaped the Milky Way
and its satellites we observe today (e.g. Tolstoy et al. 2009; Bergemann et
al. 2018; Haywood et al. 2018; Queiroz et al. 2021). The more detailed the
stellar chemistry is, the more we can tell about the nucleosynthesis processes
that occurred (e.g. Nomoto et al. 1997; Roederer et al. 2016; Anders et al.
2018). From an observational point of view, this translates into the necessity
of measuring a large variety of spectral lines from many different elements in
stellar spectra.

Deriving high precision chemical abundances for Galactic Archaeology has
become a quest for modern large scale spectroscopic surveys. Surveys use
modern spectrographs to observe stars with different setups, and at different
spectral resolutions. For instance, the _Gaia_ -ESO survey (GES, Gilmore et
al. 2022; Randich et al. 2022) used both the ESO UVES and GIRAFFE high-
resolution spectrographs, covering large wavelength ranges (from near-UV to
near-IR), and observing at different resolutions (from 16 000 to up to 48
000). Other surveys such as LAMOST followed the same approach, at low and
intermediate resolution (Zhang et al. 2019, 2020; Wang et al. 2020).
Additionally, Infrared spectroscopy is very important for gathering spectra
from stars located in high-extinction regions. APOGEE pursued this effort
($R=22\,500$, $\lambda\in 1.5-1.7\mu$m, Ahumada et al. 2020a; Abdurro’uf et
al. 2022), contributing greatly to furthering our understanding the formation
and evolution of the Galactic bulge (e.g. Rojas-Arriagada et al. 2019; Queiroz
et al. 2020). WEAVE (Dalton et al. 2018) and 4MOST (de Jong et al. 2019) will
aim at observing the northern and southern hemispheres, respectively, at both
low-($R\sim 5\,000$) and high-($R\sim 20\,000$) resolution over the optical
domain: those surveys will have to deal with an unprecedented number of
spectra with the ultimate goal of measuring numerous (¿15 elements) high-
quality abundances (Bensby et al. 2019; Chiappini et al. 2019; Christlieb et
al. 2019; Helmi et al. 2019; Cioni et al. 2019; Jin et al. 2023).

Originally, standard spectroscopy has been the best way to derive a large
variety of chemical abundances in stellar atmospheres. Large spectroscopic
surveys base their spectral analysis on standard spectroscopic techniques,
based on the knowledge of stellar atmospheric properties (such as pressure,
temperature, and density, see Gray 2005) and radiative transfer (emission and
absorption mechanisms in the stellar atmosphere). A detailed knowledge of
spectral absorption lines is also needed (e.g. Guiglion et al. 2018; Heiter et
al. 2021; Kordopatis et al. 2023) in order to find the best features for
chemical abundance derivation. Departure from local thermodynamic equilibrium
can influence abundance determination (e.g. Bergemann et al. 2012). Spectral
fitting techniques, equivalent width methods, and differential spectroscopy
are usually employed to extract abundances and atmospheric parameters from an
observation, for instance SME Valenti & Piskunov (1996), GAUGUIN (Guiglion et
al. 2016), or Bayesian methods (Schönrich & Bergemann 2014; Gent et al. 2022).
This type of method has been intensively used over the last two decades, and
still continues to play a crucial role for the analysis of modern surveys
data.

Figure 1: Examples of _Gaia_ -RVS spectra for a RC star (top) at
$[\text{M}/\text{H}]=0$ (blue) and $[\text{M}/\text{H}]=-0.87\,$dex (orange);
The bottom panel shows a solar-twin with two different metallicities.

The new, extremely large spectral surveys pushed standard spectroscopic
techniques at their limit, requiring a fundamental shift in the methods.
Machine–Learning (ML) methods to propagate the knowledge of standard
spectroscopy to large scale spectroscopic data-sets. The main idea is to build
a set of reference stars (training sample) with atmospheric parameters and
chemical abundances (stellar labels) determined using standard spectroscopy. A
ML model is then built between stellar spectra and stellar labels, and then
propagated to an external set of spectra. Such a method is powerful, because
it allows for the simultaneous derivation of many stellar labels for millions
spectra, typically in several minutes. Meticulous selection of a training
sample is the crucial part of such a framework, as biased training samples
will automatically lead to biases in the label prediction. Several types of ML
algorithms have been employed recently in the Galactic Archaeology community
in order to parameterize stellar spectra: the Cannon (Ness et al. 2015), which
builds a generative model between spectra and stellar labels; the Payne (Ting
et al. 2019), which is based on the same generative model framework but
contains an interpolator based on an Artificial Neural-Network (ANN) abd uses
synthetic spectra ab-initio; Convolutional Neural-Networks (CNN) build as well
a model between spectra and labels, but are extremely efficient in learning
from spectral features, _e.g._ AstroNN (Leung & Bovy 2019) and StarNet (Fabbro
et al. 2018; Bialek et al. 2020). Concepts and details on CNNs can be found in
LeCun et al. (1989) and LeCun & Bengio (1995).

In Guiglion et al. (2020), we showed that it was possible to extract precise
chemical information from spectra with limited resolution and wavelength
coverage. We derived homogeneous atmospheric parameters and chemical
abundances from the spectra from the 6th Data Release (DR6) of the RAdial
Velocity Experiment (RAVE; Steinmetz et al. 2020b, a). We used a CNN approach,
trained on stellar labels from the 16th Data Release (DR16) of the Apache
Point Observatory Galactic Evolution Experiment (APOGEE; Ahumada et al.
2020b). This helped to alleviate some of the spectral degeneracies inherent to
the RAVE spectra ($R\sim 7500$, $\lambda\in\,842\,0-8\,780$ Å) by using
complementary absolute magnitudes computed from 2MASS, ALLWISE, and _Gaia_ DR2
photometry and parallaxes (Gaia Collaboration et al. 2018; Lindegren et al.
2018). The uncertainties on the resulting atmospheric parameters and chemical
abundances were 2 to 3 times lower than those reported by RAVE DR6. Including
such extra constraints in the form of photometry and parallaxes has also been
done recently in the context of APOGEE for parameterizing together low- and
high-mass stars with a CNN (Sprague et al. 2022).

Recently, Nepal et al. (2023) and Ambrosch et al. (2023) achieved major
improvements on the use of CNNs for chemical abundances using GES spectra:
more complex/refined architectures, improved training strategies and
uncertainties, reliability/robustness with respect to radial-velocities,
rotational velocities, and signal-to-noise. Both studies showed that CNNs
efficiently learn from spectral features instead of abundance correlations,
which is key for detecting chemically peculiar stars (eg. lithium-rich giants;
Nepal et al. 2023). These two studies represent a major step forward in the
comprehension of CNNs for the exploitation of future surveys such as 4MOST and
WEAVE.

In June 2022, the _Gaia_ consortium released around 1 million epoch averaged
RVS spectra that were originally analysed during _Gaia_ DR3
(10.17876/gaia/dr.3) by the General Stellar Parametriser for spectroscopy
(GSP-SPec, Recio-Blanco et al. 2022) module of the Astrophysical parameters
inference system (Apsis, Creevey et al. 2022). The main aim of this work is to
obtain more precise atmospheric parameters ($\textit{T}_{\text{eff}}$,
$\text{log}(\textit{g})$, $[\text{M}/\text{H}]$) and chemical abundances
($[\text{Fe}/\text{H}]$, $[\alpha/\text{M}]$) down to S/N=15 for the _Gaia_
DR3 RVS spectra. To achieve this goal we combine a hybrid CNN approach, APOGEE
DR17 stellar labels together with RVS spectra, photometry ($G$, $Bp$, $Rp$),
parallaxes and XP coefficients in order to break the spectral degeneracies.
The precise chemistry derived with CNN allows us to trace for the first time
the $[\alpha/\text{M}]-[\text{M}/\text{H}]$ bimodality with _Gaia_ RVS data.

The paper is divided as follows: in Sect. 2, we present the data-set used, and
the creation of the training sample; in Sect. 3, we detail the CNN method we
used; in Sect. 4, we present the parametrization of the _Gaia_ -RVS spectra;
in Sect. 5, we trace the $[\alpha/\text{M}]-[\text{M}/\text{H}]$ bimodality in
the Milky Way disc, while we list some caveats and draw conclusions in Sect. 6
and Sect. 7, respectively.

Figure 2: Kiel diagram of the APOGEE DR17 input labels of the training sample
(44 780 stars) colored by $[\text{M}/\text{H}]$ (top) and in density plot
fashion (bottom). Our training sample is clearly dominated by giants (77% of
the sample has $\text{log}(\textit{g})$¡3.5), which is a direct effect of both
the APOGEE and _Gaia_ -RVS selection functions.

##  2 Data

The data used in the present study consists of _Gaia_ DR3 RVS-spectra (Gaia
Collaboration et al. 2022b). We also incorporate _Gaia_ DR3 photometry
(phot_g_mean_mag $G$, phot_bp_mean_mag $Bp$, phot_rp_mean_mag $Rp$ magnitudes;
Riello et al. 2021), parallaxes (Lindegren et al. 2021), and XP coefficients
(De Angeli et al. 2022). The labels of the training sample are taken from
APOGEE DR17 (Abdurro’uf et al. 2022).

Figure 3: Density distribution of _Gaia_ $G$ magnitudes in the training (44
780 stars, blue) and observed (841 300, orange) samples. $\sim 98\%$ of the
observed magnitudes are contained within the training sample limits. Figure 4:
Correlation matrix of the labels together with photometry (_Gaia_ $G$, $Bp$, &
$Rp$), parallaxes (p) and S/N. Left: training sample (44 780 stars). Middle:
observed sample with low-uncertainties (689 527 stars). Right: rest of the
observed sample (151 773*). The only parameter not fed to CNN during training
is S/N. Figure 5: Flow-chart of CNN: _Gaia_ RVS spectra are used as input
spectra, and passed through the convolution layers for feature extraction.
Extra information is fed to CNN in the form of _Gaia_ DR3 parallaxes, and $G$,
$Bp$, $Rp$ photometry (on the left), and XP coefficients (on the right). The
information is fully-connected (FC) to the output labels
$\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$,
$[\alpha/\text{M}]$ and $[\text{Fe}/\text{H}]$.

###  2.1 _Gaia_ -RVS spectra

We used the $999\,670$ time-averaged, normalized and radial-velocity corrected
_Gaia_ -RVS spectra111https://doi.org/10.17876/gaia/dr.3/54 from _Gaia_ DR3
(Seabroke et al. 2022). The _Gaia_ -RVS spectra contain 2 401 pixels along a
scan, with a pixel size of 0.10Å, covering a spectral range of 8 460 - 8 700 Å
(240 Å range). The spectral resolving power reported by the _Gaia_ consortium
is $R\sim 11\,500$ Katz et al. (2022). Using the flags present in the _Gaia_
DR3 archive, we removed potential galaxies and quasars (in_galaxy_candidates =
False and in_qso_candidates = False), as well as objects showing variability
(phot_variable_flag $\neq$ ’VARIABLE’), binarity signs (non_single_star = 0).
As some of the _Gaia_ -RVS may contain NaN values, we replaced such values by
an upper quartile (Q3) of continuum flux computed in three regions (8 475-8
495 Å, 8 561-8 582 Å, and 8 627-8 648 Å). These regions were selected to not
contain any strong spectral features, but not completely devoid of lines.
Examples of Red Clump star (RC) and Solar twin spectra are presented in Fig.
1. In addition to the strong Ca II triplet, RVS spectra contain a large
variety of smaller features (see Sect. 3.5).

###  2.2 _Gaia_ DR3 magnitudes and parallaxes

In addition to _Gaia_ -RVS spectra, we adopted _Gaia_ DR3 magnitudes $G$
(330-1050 nm), $Bp$ (330-680 nm), $Rp$ (630-1050 nm) and
parallaxes222https://doi.org/10.17876/gaia/dr.3/1 333Contrary to Guiglion et
al. (2020), we did not compute absolute magnitudes in order to give the CNN
more flexibility. We also note that we did not apply parallax corrections as
described in Lindegren et al. (2021). Parallaxes, combined with magnitudes
give information on the luminosity, hence of the surface gravity and
temperature of stars. We removed spurious magnitudes by applying
phot_[g/bp/rp]_mean_flux_over_error$>$500\. We removed negative parallaxes as
well.

###  2.3 _Gaia_ DR3 XP coefficients

_Gaia_ DR3 also provides low-resolution ($R\sim$30-100) time-averaged
spectra444https://doi.org/10.17876/gaia/dr.3/53 in the blue (BP) and the red
(RP) for 220 million stars (De Angeli et al. 2022)). These so-called XP
spectra have been intensively used within the _Gaia_ collaboration for
deriving among others photometric effective temperatures, surface gravities,
and metallicities (GSP-Phot pipeline; Andrae et al. 2022). XP are also known
to contain metallicity sensitive features (Andrae et al. 2023; Zhang et al.
2023; Yao et al. 2023; Xylakis-Dornbusch et al. 2022). The XP spectra are
given in the form of projection onto a set of basis functions (i.e. the
coefficients of the projection; De Angeli et al. 2022), to complement RVS-
spectra, parallaxes, $G/Bp/Rp$ photometry. _Gaia_ provides 55 BP and 55 RP
coefficients, i.e. 110 XP coefficients. XP coefficients give CNN more feature
to learn the atmospheric parameters and abundances we aim at deriving. We
require that a given RVS spectrum has available XP coefficients
(has_xp_continuous=True). To filter emission, we applied classlabel_espels ==
NaN (Creevey et al. 2022).

###  2.4 Labels of the training sample

In this paper, we aim at deriving main atmospheric parameters
$\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, and overall
$[\text{M}/\text{H}]$, together with Fe content $[\text{Fe}/\text{H}]$ and
$[\alpha/\text{M}]$. As stellar labels for the training sample, we used the
high quality calibrated atmospheric parameters and individual chemical
abundances from the 17th Data Release (DR17) of APOGEE (Abdurro’uf et al.
2022), containing $733\,901$ stars. This data set is the best suited for our
CNN application as APOGEE DR17 covers both north and south hemispheres (as
does _Gaia_), thus maximizing the size of the training sample. We cross-
matched APOGEE DR17 and _Gaia_ -RVS data based on _Gaia_ EDR3 source_id,
leading to a cross-match of $207\,953$ stars. We also filtered duplicates
based on _Gaia_ source_id. We extensively used the flags provided by APOGEE
DR17, and followed the recommendations of the survey to clean up the sample to
be the most reliable. From the APOGEE_ASPCAPFLAG bitmask555See
https://www.sdss.org/dr17/irspec/apogee-bitmasks/ for more details on the
APOGEE bitmasks., we used the Binary Digits 7 (STAR_WARN) and 23 (STAR_BAD),
_i.e._ , removing stars showing potentially bad $\textit{T}_{\text{eff}}$ and
$\text{log}(\textit{g})$, large CHI2, large discrepancy between infrared flux
method and spectroscopic temperatures, systematics due to large rotation, and
S/N¡70 (see Abdurro’uf et al. (2022) for more details). We also selected stars
with ASPCAP_CHI2¡25 together with ANDFLAG=0. We selected stars with
$[\text{Fe}/\text{H}]$ flag E_H_FLAG=0. To remove possible spurious
measurements, we performed a cut in atmospheric parameters and abundances:
TEFF_ERR$<$100 K, LOGG_ERR$<$0.1 dex, M_H_ERR$<$0.2 dex if M_H$<$-0.5 dex and
M_H_ERR$<$0.1 dex if M_H$>$-0.5 dex (same condition for
$[\text{Fe}/\text{H}]$), and ALPHA_M_ERR¡0.1 dex. We note that APOGEE DR17
$[\alpha/\text{M}]$ is derived thanks to a mixture of Ca, Ti, Mg, Si, O, Ne,
and S lines in APOGEE spectra(Abdurro’uf et al. 2022), while RVS spectra has
several Ca, Ti, and Si lines, relevant for $[\alpha/\text{M}]$ derivation (see
Sect 3.5.1 for more details)

###  2.5 Final training and observed samples

In order to build the training sample, we selected the RVS spectra with the
corresponding labels detailed in Section 2.4. Tests have shown that too low
S/N would degrade the learning performances of our CNN method (Guiglion et al.
2020; Nepal et al. 2023), hence we adopted _Gaia_ DR3
rvs_spec_sig_to_noise666rvs_spec_sig_to_noise is defined as the signal-to-
noise ratio of the mean RVS spectrum. ratios larger than 30 (S/N$\geq$30
pix-1) for the training sample spectra. For the training sample only, we
limited our sample to have parallax absolute errors lower than 20%, and
RUWE¡1.4, i.e., stars with a good astrometric solution.

Following the series of cuts, we have in hand a training sample composed of
$44\,780$ _Gaia_ -RVS spectra together with their respective _Gaia_ $G$, $Bp$,
and $Rp$ pass-bands, parallaxes, XP coefficients, and APOGEE DR17 stellar
labels $\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$,
$[\text{M}/\text{H}]$, $[\text{Fe}/\text{H}]$, and $[\alpha/\text{M}]$.

The rest of the RVS spectra (N = 841 300, with no training sample labels but
with parallaxes, photometry and XP coefficients) constitute the _observed
sample_ that we want to parametrize with CNN.

Figure 6: Left column: 2D density distribution of the residual between trained
CNN labels and APOGEE input labels, as a function of the APOGEE input labels,
for the training sample (44 780 stars). The black dashed line shows a null
difference. The mean bias (b) and dispersion ($\sigma$) of the difference is
given in the bottom left corner. Each panel contains as well a histogram of
the input label. Right column: for the same stars, we show the difference
between calibrated GSP-SPec parameters (Recio-Blanco et al. 2022) and APOGEE
labels.

###  2.6 Dynamical range of the training sample

Table 1 contains the physical range of the stellar labels. In Figure 2, we
show a Kiel diagram of the training sample. The giants
($\text{log}(\textit{g})<3.5$) represent 70% of the training sample. The
metal-poor tail ($[\text{M}/\text{H}]<-1$) is composed of 1578 stars, which
leads to very reliable metallicities down to $-2.3$ dex. We note that in
Guiglion et al. (2020), the training sample was ten times smaller and only
included 70 stars with $[\text{M}/\text{H}]<-1$. Our observed sample is
composed of 841 300 _Gaia_ RVS spectra, with associated $G$, $Bp$, and $Rp$
pass-bands, parallaxes, and XP coefficients. In Fig 3, we show the
distribution of _Gaia_ DR3 $G$ magnitudes in the training and observed
samples. The training sample ranges from $7<G<14.2$, while the observed set
includes brighter (down to $G=3.2$) and fainter (up to $G=15$) targets. We
note that 98% of the observed sample is in included within the magnitude range
covered by the training sample.

In Figure 4, we show a correlation matrix of labels, photometry, parallaxes
and S/N for the training sample. As expected, parallaxes correlate very well
with $\textit{T}_{\text{eff}}$ and $\text{log}(\textit{g})$, while S/N anti-
correlates with apparent magnitude. No correlation is measured between
$[\text{M}/\text{H}]$ (and $[\alpha/\text{M}]$) and apparent magnitudes. We
discuss the correlation matrices of the observed sample in Sect. 4.2. We note
that we do not use S/N as an extra information for CNN. S/N is naturally
encoded in the spectra, and we show in Sect. 4.5 that CNN is extremely stable
across all S/N ranges.

Table 1: Effective range of training sample labels. Label | Effective range
---|---
$\textit{T}_{\text{eff}}$ | [ 3 705 : 6 395 ] K
$\text{log}(\textit{g})$ | [ +0.58 : +4.70 ] dex
$[\text{M}/\text{H}]$ | [ $-$2.29 : +0.55 ] dex
$[\alpha/\text{M}]$ | [ $-$0.18 : +0.46 ] dex
$[\text{Fe}/\text{H}]$ | [ $-$2.20 : +0.54 ] dex

##  3 CNN for _Gaia_ -RVS

In the present study, we adopted a hybrid CNN approach, that was first
successfully applied in Guiglion et al. (2020) with RAVE spectra and _Gaia_
DR2 astrometry and photometry. A complete description of CNN can be found in
Guiglion et al. (2020), Ambrosch et al. (2023), and Nepal et al. (2023). We
build our CNN models with the open source Deep Learning library Keras (Chollet
et al. 2015) using the TENSORFLOW backend (Abadi et al. 2015).

###  3.1 CNN principles

Following our previous works and what has been largely adopted in the
community when dealing with stellar parametrization, we adopted a
Convolutional Neural-Network approach. CNNs are well known for being sensitive
and detect/learn from spectral-features, as well as being less-sensitive to
radial-velocity shifts in the spectra than simple articifical neural-networks
(see for instance Nepal et al. 2023 and references there-in). CNN allows
building a high-dimensional non-linear function that translates spectra plus
extra data to stellar labels. The architecture of the CNN we employ is built
on the architecture of the CNN developed by Nepal et al. (2023) 777We note
that Nepal et al. (2023), and Ambrosch et al. (2023) extensively improved CNN
architectures for spectroscopy compared to Guiglion et al. (2020). We
therefore refer the reader to the former two papers for more technical
details.. We use keras_tuner (O’Malley et al. 2019) to further optimize the
CNN architecture and fix the model and training hyperparameters. The hybrid-
CNN model developed in this paper consists of 3 input nodes:

  * •

The core of our approach consists of _Gaia_ -RVS spectra passed through a
block of three 1-dimensional (1D) convolution-layers (with 32, 16, and 8
filters in each convolution block, respectively), that focus on extracting the
relevant spectral features, sensitive to the stellar labels. The first
convolution block has 2 401 input neurons, corresponding to 2 401 pixels of
the RVS spectra (see central node in Figure 5). After extensive testing, we
adopted a kernel size of 8 pixels for each convolution block, larger kernels
would not allow to detect small spectral features. We used 1D Max-Pooling
layers (after 1D convolution blocks 2 and 3) that help the network focus on
important features in addition to reducing the number of parameters to fit in
the CNN. The output of the third convolution layer is then passed through a
block of fully connected layers with 128 neurons.

  * •

The second node consists of _Gaia_ DR3 apparent magnitudes $G$, $Bp$, and $Rp$
together with the parallax, as 4 input neurons, fully-connected to a layer of
32 neurons (see left node in Figure 5). We adopted LeakyRelu activation
functions for the fully-connected layers Xu et al. (2015), commonly adopted in
the community, and in our previous works.

  * •

The third input node consists of XP coefficients passed in the form of 110
input neurons, corresponding to the 110 coefficients, to a fully-connected
layer with 64 neurons (see right node in Figure 5).

The outputs of these three fully-connected layers were then concatenated
(total of 32+128+64=224 neurons), combining the information from all three
sources, and passed into three fully-connected layers with 128, 32 and 5
neurons each. The last layer with 5 neurons refers to the output corresponding
to the 5 labels i.e., $\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$,
$[\text{M}/\text{H}]$, $[\alpha/\text{M}]$ and $[\text{Fe}/\text{H}]$. To
facilitate a faster and more efficient convergence of CNN to the global
minimum of the loss function, we scale the stellar labels to values between 0
and 1. Additionally, we apply the same scaling procedure to the magnitudes and
parallax. In the case of XP coefficients, the 55 Bp coefficients are
normalized relative to the first Bp coefficient (corresponding to 15th
magnitude; Andrae et al. 2023), and then scaled between 0 and 1. Similarly, we
perform the same scaling procedure for the 55 Rp coefficients.

We adopted the ReduceLROnPlateau callbacks from Keras in order to reduce the
number of training epochs, hence computation time. In order to prevent over-
fitting and stop the training when the loss-function of the validation set
reached its minimum, we used the early-stop callbacks, with a patience of 20.

###  3.2 Training an ensemble of CNNs

As the weights and biases of a CNN model are initialized stochastically at the
beginning of each training phase, the predicted labels can vary between
different models. The training sample is usually split randomly into a
training set (seen by CNN at each training epoch) and a validation set (used
at each epoch to cross-validate with the training set and optimize the CNN
weights) 888Throughout the paper, “training sample” refers to the whole data
use for training and cross-validation purpose; “train set” and “validation
set” refer to 75% and 25% of the “training sample,” respectively.. Usually,
the splitting training/validation set is only performed once and frozen to
train the CNN. In the present study, we adopt a new approach: we split the
training sample into 7 different training/validation sets, with 7 random
states (keeping a constant training/validation ratio of 75%). In other words,
CNN will see 7 representations of the training sample, _i.e._ , the whole
training sample will be passed through CNN. For each random state, 4 models
are trained, leading to 28 CNN models. The 28 trained CNN models are used to
predict labels (28 times) for the whole training sample (44 780 star) and the
observed sample (841 300 stars). In a given sample, the labels are averaged
over the 28 models, while the standard deviation provides an estimate of the
CNN internal uncertainties. Such a deep-ensemble CNN approach allows for a
more efficient exploration the gradient space, which helps with generalizing
and reduces the variance and bias (Lee et al. 2015; Bialek et al. 2020; Ganaie
et al. 2021). Deep ensembles are also more efficient when training on large
datasets, and improve feature selection.

CNN models reach their minimum validation loss function after typically 80
epochs. The training time of one model is about 8 minutes on an Apple M1
Macbook Pro laptop (total time of 4 hours of the 28 CNN models), and the
prediction time is $\sim 0.3$ milliseconds per star, i.e., the whole observed
sample of $8\times 10^{5}$ RVS stars takes about 4 minutes to compute (total
time of $\sim$2 hours for 28 models).

Figure 7: CNN uncertainties of the training sample as a function of CNN output
labels: the 2D density distribution in red colormap corresponds to the
internal precision computed over the 28 CNN models; The green fit corresponds
to the running-dispersion computed from the residual of CNN - APOGEE training
labels (see Figure 6); The 2D histogram in blue colormap corresponds to the
quadratic sum of the two and defines our overall uncertainty.

###  3.3 Result of the training

In the left column of Figure 6, we display 2D histograms of the difference
between the CNN trained labels and (input) APOGEE labels as a function of
(input) APOGEE labels, for the training sample. The dispersion between input
and output labels is 59 K in $\textit{T}_{\text{eff}}$, 0.11 K in
$\text{log}(\textit{g})$, 0.07 dex in $[\text{M}/\text{H}]$ and
$[\text{Fe}/\text{H}]$, and 0.04 dex in $[\alpha/\text{M}]$, which is
remarkable for RVS spectra999We do not show $[\text{Fe}/\text{H}]$ results,
being almost identical as $[\text{M}/\text{H}]$ (APOGEE DR17
$[\text{M}/\text{H}]$ tracks $[\text{Fe}/\text{H}]$; Abdurro’uf et al. 2022)..
For gravities, no significant systematic offset is detected and the red-clump
locus is well reproduced. On the edges of the training sample range, we
measure larger residuals (-200 K for $\textit{T}_{\text{eff}}>6200\,$K, -0.13
dex for $[\alpha/\text{M}]>+0.35$) due to the small number of stars in these
regions of the training sample. CNN is able to measure $[\text{M}/\text{H}]$
well, even if one can see a slight residual trend of about -0.04 dex for
$[\text{M}/\text{H}]>-0.5\,$dex, and +0.1/+0.2 dex in the very metal-poor
regime ($[\text{M}/\text{H}]<-2$, due to the lack of training stars in this
region of the parameter space). Overall, the tiny mismatch between input and
output labels tell us that CNN is not likely to overfit, and that the small
residuals are likely to come from the fact that we combine spectra (with a
different wavelength coverage and resolving power compared to APOGEE), _Gaia_
DR3 photometry, parallaxes and XP spectra.

We also show how GSP-SPec101010https://doi.org/10.17876/gaia/dr.3/43 111111In
this paper, we adopted GSP-SPec $\textit{T}_{\text{eff}}$ and calibrated
$\text{log}(\textit{g})$, $[\text{M}/\text{H}]$, and $[\alpha/\text{M}]$ from
Recio-Blanco et al. (2022). We remind that the authors performed basic
polynomial calibration of $\text{log}(\textit{g})$, and $[\text{M}/\text{H}]$
using external parameters from APOGEE DR17, GALAH DR3, and RAVE DR6, while
$[\alpha/\text{M}]$ was calibrated using local galactic abundance trend.
atmospheric parameters and $[\alpha/\text{M}]$ (Recio-Blanco et al. 2022)
compare to APOGEE for the training sample stars, in the right panels of Figure
6. Overall, the dispersion is 2 to 3 times larger compared to CNN. One can
also see the presence of large outliers in $\textit{T}_{\text{eff}}$ (¿1000 K
bias) and $\text{log}(\textit{g})$ (¿1 bias), likely due to the fact that RVS
spectra alone present limited resolution and spectral coverage. We elevate the
results for the RVS dataset to the level of the APOGEE survey both in terms of
precision and accuracy, significantly improving the ones from GSP-SPec. This
could come from the fact that GSP-SPec did not use external information as we
do with our hybrid-CNN. Such systematics in GSP-SPec results were recently
reported by Brandner et al. (2023).

###  3.4 Determination of training sample uncertainties

The internal CNN uncertainty of the stellar labels is given by the standard
deviation of the 28 CNN trained models described in Sect. 3.2. It has been
shown in the past that such an internal model-to-model dispersion may not be
representative of the expected uncertainty at a given spectral resolution, and
may be an underestimate of the true uncertainty (Guiglion et al. 2020; Nepal
et al. 2023). This internal uncertainty may not be representative of the
precision of the CNN, as it does not reflect the precision from the input
labels. In order to provide more realistic uncertainties, we proceeded as in
Nepal et al. (2023): in the training sample, we compute the mean dispersion
between APOGEE input and CNN output labels, as a function of the APOGEE input
label. Such dispersion gives us an estimate of the precision with respect to
the training sample input labels that are considered as ground truth.

Results are shown in Figure 7. The internal dispersion over the 28 CNN models
(red colormap) is of the order of 30$-$40 K in $\textit{T}_{\text{eff}}$, 0.05
dex in $\text{log}(\textit{g})$, 0.03/0.05 dex in $[\text{M}/\text{H}]$ and
$[\text{Fe}/\text{H}]$, and 0.01 dex in $[\alpha/\text{M}]$. The green line
represents the running-dispersion of the difference between CNN output and
APOGEE input label, and shows how the training is precise compared to the
ground truth. When combining quadratically the internal dispersion and the
running-dispersion, the total uncertainty significantly increases (in blue).
We note a 50 K uncertainty in $\textit{T}_{\text{eff}}$ for the giants and
60$-$70 K for the dwarfs. $\text{log}(\textit{g})$ is rather constant, around
0.1 dex. $[\text{M}/\text{H}]$ and $[\text{Fe}/\text{H}]$ precision increase
from 0.06/0.08 dex in the intermediate metallicity domain to 0.15 dex in the
very-metal poor regime, due to the paucity of spectral features.
$[\alpha/\text{M}]$ is extremely precise, with typical precision of the order
of 0.02/0.04 dex. We note that such remarkable precision for all labels at RVS
resolution is only achievable when combining external information in the form
of _Gaia_ DR3 photometry, parallaxes, and XP coefficients.

Figure 8: Top: mean RVS spectra of training sample RC stars with
$[\text{M}/\text{H}]\sim 0$. In the next sub-panels, we show mean gradients of
CNN output labels with respect to input RVS pixels for
$\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$,
and $[\alpha/\text{M}]$ ($\delta\mathrm{label}/\delta\lambda$). We also show
the location of the main RVS spectral features from which CNN learns (see
text).

###  3.5 Exploring the CNN gradients

In this section, we provide a comprehensive view of the RVS and XP features
used by CNN during the training process.

####  3.5.1 RVS gradients

As demonstrated in Nepal et al. (2023), Ambrosch et al. (2023), as well as in
Fabbro et al. (2018), CNNs are able to learn each label from specific spectral
features. Here, we computed CNN gradients for the training sample RVS spectra,
by performing partial derivatives of each of the labels with respect to each
input neuron (or pixel), namely, $\delta\mathrm{Label}/\delta\lambda$. Such
gradients provide comprehensives maps of the active spectral features during
CNN training. RVS gradients are shown in Figure 8. We present mean gradients
for solar-$[\text{M}/\text{H}]$ (solid line) and
$[\text{M}/\text{H}]\sim-0.8\,$dex (dashed line) RC stars. We present some
characteristic features used by CNN, taken from various literature sources
(Boeche et al. 2011; Guiglion et al. 2018; Contursi et al. 2021). Besides
being the strongest feature in the _Gaia_ -RVS range, the CaII triplet is not
the most prominent feature in the gradient maps. In the blue wind of the Ca II
8544 line, the Fe I+Ti I blend is active for all labels. We observe that the
Cr II line at 8 551Å is active for $\textit{T}_{\text{eff}}$ and
$\text{log}(\textit{g})$ but almost no signal is present in
$[\text{M}/\text{H}]$ and $[\alpha/\text{M}]$ gradients. An Fe I and Fe I+Ti I
blend at $\sim 8\,520\,$Å is mainly active in $\textit{T}_{\text{eff}}$,
$\text{log}(\textit{g})$, and $[\text{M}/\text{H}]$. A very interesting
feature is seen at $\lambda\sim 8\,650\,$Å: a blend of Si I, V II and N. This
blend is mainly active in $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$, and
$[\alpha/\text{M}]$ gradients. It is important to note that the training was
done on APOGEE labels for which we know C & N features correlate with mass
(Salaris, Maurizio et al. 2015; Martig et al. 2016), therefore also with
metallicity and $[\alpha/\text{M}]$. An Fe I blend in the red wing of the Ca
II line at $8664\,$Å seems to be a very relevant feature for the 4 labels
determination. We notice that most of the spectral features used in the range
8 570-8 640Å are composed of Fe I lines. In the red part of the RVS domain, we
see numerous lines contributing to gradients: a S I line is active in
$\textit{T}_{\text{eff}}$ and $\text{log}(\textit{g})$ gradients, as well as
Ti I. Such lines are also active in $[\text{M}/\text{H}]$ and
$[\alpha/\text{M}]$, but to a lower extent. From what we see, CNN learns
$[\alpha/\text{M}]$ from mainly Si I, Ca II, Ti I lines, and also from the
Si/V/N blend. Overall, CNN is able to learn from distinct spectral features
for a given label even if the resolution is $\sim 10\,000$. This bodes well
for the future exploitation of 4MOST low-resolution surveys (Chiappini et al.
2019; Helmi et al. 2019; Cioni et al. 2019).

####  3.5.2 XP gradients

We investigated how network learns from the XP coefficients. First, we
computed correlations between the labels and the 110 XP coefficients. As
presented in Figure 9, the correlation matrix tells us that some coefficients
are more correlated to labels than others. It is evident from this heatmap
that XP spectra contains a lot of information on the stellar atmospheric
parameters $\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$ and
$[\text{M}/\text{H}]$. Interestingly, some of the XP coefficients show a good
amount of correlation with the alpha abundance as well. We then expect CNN to
learn differently from each XP coefficient. In the same way we did for RVS
spectra, we computed gradients for the 110 XP coefficients. We present XP
gradient ($\delta\mathrm{XP}/\delta\mathrm{label}$) as a function of XP
coefficients in the right panel of Figure 9. The gradients show a lot of
activity, meaning that CNN uses and learns from the XP coefficients for the
training sample. The basis functions with high-orders in Rp ($>30$) do not
seem to show strong activity, meaning that CNN may learn most from the lower
order coefficients. In case of Bp, information is present even down to
coefficient 45. The gradients are pretty consistent with the correlations
observed between XP and labels. Such plots confirm that XP coefficients are
extremely rich in information (see Andrae et al. 2023; Zhang et al. 2023), and
can provide additional constraints when measuring $\textit{T}_{\text{eff}}$,
$\text{log}(\textit{g})$, $[\text{M}/\text{H}]$, $[\text{Fe}/\text{H}]$, and
$[\alpha/\text{M}]$.

Figure 9: Correlation matrix shown as heatmap, between the 55 BP XP
coefficients and labels in the training sample (top). The colorbar shows the
strength of the anti-/correlation, where green in the middle (0 value)
represents no linear relationship between the labels and XP coefficients.
Second panel: Mean gradients of BP XP coefficients
($\delta\mathrm{label}/\delta\mathrm{XP}$) as a function of the 55 BP XP
coefficients for the training sample. The third and fourth panels depict the
same heatmap and gradients for the RP XP coefficients.

##  4 Predicting labels for the observed sample

Using the 28 CNN models, we predict atmospheric parameters
$\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$ as
well as $[\text{Fe}/\text{H}]$ and $[\alpha/\text{M}]$ ratios for 841 300
_Gaia_ -RVS stars, _i.e._ the previously defined observed sample, together
with their uncertainties as detailed in Sect. 3.4. Among these 841 300 stars,
we have 768 793 stars within the training sample limits as reported in Table
1.

###  4.1 Uncertainties of the observed sample

The uncertainties were derived, combining quadratically the dispersion from
the 28 CNN models together with the fit of the running-dispersion from the
training sample (polynomial curve in Figure 7). In Figure 10, we present the
total uncertainty of the 768 793 stars within the training sample limits. The
bulk of the sample shows very similar uncertainty distributions as in the
training sample (see Figure 7). Stars with larger uncertainties are also
present. For instance, cool super-giants show uncertainties of the order of
70-300 K in $\textit{T}_{\text{eff}}$, 0.15-0.5 dex in
$\text{log}(\textit{g})$, and 0.1-0.3 dex in $[\text{M}/\text{H}]$ (roughly 19
000 stars). We note that we provide to the community both the model-to-model
dispersion and the overall combined uncertainty (see Table 2).

Figure 10: 2D density distribution of the total uncertainties for 768 793
observed sample stars within the training sample limits, as a function of
stellar labels.

###  4.2 Kiel diagrams of the observed sample

We define here a high quality sample that will be used later for science
application: we require that the stars are within the training sample limits,
and within reasonable uncertainties. The uncertainty cut was preformed based
on the model-to-model dispersion. This dispersion reflects the deviation of
the observed sample labels from the input APOGEE labels training sample. We
applied the following cuts: e$\textit{T}_{\text{eff}}$¡75 K,
e$\text{log}(\textit{g})$¡0.1), e$[\text{M}/\text{H}]<$0.1 if
$[\text{M}/\text{H}]>-0.5$ and e$[\text{M}/\text{H}]<$0.2 if
$[\text{M}/\text{H}]<-0.5$, and e$[\alpha/\text{M}]<0.1$. These cuts result in
a sample of 689 527 stars with high-quality labels and low-uncertainties.

In Figure 4, we show a correlation matrix of labels, photometry, parallaxes
and S/N of the low uncertainty sample (middle column). Correlations are
consistent with those from the training sample (left column), as expected. On
the other hand, when drawing a correlation matrix for the rest of the observed
sample (high-uncertainties or outside the trainingsample limits), we do not
see any strong correlation of $\textit{T}_{\text{eff}}$ with parallaxes. $G$
and $Rp$ are in fact anti-correlated with $\textit{T}_{\text{eff}}$. Such a
behavior is discussed in more details in Appendix C and is mainly due to the
presence of spectral types under-represented in the training sample.

In Figure 11, we show Kiel diagrams of the high-quality sample in bins of S/N
(15-25, 25-35, 35-75, and $\geq 75$), color-codded with $[\text{M}/\text{H}]$
(689 527 stars). We also present the rest of the RVS sample in grey (stars
outside the training sample limits or with large uncertainties). We see a very
consistent Kiel diagram, with clear metallicity sequence in the giant branch.
CNN also does a good job of parametrizing the red clump. We also observe a
secondary cool-dwarf sequence, very similar to what has been observed in RAVE
DR6 (Steinmetz et al. 2020b), resulting from the presence of binary stars.
Indeed, these stars, in the regime $4\,600<\textit{T}_{\text{eff}}<5100\,$K
and $4<\text{log}(\textit{g})<4.2$, show a very large _Gaia_ DR3 RUWE ($\sim
4$), suggesting a poor astrometric solution likely due to binarity. We further
discuss the stability of CNN with radial-velocity errors in Appendix B. Stars
depicted in grey, correspond mainly to stars outside of the training sample
limits and are discussed in more detail in Appendix C. We refer the reader to
Appendix D for CNN application using only RVS spectra (i.e. no photometry,
parallaxes, or XP data).

Figure 11: Kiel diagrams of 689 527 _Gaia_ -RVS stars in bins of S/N, selected
within the training sample limits and with low uncertainties. Stars are binned
by mean metallicity; In the background, we show 2D histograms (in grey) of 151
773 stars whether with high-uncertainties or that fall outside of the training
sample limits.

###  4.3 The $[\alpha/\text{M}]\,vs.\,[\text{M}/\text{H}]$ distributions of
the observed sample

We explore here the abundance pattern
$[\alpha/\text{M}]\,vs.\,[\text{M}/\text{H}]$ of the observed sample in the
different regions of the Kiel diagram, when selecting stars with low
uncertainties as defined in the previous section (689 527 stars). Results are
presented in Figure 12 in bins of 500 K in $\textit{T}_{\text{eff}}$ and 1 dex
in $\text{log}(\textit{g})$. As expected, we probe the low-$[\alpha/\text{M}]$
regime preferentially in the dwarf regime as such objects are likely located
closer to us. We start probing the high-$[\alpha/\text{M}]$ sequence when
moving to lower-$\text{log}(\textit{g})$, and start populating the metal-poor
tail of the sample. In the region $4\,000<\textit{T}_{\text{eff}}<4\,500\,$K
and $1<\text{log}(\textit{g})<2$, we clearly see a bimodality in
$[\alpha/\text{M}]$, as expected (e.g. Hayden et al. 2015; Queiroz et al.
2020). Such a feature was not visible using RAVE data (Guiglion et al. 2020).
We discuss in more detail the bimodality in Sect. 5. We also observe an
interesting feature in the ranges $5\,000<\textit{T}_{\text{eff}}<6\,000\,$K
and $2<\text{log}(\textit{g})<3$, with low-$[\text{M}/\text{H}]$ and
low-$[\alpha/\text{M}]$ signature (roughly 700 stars). Such stars have typical
OB spectra, with _Gaia_ DR3 spectraltype_esphs equal to OB. We therefore warn
the reader that the low-error sample contains roughly 700 OB stars, for which
the CNN labels may not be reliable.

Figure 12: $[\alpha/\text{M}]$ vs. $[\text{M}/\text{H}]$ for 689 527 _Gaia_
RVS stars of the observed sample within the training sample limits and low
uncertainties. The sample is presented in panels corresponding to cuts in
effective temperature and surface gravity (steps of 500 K in
$\textit{T}_{\text{eff}}$ and 1 dex in $\text{log}(\textit{g})$. For each
panel, we over-plotted a $\textit{T}_{\text{eff}}$-$\text{log}(\textit{g})$
diagram with the location of the plotted stars marked in red.The top left
panel in purple shows a zoom-in of the bin
$4\,000<\textit{T}_{\text{eff}}<4\,500\,$K and $1<\text{log}(\textit{g})<2$.
We note that the secondary sequence observed in the grey panels is composed of
OB stars not included in the training sample (see text for more details).

###  4.4 Precision and accuracy of metal-poor stars in the observed sample

We investigated the precision and accuracy of metal-poor stars present in the
observed sample, that fall within the training sample limits. As a reference
we use APOGEE DR17 labels, and focus only on the stars with
$[\text{M}/\text{H}]_{\mathrm{APOGEE}}<-1\,$dex, and in the range
$15<$S/N$<25$. In the left column of Figure 13, we compare CNN labels to
APOGEE DR17 for 301 RVS metal-poor stars of the observed sample (with
available calibrated GSP-SPec parameters). The effective temperature and
surface gravity show no significant bias, with a dispersion of 95 K and 0.17
dex, respectively. The overall $[\text{M}/\text{H}]$ also shows no significant
bias down to $[\text{M}/\text{H}]=-2.1$ dex, with a dispersion of 0.15 dex.
For $[\text{M}/\text{H}]<-2.1\,$dex, 11 stars show a mean bias of +0.22 dex
and a dispersion of 0.12 dex (see Sect. 6 for more details on this). The
bottom left panel shows an $[\alpha/\text{M}]$ dispersion below 0.1 dex, and a
tiny residual that is a function of $[\alpha/\text{M}]$, and is consistent
with the training sample (see Sect 3.3).

In the right column of Figure 13, we compare the calibrated GSP-SPec
parameters with those of APOGEE DR17. The dispersion in
$\textit{T}_{\text{eff}}$ is of the order of 800 K, while
$\text{log}(\textit{g})$ shows a large bias of 1.3 dex with a dispersion of
about 1 dex. $[\text{M}/\text{H}]$ shows a bias of 0.23 dex, with a large
scatter of $\sim 0.5\,$dex, and $[\alpha/\text{M}]$ also show quite a large
scatter of 0.27 dex.

Taken together, these results demonstrate that CNN is able to provide robust
parameterization of metal-poor stars down to $[\text{M}/\text{H}]=-2.3\,$dex
at $15<$S/N$<25$, i.e. S/N regime where standard spectroscopy struggles to
provide precise and accurate measurements for such types of stars.

Figure 13: Left column, blue: residual between the CNN and APOGEE parameters,
as a function of APOGEE, for 301 metal-poor stars
($[\text{M}/\text{H}]_{\mathrm{APOGEE}}<-1\,$dex) in the observed sample, in
the range $15<$S/N$<25$. The black dashed line shows a null difference. The
mean bias (b) and dispersion ($\sigma$) of the difference is given in the
bottom left corner. Right column, red: for the same stars, we show the
difference between calibrated GSP-SPec parameters (Recio-Blanco et al. 2022)
and APOGEE parameters.

###  4.5 Stability of CNN in the low-S/N regime

The _Gaia_ DR3 RVS sample contains a significant fraction of low-S/N stars:
38% of the observed sample spectra range from 15 to 25 in S/N. We investigate
here how the CNN precision varies with S/N. For that, we compute the standard
deviation between CNN labels and APOGEE DR17 for stars with low uncertainties
in the observed sample. We compute the same quantities in the training sample
for reference. In Figure 14, we show how the precision behaves as a function
of S/N. For the training sample (in orange, solid lines), the CNN precision is
extremely stable with respect to S/N for our 4 labels
($\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$
and $[\alpha/\text{M}]$). As a comparison, the precision of GSP-SPec with
respect to APOGEE is 2 to 5 times worse (in orange, dashed lines), showing
decreasing precision with decreasing S/N. We observed the same behaviours in
the observed sample (in green). CNN precision is constant as a function of the
S/N and outperforms GSP-SPec. Such plots show how CNN is able to efficiently
deal with the noise in the data compared to standard spectroscopic methods,
and it is able to extract high-quality labels in low-S/N spectra. Such a CNN
advantage will be key for the next data releases of _Gaia_ , for instance for
extracting information from individual epoch spectra at very low-S/N, where
epoch spectra will be released at intrinsic lower S/N than the presently
available time-averaged spectra. In Appendix B, we present additional tests of
CNN sensitive tests with respect to radial velocity uncertainties.

Figure 14: Precision, computed as the standard deviation of CNN minus APOGEE
(solid lines) and calibrated GSP-SPec minus APOGEE (dashed lines), as a
function of S/N bins, for 41 623 stars of the training sample (orange), and
79412 stars of the observed sample (green, within the training sample limits
and low uncertainties).

###  4.6 Validation of surface gravities with asteroseismic data

To test CNN accuracy and precision in surface gravity, we compare CNN
$\text{log}(\textit{g})$ with precise $\text{log}(\textit{g})$ from
asteroseismology. Asteroseismology relies on stellar oscillations and is
widely used by spectroscopic surveys for validation or calibration purposes,
such as in RAVE (Valentini et al. 2017), _Gaia_ -ESO (Worley et al. 2020), and
APOGEE (Anders et al. 2017; Pinsonneault et al. 2018; Miglio et al. 2021). For
stars with solar-like oscillations, as well as red giants, the frequency at
maximum oscillation power ($\nu_{max}$ ) is used for determining
$\text{log}(\textit{g})_{\rm seismo}$ using only the additional parameter,
$\textit{T}_{\text{eff}}$ (Brown 1991; Kjeldsen & Bedding 1995; Chaplin &
Miglio 2013). We adopted the most recent version of the K2 Galactic
Archaeology Program (K2 GAP) for Campaigns C1-C8 and C10-C18 from Zinn et al.
(2022). The authors provide asteroseismic parameters for 19 000 red-giant
stars. We have 386 stars in common with our training sample, and 1 163 stars
in common with our observed set (within the training sample limits). Each star
also has GSP-SPec calibrated $\text{log}(\textit{g})$ for further comparison.
We computed $\text{log}(\textit{g})_{\rm seismo}$ from Zinn’s $\nu_{max}$ and
$\textit{T}_{\text{eff}}$ using Equation. 3 from Valentini et al. (2019),
assuming $\nu_{max,\bigodot}=3090\,\mu\mathrm{Hz}$ and
$\textit{T}_{\text{eff},\bigodot}=5\,777$ K (Huber et al. 2011).

In Figure 15, we present a 1-to-1 comparison between the asteroseismic log(g)s
and APOGEE DR17 (left), CNN (middle) and GSP-SPec (right) surface gravities,
in the training (top) and observed samples (bottom):
\- APOGEE and seismic $\text{log}(\textit{g})$ compare very well in both
training (used as input labels) and observed stars. No significant bias is
measured, while the dispersion ranges from 0.06 to 0.012 depending on the
$\text{log}(\textit{g})$ range. It is consistent with the fact that APOGEE
calibrated the spectroscopic $\text{log}(\textit{g})$ with respect to seismic
ones (Abdurro’uf et al. 2022).
\- CNN and seismic $\text{log}(\textit{g})$ also compare very well, with no
significant bias for $\text{log}(\textit{g})<2.6$. For
$\text{log}(\textit{g})>2/6$, we measure a small bias of the order of 0.1 dex
in both training and observed stars, likely due to the fact that we combine
spectra, photometry, parallaxes, and XP coefficients. In the observed sample,
the dispersion ranges from 0.08 to 0.10 dex, which is remarkable. The Red
Clump (in green) shows no apparent bias and a dispersion below 0.1 dex. We
note that the $\text{log}(\textit{g})$ residual between APOGEE and CNN shows
no trend with respect to CNN $\textit{T}_{\text{eff}}$ or
$[\text{M}/\text{H}]$.
\- For completeness, we compare GSP-SPec calibrated $\text{log}(\textit{g})$
with respect to seismic $\text{log}(\textit{g})$. The mean different ranges
from 0.12 to 0.25 dex, while the dispersion ranges from 0.25 to 0.44 dex. In
the observed sample, the Red Clump shows a mean bias of 0.15 dex, the
dispersion is 0.31 dex, while GSP-SPec $\text{log}(\textit{g})$ have a
dynamical range of more than 1.5 dex.

Such comparisons once again show the remarkable performances of CNN that
combines several datasets for improved measurements compared to pure
spectroscopic labels (as derived by GSP-SPec). We refer the reader to Appendix
D for a CNN application using RVS spectra only. We present additional
comparison with the GALAH survey in Appendix A.

Figure 15: One-to-one comparisons of surface gravities
$\text{log}(\textit{g})$ from APOGEE DR17 (left), CNN (middle), and calibrated
GSP-SPec (right) with respect to seismic $\text{log}(\textit{g})$ calculated
based on $\nu_{max}$ and $\textit{T}_{\text{eff}}$ from Zinn et al. (2022).
The top row shows stars of the training sample, while the bottom rows shows
targets of the observed sample. We computed the mean-bias (b) and mean-
dispersion ($\sigma$) for three ranges of gravity:
$\text{log}(\textit{g})<2.3$ (orange), $2.3<\text{log}(\textit{g})<2.6$
(green), and $\text{log}(\textit{g})<2.6$ (red).

###  4.7 Database and public code

Here, we present our catalogue of atmospheric parameters
($\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$ and
$[\text{M}/\text{H}]$), along with chemical abundances
($[\text{Fe}/\text{H}]$, $[\alpha/\text{M}]$) for 841 300 _Gaia_ -RVS stars
(summarised in Table 2). We provide two sources of uncertainties: model-to-
model uncertainties (e$\textit{T}_{\text{eff}}$, e$\text{log}(\textit{g})$,
e$[\text{M}/\text{H}]$, e$[\text{Fe}/\text{H}]$, and e$[\alpha/\text{M}]$),
and overall combined uncertainties ($\sigma\textit{T}_{\text{eff}}$,
$\sigma\text{log}(\textit{g})$, $\sigma[\text{M}/\text{H}]$,
$\sigma[\text{Fe}/\text{H}]$, and $\sigma[\alpha/\text{M}]$). To identify the
stars outside of the training sample limits, we provide a 5 digit integer
flag. Each digit corresponds to one of the labels (in the order
$\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$,
$[\alpha/\text{M}]$, and $[\text{Fe}/\text{H}]$): for instance ”00000” means
that all labels are within the training sample limits, while ”00011” indicates
that $[\alpha/\text{M}]$, and $[\text{Fe}/\text{H}]$ are outside of the
training sample limits. The data table is publicly available with the AIP
_Gaia_ archive at: gaia.aip.de:link_to_be_added_upon_acceptance. The CNN
Python code is available at: github_link_to_be_added_upon_acceptance.

Table 2: Atmospheric parameters, chemical abundance ratios, uncertainties, and
boundary flag of the publicly available online catalogue of 841 300 _Gaia_
-RVS stars.

Col | Format | Units | Label | Explanations
---|---|---|---|---
1 | char | - | sourceid |  _Gaia_ Source ID
2 | float | K | teff | Effective temperature
3 | float | K | eteff | Model-to-model dispersion of $\textit{T}_{\text{eff}}$
4 | float | K | sigma_teff | Overall dispersion of $\textit{T}_{\text{eff}}$
5 | float | cm s-2 | logg | Surface gravity
6 | float | cm s-2 | elogg | Model-to-model dispersion of $\text{log}(\textit{g})$
7 | float | cm s-2 | sigma_logg | Overall dispersion of $\text{log}(\textit{g})$
8 | float | dex | mh | Overall metallicity
9 | float | dex | emh | Model-to-model dispersion of $[\text{M}/\text{H}]$
10 | float | dex | sigma_mh | Overall dispersion of $[\text{M}/\text{H}]$
11 | float | dex | feh |  $[\text{Fe}/\text{H}]$ ratio
12 | float | dex | efeh | Model-to-model dispersion of $[\text{Fe}/\text{H}]$
13 | float | dex | sigma_feh | Overall dispersion of $[\text{Fe}/\text{H}]$
14 | float | dex | alpham |  $[\alpha/\text{M}]$ ratio
15 | float | dex | ealpham | Model-to-model dispersion of $[\alpha/\text{M}]$
16 | float | dex | sigma_alpham | Overall dispersion of $[\alpha/\text{M}]$
17 | int | - | flag_boundary | Boundary flag for the 5 labels

##  5 The $[\alpha/\text{M}]-[\text{M}/\text{H}]$ bimodality traced by _Gaia_
RVS

The abundance patterns of $\alpha$-elements (such as Mg & O) have been studied
and characterised in the Milky Way disc, bulge and halo since more than two
decades in the Solar neighborhood (e.g. Fuhrmann 1998; Pompéia et al. 2002;
Adibekyan et al. 2011; Fuhrmann 2011; Mikolaitis et al. 2014; Guiglion et al.
2015), and towards the inner/outer disc thanks to the advent of large scale
spectroscopic surveys (e.g. Anders et al. 2014; Hayden et al. 2015; Buder et
al. 2019; Queiroz et al. 2020). A strong debate has animated the community
regarding mechanisms responsible for the bimodality measure in this abundance
space (see for instance Chiappini et al. 1997; Schönrich & Binney 2009;
Haywood et al. 2013; Minchev et al. 2013; Grand et al. 2018; Spitoni et al.
2019; Buck 2020; Khoperskov et al. 2021; Agertz et al. 2021). So far, such
bimodality has been clearly characterized at high resolution, even though
hints of such a bimodality were detected by low-resolution and intermediate
resolution surveys such as SEGUE (Lee et al. 2011), LAMOST (Xiang et al.
2019), and RAVE (Guiglion et al. 2020). We have shown in the previous sections
that our CNN methodology provides precise and accurate chemical information.
In Figure 4.3, we have shown that giant stars show a bimodality in the
$[\alpha/\text{M}]-[\text{M}/\text{H}]$ plane. It is the first time that such
a clear bimodality has been seen in _Gaia_ RVS spectra, which are
characterized by both limited resolution and spectral coverage. Our finding is
fully consistent with previous work: a low-$[\alpha/\text{M}]$ sequence
($<+0.15$ dex) ranging from $[\text{M}/\text{H}]\sim-0.6$ to
$[\text{M}/\text{H}]\sim+0.2$ dex, together with a high-$[\alpha/\text{M}]$
($>+0.15$ dex) sequence ranging from $[\text{M}/\text{H}]\sim-1$ to
$[\text{M}/\text{H}]\sim-0.2$ dex. We note that in literature work, the shape
and zero-point of the bimodality depend on the type of stars used and the type
of $\alpha$-elements studied.

To trace spatial variations of the bimodality, we calculate positions and
velocities in the galactocentric rest-frame using available astrometric
solution (sky positions and proper motions) and radial velocities from _Gaia_
DR3 (Gaia Collaboration et al. 2022b) and assuming distances computed with the
StarHorse Bayesian method (Queiroz et al. 2023) and the current CNN labels
(more details in Nepal et al. in prep). We also assumed an in-plane distance
of the Sun from the Galactic centre of $8.19$ kpc (GRAVITY Collaboration et
al. 2018), a velocity of the Local Standard of Rest of 240 km s-1(Reid et al.
2014), and a peculiar velocity of the Sun with respect to the LSR,
$U_{\odot}=11.1$ km s-1, $v_{\odot}=12.24$ km s-1, $W_{\odot}=7.25$ km
s-1(Schönrich et al. 2010).

In Figure 16, we show the $[\alpha/\text{M}]-[\text{M}/\text{H}]$ plane
decomposed into bins of Galactocentric radius R and height above the Galactic
plane Z for 147 416 stars with $\text{log}(\textit{g})<2.2$, within the
training sample limits, and low uncertainties. At low-Z (—Z—¡0.5 kpc) and $\pm
1$kpc around the solar radius, we mainly probe low-$[\alpha/\text{M}]$ stars.
While moving towards the inner disc, we start to populate the
high-$[\alpha/\text{M}]$ sequence, and a bimodality is clearly visible in the
range $0<\mathrm{R}<4\,$kpc. Moving to higher-Z ($|\mathrm{Z}|>1.0\,$kpc), the
inner disc shows a clear transition from being low-$[\alpha/\text{M}]$
populated to high-$[\alpha/\text{M}]$ populated (stars in the bins
$0<\mathrm{R}<4\,$kpc and $1.5<|\mathrm{Z}|<4\,$kpc; top left panels). In the
outer disc, the stars mainly show low-$[\alpha/\text{M}]$ enrichment, which is
due to disk flaring, as first suggested by Minchev et al. (2015). Such results
are consistent with previous works (Anders et al. 2014; Hayden et al. 2015).
The bimodality is also seen in the bulge region with our CNN abundances,
confirming previous results based on APOGEE DR14&DR16 (Rojas-Arriagada et al.
2019; Queiroz et al. 2020, 2021). With such a chemical abundance map, we show
that CNN is able to recover the main abundance trends in the Milky Way over a
large galactic volume. In Appendix E, we show that no bimodality is visible
when adopting GSP-SPec data. This first detection of the bimodality in the RVS
data using CNN is a step forward in the scientific output of the _Gaia_
mission. A detailed discussion of the candidate-bulge stars seen in this
sample will be discussed in Nepal et al. (in prep). Other interesting results
will also be discussed in forthcoming papers, using the new StarHorse run on
this sample.

Figure 16: 2D histograms and contours of
$[\alpha/\text{M}]\,vs.\,[\text{M}/\text{H}]$ in 147 416 _Gaia_ RVS stars of
the observed sample with $\text{log}(\textit{g})\leq 2.2$, within the training
sample limits and low uncertainties. Stars are plotted in kpc bins of
galactocentric radius (R) and height above the galactic plane (Z).

##  6 Caveats

  * •

Stars with $[\text{M}/\text{H}]$ below $-2$ may suffer from systematics due to
low statistics in the training sample at very-low metallicities. For the
future use of CNN and _Gaia-_ RVS, a pro-active training sample should be
adopted, by populating further the metal-poor regime. We are going in such a
direction with an accepted SDSS-V open-fiber program (PI G. Guiglion), that
will observe 4 000 RAVE metal-poor stars (Matijevič et al. 2017; Guiglion et
al. 2020) with the APOGEE spectrograph. In the future, such metal-poor stars
will complement the current training sample, to improve the reliability of the
metallicity measurements of stars below $-2$ dex.

  * •

The catalog of CNN labels with high quality may suffer from sporadic
contamination, such as the OB stars identified in Sect. 4.3 (of the order 0f
0.1%). We encourage the reader to use _Gaia_ DR3 classification flags, and
also use the CNN uncertainties to further clean the data if needed.

  * •

Over the full RVS catalog of 841 300 stars parametrized by CNN, $9\%$ belongs
outside of the training sample limits. It is clear that in the present study
the performances of our CNN approach are limited by the training sample. The
APOGEE and _Gaia_ surveys are characterised by different selection functions.
The selection function of the training sample is then characterised by traits
common to both surveys, and a full analysis on the selection function is out
of the scope of the present paper. For future _Gaia_ releases, substantial
effort should be done to populate the training sample with more diverse
targets, such as OB stars, M dwarfs & giants. Also, nearby stars (with large
parallaxes) or bright stars should be added in the training set in order to
have a more complete representation of the local stellar populations. Such
statements are valid for on-going and future large spectroscopic surveys that
may want to use machine-learning algorithms for spectral parametrization, such
as GALAH, SDSS-V, and 4MOST.

##  7 Conclusion

In June 2022, the _Gaia_ consortium released data of one million RVS stars,
with one third having a low signal-to-noise ratio (15$<$S/N$<$25). In this
paper, we derived atmospheric parameters and chemical abundances from this
dataset combining for the first time _Gaia_ RVS spectra, photometry ($G$,
$Bp$, $Rp$), parallaxes and _Gaia_ XP coefficients. We summarize our method
and main achievements below:

  * •

Benefiting from the last data release from the APOGEE survey, we built a
training sample with high quality labels: atmospheric parameters
$\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$, $[\text{M}/\text{H}]$ and
chemical abundances $[\text{Fe}/\text{H}]$, $[\alpha/\text{M}]$. After careful
use of _Gaia_ and APOGEE flags, the resulting training sample is composed of
44 780 stars (Sect. 2, Figure 2) with RVS spectra, photometry, astrometry, and
XP data. We also assembled a set of RVS spectra (with additional photometry,
astrometry, and XP data) for which we measured the above-mentioned labels.
Such an observed set is composed of 841 300 stars.

  * •

We built a convolutional neural-network based on previously used architectures
from Guiglion et al. (2020); Nepal et al. (2023); Ambrosch et al. (2023), that
we optimized for the _Gaia_ datasets used here (Sect 3, Figure 5). We trained
a series of 28 CNN models, that we combined for determining average labels. We
showed that CNN learns from relevant spectral features for a given label, as
well as from XP coefficients (Sect 3.5, Figure 8, and Figure 9). It confirms
that XP coefficients can be used for constraining atmospheric parameters as
well as $[\alpha/\text{M}]$.

  * •

We derived improved uncertainties by combining the model-to-model dispersion
with departure from the training sample input labels (Sect 3.4, Figure 7). The
uncertainties in the observed sample are of the order of 50$-$70 K in
$\textit{T}_{\text{eff}}$, 0.1 dex in $\text{log}(\textit{g})$, 0.07/0.15 dex
in $[\text{M}/\text{H}]$ and $[\text{Fe}/\text{H}]$, and 0.02/0.04 in
$[\alpha/\text{M}]$.

  * •

CNN shows a stable performance across a large range of S/N (Sect. 4.5, Figure
14). The dispersion with respect to APOGEE is constant with S/N is both
training and observed samples, and outperforms the parameters derived by GSP-
SPec. We demonstrated that CNN is capable of parametrizing precisely and
accurately metal-poor stars in the range $15<\mathrm{S/N}<25$ (see Sect. 4.4,
and Figure 13).

  * •

Compared with precise asteroseismic $\text{log}(\textit{g})$ of red-giant
stars computed from asteroseismic parameters from Zinn et al. (2022), CNN
shows no mean bias or residual trends, with a typical dispersion of 0.1 dex,
which is remarkable (Sect. 4.6, Figure 15). Such a precision can only be
achieved thanks to the external data we used, in the form of photometry,
parallaxes and XP coefficients. Comparisons with GALAH DR3 also showed the
higher precision of CNN compared to GSP-SPec (Figure 17). We also showed that
CNN is very robust to radial-velocity uncertainties (Figure 18).

  * •

We managed for the first time to resolve and trace the
$[\alpha/\text{M}]$-$[\text{M}/\text{H}]$ bimodality in the Milky Way disc
using _Gaia_ data (Sect. 5, Figure 16). Such a performance has been achieved
thanks to a large enough and high-quality training sample, combined with a
complex CNN architecture, and most importantly combining four unique datasets
(RVS spectra, photometry, parallaxes, and XP coefficients).

RVS spectra being rich in spectral lines, we plan to measure more elemental
abundances for the next releases of _Gaia_ RVS data, such as Ti, Si, and Ce.
In addition, the next _Gaia_ data release will consist of 66 months of data
(by the end of 2025), and will include all epoch and transit data for all
sources, ie. low-S/N RVS data. The current paper represents a step forward in
the analysis on such a dataset. For the next studies and generation of
surveys, the training sample should be built in a proactive way, _i.e._ ,
selecting targets to be observed, instead of simply using an existing set of
reference stars. In this way, we shall limit the biases inherent to any
training sample. For instance, we need to focus on the metal-poor stars tail,
as well as bright stars, local stars, and M giants. Such a challenge will have
to be faced by 4MOST that aims at using machine-learning tools for the stellar
parametrization. On that topic, we believe that the experience gained here
with the analysis of spectra with limited resolution and spectral coverage
will be crucial in the development of CNN method for future surveys, such as
the 4MOST Milky Way Disc and Bulge Low-Resolution Survey (4MIDABLE-LR,
Chiappini et al. 2019).

###### Acknowledgements.

GG. sincerely thanks Gal Matijevič for the great time spent in Innsbruck where
at least 40% of this paper was written. GG. is grateful to Rene Andrae for the
fruitful discussions during the MPIA Galaxy & Cosmology Retreat 2023. We thank
the E-science & IT team for COLAB service and research infrastructure at AIP.
SN thanks the members of the StarHorse team, Chemodynamical group and MWLV &
DGGH sections at AIP for lively discussions. We acknowledge the International
Space Science Institute for supporting the ISSI team 542 on ”CatS - A
reference catalogue for Spectroscopic surveys” led by G. Guiglion and M.
Valentini, in which this paper was partly designed. M.B. is supported through
the Lise Meitner grant from the Max Planck Society. We acknowledge support by
the Collaborative Research Centre SFB 881 (projects A5, A10), Heidelberg
University, of the Deutsche Forschungsgemeinschaft (DFG, German Research
Foundation) and by the European Research Council (ERC) under the European
Union’s Horizon 2020 research and innovation programme (grant agreement
949173). G.T. acknowledges financial support from the Slovenian Research
Agency (research core funding No. P1-0188). JM acknowledges support from the
ERC Consolidator Grant funding scheme (project ASTEROCHRONOMETRY,
https://www.asterochronometry.eu, G.A. n. 772293). This work has made use of
data from the European Space Agency (ESA) mission Gaia
(https://www.cosmos.esa.int/gaia), processed by the Gaia Data Processing and
Analysis Consortium (DPAC,
https://www.cosmos.esa.int/web/gaia/dpac/consortium). Funding for the DPAC has
been provided by national institutions, in particular the institutions
participating in the Gaia Multilateral Agreement. This work made use of
overleaf 121212https://www.overleaf.com/, and of the following python packages
(not previously mentioned): matplotlib (Hunter 2007), scikit-learn (Pedregosa
et al. 2011), numpy (Harris et al. 2020), pandas (McKinney 2010), seaborn
(Waskom 2021). This work also benefited from topcat (Taylor 2005).

## References

  * Abadi et al. (2015) Abadi, M., Agarwal, A., Barham, P., et al. 2015, TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems, software available from tensorflow.org
  * Abdurro’uf et al. (2022) Abdurro’uf, Accetta, K., Aerts, C., et al. 2022, ApJS, 259, 35
  * Adibekyan et al. (2011) Adibekyan, V. Z., Santos, N. C., Sousa, S. G., & Israelian, G. 2011, A&A, 535, L11
  * Agertz et al. (2021) Agertz, O., Renaud, F., Feltzing, S., et al. 2021, MNRAS, 503, 5826
  * Ahumada et al. (2020a) Ahumada, R., Allende Prieto, C., Almeida, A., et al. 2020a, ApJS, 249, 3
  * Ahumada et al. (2020b) Ahumada, R., Prieto, C. A., Almeida, A., et al. 2020b, ApJS, 249, 3
  * Ambrosch et al. (2023) Ambrosch, M., Guiglion, G., Mikolaitis, Š., et al. 2023, A&A, 672, A46
  * Anders et al. (2017) Anders, F., Chiappini, C., Rodrigues, T. S., et al. 2017, A&A, 597, A30
  * Anders et al. (2018) Anders, F., Chiappini, C., Santiago, B. X., et al. 2018, A&A, 619, A125
  * Anders et al. (2014) Anders, F., Chiappini, C., Santiago, B. X., et al. 2014, A&A, 564, A115
  * Andrae et al. (2022) Andrae, R., Fouesneau, M., Sordo, R., et al. 2022, arXiv e-prints, arXiv:2206.06138
  * Andrae et al. (2023) Andrae, R., Rix, H.-W., & Chandra, V. 2023, arXiv e-prints, arXiv:2302.02611
  * Bensby et al. (2019) Bensby, T., Bergemann, M., Rybizki, J., et al. 2019, The Messenger, 175, 35
  * Bergemann et al. (2012) Bergemann, M., Lind, K., Collet, R., Magic, Z., & Asplund, M. 2012, MNRAS, 427, 27
  * Bergemann et al. (2018) Bergemann, M., Sesar, B., Cohen, J. G., et al. 2018, Nature, 555, 334
  * Bialek et al. (2020) Bialek, S., Fabbro, S., Venn, K. A., et al. 2020, MNRAS, 498, 3817
  * Boeche et al. (2011) Boeche, C., Siebert, A., Williams, M., et al. 2011, AJ, 142, 193
  * Brandner et al. (2023) Brandner, W., Calissendorff, P., & Kopytova, T. 2023, Benchmarking Gaia DR3 Apsis with the Hyades and Pleiades open clusters
  * Brown (1991) Brown, T. M. 1991, in Astronomical Society of the Pacific Conference Series, Vol. 20, Frontiers of Stellar Evolution, ed. D. L. Lambert, 139
  * Buck (2020) Buck, T. 2020, MNRAS, 491, 5435
  * Buder et al. (2019) Buder, S., Lind, K., Ness, M. K., et al. 2019, A&A, 624, A19
  * Buder et al. (2021) Buder, S., Sharma, S., Kos, J., et al. 2021, MNRAS, 506, 150
  * Chaplin & Miglio (2013) Chaplin, W. J. & Miglio, A. 2013, ARA&A, 51, 353
  * Chiappini et al. (1997) Chiappini, C., Matteucci, F., & Gratton, R. 1997, ApJ, 477, 765
  * Chiappini et al. (2019) Chiappini, C., Minchev, I., Starkenburg, E., et al. 2019, The Messenger, 175, 30
  * Chollet et al. (2015) Chollet, F. et al. 2015, Keras, https://keras.io
  * Christlieb et al. (2019) Christlieb, N., Battistini, C., Bonifacio, P., et al. 2019, The Messenger, 175, 26
  * Cioni et al. (2019) Cioni, M. . R. L., Storm, J., Bell, C. P. M., et al. 2019, The Messenger, 175, 54
  * Contursi et al. (2021) Contursi, G., de Laverny, P., Recio-Blanco, A., & Palicio, P. A. 2021, A&A, 654, A130
  * Creevey et al. (2022) Creevey, O. L., Sordo, R., Pailler, F., et al. 2022, arXiv e-prints, arXiv:2206.05864
  * Dalton et al. (2018) Dalton, G., Trager, S., Abrams, D. C., et al. 2018, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 10702, Proc. SPIE, 107021B
  * De Angeli et al. (2022) De Angeli, F., Weiler, M., Montegriffo, P., et al. 2022, arXiv e-prints, arXiv:2206.06143
  * de Jong et al. (2019) de Jong, R. S., Agertz, O., Berbel, A. A., et al. 2019, The Messenger, 175, 3
  * Fabbro et al. (2018) Fabbro, S., Venn, K. A., O’Briain, T., et al. 2018, MNRAS, 475, 2978
  * Fuhrmann (1998) Fuhrmann, K. 1998, A&A, 338, 161
  * Fuhrmann (2011) Fuhrmann, K. 2011, MNRAS, 414, 2893
  * Gaia Collaboration et al. (2018) Gaia Collaboration, Babusiaux, C., van Leeuwen, F., et al. 2018, A&A, 616, A10
  * Gaia Collaboration et al. (2016) Gaia Collaboration, Prusti, T., de Bruijne, J. H. J., et al. 2016, A&A, 595, A1
  * Gaia Collaboration et al. (2022a) Gaia Collaboration, Recio-Blanco, A., Kordopatis, G., et al. 2022a, arXiv e-prints, arXiv:2206.05534
  * Gaia Collaboration et al. (2022b) Gaia Collaboration, Vallenari, A., Brown, A. G. A., et al. 2022b, arXiv e-prints, arXiv:2208.00211
  * Ganaie et al. (2021) Ganaie, M. A., Hu, M., Tanveer, M., & Suganthan, P. N. 2021, CoRR, abs/2104.02395
  * Gent et al. (2022) Gent, M. R., Bergemann, M., Serenelli, A., et al. 2022, A&A, 658, A147
  * Gilmore et al. (2022) Gilmore, G., Randich, S., Worley, C. C., et al. 2022, A&A, 666, A120
  * Grand et al. (2018) Grand, R. J. J., Bustamante, S., Gómez, F. A., et al. 2018, MNRAS, 474, 3629
  * GRAVITY Collaboration et al. (2018) GRAVITY Collaboration, Abuter, R., Amorim, A., et al. 2018, A&A, 615, L15
  * Gray (2005) Gray, D. F. 2005, The Observation and Analysis of Stellar Photospheres (Cambridge University Press)
  * Guiglion et al. (2018) Guiglion, G., Chiappini, C., Valentini, M., & Steinmetz, M. 2018, Research Notes of the American Astronomical Society, 2, 212
  * Guiglion et al. (2016) Guiglion, G., de Laverny, P., Recio-Blanco, A., et al. 2016, A&A, 595, A18
  * Guiglion et al. (2020) Guiglion, G., Matijevič, G., Queiroz, A. B. A., et al. 2020, A&A, 644, A168
  * Guiglion et al. (2015) Guiglion, G., Recio-Blanco, A., de Laverny, P., et al. 2015, A&A, 583, A91
  * Harris et al. (2020) Harris, C. R., Millman, K. J., van der Walt, S. J., et al. 2020, Nature, 585, 357
  * Hayden et al. (2015) Hayden, M. R., Bovy, J., Holtzman, J. A., et al. 2015, ApJ, 808, 132
  * Haywood et al. (2013) Haywood, M., Di Matteo, P., Lehnert, M. D., Katz, D., & Gómez, A. 2013, A&A, 560, A109
  * Haywood et al. (2018) Haywood, M., Di Matteo, P., Lehnert, M. D., et al. 2018, ApJ, 863, 113
  * Heiter et al. (2021) Heiter, U., Lind, K., Bergemann, M., et al. 2021, A&A, 645, A106
  * Helmi (2020) Helmi, A. 2020, ARA&A, 58, 205
  * Helmi et al. (2019) Helmi, A., Irwin, M., Deason, A., et al. 2019, The Messenger, 175, 23
  * Huber et al. (2011) Huber, D., Bedding, T. R., Stello, D., et al. 2011, ApJ, 743, 143
  * Hunter (2007) Hunter, J. D. 2007, Computing in Science and Engineering, 9, 90
  * Jin et al. (2023) Jin, S., Trager, S. C., Dalton, G. B., et al. 2023, MNRAS
  * Katz et al. (2022) Katz, D., Sartoretti, P., Guerrier, A., et al. 2022, arXiv e-prints, arXiv:2206.05902
  * Khoperskov et al. (2021) Khoperskov, S., Haywood, M., Snaith, O., et al. 2021, MNRAS, 501, 5176
  * Kjeldsen & Bedding (1995) Kjeldsen, H. & Bedding, T. R. 1995, A&A, 293, 87
  * Kordopatis et al. (2013) Kordopatis, G., Gilmore, G., Steinmetz, M., et al. 2013, AJ, 146, 134
  * Kordopatis et al. (2023) Kordopatis, G., Hill, V., & Lind, K. 2023, arXiv e-prints, arXiv:2302.11907
  * LeCun & Bengio (1995) LeCun, Y. & Bengio, Y. 1995, in The Handbook of Brain Theory and Neural Networks, ed. M. A. Arbib (MIT Press)
  * LeCun et al. (1989) LeCun, Y., Boser, B., Denker, J. S., et al. 1989, Neural Computation, 1, 541
  * Lee et al. (2015) Lee, S., Purushwalkam, S., Cogswell, M., Crandall, D. J., & Batra, D. 2015, CoRR, abs/1511.06314
  * Lee et al. (2011) Lee, Y. S., Beers, T. C., An, D., et al. 2011, ApJ, 738, 187
  * Leung & Bovy (2019) Leung, H. W. & Bovy, J. 2019, MNRAS, 483, 3255
  * Lindegren et al. (2021) Lindegren, L., Bastian, U., Biermann, M., et al. 2021, A&A, 649, A4
  * Lindegren et al. (2018) Lindegren, L., Hernández, J., Bombrun, A., et al. 2018, A&A, 616, A2
  * Martig et al. (2016) Martig, M., Fouesneau, M., Rix, H.-W., et al. 2016, Monthly Notices of the Royal Astronomical Society, 456, 3655
  * Matijevič et al. (2017) Matijevič, G., Chiappini, C., Grebel, E. K., et al. 2017, A&A, 603, A19
  * Matijevič et al. (2012) Matijevič, G., Zwitter, T., Bienaymé, O., et al. 2012, ApJS, 200, 14
  * Matteucci (2021) Matteucci, F. 2021, A&A Rev., 29, 5
  * McKinney (2010) McKinney, W. 2010, in Proceedings of the 9th Python in Science Conference, ed. Stéfan van der Walt & Jarrod Millman, 56 – 61
  * Miglio et al. (2021) Miglio, A., Chiappini, C., Mackereth, J. T., et al. 2021, A&A, 645, A85
  * Mikolaitis et al. (2014) Mikolaitis, Š., Hill, V., Recio-Blanco, A., et al. 2014, A&A, 572, A33
  * Minchev et al. (2013) Minchev, I., Chiappini, C., & Martig, M. 2013, A&A, 558, A9
  * Minchev et al. (2015) Minchev, I., Martig, M., Streich, D., et al. 2015, ApJ, 804, L9
  * Nepal et al. (2023) Nepal, S., Guiglion, G., de Jong, R. S., et al. 2023, A&A, 671, A61
  * Ness et al. (2015) Ness, M., Hogg, D. W., Rix, H. W., Ho, A. Y. Q., & Zasowski, G. 2015, ApJ, 808, 16
  * Nomoto et al. (1997) Nomoto, K., Hashimoto, M., Tsujimoto, T., et al. 1997, Nucl. Phys. A, 616, 79
  * O’Malley et al. (2019) O’Malley, T., Bursztein, E., Long, J., et al. 2019, KerasTuner, https://github.com/keras-team/keras-tuner
  * Pedregosa et al. (2011) Pedregosa, F., Varoquaux, G., Gramfort, A., et al. 2011, Journal of Machine Learning Research, 12, 2825
  * Pinsonneault et al. (2018) Pinsonneault, M. H., Elsworth, Y. P., Tayar, J., et al. 2018, ApJS, 239, 32
  * Pompéia et al. (2002) Pompéia, L., Barbuy, B., & Grenon, M. 2002, ApJ, 566, 845
  * Queiroz et al. (2023) Queiroz, A. B. A., Anders, F., Chiappini, C., et al. 2023, A&A, 673, A155
  * Queiroz et al. (2020) Queiroz, A. B. A., Anders, F., Chiappini, C., et al. 2020, A&A, 638, A76
  * Queiroz et al. (2021) Queiroz, A. B. A., Chiappini, C., Perez-Villegas, A., et al. 2021, A&A, 656, A156
  * Randich et al. (2022) Randich, S., Gilmore, G., Magrini, L., et al. 2022, A&A, 666, A121
  * Recio-Blanco et al. (2022) Recio-Blanco, A., de Laverny, P., Palicio, P. A., et al. 2022, arXiv e-prints, arXiv:2206.05541
  * Reid et al. (2014) Reid, M. J., Menten, K. M., Brunthaler, A., et al. 2014, ApJ, 783, 130
  * Riello et al. (2021) Riello, M., De Angeli, F., Evans, D. W., et al. 2021, A&A, 649, A3
  * Roederer et al. (2016) Roederer, I. U., Mateo, M., Bailey, J. I., et al. 2016, MNRAS, 455, 2417
  * Rojas-Arriagada et al. (2019) Rojas-Arriagada, A., Zoccali, M., Schultheis, M., et al. 2019, A&A, 626, A16
  * Salaris, Maurizio et al. (2015) Salaris, Maurizio, Pietrinferni, Adriano, Piersimoni, Anna M., & Cassisi, Santi. 2015, A&A, 583, A87
  * Schönrich & Bergemann (2014) Schönrich, R. & Bergemann, M. 2014, MNRAS, 443, 698
  * Schönrich & Binney (2009) Schönrich, R. & Binney, J. 2009, MNRAS, 396, 203
  * Schönrich et al. (2010) Schönrich, R., Binney, J., & Dehnen, W. 2010, MNRAS, 403, 1829
  * Spitoni et al. (2019) Spitoni, E., Silva Aguirre, V., Matteucci, F., Calura, F., & Grisoni, V. 2019, A&A, 623, A60
  * Sprague et al. (2022) Sprague, D., Culhane, C., Kounkel, M., et al. 2022, AJ, 163, 152
  * Steinmetz et al. (2020a) Steinmetz, M., Guiglion, G., McMillan, P. J., et al. 2020a, AJ, 160, 83
  * Steinmetz et al. (2020b) Steinmetz, M., Matijevič, G., Enke, H., et al. 2020b, AJ, 160, 82
  * Taylor (2005) Taylor, M. B. 2005, in Astronomical Society of the Pacific Conference Series, Vol. 347, Astronomical Data Analysis Software and Systems XIV, ed. P. Shopbell, M. Britton, & R. Ebert, 29
  * Ting et al. (2019) Ting, Y.-S., Conroy, C., Rix, H.-W., & Cargile, P. 2019, ApJ, 879, 69
  * Tolstoy et al. (2009) Tolstoy, E., Hill, V., & Tosi, M. 2009, ARA&A, 47, 371
  * Valenti & Piskunov (1996) Valenti, J. A. & Piskunov, N. 1996, A&AS, 118, 595
  * Valentini et al. (2019) Valentini, M., Chiappini, C., Bossini, D., et al. 2019, A&A, 627, A173
  * Valentini et al. (2017) Valentini, M., Chiappini, C., Davies, G. R., et al. 2017, A&A, 600, A66
  * Wang et al. (2020) Wang, R., Luo, A. L., Chen, J.-J., et al. 2020, ApJ, 891, 23
  * Waskom (2021) Waskom, M. L. 2021, Journal of Open Source Software, 6, 3021
  * Worley et al. (2020) Worley, C. C., Jofré, P., Rendle, B., et al. 2020, A&A, 643, A83
  * Xiang et al. (2019) Xiang, M., Ting, Y.-S., Rix, H.-W., et al. 2019, ApJS, 245, 34
  * Xu et al. (2015) Xu, B., Wang, N., Chen, T., & Li, M. 2015, Empirical Evaluation of Rectified Activations in Convolutional Network
  * Xylakis-Dornbusch et al. (2022) Xylakis-Dornbusch, T., Christlieb, N., Lind, K., & Nordlander, T. 2022, A&A, 666, A58
  * Yao et al. (2023) Yao, Y., Ji, A. P., Koposov, S. E., & Limberg, G. 2023, arXiv e-prints, arXiv:2303.17676
  * Zhang et al. (2020) Zhang, B., Liu, C., Li, C.-Q., et al. 2020, Research in Astronomy and Astrophysics, 20, 051
  * Zhang et al. (2023) Zhang, X., Green, G. M., & Rix, H.-W. 2023, arXiv e-prints, arXiv:2303.03420
  * Zhang et al. (2019) Zhang, X., Zhao, G., Yang, C. Q., Wang, Q. X., & Zuo, W. B. 2019, PASP, 131, 094202
  * Zinn et al. (2022) Zinn, J. C., Stello, D., Elsworth, Y., et al. 2022, ApJ, 926, 191

##  Appendix A Comparison between CNN and GALAH DR3

Figure 17: Difference CNN minus GALAH (left column), and calibrated GSP-SPec
minus GALAH (right columns) for $\textit{T}_{\text{eff}}$,
$\text{log}(\textit{g})$, $[\text{M}/\text{H}]$, and $[\alpha/\text{M}]$, for
100 826 stars of the observed set (within the training set limits).

We previously assessed CNN performances with respect to APOGEE (which could
reflect our training sample) and GSP-SPec (that uses the same spectra as CNN).
In order to have a fully independent comparison, we adopted the third data
release (DR3) of the high-resolution ($\sim 28\,000$) optical spectroscopic
survey GALAH (Buder et al. 2021). GALAH DR3 used Spectroscopy Made Easy (SME;
Valenti & Piskunov 1996) spectral fitting code to derive atmospheric
parameters and chemical abundances for 588 571 stars. We adopted GALAH quality
flags according to the recommendations presented in the best practices for
using GALAH DR3 131313https://www.galah-survey.org/dr3/using_the_data/,
including removing stars that are flagged to have peculiarities in their
stellar parameters, and iron and alpha abundances, namely: flag_guess = 0,
flag_sp = 0, flag_fe_h = 0, flag_alpha_fe = 0, and made a S/N cut with
snr_c3_iraf ¿ 40 per pixel. Regarding CNN labels, we only require that labels
are within the training sample limits. For completeness, we also compare GALAH
to calibrated GSP-SPec parameters. Following the above selection, the sample
consists of 100 826 stars in common between CNN, GSP-SPec and GALAH DR3. We
note that 99% of these stars have low CNN uncertainties.

In Figure 17, we present label differences in the form CNN - GALAH (left
column) and GSP-SPec - GALAH (right column) as a function of GALAH. Regarding
CNN - GALAH, $\textit{T}_{\text{eff}}$ and $\text{log}(\textit{g})$ present no
strong systematics, apart from hot dwarf stars
($\textit{T}_{\text{eff}}>6\,400$K) with significant bias of ¿300K (total of 4
000 stars). We note that such a trend is also visible in the input APOGEE DR17
labels. When comparing GSP-SPec to GALAH (right panel), we see a strong
residual trend in $\text{log}(\textit{g})$ for the dwarfs, while overall, the
dispersion is 2$-$3 times larger than when comparing CNN to GALAH. We also see
many strong outliers, for instance for $[\text{M}/\text{H}]$ when comparing
CNN to GALAH, around $[\text{M}/\text{H}]_{\mathrm{GALAH}}=-1.7$ and
$\Delta[\text{M}/\text{H}]\sim+1.5\,$dex. We are in presence of 9 giants with
$\textit{T}_{\text{eff}}\sim 4\,500\,$K, $\text{log}(\textit{g})\sim 2$ as
parametrized from CNN, GALAH DR3, and GSP-SPec. CNN and GSP-SPec report a
metallicity of about -0.1 dex, while GALAH finds these stars metal-poor around
-1.6 dex. After careful comparison of these spectra with respect to metal-poor
and solar-$[\text{M}/\text{H}]$ giants, we can confidently say that such stars
are metal-poor. A more comprehensive understanding of the outliers is beyond
the scope of the present paper, but it shows the power of CNN to correct
wrongly assigned labels. In this section, we have demonstrated that CNN
parameters based on spectroscopy, astrometry and photometry are very
consistent with high-resolution spectroscopic GALAH parameters.

##  Appendix B CNN stability with respect to _Gaia_ DR3 radial velocitites

Figure 18: 2D density distribution of CNN minus APOGEE and calibrated GSP-SPec
minus APOGEE as a function of _Gaia_ DR3 radial-velocities uncertainties, in
both the training (41 623 stars) and observed samples (81 545 stars, within
the training sample limits).

In this section, we investigate how CNN is sensitive to the uncertainty is
radial velocities. In this study, the adopted _Gaia_ -RVS have been corrected
from Doppler shift by the _Gaia_ consortium. It may happen that a tiny
residual shift (fraction of pixel) can be present in the corrected spectra of
stars with large Vrad uncertainties. We remind that small systematics in the
radial velocity applied to spectra may lead to systematics in the predicted
labels (see Nepal et al. 2023). In Figure 18, we show how the difference in
labels between CNN & APOGEE and GSP-SPec & APOGEE (in both training and
observed samples) varies with _Gaia_ DR3 radial-velocity uncertainties
(e$\mathrm{V}_{\mathrm{rad}}$). First, for the training sample, we clearly see
that for each label ($\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$,
$[\text{M}/\text{H}]$, and $[\alpha/\text{M}]$) the systematics (bias) between
CNN and APOGEE is constant as a function of e$\mathrm{V}_{\mathrm{rad}}$). On
the other hand, GSP-SPec - APOGEE shows strong residual trends, for the bulk
of the distribution, with increasing bias a function of
e$\mathrm{V}_{\mathrm{rad}}$). The dispersion is also 2-3 times larger
compared to CNN. For the stars on the observed sample. We observe similar
trends, with slightly higher dispersion, mainly due to the presence of lower
S/N data. We notice that, even if not plotted here, $[\text{Fe}/\text{H}]$
behaves similarly as $[\text{M}/\text{H}]$. With such tests, we can conclude
that CNN shows no strong sensitivity to e$\mathrm{V}_{\mathrm{rad}}$, and
shows no residual trends.

Figure 19: Left: Kiel diagram representation of the observed sample stars
outside of the training sample limits (61 674 stars), color codded as a
function of $[\text{M}/\text{H}]$. Middle: 2D histogram of the same stars. We
show mean RVS spectra of the very-metal poor (cyan) and very-metal rich (pink)
regions. We also highlighted stars in different regions of the Kiel diagram.
Their mean spectra are presented in the right panel. See text for more
details.

##  Appendix C Performances of CNN outside its training sample limits

Machine-learning algorithms are extremely efficient in learning within a given
label space. However, the predicted labels belonging outside the training
sample limits may suffer from strong systematics. In this section, we present
CNN labels of the observed sample stars, outside the limits presented in Table
1. The sample consists of 61 674 stars, and a Kiel diagram is presented in the
left panel of Figure 19. The sample seems to contain FGK dwarfs, as well as
metal-poor G giants and K metal-rich giants and M giants. The middle panel of
Figure 19 shows a density plot of the sample, together with:

  * •

Typical spectrum of the metal-rich blob (in pink): It shows very strong TiO
bands, indicating in fact that such stars are M giants (confirmed by their
_Gaia_ DR3 spectraltype_esphs). Such a type of stars were also observed in
RAVE (Matijevič et al. 2012). There is no such a type of stars in the training
set. As a result, CNN interprets the strong TiO bands as metal-rich features.
Labels for these stars are unlikely to be accurate.

  * •

Typical spectrum of the metal-poor blob (in cyan): The spectrum shows very
strong Hydrogen Paschen lines, indicating in fact very hot stars. These
spectra indeed are classified as OB stars when checking the spectraltype_esphs
from _Gaia_ DR3. CNN labels are also unlikely to be accurate.

We investigate in more details other regions of the Kiel diagram that present
labels for CNN, APOGEE DR17 and GSP-SPec. Orange dots depict hot stars (as
confirmed by their spectra in the right panel). These stars are classified as
AF stars by _Gaia_ DR3. The blue and red dots, classified as GKM stars by
_Gaia_ DR3 present typical dwarf spectra while green and purple seem to be
indeed could giants. For these stars, we compare in Figure 20 CNN labels with
respect to APOGEE DR17 and GSP-SPec.

  * •

Blue dots: CNN $\textit{T}_{\text{eff}}$ matches within $\pm 200\,$K the
APOGEE $\textit{T}_{\text{eff}}$ in the range $4\,500-6\,500$, while it shows
strong systematics down to $\textit{T}_{\text{eff}}\sim 3\,500\,K$.
$\text{log}(\textit{g})$ presents an average bias of 1 dex at
$\text{log}(\textit{g})\sim 4.5$ that increases to +2 dex at
$\text{log}(\textit{g})\sim 3.5$dex. $[\text{M}/\text{H}]$ also shows strong
systematic trend, while $[\alpha/\text{M}]$ seems to work reasonably well.
Comparing APOGEE to GSP-SPec for these stars, GSP-SPec seems to show no strong
systematics bias, while the dispersion is very similar to CNN. These stars are
nearby ($6<p<17$mas), and not well represented in the training sample. CNN
labels for these regions of the label space should be taken with caution.

  * •

Orange dots: CNN labels compare pretty well to APOGEE DR17, especially
$\textit{T}_{\text{eff}}$ that shows to systematic bias. $[\text{M}/\text{H}]$
shows a bias of $+0.15\,$dex compared to APOGEE. It is interesting to see that
GSP-SPec $\textit{T}_{\text{eff}}$ and $\text{log}(\textit{g})$ are shifted by
$\sim+1\,000\,$K and 0.5 dex in $\textit{T}_{\text{eff}}$ and
$\text{log}(\textit{g})$ respectively. $[\text{M}/\text{H}]$ from GSP-SPec
presents large scatter of about +0.4 dex while $[\alpha/\text{M}]$ do not
match at all APOGEE DR17. We believe that such large differences between CNN
and GSP-SPec comes from the fact that CNN uses extra information while GSP-
SPec uses only RVS spectra. We conclude that even though these stars are
outside the training sample limits, CNN labels are still reliable.

  * •

Red dots: the 4 CNN labels $\textit{T}_{\text{eff}}$,
$\text{log}(\textit{g})$, $[\text{M}/\text{H}]$ and $[\alpha/\text{M}]$ all
present solid biases compared to APOGEE: $-500\,$, -1 dex, -2 dex and +0.4
dex, respectively. GSP-SPec $\textit{T}_{\text{eff}}$ and
$\text{log}(\textit{g})$, and $[\alpha/\text{M}]$ match rather well APOGEE
DR17, while $[\alpha/\text{M}]$ is not matching. These solar-like dwarfs are
characterized by a magnitude $G\sim 12$, and parallaxes ranging from 1 to 4
mas, so rather well represented in the training sample.

  * •

Purple dots: CNN $\textit{T}_{\text{eff}}$, $\text{log}(\textit{g})$ and
$[\alpha/\text{M}]$ match pretty well APOGEE while $[\text{M}/\text{H}]$ is
off by more than +0.6 dex. For all labels, GSP-SPec shows a very good match
with APOGEE. For these stars, CNN should still be taken with caution, these
stars being very bright (6$<G<$7.5) and nearby ($4<p<7\,$mas), and absent from
training sample.

  * •

Green dots: These very-cool giants parametrized by CNN match rather well
APOGEE, even though a systematic trend is visible is $\text{log}(\textit{g})$.
CNN $[\text{M}/\text{H}]$ and $[\alpha/\text{M}]$ show rather large dispersion
(0.3 and 0.15 dex, respectively). GSP-SPec compares to APOGEE rather well. It
is very interesting to note that some GSP-SPec $\text{log}(\textit{g})$ are
biased by +4 dex compared to APOGEE, while CNN shows no bias. It is due to the
fact that CNN uses extra information (such as parallaxes) that constrain more
accurately $\text{log}(\textit{g})$. We conclude that CNN
$\textit{T}_{\text{eff}}$ and $\text{log}(\textit{g})$ in this parameter space
are reliable, showing the capabilities of CNN to extrapolate outside its
training sample.

Figure 20: Residual of CNN minus APOGEE (left column) and calibrated GSP-SPec
minus APOGEE (right column) for the stars highlighted in the middle panel of
Figure 19.

##  Appendix D Training CNN of purely _Gaia_ RVS spectra

Figure 21: Same figure as Figure 11 but for RVS stars parametrized by CNN only
using RVS spectra.

We have demonstrated in the previous sections that combining RVS spectra,
magnitudes, parallaxes, and XP coefficients allowed to provide high-quality
CNN labels. For completeness, we train CNN using only RVS spectra as input
data. In Figure 21, we show Kiel diagrams of the high-quality sample in bins
of S/N (15-25, 25-35, 35-75, and $\geq 75$), color-codded with
$[\text{M}/\text{H}]$ (219 145 stars within training set limit and with low-
uncertainty as defined in Sect. 4.2). We present the rest of the RVS sample in
grey (stars outside the training sample limits or with large uncertainties).
We see a consistent Kiel diagram even at low-S/N, with clear metallicity
sequence in the giant branch, while the red clump locus is clearly reproduced.
The sequence of cool dwarfs only extends down to
$\textit{T}_{\text{eff}}=5\,000\,$K contrary to Figure 11. It is due to the
fact that similarly to RAVE spectra, RVS seems to suffer from degeneracies as
well. Such degeneracies are clearly put into light by the stars in grey, i.e.
a sequence connecting the cool giants to the cool dwarfs (see Kordopatis et
al. 2013; Guiglion et al. 2020 for more details of the RAVE spectral
degeneracies). Another interesting feature is a high concentration of stars
above $\textit{T}_{\text{eff}}>6500\,$K. Their spectra are characterised by
strong Hydrogen Paschen lines. CNN seems to rather well constrain their
temperature while $\text{log}(\textit{g})$ is clearly biased.

Figure 22: Same figure as Figure 15, but comparing CNN gravities derived using
only RVS spectra and seismic gravities.

In Figure 22, we compare CNN gravities (derived from RVS spectra only) to
seismic gravites computed from Zinn et al. (2022) (see Sect. 4.6; same stars
as in Figure 15). Overall, the bias in well below 0.1 dex, while the
dispersion ranges from 0.15 to 0.18 dex, which is remarkable considering that
we only trained on RVS spectra. We remind that calibrated GSP-SPec gravities
only showed accuracy of 0.13-0.23 dex and precision of 0.3-0.4 dex compared to
seismic gravities.

We such tests, we show that CNN still provides reliable parameters when
trained only on RVS spectra. It is due to the high-quality APOGEE labels
transferred and learned during the training process. CNN is still not immune
to spectral degeneracies for some stars. Such degeneracies are broken when
using extra magnitudes, parallaxes, and XP data.

##  Appendix E $[\alpha/\text{Fe}]\,vs.[\text{M}/\text{H}]$ as traced by GSP-
SPec

We have demonstrated in Sect 5 that we are able to trace the
$[\alpha/\text{M}]\,vs.[\text{M}/\text{H}]$ bimodality from the inner to the
outer disc of the Milky Way using _Gaia_ RVS data and CNN (see Figure 16). We
present here similar plots adopting using the calibrated GSP-SPec
$[\alpha/\text{Fe}]$ and $[\text{M}/\text{H}]$ for _Gaia_ RVS 87 724 stars
with CNN $\text{log}(\textit{g})<2.2$. In Figure 23, no bimodality is
observed, while the $[\alpha/\text{Fe}]$ spans a larger abundance range
(consistently with Fig. 7 of Gaia Collaboration et al. 2022a). We note that no
bimodality is observed if we filter low-S/N spectra or adopt the non-
calibrated $[\alpha/\text{Fe}]$ and $[\text{M}/\text{H}]$ from GSP-SPec. For
completeness, we plotted the same stars with CNN $[\alpha/\text{M}]$ and
$[\text{M}/\text{H}]$ in Figure 24 and recover the same main features as in
Figure 16.

Figure 23: 2D histograms and contours of calibrated GSP-SPec
$[\alpha/\text{Fe}]\,vs.\,[\text{M}/\text{H}]$ in 87 724 stars of the observed
sample with CNN $\text{log}(\textit{g})\leq 2.2$. Stars are plotted in kpc
bins of galactocentric radius (R) and height above the galactic lane (Z).
Figure 24: Same figure as Figure 23 but using CNN
$[\alpha/\text{Fe}]\,vs.\,[\text{M}/\text{H}]$.