# Magnetic dipole transition in proton-deuteron radiative capture at BBN
energies within potential model

Nguyen Le Anh1, Dao Nhut Anh1, Do Huy Tho1 and Nguyen Huu Nha2 1 Department of
Physics, Ho Chi Minh City University of Education, 280 An Duong Vuong,
District 5, Ho Chi Minh City, Vietnam  2 Department of Theoretical Physics,
Faculty of Physics and Engineering Physics, University of Science, Ho Chi Minh
City, Vietnam<EMAIL_ADDRESS>
###### Abstract

The $pd$ radiative capture reaction plays a vital role in Big Bang
nucleosynthesis and stellar proton-proton chain. The study of the low-energy
reaction is challenging in both experiments and theories. Using the framework
of potential model, we analyze $pd$ radiative capture below 1 MeV for both
electric dipole ($E1$) and magnetic dipole ($M1$) transitions. The obtained
astrophysical $S$ factors agree well with recent results, especially at
energies relevant to sensitive deuterium abundance. The calculated reaction
rate shows good agreement, with less than a 5% difference compared to recent
works. The extrapolated value for $S(0)$ including both transitions is
determined to be $0.211\pm 0.016$ eV b. A comparison with experimental data
using the $\chi^{2}$ test reveals the sensitivity of the $M1$ cross section at
low energies to the scattering potential depth.

††: Phys. Scr.

Keywords: Radiative capture, Big Bang nucleosynthesis, potential model,
elastic proton scattering.

##  1 Introduction

The primordial or Big Bang nucleosynthesis (BBN) is the production of the
first nuclei of helium, lithium, and other light elements after the Big Bang.
The formation and breakdown of deuterium involve a set of reactions, including
the established $p$($n,\gamma$)$d$ pathway for deuterium production and the
processes of deuterium reduction through $d$($d,n$)3He, $d$($d,p$)3H, and
$d$($p,\gamma$)3He ($pd$ radiative capture) reactions. The abundance of
deuterium makes it a valuable indicator for cosmological parameters because it
is highly responsive to the primordial baryon density [1]. Furthermore, it is
influenced by the number of neutrino species present in the early Universe
[2]. In stars, the $pd$ radiative capture reaction is one of the key steps in
the proton-proton chain, which converts hydrogen into helium and releases
energy [3]. The $pd$ radiative capture reaction in the BBN energy range has
been extensively studied, especially in the last years, both theoretically and
experimentally [4, 5].

Due to the presence of the Coulomb barrier, the cross sections for the $pd$
radiative capture reaction at low energies are generally limited, making them
challenging to accurately determine in experimental measurements. Ongoing and
prospective laboratory experiments are actively exploring nuclear reaction
physics, crucial components for input into BBN calculations. The $pd$
radiative capture reaction was measured at low energy in several accelerator
experiments [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]. In addition, high-
energy-density plasmas provide an alternative technique for obtaining cross
sections [17]. It is worth highlighting that this reaction is of great
significance in astrophysics and is observed not only in the Sun but also in
the majority of main-sequence stars throughout the universe. The greatest
sensitivity of the primordial deuterium abundance to the $pd$ reaction cross
section was particularly notable around 80 keV reported in Ref. [16].
Consequently, the experimental data observed below 1 MeV hold a pivotal role
in understanding stellar processes in the main sequence and BBN.

In the early 2000s, the Laboratory for Underground Nuclear Astrophysics (LUNA)
successfully conducted experiments to obtain important data on the
astrophysical $S$ factor within the low-energy range [7]. At higher energies,
data sets were compiled from measurements in Refs. [8, 9, 10, 11, 13, 14, 15,
16]. It is worth noting that these measurements retained considerable
uncertainties, which considerably affected the comparison between predicted
and observed primordial abundance. A new experimental campaign was relaunched
at LUNA in 2016 [5]. The latest experiments conducted by LUNA have effectively
decreased the uncertainty in the reaction rate to a level as low as 3% [16].
Several works, such as [18, 19], discussed the astrophysical implications
based on the updated $pd$ radiative capture rate.

Various theoretical models are extensively employed for extrapolating
available data to extremely low energies, including $R$-matrix analysis,
microscopic approaches, and potential models. The $R$-matrix analysis was
compiled in Ref. [20]. The ab initio methods recognized as state-of-the-art
techniques for the $pd$ radiative capture reaction were reviewed in Ref. [4].
The $pd$ scattering problem is an excellent testing ground for nuclear
interactions, providing essential insights into the dynamics of few-body
systems within the simplest nucleon-nucleus context. Advanced theoretical
techniques with the help of Faddeev treatment or using hyperspherical
harmonics (HH) expansions have been developed to tackle this challenge [21,
22, 23, 24, 25, 26, 27, 28, 29]. The nonlocality has been proposed to provide
a better description for the three-nucleon bound states 3He and $pd$
scattering calculations [30, 31]. The recent theoretical work showed a
disagreement at the level of 20–30% with a widely used $S$-factor best fit to
experimental datasets [32, 33].

Besides the microscopic approach toward the solution of the general problem of
nuclear forces, the $pd$ radiative capture can be addressed through a
potential model that effectively reproduces experimental observations below
the three-body breakup threshold [34, 35, 36, 37, 38]. Within the potential
model, the radiative capture process can be simply considered as an
electromagnetic transition from the single-particle (s.p.) scattering state to
the s.p. bound state [34]. The $pd$ radiative capture reaction in this work is
examined using a phenomenological approach reported in Refs. [34, 35, 36] to
obtain astrophysical $S$ factors, reaction rates, and the extrapolated value
of $S(0)$. The process of $pd$ radiative capture is complicated, involving
both electric dipole ($E1$) and magnetic dipole ($M1$) transitions, with the
latter making a significant contribution. Thus, our main focus is to evaluate
the contribution of the $M1$ transition within the potential model. The role
of electromagnetic dipole and high-order transitions has been extensively
studied with the pair-correlated HH method for $pd$ radiative capture in the
literature [28]. The comparison between the experimental data and the
theoretical ab initio calculation for the three-body problem including the
meson exchange currents (MEC) effects shows the sensitivity of $M1$
transitions [11, 24, 39]. In the present work, the sensitivity of the $M1$
transition is also pointed out within the potential model using the well-depth
method. We show that describing nuclear three-body systems as a two-body
system could provide not only a simple and effective way to describe
experimental data but also key inputs of nuclear astrophysics [34, 35]. Also,
the nuclear spectroscopic information in 3He and $pd$ scattering observables
are revealed.

The structure of this paper is as follows: In the following section, we will
present the fundamental formula for a radiative capture reaction. The detailed
formulation of the $E1$ and $M1$ transitions within the potential model can be
found in Ref. [40]. The obtained astrophysical $S$ factors, reaction rates,
and elastic scattering observables are discussed in the result section.

##  2 Formalism for radiative capture reaction within potential model

###  2.1 Reaction rate and astrophysical $S$ factor

The astrophysical reaction rates per particle pair at a certain temperature
$T$ can be calculated with

$\langle\sigma
v\rangle=\sqrt{\dfrac{8}{\pi\mu}}\dfrac{1}{(k_{B}T)^{3/2}}\int_{0}^{\infty}g(E)S(E)\,dE,$
(1)

where $k_{B}$ is the Boltzmann constant and $\mu$ is the reduced mass of the
$pd$ system. The masses of proton and deuteron used in this work are $1.0073$
u and $2.0141$ u, respectively. The Gamow window function is expressed as

$g(E)=\exp\left[-\dfrac{E}{k_{B}T}-2\pi\eta(E)\right],$ (2)

where the Sommerfeld parameter is $\eta(E)=e^{2}/(\hbar v)$ with $v$ being the
relative velocity between the proton and the deuteron. As the energy
approaches zero, the cross sections $\sigma(E)$ exhibit a significant
decrease. It is therefore customary to introduce the energy-dependent
astrophysical $S$ factor defined as

$S(E)=Ee^{2\pi\eta}\sigma(E).$ (3)

When $S(E)$ remains constant, which occurs in the absence of resonances, the
integrand in Eq. (1) reaches its peak efficiency at the most effective energy.

To evaluate the agreement between the calculated $S(E)$ and experimental data,
the $\chi^{2}$ statistic is defined as

$\chi^{2}=\sum_{i=1}^{N}\left(\dfrac{S_{i}^{\text{cal}}-S_{i}^{\text{exp}}}{\Delta
S_{i}^{\text{exp}}}\right)^{2},$ (4)

where $S_{i}^{\text{cal}}$ and $S_{i}^{\text{exp}}$ are the calculated and
experimental astrophysical $S$ factors for a set of $N$ selected data points
from experiments, respectively. These selected experimental data points below
1 MeV are from Refs. [7, 8, 9, 10, 11, 13, 14, 15, 16], and each data point is
associated with an uncertainty denoted as $\Delta S_{i}^{\text{exp}}$.

In the potential model, the internal structure of the interacting nuclei is
essentially neglected. The intrinsic spins of the target ($I$) and incident
proton ($s=1/2$) are thus kept unchanged. The system is assumed as the core
(target) capturing a proton into the s.p. state. The initial (scattering)
state is denoted as $|[I\otimes(\ell_{i}\otimes s){j_{i}}]{J_{i}}\rangle$,
while the final (bound) state is represented as $|[I\otimes(\ell_{f}\otimes
s){j_{f}}]{J_{f}}\rangle$. The total relative angular momentum of the system
is $\vec{j}=\vec{\ell}+\vec{s}$ with $\vec{\ell}$ being the relative orbital
angular momentum. The channel spin is a result of coupling
$\vec{J}=\vec{I}+\vec{j}$. The radiative capture cross section for the
electromagnetic dipole ($\Omega 1$ with $\Omega\equiv E$ or $\Omega\equiv M$)
transitions to a bound state is now written as

$\sigma_{n\ell_{f}j_{f}J_{f}}(E)=\dfrac{4}{3}\dfrac{1}{\hbar
v}\left(\dfrac{4\pi}{3}k^{3}_{\gamma}\right)\dfrac{1}{(2s+1)(2I+1)}\times\sum_{\Omega,\ell_{i}j_{i}J_{i}}|M_{\Omega
1}|^{2},$ (5)

where the $\gamma$-ray wave number is defined as

$k_{\gamma}=\dfrac{E-E_{n\ell_{f}j_{f}}}{\hbar c},$ (6)

as a function of the proton energy $E$. The binding energy
$E_{n\ell_{f}j_{f}}$ is determined within the potential model.

To determine the capture cross sections as described in Eq. (5), it is
necessary to compute the matrix elements of the dipole operators. The reduced
matrix elements of the $\Omega 1$ transition are written as

$M_{\Omega 1}=\langle[I\otimes(\ell_{f}\otimes
s)_{j_{f}}]_{J_{f}}||\mathcal{O}_{\Omega 1}||[I\otimes(\ell_{i}\otimes
s)_{j_{i}}]_{J_{i}}\rangle.$ (7)

The dipole operators of $E1$ and $M1$ take the forms [40]

$\displaystyle\mathcal{O}_{E1}$ $\displaystyle=C_{e}rY_{1},$ (8)
$\displaystyle\mathcal{O}_{M1}$
$\displaystyle=\sqrt{\dfrac{3}{4\pi}}\left(C_{m}\hat{\ell}+2\mu_{p}\hat{s}+2\mu_{d}\hat{I}\right),$
(9)

where $Y_{1}$ are spherical harmonics, and the hat notations are the
projections of the orbital angular momentum and spins. The values of $C_{e}$
and $C_{m}$ are the effective charge and effective magnetic moment,
respectively. The magnetic moments that are used in this work are
$\mu_{p}=2.79285\mu_{N}$ for proton and $\mu_{d}=0.85744\mu_{N}$ for deuteron
[41], where $\mu_{N}$ is the nuclear magneton.

The $M_{\Omega 1}$ in Eq. (7) can be simplified by the calculation of the s.p.
reduced matrix element which can be decomposed into components

$M_{\Omega 1}^{({\text{s.p.}})}=A\cdot I\cdot\sqrt{S_{\rm F}},$ (10)

where $S_{\rm F}$ is introduced to account for the fractional parentage
coefficient that the system can be described as the presumption. The formula
of $E1$ and $M1$ transitions relating to angular-spin coefficients $A$ can be
found in Ref. [40]. The most important ingredient of Eq. (10) is the radial
overlap integrals $I$ of two states.

$\displaystyle I_{E1}$
$\displaystyle=\int\phi_{n\ell_{f}j_{f}}(r)\chi_{\ell_{i}j_{i}}(E,r)r\,dr,$
(11) $\displaystyle I_{M1}$
$\displaystyle=\int\phi_{n\ell_{f}j_{f}}(r)\chi_{\ell_{i}j_{i}}(E,r)\,dr,$
(12)

where $\chi_{\ell_{i}j_{i}}$ and $\phi_{n\ell_{f}j_{f}}$ are s.p. wave
functions of scattering and bound states, respectively.

###  2.2 Phenomenological potential model

The bound and scattering wave functions are described as eigenfunctions of the
usual radial Schrödinger equations for each s.p. wave function

$\displaystyle\left[-\dfrac{\hbar^{2}}{2\mu}\left(\dfrac{d^{2}}{dr^{2}}-\dfrac{\ell_{f}(\ell_{f}+1)}{r^{2}}\right)+V_{n\ell_{f}j_{f}}(r)\right]\phi_{n\ell_{f}j_{f}}(r)$
$\displaystyle=E_{n\ell_{f}j_{f}}\phi_{n\ell_{f}j_{f}}(r),$ (13)
$\displaystyle\left[-\dfrac{\hbar^{2}}{2\mu}\left(\dfrac{d^{2}}{dr^{2}}-\dfrac{\ell_{i}(\ell_{i}+1)}{r^{2}}\right)+V_{\ell_{i}j_{i}}(r)\right]\chi_{\ell_{i}j_{i}}(E,r)$
$\displaystyle=E\chi_{\ell_{i}j_{i}}(E,r).$ (14)

In both Eqs. (13) and (14), the local potentials $V_{n\ell_{f}j_{f}}(r)$ and
$V_{\ell_{i}j_{i}}(r)$ have identical forms and include contributions from
nuclear central, spin-orbit coupling, and Coulomb terms

$V(r)=V_{\text{cent.}}(r)+V_{\text{s.o.}}(r)(\vec{\ell}\cdot\vec{\sigma})+V_{\text{Coul.}}(r).$
(15)

The nuclear terms are of the Woods-Saxon (WS) form

$\displaystyle V_{\text{cent.}}(r)$ $\displaystyle=V_{0}f_{\text{WS}},$ (16)
$\displaystyle V_{\text{s.o.}}(r)$
$\displaystyle=\left(\dfrac{\hbar}{m_{\pi}c}\right)^{2}\dfrac{V_{{\text{S}}}}{r}\dfrac{d}{dr}f_{\text{WS}},$
(17) $\displaystyle f_{\text{WS}}(r)$
$\displaystyle=\dfrac{1}{1+e^{(r-R_{0})/a_{0}}},$ (18)

where $R_{0}$ and $a_{0}$ are the radius and diffuseness parameters of the WS
potentials, respectively. The value of $m_{\pi}$ is the pion rest mass. The
parameters $V_{0}$ and $V_{\text{S}}$ are the strengths (depths) of the
nuclear central and spin-orbit potentials in MeV, respectively. The repulsive
part of the central potential is omitted. While $V_{0}$ is a negative value,
the $V_{\text{S}}$ is chosen with a positive value for consistency with the
shell model of the nucleus. The Coulomb potential is of a uniformly charged
sphere

$\displaystyle V_{\rm
Coul.}(r)=\begin{cases}\dfrac{e^{2}}{2R_{{\text{C}}}}\left(3-\dfrac{r^{2}}{R_{{\text{C}}}^{2}}\right),&r<R_{{\text{C}}}\\\
e^{2}/r,&r\geq R_{{\text{C}}}\end{cases},$ (19)

where $R_{\text{C}}$ is the Coulomb radius.

The parameters $V_{0}$ and $V_{\text{S}}$ are fine-tuned to reproduce the
ground-state energy $E_{n\ell_{f}j_{f}}$ of the deuteron in Eq. (13). The wave
function of the bound state $\phi_{n\ell_{f}j_{f}}(r)$ becomes negligible at
large distances, and its norm is determined by

$\langle\phi_{n\ell_{f}j_{f}}|\phi_{n\ell_{f}j_{f}}\rangle=1.$ (20)

The potential parameters for the scattering states are similar to those for
the bound states. The scattering states $\chi_{\ell_{i}j_{i}}(E,r)$ with
continuous energy $E$ satisfy boundary conditions at infinity replaced by

$\chi_{\ell_{i}j_{i}}(E,r\to\infty)\to\cos\delta_{\ell_{i}j_{i}}(E)F_{\ell_{i}}(\eta,kr)+\sin\delta_{\ell_{i}j_{i}}(E)G_{\ell_{i}}(\eta,kr),$
(21)

where $F_{\ell_{i}}(\eta,kr)$ and $G_{\ell_{i}}(\eta,kr)$ are the regular and
irregular Coulomb wave functions, respectively; and
$\delta_{\ell_{i}j_{i}}(E)$ represents the nuclear phase shift for the partial
wave $\ell_{i}j_{i}$.

##  3 Results and discussions

###  3.1 Single-particle configuration and potential parameters

Figure 1: Astrophysical $S$ factor of $d$($p,\gamma$)3He reaction with
experimental data selected from Refs. [7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17]. The solid line represents the total calculation with $E1$ (dashed line)
and $M1$ (dotted line) transitions. The dash-dotted line shows the
astrophysical $S$ factor using the theoretical ab initio model in Ref. [32].

There are no excited states in the deuteron, and there is no evidence
supporting a low-lying excited state in 3He [42]. We therefore consider the
transitions to the ground state of 3He with $J_{f}=1/2^{+}$. The ground state
of 3He is modeled as a proton with spin $s=1/2$ coupled to the deuterium core,
which itself possesses an intrinsic spin $I=1^{+}$. In the framework of the
shell model, it is conventional to describe 3He within a model space
characterized by $0\hbar\omega$, with approximately three nucleons in the
$1s_{1/2}$ states. The correlation in the 3He ground state, resulting from the
mixing of higher components, is estimated to be approximately below 10% in
shell-model calculation [43].

In this work, the form of WS potential is fitted based on the form of Skyrme
Hartree-Fock potential [44]. The version of SLy5 interaction gives the values
of $R_{0}=2.31$ fm and $a_{0}=0.37$ fm for the central potential. To simplify
the model and reduce the number of parameters, we maintain constant values for
the parameters $a_{0}=0.37$ fm, $R_{0}=r_{\text{C}}=2.31$ fm, and
$V_{\text{S}}=5$ MeV. It is important to note that the diffuseness and radius
parameters have minimal impact on the shape of cross section. Additionally,
given the absence of resonances in the energy region below 1 MeV, adjustments
to the strength of the spin-orbit interaction do not significantly affect the
cross section. Consequently, only adjustment of the depth $V_{0}$ is used to
reproduce simultaneously the binding energy and the $pd$ scattering.

For the bound state, an additional proton is captured into the unoccupied
$1s_{1/2}$ state ($\ell_{f}=0$). The binding energy of $1s_{1/2}$ proton is
equal to the $Q$ value of the reaction, which is $E_{1s_{1/2}}=-5.49$ MeV. To
reproduce this binding energy, the value of $V_{0}^{b}=-32$ MeV is adopted.
The $s$-wave asymptotic normalization constant (ANC) in 3He is determined to
be $1.79$ fm-1/2 in this work, yielding a squared value of $3.2$ fm-1. This
value is slightly below measurements by less than 10% but falls within the
uncertainty of measurements. In particular, the empirical squared ANCs
reported are $3.4\pm 0.2$ fm-1 in Ref. [45] and $3.5\pm 0.4$ fm-1 in Ref.
[46]. Additionally, the ANC computed for the Reid soft-core potential is found
to be 1.765 fm-1/2 [47] which is close to the value obtained from our
potential model.

The $E1$ transition is predominantly caused by incoming $p$ waves
($\ell_{i}=1$). The channel spins corresponding to possible captured $p$ waves
(both $p_{1/2}$ and $p_{3/2}$) are $J_{i}=1/2^{-},3/2^{-}$. Fig. 1 shows the
calculated astrophysical $S$ factor of $pd$ radiative capture. For comparison,
the dash-dotted line represents the astrophysical $S$ factor obtained through
the ab initio approach, extracted from Table I in Ref. [32]. The dashed line
presents our calculation with only the $E1$ transition. Notably, it well
describes the data sets from Refs. [10, 14, 15, 16] without modification.
However, it is still lower than the LUNA database at very low energy [7]. The
extrapolated value of $S_{E1}(0)$ with only $E1$ contribution is 0.16 eV b,
using $V_{0}^{s}=V_{0}^{b}=-32$ MeV.

###  3.2 Sensitivity of $M1$ transition

Figure 2: Results of the $\chi^{2}$ test examining the variation of the depth
$V^{s}_{0(M1)}$ of the scattering potential for the $s$ state. The optimal
depth is found to be $V^{s}_{0(M1)}=-27$ MeV, with values of $a_{0}=0.37$ fm
and $R_{0}=2.31$ fm. The dashed line represents the calculation using
$V_{0(E1)}^{s}=-25$ MeV for scattering states in the $E1$ transition. The
dotted line illustrates the calculation using $V_{0(E1)}^{s}=-32$ MeV,
consistent with the bound state. The solid line shows the calculation
employing the same scattering potential depths for both $E1$ and $M1$
transitions.

The contribution of the $M1$ transition is considered, which enhances the
magnitude of the $S$ factor at low energy. The scattering $s$ wave
($\ell_{i}=0$) causes the $M1$ transition to the ground state. Fig. 2 shows
the optimal value $V_{0}$ when using $\chi^{2}$ test in comparison with
experimental data from Refs. [7, 8, 9, 10, 11, 13, 14, 15, 16] as displayed in
Fig. 1. It is evident that the minimum $\chi^{2}$ value occurs when the depth
$V_{0}$ is around $-27$ MeV. It is reasonable when $V_{0}^{s}=-27$ MeV is
applied to both scattering $s$ and $p$ waves. As the depth increases beyond
this value, the $\chi^{2}$ value remains relatively stable, primarily because
the $M1$ contribution is negligible. For instance, when the same potentials
for bound and scattering states ($V^{s}_{0}=V^{b}_{0}=-32$ MeV) are adopted,
the $S$ factor for the $M1$ transition is lower by approximately 9 orders of
magnitude compared to the primary contribution from the $E1$ transition. In
contrast, decreasing the depth leads to an overestimation of the $M1$
strength, highlighting the high sensitivity of the $M1$ transition strength to
variations in potential depth.

###  3.3 Analysis of elastic cross section and polarization

Figure 3: (a1) Angular distributions of differential cross sections for $pd$
elastic scattering at $E_{\text{lab}}=0.4$ MeV, with experimental data sourced
from Ref. [48]. (b1) Angular distributions of the analyzing power calculated
using $V_{0}=-27$ MeV with $V_{\text{S}}=2$ MeV (dashed line) and
$V_{\text{S}}=5$ MeV (solid line). Data for the analyzing powers at
$E_{\text{c.m.}}=667$ keV are taken from Ref. [49]. (a2, b2) The $\chi^{2}$
test examining the variations of the depths of central potential $V_{0}$ and
spin-orbit potential $V_{\rm S}$, respectively.

.

Validating the scattering potentials requires the calculation of cross
sections and polarizations at low energy. The differential cross section for
$pd$ elastic scattering at $E_{\text{lab}}=0.4$ MeV is depicted in Fig. 3(a1),
using measurements of angular distributions from Ref. [48]. The $\chi^{2}$
value decreases by a factor of 2.7 when using $V_{0}=-27$ MeV compared to
$V_{0}=-32$ MeV. The optimal depth of the central potential is determined to
be approximately $-25$ MeV, as shown in Fig. 3(a2). Notably, an improvement in
the cross section is observed when employing the central scattering potential
$V_{0}=-27$ MeV for large scattering angles, with the inclusion of a spin-
orbit potential $V_{\text{S}}=5$ MeV. Although this inclusion does not have a
significant impact on the description of differential cross section, it does
play a role in investigating polarization.

In Fig. 3(b1), the calculated analyzing powers are presented with varying
strengths of the spin-orbit potential. The strength of $V_{\text{S}}=5$ MeV
aligns well with data points at 667 keV from Ref. [49]. In contrast, a spin-
orbit strength of $V_{\text{S}}=2$ MeV fails to replicate in this case. The
$\chi^{2}$ value for $V_{\rm S}=5$ MeV is reduced by half compared to $V_{\rm
S}=2$ MeV. Fig. 3(b2) reveals that the optimal depth of the spin-orbit
potential is approximately $4$ MeV. The description of $pd$ scattering
observables, especially the angular distributions of the analyzing powers, is
enhanced when including MEC effects, as reported in Ref. [11]. It is important
to note that the optical potentials including central and spin-orbit
potentials in this study are considered only real and energy-independent at
low energy. Therefore, the examination for higher energies is not within the
scope of this work.

###  3.4 Spectroscopic factor and the best-fit value of $S(0)$

Figure 4: (a) The different $\chi^{2}_{\min}$ values obtained when changing
$S_{\rm F}$ and $V_{0}^{s}$. The best value for the proton spectroscopic
factor in 3He is $S_{\rm F}=0.9$ corresponding to the $V_{0}^{s}=-26.3$ MeV,
which gives the lowest value of $\chi^{2}$. (b) The linear correlation between
$S_{\rm F}$ and $V_{0}^{s}$ at the minimum $\chi^{2}$ expressed by
$V_{0}^{s}=-21.9-6.1S_{\rm F}$ in MeV.

The spectroscopic factor $S_{\rm F}$ for the bound state is determined by
finding the values of $\chi^{2}_{\min}$. In Fig. 4(a), the variations in
$\chi^{2}_{\min}$ are depicted concerning changes in $S_{\rm F}$ and
$V_{0}^{s}$. The best-fit value for $S_{\rm F}$ is identified as $0.9$,
corresponding to the use of $V_{0}^{s}=-26.3$ MeV for both transitions. At the
minimum of $\chi^{2}$, the relationship between $S_{\rm F}$ and $V_{0}^{s}$
follows a linear pattern given by $V_{0}^{s}=-21.9-6.1S_{\rm F}$ in MeV, as
depicted in Fig. 4(b). The revised $S_{E1}(0)$ is now $0.098$ eV b. In
comparison, Ref. [20], utilizing $R$-matrix analysis, reported
$S_{E1}(0)=0.089\pm 0.004$ eV b, which closely aligns with our calculated
value.

Figure 5: Same as Fig. 1 but for $S_{\rm F}=0.9$ and $V_{0}^{s}=-26.3$ MeV. Table 1: The values of $S(0)$ for different experimental and theoretical works. References |  $S(0)$ (eV b)
---|---
Schmid et al. (1996) [50] | $0.165\pm 0.014$
Viviani et al. (1996) [24] | $0.185$
Viviani et al. (2000) [28] | $0.219$
Casella et al. (2002) [7] | $0.216\pm 0.010$
Descouvemont et al. (2004) [20] | $0.223\pm 0.010$
Marcucci et al. (2005) [29] | $0.219$
Xu et al. (2013) [35] | $0.21\pm 0.04$
Iliadis et al. (2016) [51] | $0.2156^{+0.0082}_{-0.0077}$
Sadeghi et al. (2013) [26] | 0.243
Turkat et al. (2021) [15] | $0.219\pm 0.004$
Moscoso et al. (2021) [19] | $0.219\pm 0.001$
This work | $0.211\pm 0.016$

In Fig. 5, the inclusion of $M1$ transition leads to an extrapolated value of
$S(0)$ of $0.211\pm 0.016$ eV b, using $V_{0}^{s}=-26.3$ MeV and $S_{\rm
F}=0.9$. The uncertainty in our computed $S$ factor arises from the variance
between calculations utilizing $S_{\rm F}=0.9$ and $S_{\rm F}=1.0$. The
contribution of $M1$ in our calculation at zero energy is determined to be
$S_{M1}(0)=0.113$ eV which is in excellent agreement with the experimental
determination in Refs. [8] and [10] reported as $0.12\pm 0.03$ eV b and
$0.109\pm 0.010$ eV b, respectively. The enhancement of $M1$ transition at
very low energy is due to two-body current contributions [10]. Table 1
presents our results of the total $S(0)$ compared with the other works. The
experimental references have reported values such as $S(0)=0.166\pm 0.014$ eV
b [10], $0.216\pm 0.010$ eV b [7], and $0.219\pm 0.004$ eV b [15]. The
calculation of $S(0)$ with the inclusion of $M1$ contribution is $4\%$ lower
than recent experimental values in Refs. [7, 15] and slightly smaller than the
ab initio value of 0.219 eV b [28, 29]. Using $R$-matrix analysis, $S(0)$ is
found to be $0.089\pm 0.004$ eV b ($E1$) and $0.134\pm 0.006$ eV b ($M1$)
[20]. Our calculation shows a good agreement with the value reported in the
NACRE II compilation [35]. It is worth mentioning that the fit of potential
depth for both $E1$ and $M1$ transitions is significantly influenced by very
low-energy data points obtained from measurements in Ref. [7]. Specifically, a
data point at 4.05 keV (see Table I in Ref. [7]) stands out significantly
lower compared to the trend of other data points as shown in Figs. 1 and 5.

Around the point where it is emphasized that the primordial deuterium
abundance is most sensitive ($E=80$ keV) according to Ref. [16], our
calculated $S$ factors are in good agreement with the latest measured values.
Particularly, the total $S$ factors at $E=66.7$ keV and $E=99.5$ keV in the
present work give $0.602\pm 0.042$ eV b and $0.821\pm 0.073$ eV b while the
experimental values are $0.627\pm 0.025$ eV b and $0.850\pm 0.029$ eV b [16],
respectively. The prediction of $S$ factor at 91 keV reported in Ref. [19] is
$0.799\pm 0.018$ eV b which is slightly higher than our value of $0.763\pm
0.065$ eV b. In this range of energy, the contribution of the $M1$ transition
in our approach is approximately 11% to 16%.

At very low energy, the total $S$ factor (in eV b) can be approximated as a
polynomial function of energy (in MeV). For energies below 40 keV, Ref. [8]
reported the linear function $S(E)=(0.25\pm 0.04)+7.9E$. Additionally, a cubic
function represented as $S(E)=0.2121+5.973E+5.449E^{2}-1.656E^{3}$ was
reported for energies below 2 MeV in Ref. [16]. Based on the statistical model
with data from 11 experiments, Ref. [19] gave
$S(E)=0.219^{+0.01}_{-0.01}+5.8^{+0.24}_{-0.24}E+6.34^{+0.88}_{-0.82}E^{2}-2.2^{+0.52}_{-0.52}E^{3}$.
In the present work, the total $S$ factor calculated for energies below 100
keV is approximated by

$S(E)\approx 0.211+5.25E+9.47E^{2}-5.54E^{3},$ (22)

where $S(E)$ and $E$ are in eV b and MeV, respectively. The slope of $S(E)$
from our calculation is slightly lower than those of Refs. [16, 19]. The
approximated $S$ factors for $E1$ and $M1$ transitions using $V_{0}^{s}=-26.3$
MeV and $S_{\rm F}=0.9$ are given by

$\displaystyle S_{E1}(E)\approx 0.098+5.72E+5.94E^{2}+4.59E^{3},$ (23)
$\displaystyle S_{M1}(E)\approx 0.113-0.46E+3.54E^{2}-10.1E^{3}.$ (24)

Notably, the slope of $S_{M1}(E)$ is negative, indicating that $S_{M1}(E)$ is
influenced by a sub-threshold $s$-state resonance. In contrast, the positive
slope of $S_{E1}(E)$ suggests $p$-state resonances above 1 MeV.

###  3.5 Reaction rate

Figure 6: The ratio of reaction rates below 1 GK obtained from Refs. [16, 19,
20, 35, 51, 52] to the calculated rates in this work.

Our calculation of Gamow window functions $g(E)$ given in Eq. (2) for
different temperatures below 1 GK indicates that the effective energy range
for this reaction falls below 1 MeV. The recommended Maxwellian-averaged
reaction rate $N_{A}\langle\sigma v\rangle$ for $pd$ radiative capture
reaction at temperatures below 1 GK is presented in Table 2. In comparison,
Fig. 6 illustrates the ratio of rates obtained from Refs. [16, 19, 20, 35, 51,
52] to the rates calculated in the present work. The dashed and solid curves
in Fig. 6 represent the resulting reaction rates for the calculation without
and with the inclusion of $M1$ transition, respectively. Notably, there is a
significant difference between these two curves. Our calculation shows a good
agreement with Refs. [51, 52] at very low temperatures. Values from Refs. [51,
52] exhibit no significant difference, as both adopted fitting based on
theoretical $S$ factors [32]. The calculated rates are approximately $1.5\%$
higher than the NACRE II compilation [35] but the difference becomes larger at
high temperatures. The $R$-matrix analysis [20] and the recent best-fit
measured $S$ factors [16, 19] provide rates higher than our calculation below
$0.1$ GK. The discrepancy between our calculated rates and those from Refs.
[16, 19, 51, 52] is below $5\%$.

Table 2: Calculated reaction rates in this work. $T$ | $N_{A}\langle\sigma v\rangle$ | $T$ | $N_{A}\langle\sigma v\rangle$
---|---|---|---
(GK) | (cm3 mol-1 s-1) | (GK) | (cm3 mol-1 s-1)
$0.001$ | $9.445\times 10^{-12}$ | $0.002$ | $1.877\times 10^{-08}$
$0.003$ | $6.159\times 10^{-07}$ | $0.004$ | $5.460\times 10^{-06}$
$0.005$ | $2.558\times 10^{-05}$ | $0.006$ | $8.271\times 10^{-05}$
$0.007$ | $2.105\times 10^{-04}$ | $0.008$ | $4.539\times 10^{-04}$
$0.009$ | $8.677\times 10^{-04}$ | $0.010$ | $1.514\times 10^{-03}$
$0.011$ | $2.462\times 10^{-03}$ | $0.012$ | $3.783\times 10^{-03}$
$0.013$ | $5.551\times 10^{-03}$ | $0.014$ | $7.840\times 10^{-03}$
$0.015$ | $1.073\times 10^{-02}$ | $0.016$ | $1.428\times 10^{-02}$
$0.018$ | $2.368\times 10^{-02}$ | $0.020$ | $3.658\times 10^{-02}$
$0.025$ | $8.726\times 10^{-02}$ | $0.030$ | $1.691\times 10^{-01}$
$0.040$ | $4.426\times 10^{-01}$ | $0.050$ | $8.774\times 10^{-01}$
$0.060$ | $1.480\times 10^{+00}$ | $0.070$ | $2.248\times 10^{+00}$
$0.080$ | $3.179\times 10^{+00}$ | $0.090$ | $4.264\times 10^{+00}$
$0.100$ | $5.497\times 10^{+00}$ | $0.110$ | $6.871\times 10^{+00}$
$0.120$ | $8.379\times 10^{+00}$ | $0.130$ | $1.001\times 10^{+01}$
$0.140$ | $1.177\times 10^{+01}$ | $0.150$ | $1.363\times 10^{+01}$
$0.160$ | $1.561\times 10^{+01}$ | $0.180$ | $1.987\times 10^{+01}$
$0.200$ | $2.451\times 10^{+01}$ | $0.250$ | $3.755\times 10^{+01}$
$0.300$ | $5.236\times 10^{+01}$ | $0.350$ | $6.865\times 10^{+01}$
$0.400$ | $8.621\times 10^{+01}$ | $0.450$ | $1.048\times 10^{+02}$
$0.500$ | $1.245\times 10^{+02}$ | $0.600$ | $1.662\times 10^{+02}$
$0.700$ | $2.106\times 10^{+02}$ | $0.800$ | $2.573\times 10^{+02}$
$0.900$ | $3.059\times 10^{+02}$ | $1.000$ | $3.561\times 10^{+02}$

##  4 Conclusions

Our investigation has provided a quantitative analysis of the role of $M1$
transition in the $pd$ radiative capture process at extremely low energies,
employing the potential model. The form of the phenomenological potential is
derived from microscopic calculations, showcasing the effectiveness of the
potential model as a simple yet powerful tool for addressing few-body
problems. We have emphasized that the contribution of the $M1$ transition is
highly sensitive to scattering potentials. Our calculated astrophysical $S$
factors, reaction rates, and elastic scattering observables closely align with
recent works, showing a difference of less than 10%. This good agreement
reinforces the validity of our approach.

The authors would like to thank Bui Minh Loc for engaging in discussions. This
work was funded by Ho Chi Minh City University of Education Foundation for
Science and Technology under grant number CS.2023.19.57. N. L. A. acknowledges
the Master, PhD Scholarship Programme of Vingroup Innovation Foundation
(VINIF), code VINIF.2023.TS.003.

## References

## References

  * [1] Cooke R J, Pettini M and Steidel C C 2018 Astrophys. J. 855 102
  * [2] Xu X J, Wang Z and Chen S 2023 Prog. Part. Nucl. Phys. 104043
  * [3] Arcones A and Thielemann F K 2023 Astron. Astrophys. Rev. 31 1
  * [4] Adelberger E G, García A, Robertson R G H, Snover K A, Balantekin A B, Heeger K, Ramsey-Musolf M J, Bemmerer D, Junghans A et al. 2011 Rev. Mod. Phys. 83(1) 195–245
  * [5] Cavanna F 2023 EPJ Web Conf. 279 01002
  * [6] Bystritsky V M, Gerasimov V V, Krylov A R, Parzhitskii S S, Dudkin G N, Kaminskii V L, Nechaev B A, Padalko V N, Petrov A V, Mesyats G A et al. 2008 Nucl. Instrum. Methods Phys. Res. A 595 543–548
  * [7] Casella C, Costantini H, Lemut A, Limata B, Bonetti R, Broggini C, Campajola L, Corvisiero P, Cruz J, D’Onofrio A et al. 2002 Nucl. Phys. A 706 203–216
  * [8] Griffiths G M, Lal M and Scarfe C D 1963 Can. J. Phys. 41 724–736
  * [9] Bailey G M, Griffiths G M, Olivo M A and Helmer R L 1970 Can. J. Phys. 48 3059–3061
  * [10] Schmid G J, Chasteler R M, Laymon C M, Weller H R, Prior R M and Tilley D R 1995 Phys. Rev. C 52(4) R1732–R1735
  * [11] Ma L, Karwowski H J, Brune C R, Ayer Z, Black T C, Blackmon J C, Ludwig E J, Viviani M, Kievsky A and Schiavilla R 1997 Phys. Rev. C 55(2) 588–596
  * [12] Weller H R 2000 AIP Conf. Proc. 529 442–449
  * [13] Bystritsky V M, Gazi S, Huran J, Dudkin G N, Krylov A R, Lysakov A, Nechaev B A, Padalko V N, Sadovsky A B, Filipowicz M et al. 2015 Phys. Part. Nucl. Lett. 12 550–558
  * [14] Tišma I, Lipoglavšek M, Mihovilovič M, Markelj S, Vencelj M and Vesić J 2019 Eur. Phys. J. A 55 137
  * [15] Turkat S, Hammer S, Masha E, Akhmadaliev S, Bemmerer D, Grieger M, Hensel T, Julin J, Koppitz M, Ludwig F, Möckel C, Reinicke S, Schwengner R, Stöckel K, Szücs T, Wagner L and Zuber K 2021 Phys. Rev. C 103(4) 045805
  * [16] Mossa V, Stöckel K, Cavanna F, Ferraro F, Aliotta M, Barile F, Bemmerer D, Best A, Boeltzig A, Broggini C et al. 2020 Nature 587 210–213
  * [17] Zylstra A B, Herrmann H W, Kim Y H, McEvoy A, Frenje J A, Johnson M G, Petrasso R D, Glebov V Y, Forrest C, Delettrez J, Gales S and Rubery M 2020 Phys. Rev. C 101(4) 042802
  * [18] Pisanti O, Mangano G, Miele G and Mazzella P 2021 J. Cosmol. Astropart. Phys. 2021 020
  * [19] Moscoso J, de Souza R S, Coc A and Iliadis C 2021 Astrophys. J. 923 49
  * [20] Descouvemont P, Adahchour A, Angulo C, Coc A and Vangioni-Flam E 2004 At. Data Nucl. Data Tables 88 203–236
  * [21] Friar J L, Gibson B F, Jean H C and Payne G L 1991 Phys. Rev. Lett. 66(14) 1827–1830
  * [22] Kievsky A, Viviani M and Rosati S 1994 Nucl. Phys. A 577 511–527
  * [23] Kievsky A, Viviani M and Rosati S 1995 Phys. Rev. C 52(1) R15–R19
  * [24] Viviani M, Schiavilla R and Kievsky A 1996 Phys. Rev. C 54(2) 534–553
  * [25] Golak J, Kamada H, Witała H, Glöckle W, Kuro ś Zołnierczuk J, Skibiński R, Kotlyar V V, Sagara K and Akiyoshi H 2000 Phys. Rev. C 62(5) 054005
  * [26] Sadeghi H, Khalili H and Godarzi M 2013 Chin. Phys. C. 37 044102
  * [27] Vanasse J, Egolf D A, Kerin J, König S and Springer R P 2014 Phys. Rev. C 89(6) 064003
  * [28] Viviani M, Kievsky A, Marcucci L E, Rosati S and Schiavilla R 2000 Phys. Rev. C 61(6) 064001
  * [29] Marcucci L E, Viviani M, Schiavilla R, Kievsky A and Rosati S 2005 Phys. Rev. C 72(1) 014001
  * [30] Doleschall P, Borbély I, Papp Z and Plessas W 2003 Phys. Rev. C 67(6) 064005
  * [31] Doleschall P and Papp Z 2005 Phys. Rev. C 72(4) 044003
  * [32] Marcucci L E, Mangano G, Kievsky A and Viviani M 2016 Phys. Rev. Lett. 116(10) 102501
  * [33] Marcucci L E, Mangano G, Kievsky A and Viviani M 2016 Phys. Rev. Lett. 117(4) 049901
  * [34] Huang J T, Bertulani C A and Guimaraes V 2010 At. Data Nucl. Data Tables 96 824–847
  * [35] Xu Y, Takahashi K, Goriely S, Arnould M, Ohta M and Utsunomiya H 2013 Nucl. Phys. A 918 61–169
  * [36] Ghasemi R and Sadeghi H 2018 Results Phys. 9 151–165
  * [37] Dubovichenko S B and Dzhazairov-Kakhramanov A V 2009 Eur. Phys. J. A 39 139–143
  * [38] Dubovichenko S B, Chechin L M, Burkova N A, Dzhazairov-Kakhramanov A V, Omarov C T, Nurakhmetova S Z, Beisenov B U, Ertaiuly A and Eleusheva B 2020 Russ. Phys. J. 63 1118–1125
  * [39] Rice B J, Wulf E A, Canon R S, Kelley J H, Prior R M, Spraker M, Tilley D R and Weller H R 1997 Phys. Rev. C 56(6) R2917–R2919
  * [40] Anh N L and Loc B M 2022 Phys. Rev. C 106(1) 014605
  * [41] Mohr P J and Taylor B N 2000 Rev. Mod. Phys. 72(2) 351–495
  * [42] Tilley D R, Weller H R and Hasan H H 1987 Nucl. Phys. A 474 1–60
  * [43] Dortmans P J, Amos K and Karataglidis S 1998 Phys. Rev. C 57(5) 2433–2437
  * [44] Colò G, Cao L, Van Giai N and Capelli L 2013 Comput. Phys. Commun. 184 142–161
  * [45] Plattner G R, Bornand M and Viollier R D 1977 Phys. Rev. Lett. 39(3) 127–130
  * [46] Bornand M P, Plattner G R, Viollier R D and Alder K 1978 Nucl. Phys. A 294 492–512
  * [47] Sasakawa T, Sawada T and Kim Y E 1980 Phys. Rev. Lett. 45(17) 1386–1388
  * [48] Huttel E, Arnold W, Berg H, Krause H, Ulbricht J and Clausnitzer G 1983 Nucl. Phys. A 406 435–442
  * [49] Wood M H, Brune C R, Fisher B M, Karwowski H J, Leonard D S, Ludwig E J, Kievsky A, Rosati S and Viviani M 2002 Phys. Rev. C 65(3) 034002
  * [50] Schmid G J, Viviani M, Rice B J, Chasteler R M, Godwin M A, Kiang G C, Kiang L L, Kievsky A, Laymon C M, Prior R M, Schiavilla R, Tilley D R and Weller H R 1996 Phys. Rev. Lett. 76(17) 3088–3091
  * [51] Iliadis C, Anderson K S, Coc A, Timmes F X and Starrfield S 2016 Astrophys. J. 831 107
  * [52] Coc A, Petitjean P, Uzan J P, Vangioni E, Descouvemont P, Iliadis C and Longland R 2015 Phys. Rev. D 92(12) 123526


Please refer to the extended journal version of this work. The extended paper
provides additional information on the _Shellcode_IA32_ dataset, and an
extensive experimental analysis.

Can we generate shellcodes via natural language? An empirical study. Pietro
Liguori, Erfan Al-Hossami, Domenico Cotroneo, Roberto Natella, Bojan Cukic,
and Samira Shaikh Automated Software Engineering, Volume 29, Article no. 30,
March 2022 DOI: 10.1007/s10515-022-00331-3 arXiv: 2202.03755

#  _Shellcode_IA32_ : A Dataset for Automatic Shellcode Generation

Pietro Liguori University of Naples Federico II
Naples, Italy  Erfan Al-Hossami University of North Carolina at Charlotte
Charlotte, NC, USA  Domenico Cotroneo University of Naples Federico II
Naples, Italy  Roberto Natella University of Naples Federico II
Naples, Italy
Bojan Cukic University of North Carolina at Charlotte
Charlotte, NC, USA  Samira Shaikh University of North Carolina at Charlotte
Charlotte, NC, USA

###### Abstract

We take the first step to address the task of automatically generating
shellcodes, i.e., small pieces of code used as a payload in the exploitation
of a software vulnerability, starting from natural language comments. We
assemble and release a novel dataset (Shellcode_IA32), consisting of
challenging but common assembly instructions with their natural language
descriptions. We experiment with standard methods in neural machine
translation (NMT) to establish baseline performance levels on this task.

##  1 Introduction and Related Work

A growing body of research has dealt with automated code generation: given a
natural language description, a code comment or intent, the task is to
generate a piece of code in a programming language Yin and Neubig (2017); Ling
et al. (2016). The task of generating programming code snippets, also referred
to as semantic parsing Yin and Neubig (2019); Xu et al. (2020), has been
previously addressed to generate executable snippets in domain-specific
languages Guu et al. (2017); Long et al. (2016), and several programming
languages, including Python Yin and Neubig (2017) and Java Ling et al. (2016).

We consider the task of generating _shellcodes_ , i.e., small pieces of code
used as a payload to exploit software vulnerabilities. Shellcoding, in its
most literal sense, means writing code that will return a remote shell when
executed. It can represent any byte code that will be inserted into an exploit
to accomplish the desired, malicious, task Mason et al. (2009). An example of
a shellcode program in assembly language and the corresponding natural
language comments are shown in Listing 1.

Shellcodes are important because they are the key element of security attacks:
they represent code injected into victim software to take control of a
machine, to escalate privileges, and to use the machine for malicious purposes
such as DDoS attacks, data theft, and running malware Arce (2004). Well-
intentioned actors (security practitioners and product vendors) also develop
shellcodes to run non-harmful _proof-of-concept_ attacks, to show how security
weaknesses can be exploited to identify vulnerabilities and patch systems.
Thus, shellcode generation using (semi-) automated techniques has become a
popular and very active research topic Bao et al. (2017). However, writing
shellcodes is technically challenging since they are typically written in
assembly language (c.f. Listing 1). The most sophisticated shellcodes can
reach hundreds of assembly lines of code.

⬇

1global _start; Declare global _start.

2section .text; Declare the text section.

3_start:; Define the _start label.

4xor eax, eax; Zero out the eax register

5push eax; and push its contents on the stack.

6push 0x68732f2f;Move /bin//sh

7push 0x6e69622f;into the ebx register.

8mov ebx, esp

9push eax; Push the contents of eax onto the stack

10mov edx, esp; and point edx to the stack register.

11push ebx; Push the contents of ebx onto the stack

12mov ecx, esp; and point ecx to the stack register.

13mov al, 11; Put the system call 11 into the al register.

14int 0x80; Make the kernel call.

Listing 1: x86 assembly code used to spawn /bin/sh shell on Linux OS. Lines
4-5, 6-7-8, 9-10, 11-12 are multi-line snippets generated by four different
intents.

The task of the shellcode generation has been addressed by several works and
tools. Bao et al. (2017) designed ShellSwap, a system that can modify an
observed exploit and replace the original shellcode with an arbitrary
replacement shellcode. The system uses symbolic tracing, with a combination of
shellcode layout remediation and path kneading to achieve shellcode
transplants. Pwntools pwntools (Accessed: 2021-05-29) is a CTF framework and
exploit development library written in Python. It is designed for rapid
prototyping and development and intended to make exploit writing as simple as
possible.

Differently from previous work in the security literature, we approach this
problem as a machine translation (NMT) task. We apply neural machine
translation Goodfellow et al. (2016), which unlike the traditional phrase-
based translation system consisting of many small sub-components tuned
separately, attempts to build and train a single, large neural network that
reads a sentence and outputs a correct translation Bahdanau et al. (2015). NMT
has emerged as a promising machine translation approach, showing superior
performance on public benchmarks Bojar et al. (2016), and it is widely
recognized as the premier method for the translation of different languages Wu
et al. (2016). NMT has also been used to perform complex tasks on the UNIX
operating system shell Lin et al. (2017) (e.g. file manipulation and search),
by stating goals in English Lin et al. (2018), to automatically generate
commit messages Liu et al. (2018), etc. However, the NMT techniques have not
heretofore been adopted to automatically generate software exploits from
natural language comments.

Since NMT is a data-driven approach to code generation, we need a dataset of
intents in natural language, and their corresponding translation (in our
context, in assembly language) for shellcode generation. In this preliminary
work, we address the lack of such a dataset by presenting _Shellcode_IA32_ , a
dataset containing $3,200$ lines of assembly code extracted from real
shellcodes and described in the English language. Moreover, we present
experiments on our dataset using a baseline technique, in order to establish
performance levels for evaluating shellcode generation techniques.

##  2 Dataset

We compiled a dataset, _Shellcode_IA32_ , specific to our task. This dataset
consists of 3,200 examples of instructions in assembly language for IA-32 (the
32-bit version of the x86 Intel Architecture) from publicly-available security
exploits. We collected assembly programs used to generate shellcode from
shell-storm Shellcodes database for study cases (Accessed: 2021-04-22) and
from Exploit Database Exploit Database Shellcodes (Accessed: 2021-04-22), in
the period between 2000 and 2020.

Our focus is on Linux, the most common OS for security-critical network
services. Accordingly, we added assembly instructions written with Netwide
Assembler (NASM) for Linux Duntemann (2000). NASM is line-based. Figure 1
shows a simple example of a NASM source line. Every source line contains a
combination of four fields: an optional label used to represent either an
identifier or a constant, a mnemonic or instruction, which identifies the
purpose of the statement and followed by zero or more operands specifying the
data to be manipulated, and an optional comment, i.e., text ignored by the
compiler. A mnemonic is not required if a line contains only a label or a
comment.

Figure 1: Layout of NASM source line

Each line of _Shellcode_IA32_ dataset represents a snippet – intent pair. The
snippet is a line or a combination of multiple lines of assembly code, built
by following the NASM syntax. The intent is a comment in the English language
(c.f. Listing 1).

To take into account the variability of descriptions in natural language,
multiple authors described independently different samples of the dataset in
the English language. Where available, we used as natural language
descriptions the comments written by developers of the collected programs. We
enriched the dataset by adding examples of assembly programs for the IA-32
architecture from popular tutorials and books Duntemann (2011); Kusswurm
(2014); Tutorialspoint (Accessed: 2021-04-22) to understand how different
authors and assembly experts describe the code and, thus, how to deal with the
ambiguity of natural language in this specific context. Our dataset consists
of $\sim 10\%$ of instructions collected from books and guidelines and the
rest from real shellcodes.

Multi-line Snippets: To automatically generate shellcodes, we need to look
beyond a one-to-one mapping between a line of code and its comment/intent. For
example, a common operation in shellcodes is to save the ASCII “/bin/sh” into
a register. This operation requires three distinct assembly instructions: push
the hexadecimal values of the words “/bin” and “//sh” onto the stack register
before moving the contents of the stack register into the destination register
(lines 6-8 in Listing 1). It would be meaningless to consider these three
instructions as separate. To address such situations, we include $510$ lines
($\sim 16\%$ of the dataset) of intents that generate multiple lines of
shellcodes (separated by the newline character \n). Table 1 shows two further
examples of multi-line snippets with their natural language intent.

|  Intent: jump short to the decode label if the contents of the
---
al register is not equal to the contents of the cl register
else jump to the shellcode label
Multi-line Snippets: cmp al, cl \n
jne short decode \n jmp shellcode
|  Intent: jump to the label recv_http_request
---
if the contents of the eax register is not zero else subtract
the value 0x6 from the contents of the ecx register
Multi-line Snippets: test eax, eax \n
jnz recv_http_request \n sub ecx, 0x6
Table 1: Examples of multi-line snippets

Statistics: Table 2 presents the descriptive statistics of the
_Shellcode_IA32_ dataset. The dataset contains $52$ distinct assembly
instructions (excluding function, section, and label declaration). The two
most frequent assembly instructions are mov ($\sim 30$% frequency), used to
move data into/from registers/memory or to invoke a system call, and push
($\sim 22$% frequency), which is used to push a value onto the stack. The next
most frequent instructions are the cmp ($\sim 7\%$ frequency), xor and jmp
instructions ($\sim 4\%$ frequency). The low-frequency words (i.e., the words
that appear only once or twice in the dataset) contribute to the $3.6\%$ and
$7.3\%$ of the natural language and the assembly language, resp. Figure 2
shows the distribution of the number of tokens across the intents and snippets
in the dataset. We publicly share our entire _Shellcode_IA32_ dataset on a
GitHub repository.111The dataset can be found here:
https://github.com/dessertlab/Shellcode_IA32

Size of our dataset: Our dataset contains $3,200$ instances, which may seem
relatively small compared to training data available for most common NLP
tasks. We note, however, that our dataset is comparable in size to the CoNaLa
annotated dataset ($2,379$ training and $500$ test examples), which is one of
the standard datasets in code generation (for English-Python code generation)
Yin et al. (2018). Further, _Shellcode_IA32_ contains a higher percentage of
multi-line snippets ($\sim 16\%$ vs. $\sim 4\%$). We also note here that
existing code generation datasets do contain a larger, potentially noisy,
subset of training examples (ranging in several thousand) obtained by mining
the web. For example, the CoNaLa mined (as opposed to the CoNaLa annotated)
dataset contains 598,237 training examples mined directly from Stack Overflow
Yin et al. (2018). In our case, although shellcodes are written in assembly
language, it is not feasible to simply mine examples of natural
language–assembly from the web: not all assembly programs are shellcodes.
Thus, our _Shellcode_IA32_ dataset, which contains $\sim 20$ years of
shellcodes from a variety of sources is the largest collection of shellcodes
in assembly available to date.

Statistics |  Natural Language |  Assembly Language
---|---|---
Unique Statements |  3,184 |  2,248
Unique Tokens |  1,498 |  1,244
Avg. tokens per statement |  9.22 |  4.38
Min tokens per statement |  1 |  2
Max tokens per statement |  46 |  30
Table 2: _Shellcode_IA32_ statistics Figure 2: Histogram of the
_Shellcode_IA32_ dataset showcasing the distribution of token counts across
intents and snippets.

##  3 Preliminary Evaluation

Number Layers |  Layer Dimension |  BLEU-1 (%) |  BLEU-2 (%) |  BLEU-3 (%) |  BLEU-4 (%) |  ACC (%)
---|---|---|---|---|---|---
1 |  64 |  75.75 |  69.76 |  65.14 |  60.8 |  34.69
128 |  80.80 |  76.29 |  73.10 |  69.69 |  42.5
256 |  75.50 |  70.50 |  66.65 |  62.86 |  43.75
512 |  83.55 |  80.08 |  78.06 |  76.12 |  51.25
2 |  64 |  63.25 |  53.24 |  46.12 |  39.46 |  15.62
128 |  71.79 |  64.24 |  58.25 |  51.65 |  26.25
256 |  75.13 |  68.63 |  63.94 |  58.93 |  25.62
512 |  80.22 |  75.00 |  71.11 |  67.24 |  43.44
3 |  64 |  61.98 |  50.68 |  43.02 |  36.15 |  9.38
128 |  69.75 |  61.08 |  55.09 |  49.18 |  19.06
256 |  76.93 |  71.32 |  67.41 |  63.50 |  31.87
512 |  74.99 |  68.58 |  64.23 |  60.36 |  29.38
4 |  64 |  61.41 |  50.68 |  43.58 |  37.33 |  10.00
128 |  63.26 |  51.98 |  44.62 |  37.57 |  10.94
256 |  66.94 |  57.85 |  51.97 |  46.87 |  15.31
512 |  70.51 |  62.44 |  56.27 |  50.15 |  18.75
Table 3: Performance results obtained by varying the model hyper-parameters.
The best performances for each number of layers are in bold.

We performed a set of preliminary experiments with our dataset, in order to
assess the applicability of NMT in the context of shellcode generation and to
establish baseline performance levels for evaluating techniques for future
research. Similar to the encoder-decoder architecture with attention Bahdanau
et al. (2015), we use a bi-directional LSTM as the encoder to transform an
embedded intent sequence $E=|e_{1},...,e_{T_{S}}|$ into a vector $c$ of hidden
states with equal length. We implement this architecture with Bahdanau-style
attention Bahdanau et al. (2015) using xnmt Neubig et al. (2018). We use an
Adam optimizer Kingma and Ba (2015) with $\beta_{1}=0.9$ and
$\beta_{2}=0.999$. The last step is inference. During inference, the auto
regressive inference component uses beam search with a beam size of $5$. The
train/dev/test split is train (N = 2560), dev (N = 320), and test (N = 320)
using a random $80/10/10$ ratio. The test set includes $44$ multi-line
snippets ($13.75\%$ of the test set).

Following prior work in this area Ling et al. (2016); Yin and Neubig (2017);
Oda et al. (2015), we evaluate the translation performance in terms of
averaged token level BLEU scores Papineni et al. (2002). BLEU uses the
modified form of n-grams precision and length difference penalty to evaluate
the quality of the output generated by the model compared to the referenced
one. BLEU measures translation quality by the accuracy of translating ngrams
to n-grams, for values of n usually ranging between $1$ and $4$ Han (2016);
Munkova et al. (2020). We measure the performance of the evaluation task also
in terms of exact match accuracy (ACC), which is the fraction of exactly
matching samples between the predicted output and the reference Yin and Neubig
(2017). Both metrics range between $0$ and $1$.

During our experiments, we set a basic configuration of the model:
$\alpha=0.001$, layers = $1$, vocabulary size = $4,000$, epochs (with early
stopping enforced) = $200$, beam size = $5$, minimun word frequency = $1$.
Next, we performed experiments by varying the dimensionality of the layers
from $64$ to $1024$, and the number of layers from $1$ to $4$ while keeping
all other hyper-parameters constant. Table 3 summarizes the results. We notice
that increasing the number of layers leads to worse performance, while a layer
dimension set between $256$ and $512$ is found to be the best option.

All experiments were performed on a Linux OS running on a virtual machine with
$8$ CPU cores and $8$ GB RAM. The computational times are highly dependent on
the model hyper-parameters, and range between few minutes to $\sim 105$
minutes, with the average training time equal to $\sim 28$ minutes.

##  4 Qualitative Analysis

Natural Language |  Ground Truth |  Model Output
---|---|---
Put ASCII /bin/sh into eax |  push 0x68732f2f \n push 0x6e69622f \n mov eax , esp |  push 0x68732f2f \n push 0x6e69622f \n mov eax, esp
Place address buff into esi |  mov esi, buff |  lea esi, [buff]
Perform a bit-wise inversion of edx |  not edx |  and edx, 0
if the contents of the bl register is greater than or equal to the value 78h then jump to the memory location loc_402B1D |  cmp bl, 78h \n jge short loc_402B1D |  cmp bl, 78h \n jle short loc_402B1D
Table 4: Illustrative examples of correct and incorrect output. The prediction
errors are red/bold.

Automated metrics (BLEU and accuracy) provide a somewhat limited window into
the efficacy of the models to accomplish our task: the task of automatically
generating assembly code from natural language intents. We conducted a
qualitative analysis of the outputs to address this issue and present our
findings through cherry- and lemon-picked examples from our test set (Table
4). In particular, we manually expected the outputs predicted by the best
model configurations found in Table 3 (layers number = 1, layer dimension =
512).

The first two rows of Table 4 are illustrative examples of categories of
intent – snippet pairs that the model can successfully translate. The first
row demonstrates the ability of the model to generate multi-line snippets from
a relatively abstract intent. The example in the second row shows the model’s
ability to properly use the instruction lea with the correct addressing mode
(specified by the bracket [] in NASM syntax) to translate the intent. We note
here that a1though the output would be considered incorrect based on automated
metrics (e.g. BLEU-4), it is considered correct using manual inspection.

We also highlight problems with the models through illustrative examples of
failure outputs (Rows 3 and 4, Table 4). In the third row of the table, the
model generates the wrong instruction due to the model’s failure in using
implicit knowledge (i.e. the bit-wise inversion to negate the contents of the
register) because it was not explicitly mentioned in the intent. Row 4
illustrates the model’s failure in predicting the right command among fifteen
different conditional jumps in the dataset (jle instead of jge) in an if-then
statement. To summarize, the failures we observed are caused either by a lack
of implicit intent knowledge, the model generating incorrect
instruction/identifiers (i.e., register names, labels, etc), or even both.

##  5 Ethical Considerations

Recognizing that attackers use exploit code as a weapon, it is important to
specify that the goal of the proof-of-concept (POC) exploits is not to cause
harm but to surface security weaknesses within the software. Identifying such
security issues allows companies to patch vulnerabilities and protect
themselves against attacks.

_Offensive security_ is a sub-field of security research that employs ethical
hackers to probe a system for vulnerabilities or can be a technique used to
disrupt an attacker. _Automatic exploit generation_ (AEG), an offensive
security technique, is a developing area of research that aims to automate the
exploit generation process and to explore and test critical vulnerabilities
before they are discovered by attackers Avgerinos et al. (2014). Indeed,
studying exploits on compromised systems can provide valuable information
about the technical skills, degree of experience, and intent of the attackers
who developed or used them. Using this information, it is possible to
implement measures to detect and prevent attacks Arce (2004).

##  6 Conclusion

We address the problem of automated exploit generation through NLP. We use
Neural Machine Translation to translate the natural language intents into
assembly code. The contribution in this work is a new dataset,
_Shellcode_IA32_ , containing $3,200$ pairs of instructions in assembly
language code snippets and their corresponding intents in English. These
assembly language snippets can be combined together to generate attacks or
exploits on Linux OS running on Intel Architecture 32-bit machines.

_Shellcode_IA32_ represents a first step towards the ambitious goal of
automatically generating shellcodes from natural language. Our experimental
evaluation has shown promising early results, demonstrating the feasibility of
generating assembly code instructions with high accuracy.

## Acknowledgements

This work has been partially supported by the University of Naples Federico II
in the frame of the Programme F.R.A., project id OSTAGE.

## References

  * Arce (2004) Iván Arce. 2004.  The shellcode generation.  _IEEE security & privacy_, 2(5):72–76.
  * Avgerinos et al. (2014) Thanassis Avgerinos, Sang Kil Cha, Alexandre Rebert, Edward J. Schwartz, Maverick Woo, and David Brumley. 2014.  Automatic exploit generation.  _Commun. ACM_ , 57(2):74–84.
  * Bahdanau et al. (2015) Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015.  Neural machine translation by jointly learning to align and translate.  _CoRR_ , abs/1409.0473.
  * Bao et al. (2017) Tiffany Bao, Ruoyu Wang, Yan Shoshitaishvili, and David Brumley. 2017.  Your exploit is mine: Automatic shellcode transplant for remote exploits.  In _2017 IEEE Symposium on Security and Privacy (SP)_ , pages 824–839. IEEE.
  * Bojar et al. (2016) Ondřej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, et al. 2016.  Findings of the 2016 conference on machine translation.  In _Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers_ , pages 131–198.
  * Duntemann (2000) Jeff Duntemann. 2000.  _Assembly language step-by-step: programming with DOS and Linux_.  John Wiley & Sons.
  * Duntemann (2011) Jeff Duntemann. 2011.  _Assembly language step-by-step: Programming with Linux_.  John Wiley & Sons.
  * Exploit Database Shellcodes (Accessed: 2021-04-22) Exploit Database Shellcodes . Accessed: 2021-04-22.  exploit-db.
  * Goodfellow et al. (2016) Ian Goodfellow, Yoshua Bengio, and Aaron Courville. 2016.  _Deep learning_.  MIT press.
  * Guu et al. (2017) Kelvin Guu, Panupong Pasupat, Evan Liu, and Percy Liang. 2017.  From language to programs: Bridging reinforcement learning and maximum marginal likelihood.  In _Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 1051–1062.
  * Han (2016) Lifeng Han. 2016.  Machine translation evaluation resources and methods: A survey.  _arXiv preprint arXiv:1605.04515_.
  * Kingma and Ba (2015) Diederik P. Kingma and Jimmy Ba. 2015.  Adam: A method for stochastic optimization.  In _3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings_.
  * Kusswurm (2014) Daniel Kusswurm. 2014.  _Modern X86 Assembly Language Programming_.  Springer.
  * Lin et al. (2017) Xi Victoria Lin, Chenglong Wang, Deric Pang, Kevin Vu, and Michael D Ernst. 2017\.  Program synthesis from natural language using recurrent neural networks.  _University of Washington Department of Computer Science and Engineering, Seattle, WA, USA, Tech. Rep. UW-CSE-17-03-01_.
  * Lin et al. (2018) Xi Victoria Lin, Chenglong Wang, Luke Zettlemoyer, and Michael D. Ernst. 2018.  NL2Bash: A corpus and semantic parser for natural language interface to the linux operating system.  In _Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)_ , Miyazaki, Japan. European Language Resources Association (ELRA).
  * Ling et al. (2016) Wang Ling, Edward Grefenstette, Karl Moritz Hermann, Tomás Kociský, Andrew W. Senior, Fumin Wang, and Phil Blunsom. 2016.  Latent predictor networks for code generation.  _CoRR_ , abs/1603.06744.
  * Liu et al. (2018) Zhongxin Liu, Xin Xia, Ahmed E Hassan, David Lo, Zhenchang Xing, and Xinyu Wang. 2018.  Neural-machine-translation-based commit message generation: how far are we?  In _Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering_ , pages 373–384.
  * Long et al. (2016) Reginald Long, Panupong Pasupat, and Percy Liang. 2016.  Simpler context-dependent logical forms via model projections.  In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 1456–1465.
  * Mason et al. (2009) Joshua Mason, Sam Small, Fabian Monrose, and Greg MacManus. 2009.  English shellcode.  In _Proceedings of the 16th ACM conference on Computer and communications security_ , pages 524–533.
  * Munkova et al. (2020) Dasa Munkova, Petr Hajek, Michal Munk, and Jan Skalka. 2020.  Evaluation of machine translation quality through the metrics of error rate and accuracy.  _Procedia Computer Science_ , 171:1327–1336.
  * Neubig et al. (2018) Graham Neubig, Matthias Sperber, Xinyi Wang, Matthieu Felix, Austin Matthews, Sarguna Padmanabhan, Ye Qi, Devendra Sachan, Philip Arthur, Pierre Godard, John Hewitt, Rachid Riad, and Liming Wang. 2018.  XNMT: The eXtensible neural machine translation toolkit.  In _Proceedings of the 13th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Track)_ , pages 185–192, Boston, MA. Association for Machine Translation in the Americas.
  * Oda et al. (2015) Yusuke Oda, Hiroyuki Fudaba, Graham Neubig, Hideaki Hata, Sakriani Sakti, Tomoki Toda, and Satoshi Nakamura. 2015.  Learning to generate pseudo-code from source code using statistical machine translation (t).  In _2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE)_ , pages 574–584. IEEE.
  * Papineni et al. (2002) Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002.  Bleu: a method for automatic evaluation of machine translation.  In _Proceedings of the 40th annual meeting on association for computational linguistics_ , pages 311–318. Association for Computational Linguistics.
  * pwntools (Accessed: 2021-05-29) pwntools. Accessed: 2021-05-29.  _pwntools_.
  * Shellcodes database for study cases (Accessed: 2021-04-22) Shellcodes database for study cases. Accessed: 2021-04-22.  shell-storm.
  * Tutorialspoint (Accessed: 2021-04-22) Tutorialspoint. Accessed: 2021-04-22.  Assembly Programming Tutorial.
  * Wu et al. (2016) Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. 2016.  Google’s neural machine translation system: Bridging the gap between human and machine translation.  _CoRR_ , abs/1609.08144.
  * Xu et al. (2020) Frank F. Xu, Zhengbao Jiang, Pengcheng Yin, Bogdan Vasilescu, and Graham Neubig. 2020.  Incorporating external knowledge through pre-training for natural language to code generation.  In _Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics_ , pages 6045–6052, Online. Association for Computational Linguistics.
  * Yin et al. (2018) Pengcheng Yin, Bowen Deng, Edgar Chen, Bogdan Vasilescu, and Graham Neubig. 2018\.  Learning to mine aligned code and natural language pairs from stack overflow.  In _International Conference on Mining Software Repositories_ , MSR, pages 476–486. ACM.
  * Yin and Neubig (2017) Pengcheng Yin and Graham Neubig. 2017.  A syntactic neural model for general-purpose code generation.  _CoRR_ , abs/1704.01696.
  * Yin and Neubig (2019) Pengcheng Yin and Graham Neubig. 2019.  Reranking for neural semantic parsing.  In _Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics_ , pages 4553–4559.


# Provenance Tools for Astronomy

Michèle Sanguillon,1 François Bonnarel,2 Mireille Louys,2,3 Markus Nullmeier,4
Kristin Riebe,5 and Mathieu Servillat6 1Laboratoire Univers et Particules de
Montpellier, Université de Montpellier, CNRS/IN2P3, France;
<EMAIL_ADDRESS>2Centre de Données astronomiques de
Strasbourg, Observatoire Astronomique de Strasbourg, Université de Strasbourg,
CNRS, Strasbourg, France 3ICube Laboratory, Université de Strasbourg, CNRS,
Strasbourg, France 4Zentrum für Astronomie der Universität Heidelberg,
Astronomisches Rechen-Institut, Heidelberg, Germany 5Leibniz Institute for
Astrophysics Potsdam, Germany 6Laboratoire Univers et Théories, Observatoire
de Paris, PSL Research University, CNRS, 92190 Meudon, France

###### Abstract

In the context of astronomy projects, scientists have been confronted with the
problem of describing in a standardized way how their data have been produced.

As presented in a talk at last year’s ADASS, the International Virtual
Observatory Alliance (IVOA) is working on the definition of a Provenance Data
Model, compatible with the W3C PROV model, which shall describe how provenance
metadata can be modeled, stored and exchanged in astronomy.

In this poster, we present the current status of our developments of libraries
and tools, mainly open source, which implement the IVOA Provenance Data Model
in order to produce, serve, load and visualize provenance information. These
implementations are also needed to validate and adjust the data model and the
standard definitions for accessing provenance. The provenance tools developed
and created for the W3C framework are reused and extended when possible to
tackle the domain of astronomical data.

##  1 Introduction

The International Virtual Observatory Alliance111http://www.ivoa.net/ has
developed several data models to foster interoperability between diverse
astronomy projects. Even though a lot of objects (spectra, images,
simulations, etc.) are already well described, some parts of the information
about how datasets have been produced is still missing.

That is why the IVOA Data Model Working Group investigates how to model
provenance information of a dataset, how this information can be stored and
how it can be exchanged. In order to check the validity of the defined model,
the group implemented the IVOA Provenance Data Model in four environments:
Pollux, CTA, RAVE, and one at CDS.

Here, we present the tools developed to implement this model in these
different contexts.

##  2 IVOA Provenance Data Model

The IVOA Provenance Data Model (Riebe et al. 2017) follows the W3C Provenance
definition, i. e., that provenance is “information about entities, activities,
and people involved in producing a piece of data or thing, which can be used
to form assessments about its quality, reliability or trustworthiness”.

The main core classes (_Entity_ , _Activity_ , _Agent_) and its relations
(_wasGeneratedBy_ , etc.) have the same name as in the W3C Provenance Data
Model (Belhajjame et al. 2013). We add the _ActivityFlow_ class and the
_hadStep_ relation in order to allow users to describe workflows of
activities. We also add the possibility to separate the description of an
activity or entity from the activity/entity itself.

Figure 1.: IVOA Provenance Data Model

##  3 voprov library

The voprov222https://github.com/sanguillon/voprov/ package is an open source
Python library derived from the prov333https://github.com/trungdong/prov/
Python library (MIT license) developed by Trung Dong Huynh (University of
Southampton).

The voprov package implements the serialization of the IVOA Provenance Data
Model. As this model is very close to the W3C one, the voprov library uses the
following facilites from prov: the PROV-N, PROV-JSON, and PROV-XML
serialization formats, as well as PDF, PNG, and SVG graphical representations.
It adds these IVOA features: flows of activities (pipelines), which are
composed of different activity steps, and serialization into the VOTable
format.

This library is currently used in the context of the POLLUX database, which
offers high resolution synthetic spectra computed using the best available
models of the atmosphere and efficient spectral synthesis codes.

When a spectrum is integrated into the database, provenance information is
retrieved and serialized in different formats and with different levels of
detail. When a user or a program queries the Pollux database (via the SSA
protocol of the Virtual Observatory), he is informed (via the DataLink
protocol) of the existence of a service that allows him to retrieve provenance
information in a given format and for a given detail level. This functionality
has been implemented in the CASSIS spectrum visualization tool.

##  4 Django package

The django-prov_vo package444https://github.com/kristinriebe/django-prov_vo is
an open source Python package that can be reused in Django web applications
for serving provenance information. The data model classes are directly mapped
to tables in a relational database. The package provides different interfaces
to extract provenance: a REST interface to retrieve lists of entities,
activities and agents, and a ProvDAL interface, which is defined in the
current IVOA Provenance Working Draft. The ProvDAL interface takes the
identifier of an entity, activity or an agent as a parameter and then returns
the available provenance information in one of the serialization formats
(currently PROV-N and PROV-JSON). A few visualization techniques for the
retrieved provenance graph are also included.

This django-prov_vo package was developed for a provenance service of the
RAVE555https://www.rave-survey.org/ project. Within the RAVE (RAdial Velocity
Experiment) survey, spectra of about half a million stars from the southern
hemisphere were observed and stellar properties determined.

##  5 Prototype PostgreSQL database at CDS

We implemented the IVOA Provenance DM in a test Postgres database at CDS. The
database handles a small collection of image datasets, such as Schmidt plates,
mono-band and color composed images or HiPS representations of pixel data.
From the IVOA Provenance Datamodel specification we designed a database schema
and implemented the various related tables recommended in the data model as
Postgres tables.

A small set of plates, with their digitization, cutout extractions, RGB color
composition, and HiPS generation activities, is used to populate the database.
Various scenarios for querying and displaying their provenance information
have been tested in SQL. For query responses, PROV-N, PROV-JSON, and PROV-
VOTable formats are provided. A simple Python API allowing users to select the
main types of requests and to display the responses via W3C Prov library has
been designed. It allows users querying for various combinations of provenance
relationships in the database and to visualize the provenance graph in a user
friendly representation.

This provides experience with the DM implementation and clues to build up a
TAP SCHEMA representation for ProvTAP services, a preliminary version of which
has been developed.

##  6 UWS Server at Observatoire de Paris

In the context of the Cherenkov Telescope Array666https://www.cta-
observatory.org/ (CTA) project, a job control system based on the IVOA UWS
pattern has been developed as an open source Python application:
OPUS777https://github.com/mservillat/OPUS (Observatoire de Paris UWS System).
This system has been used to test the execution of CTA data analysis tools on
a work cluster. It implements the ProvenanceDM concept of ActivityDescription
files and provides the provenance information for each executed job in PROV-
JSON and PROV-XML serializations.

The CTA is the next generation ground-based very high energy gamma-ray
instrument. Contrary to previous Cherenkov experiments, it will serve as an
open observatory providing data to a wide astrophysics community, with the
requirement to offer self-described data products to users that may be unaware
of the Cherenkov astronomy specificities (see also Servillat et al. (2018)).

### Acknowledgments

This work was partially funded by the Federal Ministry of Education and
Research in Germany and by the ASTERICS project (http://www.asterics2020.eu/).
Additional funding was provided by the INSU (Action Spécifique Observatoire
Virtuel, ASOV), the Grand-Sud-Ouest Data Centre, the Paris Astronomical Data
Centre, and the Observatoire Astronomique de Strasbourg.

## References

  * Belhajjame et al. (2013) Belhajjame, K., B’Far, R., Cheney, J., Coppens, S., Cresswell, S., Gil, Y., Groth, P., Klyne, G., Lebo, T., McCusker, J., Miles, S., Myers, J., Sahoo, S., & Tilmes, C. 2013, PROV-DM: The PROV data model, W3C Recommendation. URL http://www.w3.org/TR/prov-dm/
  * Riebe et al. (2017) Riebe, K., Servillat, M., Bonnarel, F., Louys, M., Nullmeier, M., Rothmaier, F., Sanguillon, M., & the IVOA Data Model Working Group 2017, IVOA provenance data model, http://www.ivoa.net/documents/ProvenanceDM/
  * Servillat et al. (2018) Servillat, M., Boisson, C., Lefaucheur, J., Kosack, K., Sanguillon, M., Louys, M., & Bonnarel, F. 2018, in ADASS XXVII, edited by TBD (San Francisco: ASP), vol. TBD of ASP Conf. Ser., TBD