# SDSS-IV MaNGA: the “G-dwarf problem” revisited

Michael J. Greener,1 Michael Merrifield,1 Alfonso Aragón-Salamanca,1 Thomas
Peterken,1 Brett Andrews,2 and Richard R. Lane3
1School of Physics & Astronomy, University of Nottingham, University Park,
Nottingham, NG7 2RD, UK
2Department of Physics and Astronomy, University of Pittsburgh, 3941 O’Hara
Street, Pittsburgh, Pennsylvania 15260, USA
3Instituto de Astronomía y Ciencias Planetarias de Atacama, Universidad de
Atacama, Copayapu 485, Copiapó, Chile
E-mail<EMAIL_ADDRESS>
(Accepted XXX. Received YYY; in original form ZZZ)

###### Abstract

The levels of heavy elements in stars are the product of enhancement by
previous stellar generations, and the distribution of this metallicity among
the population contains clues to the process by which a galaxy formed. Most
famously, the “G-dwarf problem” highlighted the small number of low-
metallicity G-dwarf stars in the Milky Way, which is inconsistent with the
simplest picture of a galaxy formed from a “closed box” of gas. It can be
resolved by treating the Galaxy as an open system that accretes gas throughout
its life. This observation has classically only been made in the Milky Way,
but the availability of high-quality spectral data from SDSS-IV MaNGA and the
development of new analysis techniques mean that we can now make equivalent
measurements for a large sample of spiral galaxies. Our analysis shows that
high-mass spirals generically show a similar deficit of low-metallicity stars,
implying that the Milky Way’s history of gas accretion is common. By contrast,
low-mass spirals show little sign of a G-dwarf problem, presenting the
metallicity distribution that would be expected if such systems evolved as
pretty much closed boxes. This distinction can be understood from the
differing timescales for star formation in galaxies of differing masses.

###### keywords:

galaxies: spiral – galaxies: – evolution – galaxies: abundances

††pubyear: 2020††pagerange: SDSS-IV MaNGA: the “G-dwarf problem”
revisited–SDSS-IV MaNGA: the “G-dwarf problem” revisited

##  1 Introduction

Almost all of the elements heavier than helium that we find in our galaxy’s
stars, the “metals”, are there because these objects incorporate matter
recycled from previous stellar generations, with stars born early on
containing less of this enhanced material (Schmidt, 1963; Talbot & Arnett,
1971; Tinsley, 1980). There are thus clues to the star-formation history of
the Galaxy encoded in the distribution of the metallicity that we find in its
stars (Talbot & Arnett, 1971). This phenomenon can be most simply quantified
by the cumulative metallicity distribution function (CMDF), which is just the
total mass in stars in which the heavy element fraction is less than $Z$,
$M_{*}(<Z)$.

Such a simple distribution clearly does not contain the full life history of
the Galaxy’s star formation and gas recycling, but it is sufficiently robust
to make quite strong statements about its past history. For example, if the
Milky Way formed in isolation from a single initial gas cloud of mass
$M_{\rm{gas,}\>0}$, with enhanced material well mixed in as it is
recycled111Throughout this work, we adopt the instantaneous recycling
approximation, which assumes that metals are expelled by a generation of stars
immediately after these stars form (see Binney & Merrifield, 1998 Section
5.3.1). (a scenario termed the “closed box” model of chemical evolution;
Talbot & Arnett, 1971; Tinsley, 1974), then the CMDF takes the simple form

$M_{*}\left(<Z\right)=M_{\rm{gas,}\>0}\left[1-\exp{\left(-Z/p\right)}\right],$
(1)

where $p$ is a parameter that defines the yield of heavy elements created by
each generation of stars (see, for example, Binney & Merrifield, 1998 Section
5.3.1). An illustration of the resulting function is shown in Figure 1. A
conflict between this model and observation was first noted by van den Bergh
(1962), who pointed out that the Milky Way contains many fewer low-metallicity
G-dwarf stars than the steep initial rise in this function predicts. This
“G-dwarf problem” has subsequently been observed in populations of K dwarfs
(Casuso & Beckman, 2004) and M dwarfs (Mould, 1978; Woolf & West, 2012; Woolf
& Wallerstein, 2020), and seen both in the Solar neighbourhood (e.g. Rocha-
Pinto & Maciel, 1996; Gratton et al., 1996; Chiappini et al., 1996; Holmberg
et al., 2007) and throughout the Galaxy (e.g. Chiappini et al., 2001; Hayden
et al., 2015), so is clearly a substantive issue.

Figure 1: Simple model CMDFs showing the fractional mass of stars that have a
metallicity less than $Z$ for a closed box (blue) and an accreting box (red).
Characteristically, the yield $p$ of a generation of star formation is of
order the value of Solar metallicity ($Z_{\odot}=0.0148$; Lodders, 2019); for
these models, we adopt yields of one-third $Z_{\odot}$ for the closed box, and
three times $Z_{\odot}$ for the accreting box. These yield values are not
physically motivated, but have been selected simply for illustrative purposes.

In essence, the problem is that by the time a closed box has built up
sufficient heavy elements to make stars with high metallicity, there is very
little gas left to make new stars, so it will always produce the majority of
its stars at low metallicities. A variety of mechanisms have been invoked to
seek to resolve the G-dwarf problem (for an extensive list of proposed
solutions to the problem, see Pagel, 2009 Section 8.4). However, conceptually
the simplest solution – and the most widely accepted – is to introduce a
steady stream of pristine gas to the galaxy, the “accreting box” model
(Tinsley, 1974, 1980). In this case, the CMDF can be shown to be

$M_{*}\left(<Z\right)=-M_{\rm{gas}}\left[\ln{\left(1-Z/p\right)}\right],$ (2)

where $M_{\rm{gas}}$ is a constant (Binney & Merrifield, 1998 Section 5.3.3).
As can be seen from Figure 1, the constant addition of new gas provides the
raw material necessary for more star formation at later times, tipping the
balance in favour of high-metallicity stars. The resulting change in the shape
of the CMDF has been found to largely eliminate the G-dwarf problem both in
the Solar neighbourhood (Gratton et al., 1996; Chiappini et al., 1996) and
across the entire Galaxy (Chiappini et al., 2001; Hayden et al., 2015).

While such a scenario is reassuring for our understanding of the Milky Way, we
lack the context to know where our galaxy fits into the wider picture of
chemical enrichment. Although metallicity distribution functions can be
produced from analysis of resolved stellar populations in Local Group galaxies
(e.g. Escala et al., 2018; Manning & Cole, 2018; Gilbert et al., 2019), for
more distant unresolved galaxies all that we know for sure is that the average
stellar metallicities of less massive galaxies are lower (e.g. Gallazzi et
al., 2005; Panter et al., 2008). It therefore remains unclear where the Milky
Way lies relative to its spiral galaxy peers in terms of its CMDF.

Fortunately, as recent work by Mejía-Narváez et al. (2020) indicates, the
wealth of data obtained by integral field unit (IFU) surveys in the past few
years means that we are now in a position to address this question.
Observations from the Mapping Nearby Galaxies at Apache Point Observatory
(MaNGA) project (Bundy et al., 2015) have provided spectra right across the
faces of thousands of nearby galaxies. Spectral synthesis fitting with codes
such as STARLIGHT (Cid Fernandes et al., 2005) can then be used to decompose
such spectra into their component stellar populations of differing ages and
metallicities. By integrating across all ages and co-adding all the spatial
data for each galaxy, we can reconstruct the CMDFs of these spiral systems for
comparison with the Milky Way. Clearly, collapsing all this data into a single
one-dimensional function is not making full use of all of the information that
it contains, but it does offer a simple robust metric of the global metal
content of a spiral galaxy. While the quality of the reconstructed CMDFs may
not be as high as for our own galaxy, it should be more than adequate to
distinguish between the very different functions of Figure 1, providing an
overview of the metallicity evolution of a complete sample of spiral galaxies
in the local Universe.

##  2 Data and Analysis

###  2.1 The MaNGA Survey

MaNGA (Bundy et al., 2015) is part of the fourth generation of the Sloan
Digital Sky Survey (SDSS-IV; Blanton et al., 2017), and has recently completed
its mission to acquire spectroscopic observations for 10000 nearby galaxies
(Yan et al., 2016b; Wake et al., 2017). The MaNGA survey thus represents a
complete sample of these systems in the local Universe. Using hexagonal IFU
fibre bundles (Law et al., 2015) to feed into a spectrograph (Smee et al.,
2013; Drory et al., 2015) mounted on the $2.5\,{\rm m}$ telescope at Apache
Point Observatory (Gunn et al., 2006), spectra were obtained across the face
of each galaxy out to at least 1.5 effective radii, capturing most of the
light from each system. The raw data were reduced and calibrated (Yan et al.,
2016a) by the Data Reduction Pipeline (DRP; Law et al., 2016), before being
processed through the Data Analysis Pipeline (DAP; Westfall et al., 2019;
Belfiore et al., 2019) to create the data products employed here.

###  2.2 Sample Selection

Since the intent of this paper is to place the Milky Way metallicity data in
context, we need to select a sample of comparable spiral galaxies from the
full MaNGA data set. Fortunately, the citizen science project Galaxy Zoo 2
(GZ2; Willett et al., 2013) provides robust classifications of galaxies upon
which we can draw. The process that we follow is essentially identical to that
described in Peterken et al. (2020), except that we make use of the more
current ninth MaNGA Product Launch (MPL-9) data. The reasoning behind the
method adopted here is described in more detail by Willett et al. (2013) and
Hart et al. (2016).

GZ2 classifications are available for a total of 7330 MPL-9 galaxies. From
this sample, we first reject 58 galaxies which were flagged by GZ2 as obscured
by a star or other artifact. We then ensure each galaxy has a spiral
morphology: following the recommendations of Willett et al. (2013) we require
that $>43\%$ of $N\geq 20$ respondents observed either spiral features or a
disk in the galaxy. This requirement reduces the sample to 5255 potentially
spiral galaxies. Since we are seeking a clean sample of spiral systems, we
retain only those which are oriented reasonably face-on so that their spiral
structure is apparent. Again following Willett et al. (2013), we require that
$>80\%$ of $N\geq 20$ respondents determine that each galaxy is not edge-on,
and we also implement a cut based on the photometric axis ratios of the
galaxies such that $\frac{b}{a}\geq 0.5$, which is equivalent to an
inclination of $i\geq$$$. This constraint is slightly more stringent than that
suggested by Hart et al. (2017), as discussed by Peterken et al. (2020), and
leaves a sample of 1641 reasonably face-on spiral galaxies. Finally, we remove
a further 166 galaxies that were flagged for poor data quality by the DRP or
had for any reason failed to produce the necessary DAP data sets.
Collectively, these criteria produce the final clean sample of 1475 face-on
spiral galaxies that are analysed in this work. The galaxies in this final
sample have a median redshift of $z=0.037$. We also note that none of the
results depend at all sensitively on the exact sample selection criteria.

###  2.3 Spectral Fitting

The stellar evolution histories of the sample galaxies were determined using
the full-spectrum stellar population fitting code STARLIGHT (Cid Fernandes et
al., 2005). STARLIGHT essentially derives a best fit to each spectrum by
combining a set of templates of differing ages and metallicities; the process
is very similar to that employed by Greener et al. (2020), and is explained in
detail by Peterken et al. (2020). Here, we summarise the main steps relevant
to this work.

After removing any emission lines using the MaNGA DAP and shifting to zero
redshift, each spectrum is fitted using a linear combination of the single
stellar population (SSP) E-MILES templates of Vazdekis et al. (2016). The
E-MILES library of SSP templates is based on the earlier MILES library
(Vazdekis et al., 2010), and we adopt a Chabrier (2003) initial mass function
(IMF), the “Padova” isochrones of Girardi et al. (1999), and an appropriately
metallicity scaled value for alpha-element enrichment. The E-MILES templates
incorporate nine ages $(\log(\rm
age/yr)=7.85,\allowbreak\>8.15,\>8.45,\>8.75,\>9.05,\>9.35,\>9.65,\>9.95,\>10.25)$
and six metallicities $([\rm
M/H]=-1.71,\>-1.31,\>-0.71,\>-0.40,\>+0.00,\>+0.22)$. Template logarithmic
values, $\rm[M/H]$, are then converted to metallicity $Z=Z_{\odot}\times
10^{\rm[M/H]}$. To reproduce younger stellar populations, we include an
additional six ages $(\log(\rm
age/yr)=6.8,\>6.9,\>7.0,\allowbreak\>7.2,\>7.4,\>7.6)$ and two metallicities
$([\rm M/H]=-0.41,\>+0.00)$ from the templates of Asa’d et al. (2017). Apart
from adopting the slightly different Bertelli et al. (1994) isochrones, these
younger templates were generated using exactly the same method as the E-MILES
templates. We use the STARLIGHT configuration settings which prioritise
robustness over computation times, following the recommendations of Ge et al.
(2018) and Cid Fernandes (2018), and as fully described and tested by Peterken
et al. (2020, including Appendix A).

The result of this fitting process for every spaxel across the face of a
spiral galaxy is a set of weights for the mass contribution made by each SSP
to the light seen in that spectrum. Co-adding the results from each spaxel
then gives a fit to the integrated light from the entire galaxy, with
contributions from SSPs spanning the two-dimensional parameter space of
metallicity and age. Adding the contributions from SSPs of different ages
reduces the data to a one-dimensional function of the contribution from stars
of different metallicities to the total mass of that galaxy. Finally, adding
together all the contributions from templates with metallicities less than $Z$
produces the required CMDF for the galaxy, $M_{*}(<Z)$.

##  3 Results and Discussion

The resulting CMDFs are presented in Figure 2. In order to investigate any
trend with galaxy mass, we have combined the galaxies into five
logarithmically-spaced mass bins, normalised each galaxy by its total stellar
mass, and calculated the median normalised CMDF within each bin. The step-like
nature of the resulting cumulative functions reflects the relatively small
number of template metallicities used in the fitting process, which, in turn,
is determined by the limited amount of information that can be derived when
decomposing such integrated spectral data.

Figure 2: CMDFs for the spiral galaxies in the MaNGA sample, binned by stellar
mass. The histograms show the median value for the CMDF within each mass bin,
normalised by the total mass of each galaxy.

It is immediately apparent from Figure 2 that the shape of a galaxy’s CMDF
depends strongly on stellar mass. Higher mass galaxies show a steepening CMDF,
indicating a relative paucity of low-metallicity stars. Like their kin the
Milky Way – a galaxy of stellar mass ${\sim}5\times 10^{10}\ \rm M_{\odot}$
(McMillan, 2017) – they show a G-dwarf problem, which, comparison to Figure 1
confirms, is resolved if these systems are modelled as accreting boxes. By
contrast, spiral galaxies with stellar masses of less than $10^{10}\ \rm
M_{\odot}$ show a rapid initial rise in $M_{*}(<Z)$, reflecting their much
greater proportion of low-metallicity stars, and matching rather well to the
closed box model shown in Figure 1. This finding builds on the significance of
the much smaller sample studied by Mejía-Narváez et al. (2020), who found
evidence that the distribution of metallicities is broader in lower mass
spiral galaxies. It also fits with what has already been gleaned from the
other axis in this population decomposition of MaNGA data, the time evolution
of star formation, in which it was found that more massive spiral galaxies
formed most of their stars in a relatively short period of time, whereas the
less massive spiral systems have been slowly but steadily forming their
stellar content over most of the lifetime of the Universe (Peterken et al.
2021, _submitted_). It would appear that in the more massive galaxies, in
order to keep up with the demand for gas to make more stars, largely unmixed
pristine gas is pulled in to add to material enriched by the previous
generations, making them produce a much larger fraction of high-metallicity
stars in what is effectively an accreting box system. By contrast, the more
leisurely star formation rate of the lower mass spirals affords them the
opportunity to mix recycled gas thoroughly between stellar generations, making
them behave as close to closed boxes. While the Milky Way is entirely typical
of spiral galaxies of its size in displaying the G-dwarf problem caused by
such systems’ rush to make stars, lower-mass spiral galaxies avoid the issue
by taking their time.

## Data Availability

This publication uses the team-internal MPL-9 MaNGA science data products. The
full sample of data used here will be publicly released in 2021 as part of
SDSS DR17.

## Acknowledgements

We thank the anonymous referee for their very positive comments and
suggestions which have improved this manuscript.

This research was supported by funding from the Science and Technology
Facilities Council (STFC).

Funding for the Sloan Digital Sky Survey IV has been provided by the Alfred P.
Sloan Foundation, the U.S. Department of Energy Office of Science, and the
Participating Institutions. SDSS acknowledges support and resources from the
Center for High-Performance Computing at the University of Utah. The SDSS
website is www.sdss.org.

SDSS is managed by the Astrophysical Research Consortium for the Participating
Institutions of the SDSS Collaboration including the Brazilian Participation
Group, the Carnegie Institution for Science, Carnegie Mellon University, the
Chilean Participation Group, the French Participation Group, Harvard-
Smithsonian Center for Astrophysics, Instituto de Astrofísica de Canarias, The
Johns Hopkins University, Kavli Institute for the Physics and Mathematics of
the Universe (IPMU) / University of Tokyo, the Korean Participation Group,
Lawrence Berkeley National Laboratory, Leibniz Institut für Astrophysik
Potsdam (AIP), Max-Planck-Institut für Astronomie (MPIA Heidelberg), Max-
Planck-Institut für Astrophysik (MPA Garching), Max-Planck-Institut für
Extraterrestrische Physik (MPE), National Astronomical Observatories of China,
New Mexico State University, New York University, University of Notre Dame,
Observatório Nacional / MCTI, The Ohio State University, Pennsylvania State
University, Shanghai Astronomical Observatory, United Kingdom Participation
Group, Universidad Nacional Autónoma de México, University of Arizona,
University of Colorado Boulder, University of Oxford, University of
Portsmouth, University of Utah, University of Virginia, University of
Washington, University of Wisconsin, Vanderbilt University, and Yale
University.

This research made use of Astropy (Robitaille et al., 2013); Marvin (Cherinka
et al., 2018); Matplotlib (Hunter, 2007); NumPy (van der Walt et al., 2011);
SciPy (Virtanen et al., 2020); and TOPCAT (Taylor, 2005).

## References

  * Asa’d et al. (2017) Asa’d R. S., Vazdekis A., Cervino M., Noel N. E. D., Beasley M. A., Kassab M., 2017, MNRAS, 471, 3599
  * Belfiore et al. (2019) Belfiore F., et al., 2019, AJ, 158, 160
  * Bertelli et al. (1994) Bertelli G., Bressan A., Chiosi C., Fagotto F., Nasi E., 1994, A&AS, 106, 275
  * Binney & Merrifield (1998) Binney J., Merrifield M., 1998, Galactic Astronomy. Princeton University Press, Princeton
  * Blanton et al. (2017) Blanton M. R., et al., 2017, AJ, 154, 28
  * Bundy et al. (2015) Bundy K., et al., 2015, ApJ, 798, 7
  * Casuso & Beckman (2004) Casuso E., Beckman J. E., 2004, A&A, 419, 181
  * Chabrier (2003) Chabrier G., 2003, PASP, 115, 763
  * Cherinka et al. (2018) Cherinka B., et al., 2018, AJ, 158, 74
  * Chiappini et al. (1996) Chiappini C., Matteucci F., Gratton R., 1996, ApJ, 477, 765
  * Chiappini et al. (2001) Chiappini C., Matteucci F., Romano D., 2001, ApJ, 554, 1044
  * Cid Fernandes (2018) Cid Fernandes R., 2018, MNRAS, 480, 4480
  * Cid Fernandes et al. (2005) Cid Fernandes R., Mateus A., Sodré L., Stasińska G., Gomes J. M., 2005, MNRAS, 358, 363
  * Drory et al. (2015) Drory N., et al., 2015, AJ, 149, 77
  * Escala et al. (2018) Escala I., et al., 2018, MNRAS, 474, 2194
  * Gallazzi et al. (2005) Gallazzi A., Charlot S., Brinchmann J., White S. D., Tremonti C. A., 2005, MNRAS, 362, 41
  * Ge et al. (2018) Ge J., Yan R., Cappellari M., Mao S., Li H., Lu Y., 2018, MNRAS, 478, 2633
  * Gilbert et al. (2019) Gilbert K. M., Kirby E. N., Escala I., Wojno J., Kalirai J. S., Guhathakurta P., 2019, ApJ, 883, 128
  * Girardi et al. (1999) Girardi L., Bressan A., Bertelli G., Chiosi C., 1999, A&AS, 141, 371
  * Gratton et al. (1996) Gratton R., Carretta E., Matteucci F., Sneden C., 1996, ASPC, 92, 307
  * Greener et al. (2020) Greener M. J., et al., 2020, MNRAS, 495, 2305
  * Gunn et al. (2006) Gunn J. E., et al., 2006, AJ, 131, 2332
  * Hart et al. (2016) Hart R. E., et al., 2016, MNRAS, 461, 3663
  * Hart et al. (2017) Hart R. E., et al., 2017, MNRAS, 472, 2263
  * Hayden et al. (2015) Hayden M. R., et al., 2015, ApJ, 808, 132
  * Holmberg et al. (2007) Holmberg J., Nordstrom B., Andersen J., 2007, A&A, 475, 519
  * Hunter (2007) Hunter J. D., 2007, Comput. Sci. Eng., 9, 90
  * Law et al. (2015) Law D. R., et al., 2015, AJ, 150, 19
  * Law et al. (2016) Law D. R., et al., 2016, AJ, 152, 83
  * Lodders (2019) Lodders K., 2019, eprint (arXiv:1912.00844)
  * Manning & Cole (2018) Manning E. M., Cole A. A., 2018, MNRAS, 471, 4194
  * McMillan (2017) McMillan P. J., 2017, MNRAS, 465, 76
  * Mejía-Narváez et al. (2020) Mejía-Narváez A., Sánchez S. F., Lacerda E. A. D., Carigi L., Galbany L., Husemann B., García-Benito R., 2020, MNRAS, 499, 4838
  * Mould (1978) Mould J. R., 1978, ApJ, 226, 923
  * Pagel (2009) Pagel B. E. J., 2009, Nucleosynthesis and Chemical Evolution of Galaxies, 2nd edn. Cambridge University Press, Cambridge
  * Panter et al. (2008) Panter B., Jimenez R., Heavens A. F., Charlot S., 2008, MNRAS, 391, 1117
  * Peterken et al. (2020) Peterken T., Merrifield M., Aragón-Salamanca A., Fraser-McKelvie A., Avila-Reese V., Riffel R., Knapen J., Drory N., 2020, MNRAS, 495, 3387
  * Robitaille et al. (2013) Robitaille T. P., et al., 2013, A&A, 558
  * Rocha-Pinto & Maciel (1996) Rocha-Pinto H. J., Maciel W. J., 1996, MNRAS, 279, 447
  * Schmidt (1963) Schmidt M., 1963, ApJ, 137, 758
  * Smee et al. (2013) Smee S. A., et al., 2013, AJ, 146, 32
  * Talbot & Arnett (1971) Talbot R. J., Arnett W. D., 1971, ApJ, 170, 409
  * Taylor (2005) Taylor M. B., 2005, Astronomical Data Analysis Software and Systems XIV - ASP Conference Series, 347, 29
  * Tinsley (1974) Tinsley B. M., 1974, ApJ, 192, 629
  * Tinsley (1980) Tinsley B. M., 1980, Fund. Cosmic Phys., 5, 287
  * Vazdekis et al. (2010) Vazdekis A., Sánchez-Blázquez P., Falcón-Barroso J., Cenarro A. J., Beasley M. A., Cardiel N., Gorgas J., Peletier R. F., 2010, MNRAS, 404, 1639
  * Vazdekis et al. (2016) Vazdekis A., Koleva M., Ricciardelli E., Röck B., Falcón-Barroso J., 2016, MNRAS, 463, 3409
  * Virtanen et al. (2020) Virtanen P., et al., 2020, Nature Methods, 17, 261
  * Wake et al. (2017) Wake D. A., et al., 2017, AJ, 154, 86
  * Westfall et al. (2019) Westfall K. B., et al., 2019, AJ, 158, 231
  * Willett et al. (2013) Willett K. W., et al., 2013, MNRAS, 435, 2835
  * Woolf & Wallerstein (2020) Woolf V. M., Wallerstein G., 2020, MNRAS, 494, 2718
  * Woolf & West (2012) Woolf V. M., West A. A., 2012, MNRAS, 422, 1489
  * Yan et al. (2016a) Yan R., et al., 2016a, AJ, 151, 8
  * Yan et al. (2016b) Yan R., et al., 2016b, AJ, 152, 197
  * van den Bergh (1962) van den Bergh S., 1962, AJ, 67, 486
  * van der Walt et al. (2011) van der Walt S., Colbert S. C., Varoquaux G., 2011, Comput. Sci. Eng., 13, 22


# G-STO: Sequential Main Shopping Intention Detection via Graph-Regularized
Stochastic Transformer

Yuchen Zhuang<EMAIL_ADDRESS>Georgia Institute of
TechnologyAtlantaGeorgiaUSA ,  Xin Shen<EMAIL_ADDRESS>AmazonSeattleWashingtonUSA ,  Yan Zhao<EMAIL_ADDRESS>AmazonSeattleWashingtonUSA ,  Chaosheng Dong<EMAIL_ADDRESS>AmazonSeattleWashingtonUSA ,  Ming Wang<EMAIL_ADDRESS>AmazonNew YorkNew
YorkUSA ,  Jin Li<EMAIL_ADDRESS>AmazonSeattleWashingtonUSA and  Chao
Zhang<EMAIL_ADDRESS>Georgia Institute of TechnologyAtlantaGeorgiaUSA

(2018)

###### Abstract.

Sequential recommendation requires understanding the dynamic patterns of
users’ behaviors, contexts, and preferences from their historical
interactions. Most existing works focus on modeling user-item interactions
only from the item level, ignoring that they are driven by latent shopping
intentions (_e.g._ , ballpoint pens, miniatures, _etc._). Detecting these
latent shopping intentions is crucial for e-commerce platforms such as Amazon
to improve their customers’ shopping experience. Despite its significance, the
area of main shopping intention detection remains under-investigated in the
academic literature. To fill this gap, we propose a graph-regularized
stochastic Transformer method, G-STO. By considering intentions as sets of
products and user preferences as compositions of intentions, we model both of
them as stochastic Gaussian embeddings in the latent representation space.
Instead of training the stochastic representations from scratch, we develop a
global intention relational graph as prior knowledge for regularization,
allowing relevant shopping intentions to be distributionally close. Finally,
we feed the newly regularized stochastic embeddings into Transformer-based
models to encode sequential information from the intention transitions. We
evaluate our main shopping intention identification model on three different
real-world datasets, where G-STO achieves significantly superior performances
to the baselines by $18.08\%$ in Hit@1, $7.01\%$ in Hit@10, and $6.11\%$ in
NDCG@10 on average.

††copyright: acmcopyright††journalyear: 2018††doi:
XXXXXXX.XXXXXXX††conference: 32nd ACM International Conference on Information
and Knowledge Management; August 6-10, 2023; Long Beach, CA

##  1\. Introduction

Figure 1. Illustration of sequential item recommendation and main shopping
intention identification. For the majority of sequential recommendation
algorithms, recommendations are provided without specific reasons, which can
be explained by the main shopping intention identification.

Sequential recommendation, which aims at understanding evolving customer
behaviors and dynamically recommending new items, has garnered considerable
interests. E-commerce stores, _e.g._ , Amazon, have adopted customers’
_shopping intentions_ signals into their recommendation systems (Hao et al.,
2020). Although such initial works were built with a heuristic shopping
intention detection approach, they already achieved significant improvement in
terms of the MOI metric (metric of interest), which considers both the short-
and long-term effects on the customers’ shopping experience. Besides product-
level recommendations, whole-page optimization, another downstream
application, can also benefit from such customer intention signals. Recent
work (Kanase et al., 2022) has also achieved significant lift of MOI on retail
website homepage and checkout page through online A/B experimentation. Thus, a
robust, scalable, and explainable shopping intention detection approach plays
crucial roles in multiple stages of the recommendation pipeline.

However, the majority of existing sequential recommendation algorithms (Chen
et al., 2018; Kang and McAuley, 2018; Sun et al., 2019; Tang and Wang, 2018)
focus solely on product-level data to predict subsequent recommendation items,
regardless of the underlying shopping intentions. This leaves these approaches
inadequate in capturing whole-sequence patterns, as they tend to place more
emphasis on the item transitions learned from training data than on
comprehending the customers’ underlying objectives. For example, when a user’s
interaction sequence is provided as in Figure 1, most sequential
recommendation systems will emphasize the commonly-seen transition pair, (baby
formula$\to$baby formula), to recommend subsequent products without
explanation. In contrast, if we can identify the main shopping intention, we
will find out that PC Accessories should be the most important intention for
this customer and recommend products accordingly.

To this end, some approaches (Li et al., 2022; Chang et al., 2021) start to
take both product-level and intention-level data into account, but merely use
the concealed main shopping intentions as implicit guidance for the following
item recommendation. However, these implicit guidances can be severely
influenced by the product-level interactions, making popular item transitions
dominate the main intention detection. Thus, explicitly identifying the
customers’ main shopping intentions to infer the user preferences becomes a
prerequisite for explainable recommendations and user understanding.

To accomplish the main shopping intention identification task, the most
typical and direct method is to map product-level interactions to intention-
level sequences and then apply sequential recommendation algorithms. Among the
existing methods, recent advancements in Transformer (Kang and McAuley, 2018;
Sun et al., 2019; Liu et al., 2021) introduce the self-attention mechanism to
reveal the position-wise item-item relations, which have achieved state-of-
the-art performances. Despite their success in product-level sequential
recommendations, we argue that simply adapting such embedding-based
Transformer architectures to intention-level sequences fail to incorporate:
(1) the shopping intention characteristics: Shopping intentions are higher-
level taxonomy, which can be considered as sets of products. Using only
deterministic embeddings to represent shopping intentions is insufficient to
capture this high-level characteristic; (2) the user preferences composed of
multiple intentions: Users can have multiple intentions and preferences in
mind during a shopping journey. Using the Transformer architecture to
characterize user preferences as deterministic points is also insufficient for
estimating the relevance between user preferences and a composition of
multiple shopping intentions; (3) the collaborative transitivity:
Collaborative transitivity indicates the ability of introducing additional
collaborative relevance beyond constrained intention transition pairs.
Transformer architectures employ dot-product-based attention mechanism, which
is difficult to infer the relevance across pairs, (_e.g._ , using a and b, b
and c pairs to infer a and c are relevant as well); (4) dynamic uncertainty:
In customer interaction sequences, it is common to witness a significant
random shift in preferences without obvious correlations across intention
transitions. Customers with more interests in dynamic variability are
intuitively more uncertain. Therefore, when modeling user preferences, dynamic
uncertainty is a vital component.

To this end, we present a new graph-regularized stochastic Transformer
framework, G-STO, for main shopping intention identification. Our approach
overcomes the aforementioned challenges with the following key designs: (1) To
better incorporate collaborative transitivity and uncertainty into
representations, we describe each intention as an elliptical Gaussian
distribution. Specifically, G-STO applies stochastic embedding layers to
assign each intention a mean and covariance embedding, composing the
stochastic representations; (2) To transfer knowledge from popular intentions
to unpopular ones for cold-start issue resolution, we introduce global
intention relation information as prior knowledge for improved intention
modeling. Specifically, we design an intention relation graph for
regularization, with diverse intentions as nodes and complementary/relevant
relations between intentions as edges. By propagating intention
representations on the graph, relevant shopping intentions are dragged towards
each other on latent representation space to share close embedding
distributions. It can also alleviate the data scarcity issue for unpopular
intentions, whose embeddings can be inferred from their neighbors on the
graph. (3) Once we obtain the regularized stochastic representations for the
users’ interactions with intentions, we send them to mean and covariance
Transformers to model the sequential information from intention transitions.
Instead of using dot product to compute relevance score between user
preferences and recommendations in deterministic models, we apply Wasserstein
distance to measure the distances between distributions. Considering the
distances as dissimilarity between intentions with uncertainty information, we
combine it with Bayesian Personalize Ranking (BPR) loss (Rendle et al., 2009)
as the training objective.

Our contributions can be summarized as follows:

$\bullet$ To the best of our knowledge, this is the first work focusing on the
main shopping intention identification task with solely intention-level data.
This will help with user understanding and improve the performances of
downstream tasks, including product-level recommendation, ranking stage of
whole page optimization;

$\bullet$ We describe the intentions as Gaussian distributions using
stochastic representations to reflect the high-level properties of intentions,
collaborative transitivity across intentions, and user preference uncertainty;

$\bullet$ We introduce the shopping intention relation graph as prior
knowledge and propose a novel graph regularizer to restrict the stochastic
representations in distribution-based methods;

$\bullet$ We develop three different Amazon real-world datasets, covering
long-term, short-term, and purchase-related user cases. Our proposed G-STO
outperforms state-of-the-art baselines significantly by $18.08\%$ in Hit@1,
$6.11\%$ in NDCG@10, and $7.01\%$ in Hit@10 on average of three datasets.

##  2\. Related Works

###  2.1. Sequential Recommendation (SR)

Sequential Recommendation (SR) aims to predict the next item based on the user
historical interactions with products. Earlier SR works, like FPMC (Rendle et
al., 2010) and Fossil (He and McAuley, 2016), apply Markov Chains with matrix
factorization to model the first-order and higher-order item-to-item
transition matrices. However, when encountering with long interaction
sequences or considering long-term influence from previous items, the
computations of modeling the transition matrices increase exponentially. More
recent sequential recommendations can better learn item-to-item transition
patterns automatically via deep learning architectures, including Convolution
Neural Networks (CNN) (Tang and Wang, 2018), Recurrent Neural Networks (RNN)
(Quadrana et al., 2017; Devooght and Bersini, 2017; Li et al., 2017; Ma et
al., 2019; Peng et al., 2021) and self-attentive models (Kang and McAuley,
2018; Sun et al., 2019; Wu et al., 2020). Among them, the Transformer-based
models reach the state-of-the-art performances with the capability of
extracting context information from all past actions and learn short-term
dynamics. However, they still struggle to solve the cold-start issue (Yu et
al., 2023), which means for unpopular items, the representations are under-
trained and it is difficult for models to make precise predictions over them
without sufficient data. In addition, despite the fact that these models have
been successful in sequential recommendation systems and can be directly
transferred to the main shopping intention identification task, they are
incapable of capturing the unique characteristics of intentions, as intentions
are higher-level concepts than items.

###  2.2. Intention Identification in SR

With the development of recommendation systems, people start to seek for other
side information to help improve the recommendation qualities. Shopping
intentions usually serve as a coarse-grained side information that can better
describe users’ preferences. Most of the existing methods (Zhang et al., 2019;
Tanjim et al., 2020; Zhu et al., 2020; Liu et al., 2021; Li et al., 2022; Shen
et al., 2023c) focus on treating the intentions as an implicit guidance or an
additional feature for downstream product-level recommendation. However, the
intention guidance learned from the sequences may not be in line with
expectation. As they are using the same model architecture on both intention
and item sequences, the main shopping intention can be misled by some commonly
seen yet totally irrelevant item pairs. To resolve this issue, some other
methods leverage clustering algorithms (Chang et al., 2021) or graph neural
networks (Wang et al., 2021; Chen et al., 2022b, a) to better understand the
intentions via linking them with items and users. However, these approaches
lose the explainability of shopping intentions for better user understanding.
Another line of works identify the shopping intentions from search queries
input by the users (Hashemi et al., 2021; Gong et al., 2021; Yang et al.,
2021), which is orthogonal to our work.

###  2.3. Stochastic Representations in SR

Representing concepts (_e.g._ , natural language sequences, images, graphs) as
distributions has attracted interests from the research community (Kingma and
Welling, 2013; Bojchevski and Günnemann, 2018; He et al., 2015; Qian et al.,
2021; Shen et al., 2023b, a). Most stochastic models represent the concepts
with Gaussian distributions, composed of mean and covariance. The distribution
representations introduce uncertainties and provide more flexibility compared
with deterministic embeddings. In the recommendation systems area, a few
studies propose to leverage the advantages of Gaussian distributions to
flexibly represent users and items. For example, GeRec (Jiang et al., 2019)
models each user and item as a Gaussian distribution and applies CNN on the
sampled matrix from their distributions for inference. To dynamically monitor
the sequential changes in user interactions, a series of work (Zheng et al.,
2019; Fan et al., 2021, 2022) also combine Gaussian distributions with
sequential recommendation algorithms. DT4SR (Fan et al., 2021) is one of these
attempts, proposing the mean and covariance embeddings to model items as
distributions. STOSA (Fan et al., 2022) extends DT4SR architecture via
proposing a new stochastic attention mechanism based on Wasserstein distance.
However, all the previous stochastic methods, learning the distributions only
from the transitions within the sequence, can still fail in cold-start
situations in § 2.1, which can be mitigated by G-STO. In addition, none of the
aforementioned methods naturally combine stochastic representations with
intentions to learn the intention distributions, which is accomplished by
G-STO as well. Another methodology line is variational autoencoder (VAE),
approximating posterior distributions of latent variables via variational
inference. Combining SR and VAE, SVAE (Sachdeva et al., 2019) and VSAN (Zhao
et al., 2021) learn the dynamic hidden representations of shopping sequences.
However, these efforts still perform worse than existing deterministic models
on many tasks (Kang and McAuley, 2018; Sun et al., 2019). As an update, ACVAE
(Xie et al., 2021) incorporates adversarial variational Bayes and maximization
of mutual information between user embeddings and input sequences to obtain
more distinctive and personalized representations of individual users.
However, all these VAE-based SR methods are easy to suffer from posterior
collapse problems, generating poor-quality latent representations, which G-STO
can avoid.

##  3\. Method

Figure 2. Illustration of G-STO model, containing key components: (A)
stochastic representations to map each intention as a Gaussian distribution;
(B) graph regularizer to restrict the more relevant intentions to have closer
representations; (C) mean and covariance transformers to encode the sequential
information from user historical interactions; (D) Wasserstein distance for
training and inference.

In this section, we introduce our proposed graph regularized stochastic model,
G-STO, for main shopping intention identification (§ 3.1). Figure 2 displays
the working flow of G-STO. It consists of several key components: (1)
stochastic representations (§ 3.2), which model the shopping intentions as
stochastic distributions, consisting of mean and covariance embeddings; (2)
intention relation regularizer (§ 3.3), which creates an intention relation
graph and regularize more relevant intentions on the graph to have closer
stochastic representations; (3) mean and covariance Transformers (§ 3.4),
encoding sequential information from the transition patterns in user
historical interactions to generate stochastic representations of user
preferences; (4) Wasserstein distance (§ 3.5), which measures the
dissimilarity between intentions and user preferences and can be combined with
Bayesian Personalized Ranking (BPR) (Rendle et al., 2009) loss on the positive
and negative sequences for model training.

###  3.1. Problem Definition

A sequential recommendation system collects the interactions between a set of
users $\mathcal{U}$ and items $\mathcal{V}$, (_e.g._ , clicks, purchases,
_etc._) and sorts them chronologically into sequences. Similarly, to identify
users’ main shopping intentions, models need to map all the items
$\mathcal{V}$ to their belonging shopping intentions $\mathcal{M}$ and
reorganize them chronically as
$\mathcal{S}^{u}=[m_{1}^{u},m_{2}^{u},\cdots,m_{|\mathcal{S}^{u}|}^{u}]$. The
goal of the main shopping intention identification can be formulated as:

(1) $\displaystyle p(m^{u}=m|\mathcal{S}^{u}),$

which measures the probability of an intention $m$ being the main shopping
intention $m^{u}$ given user $u$’s sequence.

###  3.2. Stochastic Embedding Layers

Different from the deterministic embedding layers that only map the
items/intentions to unique high-dimensional vectors, stochastic embedding
layers formulate the intentions as high-dimensional elliptical Gaussian
distributions. These Gaussian distributions are constructed of mean and
covariance embeddings, spanning a broader space to include more high-
dimensional points, which naturally captures high-level semantics of shopping
intentions. Specifically, we define a mean embedding table
$\mathbf{T}^{\mu}\in\mathbb{R}^{|\mathcal{M}|\times d}$ and a covariance
embedding table $\mathbf{T}^{\Sigma}\in\mathbb{R}^{|\mathcal{M}|\times d}$,
where $|\mathcal{M}|$ denotes the total number of shopping intentions and $d$
denotes the hidden dimension size. As the mean and covariance of a Gaussian
distribution identify different signals of expectation and uncertainty, we
introduce different position embeddings
$\mathbf{P}^{\mu}\in\mathbb{R}^{L\times d}$ and
$\mathbf{P}^{\Sigma}\in\mathbb{R}^{L\times d}$, where $L$ indicates the
sequence length. Thus, we can obtain the stochastic representations via the
summation of the previously defined embeddings and position embeddings:

(2) $\displaystyle\mathbf{E}^{\mu}_{\mathcal{S}^{u}}$
$\displaystyle=[\mathbf{E}_{s_{1}}^{\mu},\cdots,\mathbf{E}_{s_{L}}^{\mu}]=[\mathbf{T}_{s_{1}}^{\mu}+\mathbf{P}_{s_{1}}^{\mu},\cdots,\mathbf{T}_{s_{L}}^{\mu}+\mathbf{P}_{s_{L}}^{\mu}],$
$\displaystyle\mathbf{E}^{\Sigma}_{\mathcal{S}^{u}}$
$\displaystyle=[\mathbf{E}_{s_{1}}^{\Sigma},\cdots,\mathbf{E}_{s_{L}}^{\Sigma}]=[\mathbf{T}_{s_{1}}^{\Sigma}+\mathbf{P}_{s_{1}}^{\Sigma},\cdots,\mathbf{T}_{s_{L}}^{\Sigma}+\mathbf{P}_{s_{L}}^{\Sigma}].$

For example, the first intention $s_{1}$ in the sequence $\mathcal{S}^{u}$ is
formulated as a Gaussian distribution
$\mathcal{N}(\mu_{s_{1}},\Sigma_{s_{1}})$, where
$\mu_{s_{1}}=\mathbf{E}_{s_{1}}^{\mu}$ and
$\Sigma_{s_{1}}=\operatorname{diag}(\operatorname{elu}(\mathbf{E}_{s_{1}}^{\Sigma})+\mathbf{1})\in\mathbb{R}^{d\times
d}$. $\operatorname{elu}(\cdot)$ is the ELU activation function and
$\mathbf{1}\in\mathbb{R}^{d}$ is an all-ones vector. 111The operations on
covariance embeddings are designed to guarantee the covariance matrix to be
positive definite.

###  3.3. Intention Relation Graph Regularizer

To effectively model infrequent and under-trained shopping intentions, our
goal is to utilize the most related intentions to help the model comprehend
them. To this end, we propose a novel graph-based regularizer, allowing more
pertinent shopping intentions to share closer stochastic representations.
Thus, we introduce the global intention relationship as the prior knowledge
and create a graph accordingly, which can be introduced as follows:

Intention Relation Graph. We create the intention relation graph with the aid
of P-Companion (Hao et al., 2020). Given a pair of shopping intentions
$(m_{i},m_{j})$ as inputs, we treat the co-purchase relations between them as
distant supervised labels $y_{i,j}=\\{+1,-1\\}$. To extract relevant
information from co-purchase relations, each shopping intention and its
complementary side are represented by two separate embeddings,
$\phi_{w},\phi_{w}^{c}$. Thus, to infer the relation between shopping
intentions $(m_{i},m_{j})$, we first apply a 2-layer feed-forward network
(FFN) to transform $m_{i}$:

(3)
$\displaystyle\gamma_{m_{i}}=\operatorname{ReLU}(\phi_{m_{i}}\mathbf{W}_{1}+\mathbf{b}_{1})\mathbf{W}_{2}+\mathbf{b}_{2},$

where $\\{\mathbf{W}_{1},\mathbf{W}_{2},\mathbf{b}_{1},\mathbf{b}_{2}\\}$ are
trainable parameters. Then, we optimize the relation between the transformed
embedding of $m_{i}$, $\gamma_{m_{i}}$, and the complementary embedding of
$m_{j}$, $\phi_{m_{j}}^{c}$, via applying hinge loss function on labels
$y_{i,j}$:

(4) $\displaystyle\ell=\min\sum_{m_{i},m_{j}\in\mathcal{M}}(\max\\{0,\epsilon-
y_{i,j}(\lambda-\|\gamma_{m_{i}}-\phi_{m_{j}}^{c}\|_{2}^{2}\\}),$

where $\lambda$ is the base distance to distinguish $\gamma_{m_{i}}$ and
$\phi_{m_{j}}^{c}$, and $\epsilon$ is the margin distance. When $y_{i,j}=1$,
the two shopping intentions have the co-purchase/complementary relation and
the model will force the distance between $\gamma_{m_{i}}$ and
$\phi_{m_{j}}^{c}$ to be smaller than $\lambda-\epsilon$. Otherwise, when
$y_{i,j}=-1$, the two shopping intentions do not possess the complementary
relation, pushing the $\gamma_{m_{i}}$ and $\phi_{m_{j}}^{c}$ far away from
each other with distance more than $\lambda+\epsilon$. With the trained
$\phi_{m_{i}}$ and $\phi_{m_{i}}^{c}$, we can create the shopping intention
relation graph $\mathcal{G}=\\{\mathcal{V},\mathcal{E}\\}$, where the nodes
$\mathcal{V}$ are different shopping intentions, and the edges $\mathcal{E}$
indicate the relevant/complementary scores between the intentions. To compute
edge weights between intentions $m_{i}$ and $m_{j}$, we apply cosine
similarities between $m_{i}$’s complementary embedding, $\phi_{m_{i}}^{c}$,
and $m_{j}$’s embedding, $\phi_{m_{j}}$:

(5) $\displaystyle
e(m_{i},m_{j})=\frac{\phi_{m_{i}}^{c}\cdot\phi_{m_{j}}}{\|\phi_{m_{i}}^{c}\|\|\phi_{m_{j}}\|}.$

Graph Neural Regularizer. Considering the previously constructed relational
graph of intentions as prior knowledge, we aim to regularize the more relevant
intentions on the graph so that they share closer distributions. When
determining the main shopping intentions of a user, we can rank all relevant
intentions higher, including those even unpopular ones, if they are
represented similarly. Thus, we employ the graph convolutional network (GCN)
to induce stochastic representations of nodes based on the neighboring
features, transferring knowledge to under-trained nodes from their frequently-
seen neighbors. To learn a unified set of parameters regularizing both the
mean embeddings $\mathbf{T}^{\mu}\in\mathbb{R}^{|\mathcal{M}|\times d}$ and
the covariance embeddings
$\mathbf{T}^{\Sigma}\in\mathbb{R}^{|\mathcal{M}|\times d}$ simultaneously, we
concatenate them together as the initial node representations:

(6)
$\displaystyle\mathbf{X}^{(0)}=\mathbf{T}^{\mu}\oplus\mathbf{T}^{\Sigma}\in\mathbb{R}^{|\mathcal{M}|\times
2d}.$

Then, the GCN propagation can be represented as follows:

(7)
$\displaystyle\mathbf{X}^{(l)}=\sigma(\tilde{\mathbf{A}}\mathbf{X}^{(l-1)}\mathbf{W}^{(l-1)}),$

where $\mathbf{W}^{(l-1)}\in\mathbb{R}^{2d\times 2d}$ is the trainable weight
matrix after the $l$-th layer, and
$\mathbf{X}^{(l)}\in\mathbb{R}^{|\mathcal{M}|\times 2d}$ indicates the
obtained new regularized intention representations at the $l$-th layer.
$\tilde{\mathbf{A}}\in\mathbb{R}^{|\mathcal{M}|\times|\mathcal{M}|}$ is the
normalized format of the adjacent matrix
$\mathbf{A}\in\mathbb{R}^{|\mathcal{M}|\times|\mathcal{M}|}$ derived from
graph $\mathcal{G}$, which can be computed via
$\tilde{\mathbf{A}}=\mathbf{D}^{-\frac{1}{2}}\mathbf{A}\mathbf{D}^{-\frac{1}{2}}$,
where $\mathbf{D}$ is the degree matrix 222$D_{ii}=\sum_{j}A_{ij}$. of
$\mathbf{A}$. Once obtain the regularized intention representations
$\mathbf{X}^{(l)}\in\mathbb{R}^{|\mathcal{M}|\times 2d}$ at the $l$-th layer,
we will separate the new mean embeddings
$\hat{\mathbf{T}}^{\mu}\in\mathbb{R}^{|\mathcal{M}|\times d}$ and the new
covariance embeddings
$\hat{\mathbf{T}}^{\Sigma}\in\mathbb{R}^{|\mathcal{M}|\times d}$ from them to
form the regularized Gaussian distributions with intention relations:

(8) $\displaystyle=\mathbf{X}^{(l)}.$

Thus, we can finally rewrite the embedding layer in Eq.(2) to encode the user
shopping sequences with regularized distributions:

(9) $\displaystyle\hat{\mathbf{E}}^{\mu}_{\mathcal{S}^{u}}$
$\displaystyle=[\hat{\mathbf{E}}_{s_{1}}^{\mu},\cdots,\hat{\mathbf{E}}_{s_{L}}^{\mu}]=[\hat{\mathbf{T}}_{s_{1}}^{\mu}+\hat{\mathbf{P}}_{s_{1}}^{\mu},\cdots,\hat{\mathbf{T}}_{s_{L}}^{\mu}+\hat{\mathbf{P}}_{s_{L}}^{\mu}],$
$\displaystyle\hat{\mathbf{E}}^{\Sigma}_{\mathcal{S}^{u}}$
$\displaystyle=[\hat{\mathbf{E}}_{s_{1}}^{\Sigma},\cdots,\hat{\mathbf{E}}_{s_{L}}^{\Sigma}]=[\hat{\mathbf{T}}_{s_{1}}^{\Sigma}+\hat{\mathbf{P}}_{s_{1}}^{\Sigma},\cdots,\hat{\mathbf{T}}_{s_{L}}^{\Sigma}+\hat{\mathbf{P}}_{s_{L}}^{\Sigma}].$

###  3.4. Mean and Covariance Transformers

Apart from the prior knowledge we obtain from the global intention relation
information, we still need to encode the sequential information from the user
historical interaction sequences. Therefore, we propose mean and covariance
Transformers to automatically learn the hidden patterns from the intention
transitions in the sequences. The deterministic Transformer-based models build
up the self-attention mechanisms with the dot products between query
$\mathbf{Q}$, key $\mathbf{K}$, and value $\mathbf{V}$. In sequential
recommendation, the query, key, and value are obtained from the linear
transformations of the same sequence embedding
$\hat{\mathbf{E}}_{\mathcal{S}^{u}}$. However, in distribution-based
stochastic models, we use mean and covariance embeddings to form a Gaussian
distribution as intention and sequence representations. Thus, we need two
separate sets of $\mathbf{Q}$, $\mathbf{K}$, and $\mathbf{V}$ for both mean
and covariance embeddings of the sequence:

(10)
$\displaystyle\mathbf{Q}_{\mu}(\mathcal{S}^{u})=\hat{\mathbf{E}}_{\mathcal{S}^{u}}^{\mu}\mathbf{W}_{\mu}^{Q},\
\mathbf{K}_{\mu}(\mathcal{S}^{u})=\hat{\mathbf{E}}_{\mathcal{S}^{u}}^{\mu}\mathbf{W}_{\mu}^{K},\
\mathbf{V}_{\mu}(\mathcal{S}^{u})=\hat{\mathbf{E}}_{\mathcal{S}^{u}}^{\mu}\mathbf{W}_{\mu}^{V};$
$\displaystyle\mathbf{Q}_{\Sigma}(\mathcal{S}^{u})=\hat{\mathbf{E}}_{\mathcal{S}^{u}}^{\Sigma}\mathbf{W}_{\Sigma}^{Q},\
\mathbf{K}_{\Sigma}(\mathcal{S}^{u})=\hat{\mathbf{E}}_{\mathcal{S}^{u}}^{\Sigma}\mathbf{W}_{\Sigma}^{K},\
\mathbf{V}_{\Sigma}(\mathcal{S}^{u})=\hat{\mathbf{E}}_{\mathcal{S}^{u}}^{\Sigma}\mathbf{W}_{\Sigma}^{V};$

where $\mathbf{W}_{*}^{*}\in\mathbb{R}^{d\times d}$ represent the learnable
weight matrices in the linear transformation. Combining the computed query
$\mathbf{Q}$, key $\mathbf{K}$, and value $\mathbf{V}$ with scaled dot-product
attention. we can use the mean self-attention (MSA) and covariance self
attention (CSA) to obtain newly generated sequence stochastic representations
$\\{\mathbf{z}_{\mathcal{S}^{u}}^{\mu},\mathbf{z}_{\mathcal{S}^{u}}^{\Sigma}\\}$:

(11) $\displaystyle\mathbf{z}_{\mathcal{S}^{u}}^{\mu}$
$\displaystyle=\mathbf{MSA}(\mathcal{S}^{u})=\sigma(\frac{\mathbf{Q}_{\mu}(\mathcal{S}^{u})\mathbf{K}_{\mu}(\mathcal{S}^{u})^{\mathrm{T}}}{\sqrt{d}})\mathbf{V}_{\mu}(\mathcal{S}^{u});$
$\displaystyle\mathbf{z}_{\mathcal{S}^{u}}^{\Sigma}$
$\displaystyle=\mathbf{CSA}(\mathcal{S}^{u})=\sigma(\frac{\mathbf{Q}_{\Sigma}(\mathcal{S}^{u})\mathbf{K}_{\Sigma}(\mathcal{S}^{u})^{\mathrm{T}}}{\sqrt{d}})\mathbf{V}_{\Sigma}(\mathcal{S}^{u}).$

In addition to uncovering sequential patterns from linear transformations, we
leverage the feed-forward network (FFN) to endow the model with non-linearity.
The FFN with respect to both $\mathbf{MSA}$ and $\mathbf{CSA}$ at position $t$
are defined as:

(12) $\displaystyle\mathbf{F}_{\mu}(\mathcal{S}_{t}^{u})$
$\displaystyle=\operatorname{FFN}^{\mu}(\mathbf{MSA}(\mathcal{S}_{t}^{u}))=\operatorname{elu}(\mathbf{z}_{\mathcal{S}_{t}^{u}}^{\mu}\mathbf{W}_{1}^{\mu}+\mathbf{b}_{1}^{\mu})\mathbf{W}_{2}^{\mu}+\mathbf{b}_{2}^{\mu};$
$\displaystyle\mathbf{F}_{\Sigma}(\mathcal{S}_{t}^{u})$
$\displaystyle=\operatorname{FFN}^{\Sigma}(\mathbf{CSA}(\mathcal{S}_{t}^{u}))=\operatorname{elu}(\mathbf{z}_{\mathcal{S}_{t}^{u}}^{\Sigma}\mathbf{W}_{1}^{\Sigma}+\mathbf{b}_{1}^{\Sigma})\mathbf{W}_{2}^{\Sigma}+\mathbf{b}_{2}^{\Sigma};$

where all the $\mathbf{W}_{*}^{*}\in\mathbb{R}^{d\times d}$ and
$\mathbf{b}_{*}^{*}\in\mathbb{R}^{d}$ are trainable parameters in feed-forward
networks.

###  3.5. Training and Evaluation

Wasserstein Distance. For embedding-based models, when measuring how
accurately the model detects the main intention, we need to apply dot products
between the user preference embedding and the intention embeddings. Similarly,
for stochastic models, we need to identify the distances between distributions
of the ground-truth labels and the inferred distributions. Many existing works
formulating concepts as distributions use Kullback-Leibler (KL) divergence to
compute the distribution distances. However, when two intentions are
excessively unrelated, their stochastic representations will be expressed as
two almost non-overlapping distributions, and the KL divergence will describe
the distance as nearly infinity, resulting in value instability. Thus, we use
Wasserstein distance to measure the distance between Gaussian distributions.
Given two Gaussian distributions $q_{i}=\mathcal{N}(\mu_{i},\Sigma_{i})$ and
$q_{j}=\mathcal{N}(\mu_{j},\Sigma_{j})$, the Wasserstein distance can be
computed as:

(13) $\displaystyle
d_{W}(i,j)=\|\mu_{i}-\mu_{j}\|_{2}^{2}+\operatorname{trace}(\Sigma_{i}+\Sigma_{j}-2(\Sigma_{j}^{1/2}\Sigma_{i}\Sigma_{j}^{1/2})^{1/2}).$

For time efficiency, the second term in the above equation can be simplified
as a calculation of Euclidean norm:

(14)
$\displaystyle\operatorname{trace}(\Sigma_{i}+\Sigma_{j}-2(\Sigma_{j}^{1/2}\Sigma_{i}\Sigma_{j}^{1/2})^{1/2})=\|\Sigma_{i}^{1/2}-\Sigma_{j}^{1/2}\|_{F}^{2},$

where $\|\cdot\|_{F}^{2}$ is Frobenius norm that can be calculated by matrix
multiplications.

Training Objective. Many deterministic sequential recommendation models apply
Bayesian Personalize Ranking (BPR) loss (Rendle et al., 2009) on the dot-
product scores, making the ground-truth label nearest to the customer
preference. In G-STO, we apply BPR loss on the previous defined Wasserstein
distances between distributions to measure the correctness of the main
intention identification:

(15)
$\displaystyle\ell=-\sum_{\mathcal{S}^{u}\in\mathcal{S}}\sum_{t\in\\{1,2,\cdots,|\mathcal{S}^{u}|\\}}\log(\sigma(d_{W}(m_{t}^{+},\hat{p}_{t})-d_{W}(m_{t}^{-},\hat{p}_{t}))),$

where $\hat{p}_{t}$ dentoes the inferred distribution of user preference at
position $t$, $m_{t}^{+}$ is the ground-truth shopping intention and
$m_{t}^{-}$ denotes the negative samples from the intentions that the user
never interact with. During the inference stage, for user $u$, we calculate
the distances between the customer preference distribution and the candidates
set containing the ground-truth intention and 100 negative sampled intentions.

Algorithm 1 shows the whole working flow of G-STO.

Input: $\mathcal{S}_{u}$: User Shopping Sequence.

// Step 1: Construct the Intention Relation Graph.

Train the co-purchase relation model via Eq. 4.

Considering intentions as nodes, compute edge weights via Eq. 5.

// Step 2: Compute Graph-Regularized Embeddings.

Use embedding layer to map intentions into mean and covariance embeddings:
$\mathbf{T}^{\mu}$ and $\mathbf{T}^{\Sigma}$.

Regularize $\mathbf{T}^{\mu}$ and $\mathbf{T}^{\Sigma}$ with intention
relation graph as: $\hat{\mathbf{T}}^{\mu}$ and $\hat{\mathbf{T}}^{\Sigma}$.

Map the user shopping sequences $\mathcal{S}^{u}$ into mean and covariance
embedding sequences: $\hat{\mathbf{E}}^{\mu}_{\mathcal{S}^{u}}$ and
$\hat{\mathbf{E}}^{\Sigma}_{\mathcal{S}^{u}}$ via Eq.9.

// Step 3: Encode Sequential Information.

Use Mean and Covariance Transformers to model user preferences
$\mathbf{F}_{\mu}(\mathcal{S}^{u}_{t})$ and
$\mathbf{F}_{\Sigma}(\mathcal{S}^{u}_{t})$.

Update the model parameters via Eq. 15.

Output: The final user main shopping intentions for the whole shopping
trajectory.

Algorithm 1 Process of G-STO.

##  4\. Experiments

In this section, we evaluate the empirical effectiveness G-STO by studying the
following research questions (RQs):

$\bullet$RQ1: Does G-STO provide better shopping intention identification
results than baselines?

$\bullet$RQ2: Why do we need to design different kinds of scenarios? How does
G-STO perform on different circumstances?

$\bullet$RQ3: What is the influence of the intention relation graph
regularizer and stochastic representations?

$\bullet$RQ4: How sensitivity is G-STO to the hyper-parameters?

$\bullet$RQ5: Why can G-STO alleviate intention cold start issue?

Table 1. An example of generated sequences under different scenarios. Different numbers represent different shopping intentions. The blue intentions indicate the validation set labels and the red intentions indicate the test set labels. Scenarios |  Examples |  Explanation
---|---|---
Original |  (0, 4293, 234, 2173, 232, 183, 913, 4298, 582, 98, 4299) |  Raw Sequences obtained from user historical data;
24-Hours |  (0, 4293, 234, 2173, 232, 183), (913, 4298, 582, 98, 4299) |  Time interval between 183 and 913 is longer than 24 hours;
Purchase |  (377, 19, 76, 6, 87, 112), 90, 4, 346, 85 |  112 is the PURCHASE action.
(0, 4293, 234, 2173, 232, 183), 913, 4298, 582, 98, 4299 |  183 is the PURCHASE action;

###  4.1. Data Curation

We create three benchmarks for main shopping intention identification using
anonymized data from amazon.com. To provide a comprehensive evaluation, the
ground-truth main shopping intention labels of the three datasets are created
based on different real-life scenarios: (1) original sequences, using the raw
sequences composed of user historical interactions to model the long-term
shopping scenario; (2) 24-hours sequences, leveraging more frequent user-
intention interactions sampled from raw data to model the short-term shopping
scenario; (3) purchase sequences, considering purchase actions of the raw
sequences as strong signal of the main shopping intentions to model the
purchase-related shopping scenario. Table 1 shows examples of the three
datasets, and the statistics of three datasets, original, 24-hours, purchase
sequences, are listed in Table. 2.

Table 2. Statistics of original, 24-hours, and purchase data. | #Users | #Intentions | Average #Interactions/Seq
---|---|---|---
Original | 140000 | 14695 | 49.28
24-hours | 130000 | 14695 | 15.66
Purchase | 90000 | 14695 | 38.69

Original sequences: We follow the "leave-one-out" strategy (Kang and McAuley,
2018) to split the sequences into training, validation, and test datasets. To
create the intention labels for each user and each split, we partition the
curated historical sequence $\mathcal{S}^{u}$ for each user $u$ into three
parts: (1) the most recent intention action
$\mathcal{S}^{u}_{|\mathcal{S}^{u}|}$ as the intention label for test set; (2)
the second most recent action $\mathcal{S}^{u}_{|\mathcal{S}^{u}|-1}$ as the
intention label for validation set; and (3) all remaining actions as training
data. Note that during testing, the input sequences contain training actions
and validation action.

24-hours sequences: Although the original sequences can more accurately
describe the long-term preferences of customers and be more useful for the
downstream task of next item recommendation, the users’ final interactions
cannot always convey the main shopping intention labels due to the random
shift of interests. Assuming that, for more dense and frequent interactions in
a short period, the last intentions from "leave-one-out" mechanism can better
reflect the main shopping intentions, we assess the time intervals between the
successive activities to breakdown the raw sequences. If there is a temporal
gap longer than a pre-determined threshold (_e.g._ , 24 hours), we will insert
a break-point and divide the entire sequence into two sub-sequences.

Purchase sequences: Aside from using the last intentions as the labels, the
purchase actions can also serve as a very strong positive signal for main
shopping intention identification. For each customer’s historical data, the
purchase actions can be viewed as the main shopping intentions for its
preceding sub-sequences. As purchasing activities are dispersed over the
sequences, we can only apply user-based split for train/val/test separation in
this scenario.

###  4.2. Experiment Setup

####  4.2.1. Evaluation Protocol

We evaluate all models with the following metrics: (1) NDCG@10: A position-
aware metric which assigns larger weights for higher positions; (2) Hit@K,
(K=1,2,5,10): Metrics counting the fraction of times that the ground-truth
intention is among top $K$ predictions. We report the averaged metrics over
all users. We select the model to report the test set performances based on
the best validation NDCG@10 score.

####  4.2.2. Baselines

We compare our proposed model with baselines from three different groups: (1)
static recommendation methods: Count-based Bayesian (CB) is a non-learning
approach that solely considers the appearance frequency of shopping
intentions. We consider the intention frequencies across the entire market as
prior, and the intention frequencies in each user’s shopping sequence as
likelihood. The final shopping intention rankings are derived using posterior,
which is the multiplication of prior and likelihood; LightGCN (He et al.,
2020) is a state-of-the-art graph-based static recommendation method, which
considers high-order collaborative signals in user-item graph; (2)
deterministic sequential recommendation methods: SASRec (Kang and McAuley,
2018) is a self-attention based sequential recommendation system model that
captures long-term semantics and short-term dynamics; (3) stochastic
sequential recommendation methods: DT4SR (Fan et al., 2021) is a distribution-
based method, mapping the intentions to elliptical Gaussian distributions and
then send them into two separate Transformer-based model to infer the users’
preferences; STOSA (Fan et al., 2022) is a state-of-the-art distribution-based
recommendation system model. STOSA extends DT4SR by proposing a new stochastic
self-attention mechanism to further improve the combination of Transformer and
stochastic representations; (4) VAE-based sequential recommendation methods:
SVAE (Sachdeva et al., 2019) is a recurrent version of VAE, combining
recurrent neural network (RNN) and VAE. The model outputs the probability
distribution of the most likely future preferences at each time step; ACVAE
(Xie et al., 2021) is a state-of-the-art VAE-based model, first introducing
the adversarial training for sequence generation, enabling the model to
generate high-quality latent variables.

####  4.2.3. Implementation Details

For the hyper-parameters, the learning rate is set as $1e-4$, the maximum
number of epochs is 500, the batch size is $128$. For the stochastic
representations, the hidden dimensionalities of mean and covariance embeddings
are set as $64$. For the intention relation graph regularizer, we apply
1-layer graph convolution network (GCN). We train and test our code on the
system Ubuntu 18.04.4 LTS with CPU: Intel(R) Xeon(R) Silver 4214 CPU@ 2.20GHz
and GPU: NVIDIA V100. We implement our method using Python 3.8 and PyTorch 1.6
(Paszke et al., 2019). For the hyper-parameters, the learning rate is set as
$1e-4$, the maximum number of epochs is 500, the batch size is $128$. For the
stochastic representations, the hidden dimensionalities of mean and covariance
embeddings are set as $64$. For the intention relation graph regularizer, we
apply 1-layer graph convolution network (GCN). During training, we use the
Adam (Kingma and Ba, 2014) optimizer with $\beta_{1}=0.9$ and
$\beta_{2}=0.999$ in our experiments for all the models. We select the best
set of hyper-parameters of the models based on the NDCG@10 on the
corresponding validation sets.

###  4.3. Performance Comparison

Table 3. Performance Comparison in Hit@1, NDCG@10, Hit@2, Hit@5, and Hit@10 on three different datasets. The best results are boldfaced. Scenarios ($\rightarrow$) | Original | 24-Hours | Purchase
---|---|---|---
Methods($\downarrow$) | Hit@1 | NDCG@10 | Hit@2 | Hit@5 | Hit@10 | Hit@1 | NDCG@10 | Hit@2 | Hit@5 | Hit@10 | Hit@1 | NDCG@10 | Hit@2 | Hit@5 | Hit@10
_Static Recommendation_
CB | 0.3242 | 0.4007 | 0.5224 | 0.7268 | 0.7708 | 0.3327 | 0.3949 | 0.5235 | 0.7233 | 0.7542 | 0.2767 | 0.3738 | 0.4376 | 0.6753 | 0.7502
LightGCN | 0.2810 | 0.3528 | 0.4743 | 0.6461 | 0.7436 | 0.3545 | 0.4423 | 0.5411 | 0.7265 | 0.8783 | 0.2281 | 0.3635 | 0.4054 | 0.6470 | 0.7038
_Deterministic Sequential Recommendation_
SASRec | 0.3192 | 0.3886 | 0.4509 | 0.6529 | 0.7865 | 0.4341 | 0.4537 | 0.5824 | 0.7610 | 0.8708 | 0.2761 | 0.3763 | 0.4160 | 0.6372 | 0.7804
_Stochastic Sequential Recommendation_
DT4SR | 0.4879 | 0.4417 | 0.5908 | 0.7231 | 0.8197 | 0.5950 | 0.5003 | 0.7027 | 0.8245 | 0.8968 | 0.4410 | 0.3863 | 0.5202 | 0.6308 | 0.7097
STOSA | 0.5646 | 0.4736 | 0.6598 | 0.7714 | 0.8530 | 0.6240 | 0.5484 | 0.7106 | 0.8298 | 0.9183 | 0.6017 | 0.4781 | 0.6779 | 0.7763 | 0.8449
_VAE-based Sequential Recommendation_
SVAE | 0.2722 | 0.2666 | 0.3014 | 0.3573 | 0.4041 | 0.3142 | 0.3718 | 0.4863 | 0.7163 | 0.8257 | 0.2897 | 0.3706 | 0.4221 | 0.6419 | 0.7871
ACVAE | 0.3866 | 0.4582 | 0.4843 | 0.6712 | 0.7107 | 0.3264 | 0.4573 | 0.5286 | 0.7261 | 0.9125 | 0.2858 | 0.3743 | 0.4834 | 0.6682 | 0.7644
Ours | 0.7061 | 0.5297 | 0.7890 | 0.8623 | 0.9050 | 0.8985 | 0.6115 | 0.9592 | 0.9896 | 0.9955 | 0.7280 | 0.5423 | 0.8062 | 0.8818 | 0.9259

Cross-Method Comparison (RQ1). Table 3 reports the performances of G-STO and
the baselines on all three benchmarks. The results demonstrate that G-STO
consistently outperforms all baselines in terms of all metrics on all the
three datasets. Compared with the strongest baseline, STOSA, G-STO shows
significant improvements of $18.08\%$ of Hit@1, $6.11\%$ of NDCG@10, $16.87\%$
of Hit@2, $11.87\%$ of Hit@5, and $7.01\%$ of Hit@10 on average of three
datasets. From the results, we have the following observations:

(1) The performance gaps between our method and static methods, CB and
LightGCN, show the importance of temporal order sequential information.
Different from product-level recommendations, the intentions may appear
multiple times in single sequence, making counts-based method, CB, achieve
comparable results to state-of-the-art static method of LightGCN, and even
SASRec.

(2) Comparing our method with the backbone model, SASRec, G-STO shows
significant improvement of $43.44\%$ in Hit@1 and $15.50\%$ in NDCG@10. This
indicates that the stochastic representations expand the latent space for
user-intention interactions and equip the model with collaborative
transitivity. Besides, the graph regularizer captures global intention
information, enabling model to better understand the intentions. Both modules
help enhance the intention identification capabilities, particularly in small-
data situations;

(3) The comparison between G-STO and other distribution-based recommendation
methods, DT4SR and STOSA, shows the efficacy of leveraging the intention
relation graph as prior knowledge to regularize the stochastic representations
and reveals the potential to further incorporate G-STO with distribution-based
attention;

(4) Comparing G-STO with VAE-based methods, we find that VAE-based methods are
easy to suffer posterior collapse problems: if the decoder is too expressive,
the KL divergence term in the loss will converge to 0, generating similar
latent representations for all inputs. This situation becomes worse for less-
interacted under-trained intentions. On the contrary, our model leverages
graph regularization to transfer knowledge from more-interacted intentions to
less-interacted ones to mitigate this issue.

Figure 3. Ablation Study in Hit@1, NDCG@10, Hit@2, Hit@5, Hit@10. The
performances are averaged on three datasets.

Cross-Dataset Comparison (RQ2). From Table 3, we can also compare the
performances horizontally to gain insights into the models’ performances in
different scenarios. We notice that the performance improvements made by
G-STO, compared with baselines, varies by different scenarios. The performance
gap is larger on 24-hours and purchase sequences than on original sequences.
We summarize the reasons as follows: (1) On 24-hour sequences, G-STO and all
the baselines achieve higher absolute performances than on the other two
categories. As the 24-hour sequences consist of more dense and frequent
activities, where users’ severe random interest shifts are less likely to
appear, and the hidden sequential dynamic patterns are easier for models to
learn and capture. (2) On purchase sequences, G-STO performs slightly better,
while most baselines perform poorly. This is because of the difference of data
split for train/validation/test set: we apply user-based split on purchase
sequences, and "leave-one-out" on the other two categories. Thus, it is easier
for model to face new users/intentions during validation or testing, making
the models more likely to suffer from the cold-start issue. With the graph-
regularized stochastic Transformer, G-STO can better resolve this issue than
the other baselines, enlarging the performance gap on this dataset.

###  4.4. A/B Test

We have an existing products recommendation feature using a static mapping
created from the work (Hao et al., 2020). However, the procedure only provides
static product to product recommendation, it doesn’t take customer’s shopping
history and provide personalized shopping experience. Our goal was to improve
the recommendation’s relevance by taking customers’ shopping intentions into
consideration while optimizing sales and revenue. Our work, G-STO, has been
recently deployed for online A/B testing as the treatment group, while the
control group is the existing solution using static mapping. The model takes
customer’s past shopping activities as input, then predict the possible
product categories for downstream recommendations. This online testing has
been run for 2 weeks, and we have already found the achievements shown below:

We observe a World Wide (WW) commercial success:

  * •

WW annual revenue was improved by 1%;

  * •

WW annual sales were improved by 2%.

Figure 4. Parameter studies of our model about the hidden dimensionality of
mean and covariance embeddings on original sequences.The red line indicates
that the best performances are obtained when the hidden size is 64.

(a) Intention embeddings trained by SASRec.

(b) Intention embeddings trained by STOSA.

(c) Intention embeddings trained by G-STO.

Figure 5. T-SNE visualization of mission embeddings trained by SASRec, STOSA, and G-STO. Blue points are irrelevant points to a certain intention. Red points are relevant shopping intentions. Table 4. Ablation studies on stochastic embeddings on original sequences. Methods | Recall@1 | NDCG@10 | Recall@2 | Recall@5 | Recall@10
---|---|---|---|---|---
G-STO w/o covar | 0.5516 | 0.4418 | 0.6280 | 0.7030 | 0.7571
G-STO w/o G-mean | 0.5685 | 0.4744 | 0.6626 | 0.7739 | 0.8512
G-STO w/o G-covar | 0.6704 | 0.5163 | 0.7553 | 0.8359 | 0.8962
G-STO | 0.7061 | 0.5297 | 0.7890 | 0.8623 | 0.9050
Table 5. Study on different graph neural networks (GNN) in intention graph regularizer on original sequences. Methods | Recall@1 | NDCG@10 | Recall@2 | Recall@5 | Recall@10
---|---|---|---|---|---
Ours (1-layer GCN) | 0.7061 | 0.5297 | 0.7890 | 0.8623 | 0.9050
Ours (2-layer GCN) | 0.4970 | 0.4633 | 0.6302 | 0.7756 | 0.8564
Ours (1-layer GAT) | 0.3390 | 0.4660 | 0.5698 | 0.7949 | 0.9202

###  4.5. Ablation Study (RQ3)

Ablation on Model Structure. Figure 3 presents the ablation study to verify
the effects of different components in G-STO. We compare G-STO with model
variants that remove one of the key components: (1) Ours w/o Graph Regularizer
(GR): We remove the intention graph regularizer and directly send the
stochastic representations generated by the stochastic embedding layer into
Transformers; (2) Ours w/o Stochastic Representation (SR): We degrade the
stochastic representations into deterministic embeddings for each intention.
Then, we have the following observations: (1) Compared with the backbone
model, SASRec, stochastic representations can bring significant improvements
of $16.48\%$ in Hit@1 and $3.66\%$ in NDCG@10, and graph regularizer can bring
$41.85\%$ of Hit@1 and $14.92\%$ of NDCG@10 increase. Removing either the
graph regularizer or the stochastic representation will cause performance drop
in all metrics on all three datasets, which shows the efficacy of the
components in our model design; (2) Comparing the performance drops caused by
removing different components, we notice that removing the intention relation
graph regularizer is more harmful than the stochastic representation. This is
because some collaborative transitivity relations captured by stochastic
representations may be already included in the global intention relation
graph.

Ablation on stochastic Representations. Table 4 shows the ablation studies on
stochastic embeddings in G-STO. Our objective is to study the effect of
various components of the stochastic embeddings and assess if the use of graph
regularization enhances their performance. To achieve this, we conduct
evaluations under three distinct experimental settings: (1) exclusion of graph
regularization on the covariance embedding (w/o G-covar); (2) exclusion of
graph regularization on the mean embedding (w/o G-mean); and (3) exclusion of
the entire covariance embedding (w/o covar). The results of our evaluation
indicate that the removal of graph regularization on either component of the
stochastic embedding results in a significant decrease in performance. This is
due to the fact that regularizing only one component of the embedding allows
for more flexibility in the other component, thereby weakening the overall
regularization power. Furthermore, the removal of the entire covariance
embedding results in a further decline in performance, as the model
degenerates into a lower-dimensional deterministic sequential recommendation
model.

###  4.6. Parameter Studies (RQ4)

We have performed extensive parameter studies to evaluate the effects of
different parameters on our model:

Effect of Hidden Dimensionalities. We study the influence of hidden
dimensionalities of mean and covariance embedding, $d$, towards our methods.
Among the searching range of $[16$, $32$, $64$, $128$, $256$, $512]$, $d=64$
works the best. If $d$ is too small, the model cannot encode the shopping
intentions well and cannot learn some high-dimensional relation between
intentions. If $d$ is too large, it will become a problem for model to learn
the high-dimensional representations, also causing a performance drop.

Effect of GNN Types. Table 5 presents the results of using various GNNs in the
intention relation graph regularizer. The results indicate that the graph
convolution network (GCN) outperforms the graph attention network (GAT). This
is because GAT requires additional edge weight learning for dense, noisy
graphs. However, our intention relation graph is not dense, and the edge
quality is high, rendering the training of additional attention weights
unnecessary. We utilize the MAD metric (Chen et al., 2020) to evaluate the
smoothness of node representations. The results show that as the number of GCN
layers increases from one to two, the MAD drops significantly from 0.774 to
0.379, indicating that the 2-layer GCN produces smoother representations. On
the other hand, the performance drop as shown in Table 5 suggests that the
2-layer GCN is over-smoothing.

Effect of Number of GCN Layers. Besides, we also investigate the effect of the
number of GCN layers on G-STO. With a single layer of graph convolution, GCN
can only gather data from its immediate neighbors. Information from larger
neighborhoods can only be incorporated when numerous GCN layers are applied.
The results in Table 5 indicate that 1-layer GCNs perform better than multi-
layer GCNs. The reason is that the directly related intentions on the graph
are more crucial when identifying the main shopping intentions from consumer
historical data, and introducing more distant neighbours on the graph can
introduce more noise.

###  4.7. Intention Embeddings Comparison (RQ5)

To better explain the efficacy of the proposed intention relation graph
regularizer, we compare the shopping intention representations trained by
SASRec, STOSA, and G-STO via t-SNE visualization (Van der Maaten and Hinton,
2008) in Figure 5. The red points in the figure represent the relevant
shopping intentions to the intention "miniature", while the blue points
indicate the irrelevant ones. From Figure 5(a), we observe that although
SASRec is trained on user historical data to learn some correlations between
intentions, the embeddings of relevant shopping intentions are still quite
scattered across the latent space. From Figure 5(b), the red points start to
cluster with each other, because the state-of-the-art distribution-based
model, STOSA, can capture the collaborative transitivity between intentions,
which are ignored by SASRec. In contrary, from Figure 5(c), it is obvious that
the related intention embeddings further cluster with each other. This proves
that the intention relation graph truly regularizes the stochastic
representations, constricting relevant intentions embeds closer to improve
G-STO performances.

##  5\. Conclusion

We presented G-STO, a graph-regularized stochastic Transformer-based model for
main shopping intention identification. G-STO first models the shopping
intentions as Gaussian distributions and then creates an intention relation
graph as prior knowledge to regularize these distributions. The regularized
stochastic representations will be fed to the Transformer architecture for
user main shopping intention identification. We perform experiments on three
different datasets, representing three different scenarios in real life
applications. Extensive experimental results demonstrate G-STO significantly
improve the main shopping intention identification from users’ historical
interaction sequences. In the future, we will change the Transformer
architecture to accommodate distribution-based models more effectively.

## References

  * (1)
  * Bojchevski and Günnemann (2018) Aleksandar Bojchevski and Stephan Günnemann. 2018.  Deep Gaussian Embedding of Graphs: Unsupervised Inductive Learning via Ranking. In _International Conference on Learning Representations_.
  * Chang et al. (2021) Jianxin Chang, Chen Gao, Yu Zheng, Yiqun Hui, Yanan Niu, Yang Song, Depeng Jin, and Yong Li. 2021\.  Sequential recommendation with graph neural networks. In _Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval_. 378–387.
  * Chen et al. (2020) Deli Chen, Yankai Lin, Wei Li, Peng Li, Jie Zhou, and Xu Sun. 2020.  Measuring and relieving the over-smoothing problem for graph neural networks from the topological view. In _Proceedings of the AAAI conference on artificial intelligence_ , Vol. 34. 3438–3445.
  * Chen et al. (2022a) Weixin Chen, Mingkai He, Yongxin Ni, Weike Pan, Li Chen, and Zhong Ming. 2022a.  Global and Personalized Graphs for Heterogeneous Sequential Recommendation by Learning Behavior Transitions and User Intentions. In _Proceedings of the 16th ACM Conference on Recommender Systems_. 268–277.
  * Chen et al. (2018) Xu Chen, Hongteng Xu, Yongfeng Zhang, Jiaxi Tang, Yixin Cao, Zheng Qin, and Hongyuan Zha. 2018.  Sequential recommendation with user memory networks. In _Proceedings of the eleventh ACM international conference on web search and data mining_. 108–116.
  * Chen et al. (2022b) Yongjun Chen, Zhiwei Liu, Jia Li, Julian McAuley, and Caiming Xiong. 2022b.  Intent Contrastive Learning for Sequential Recommendation. In _Proceedings of the ACM Web Conference 2022_. 2172–2182.
  * Devooght and Bersini (2017) Robin Devooght and Hugues Bersini. 2017.  Long and short-term recommendations with recurrent neural networks. In _Proceedings of the 25th Conference on User Modeling, Adaptation and Personalization_. 13–21.
  * Fan et al. (2021) Ziwei Fan, Zhiwei Liu, Shen Wang, Lei Zheng, and Philip S Yu. 2021.  Modeling Sequences as Distributions with Uncertainty for Sequential Recommendation. In _Proceedings of the 30th ACM International Conference on Information & Knowledge Management_. 3019–3023.
  * Fan et al. (2022) Ziwei Fan, Zhiwei Liu, Yu Wang, Alice Wang, Zahra Nazari, Lei Zheng, Hao Peng, and Philip S Yu. 2022\.  Sequential Recommendation via Stochastic Self-Attention. In _Proceedings of the ACM Web Conference 2022_. 2036–2047.
  * Gong et al. (2021) Yantao Gong, Cao Liu, Jiazhen Yuan, Fan Yang, Xunliang Cai, Guanglu Wan, Jiansong Chen, Ruiyao Niu, and Houfeng Wang. 2021.  Density-based dynamic curriculum learning for intent detection. In _Proceedings of the 30th ACM International Conference on Information & Knowledge Management_. 3034–3037.
  * Hao et al. (2020) Junheng Hao, Tong Zhao, Jin Li, Xin Luna Dong, Christos Faloutsos, Yizhou Sun, and Wei Wang. 2020.  P-companion: A principled framework for diversified complementary product recommendation. In _Proceedings of the 29th ACM International Conference on Information & Knowledge Management_. 2517–2524.
  * Hashemi et al. (2021) Helia Hashemi, Hamed Zamani, and W Bruce Croft. 2021\.  Learning Multiple Intent Representations for Search Queries. In _Proceedings of the 30th ACM International Conference on Information & Knowledge Management_. 669–679.
  * He and McAuley (2016) Ruining He and Julian McAuley. 2016.  Fusing similarity models with markov chains for sparse sequential recommendation. In _2016 IEEE 16th international conference on data mining (ICDM)_. IEEE, 191–200.
  * He et al. (2015) Shizhu He, Kang Liu, Guoliang Ji, and Jun Zhao. 2015\.  Learning to represent knowledge graphs with gaussian embedding. In _Proceedings of the 24th ACM international on conference on information and knowledge management_. 623–632.
  * He et al. (2020) Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yongdong Zhang, and Meng Wang. 2020\.  Lightgcn: Simplifying and powering graph convolution network for recommendation. In _Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval_. 639–648.
  * Jiang et al. (2019) Junyang Jiang, Deqing Yang, Yanghua Xiao, and Chenlu Shen. 2019\.  Convolutional Gaussian embeddings for personalized recommendation with uncertainty. In _Proceedings of the 28th International Joint Conference on Artificial Intelligence_. 2642–2648.
  * Kanase et al. (2022) Sameer Kanase, Yan Zhao, Shenghe Xu, Mitchell Goodman, Manohar Mandalapu, Benjamyn Ward, Chan Jeon, Shreya Kamath, Ben Cohen, Vlad Suslikov, Yujia Liu, Hengjia Zhang, Yannick Kimmel, Saad Khan, Brent Payne, and Patricia Grao. 2022\.  An Application of Causal Bandit to Content Optimization. In _Proceedings of the 5th Workshop on Online Recommender Systems and User Modeling (ORSUM 2022), in conjunction with the 16th ACM Conference on Recommender Systems (RecSys 2022), Seattle, WA, USA_.
  * Kang and McAuley (2018) Wang-Cheng Kang and Julian McAuley. 2018.  Self-attentive sequential recommendation. In _2018 IEEE international conference on data mining (ICDM)_. IEEE, 197–206.
  * Kingma and Ba (2014) Diederik P Kingma and Jimmy Ba. 2014.  Adam: A method for stochastic optimization.  _arXiv preprint arXiv:1412.6980_ (2014).
  * Kingma and Welling (2013) Diederik P Kingma and Max Welling. 2013.  Auto-encoding variational bayes.  _arXiv preprint arXiv:1312.6114_ (2013).
  * Li et al. (2017) Jing Li, Pengjie Ren, Zhumin Chen, Zhaochun Ren, Tao Lian, and Jun Ma. 2017\.  Neural attentive session-based recommendation. In _Proceedings of the 2017 ACM on Conference on Information and Knowledge Management_. 1419–1428.
  * Li et al. (2022) Jiacheng Li, Tong Zhao, Jin Li, Jim Chan, Christos Faloutsos, George Karypis, Soo-Min Pantel, and Julian McAuley. 2022\.  Coarse-to-Fine Sparse Sequential Recommendation.  _arXiv preprint arXiv:2204.01839_ (2022).
  * Liu et al. (2021) Chang Liu, Xiaoguang Li, Guohao Cai, Zhenhua Dong, Hong Zhu, and Lifeng Shang. 2021\.  Noninvasive self-attention for side information fusion in sequential recommendation. In _Proceedings of the AAAI Conference on Artificial Intelligence_ , Vol. 35. 4249–4256.
  * Ma et al. (2019) Chen Ma, Peng Kang, and Xue Liu. 2019.  Hierarchical gating networks for sequential recommendation. In _Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining_. 825–833.
  * Paszke et al. (2019) Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. 2019\.  Pytorch: An imperative style, high-performance deep learning library.  _Advances in neural information processing systems_ 32 (2019).
  * Peng et al. (2021) Bo Peng, Zhiyun Ren, Srinivasan Parthasarathy, and Xia Ning. 2021.  HAM: Hybrid Associations Models for Sequential Recommendation.  _IEEE Transactions on Knowledge & Data Engineering_ 01 (2021), 1–1.
  * Qian et al. (2021) Chen Qian, Fuli Feng, Lijie Wen, and Tat-Seng Chua. 2021\.  Conceptualized and Contextualized Gaussian Embedding. In _Proceedings of the AAAI Conference on Artificial Intelligence_ , Vol. 35. 13683–13691.
  * Quadrana et al. (2017) Massimo Quadrana, Alexandros Karatzoglou, Balázs Hidasi, and Paolo Cremonesi. 2017\.  Personalizing session-based recommendations with hierarchical recurrent neural networks. In _proceedings of the Eleventh ACM Conference on Recommender Systems_. 130–137.
  * Rendle et al. (2009) Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. 2009.  BPR: Bayesian personalized ranking from implicit feedback. In _Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence_. 452–461.
  * Rendle et al. (2010) Steffen Rendle, Christoph Freudenthaler, and Lars Schmidt-Thieme. 2010\.  Factorizing personalized markov chains for next-basket recommendation. In _Proceedings of the 19th international conference on World wide web_. 811–820.
  * Sachdeva et al. (2019) Noveen Sachdeva, Giuseppe Manco, Ettore Ritacco, and Vikram Pudi. 2019.  Sequential variational autoencoders for collaborative filtering. In _Proceedings of the twelfth ACM international conference on web search and data mining_. 600–608.
  * Shen et al. (2023a) Xin Shen, Kyungdon Joo, and Jean Oh. 2023a.  FishRecGAN: An End to End GAN Based Network for Fisheye Rectification and Calibration.  arXiv:2305.05222 [cs.CV]
  * Shen et al. (2023b) Xin Shen, Xiaonan Zhao, and Rui Luo. 2023b.  Semantic Embedded Deep Neural Network: A Generic Approach to Boost Multi-Label Image Classification Performance.  arXiv:2305.05228 [cs.CV]
  * Shen et al. (2023c) Xin Shen, Yan Zhao, Sujan Perera, Yujia Liu, Jinyun Yan, and Mitchell Goodman. 2023c.  Learning Personalized Page Content Ranking Using Customer Representation.  arXiv:2305.05267 [cs.IR]
  * Sun et al. (2019) Fei Sun, Jun Liu, Jian Wu, Changhua Pei, Xiao Lin, Wenwu Ou, and Peng Jiang. 2019.  BERT4Rec: Sequential recommendation with bidirectional encoder representations from transformer. In _Proceedings of the 28th ACM international conference on information and knowledge management_. 1441–1450.
  * Tang and Wang (2018) Jiaxi Tang and Ke Wang. 2018.  Personalized top-n sequential recommendation via convolutional sequence embedding. In _Proceedings of the eleventh ACM international conference on web search and data mining_. 565–573.
  * Tanjim et al. (2020) Md Mehrab Tanjim, Congzhe Su, Ethan Benjamin, Diane Hu, Liangjie Hong, and Julian McAuley. 2020\.  Attentive sequential models of latent intent for next item recommendation. In _Proceedings of The Web Conference 2020_. 2528–2534.
  * Van der Maaten and Hinton (2008) Laurens Van der Maaten and Geoffrey Hinton. 2008.  Visualizing data using t-SNE.  _Journal of machine learning research_ 9, 11 (2008).
  * Wang et al. (2021) Xiang Wang, Tinglin Huang, Dingxian Wang, Yancheng Yuan, Zhenguang Liu, Xiangnan He, and Tat-Seng Chua. 2021.  Learning intents behind interactions with knowledge graph for recommendation. In _Proceedings of the Web Conference 2021_. 878–887.
  * Wu et al. (2020) Liwei Wu, Shuqing Li, Cho-Jui Hsieh, and James Sharpnack. 2020\.  SSE-PT: Sequential recommendation via personalized transformer. In _Fourteenth ACM Conference on Recommender Systems_. 328–337.
  * Xie et al. (2021) Zhe Xie, Chengxuan Liu, Yichi Zhang, Hongtao Lu, Dong Wang, and Yue Ding. 2021\.  Adversarial and contrastive variational autoencoder for sequential recommendation. In _Proceedings of the Web Conference 2021_. 449–459.
  * Yang et al. (2021) Yatao Yang, Biyu Ma, Jun Tan, Hongbo Deng, Haikuan Huang, and Zibin Zheng. 2021\.  FINN: Feedback Interactive Neural Network for Intent Recommendation. In _Proceedings of the Web Conference 2021_. 1949–1958.
  * Yu et al. (2023) Yue Yu, Rongzhi Zhang, Ran Xu, Jieyu Zhang, Jiaming Shen, and Chao Zhang. 2023\.  Cold-Start Data Selection for Few-shot Language Model Fine-tuning: A Prompt-Based Uncertainty Propagation Approach.  arXiv:2209.06995 [cs.CL]
  * Zhang et al. (2019) Tingting Zhang, Pengpeng Zhao, Yanchi Liu, Victor S Sheng, Jiajie Xu, Deqing Wang, Guanfeng Liu, and Xiaofang Zhou. 2019\.  Feature-level Deeper Self-Attention Network for Sequential Recommendation.. In _IJCAI_. 4320–4326.
  * Zhao et al. (2021) Jing Zhao, Pengpeng Zhao, Lei Zhao, Yanchi Liu, Victor S Sheng, and Xiaofang Zhou. 2021\.  Variational self-attention network for sequential recommendation. In _2021 IEEE 37th International Conference on Data Engineering (ICDE)_. IEEE, 1559–1570.
  * Zheng et al. (2019) Lei Zheng, Chaozhuo Li, Chun-Ta Lu, Jiawei Zhang, and Philip S Yu. 2019.  Deep Distribution Network: Addressing the Data Sparsity Issue for Top-N Recommendation. In _Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval_. 1081–1084.
  * Zhu et al. (2020) Nengjun Zhu, Jian Cao, Yanchi Liu, Yang Yang, Haochao Ying, and Hui Xiong. 2020\.  Sequential modeling of hierarchical user intention and preference for next-item recommendation. In _Proceedings of the 13th International Conference on Web Search and Data Mining_. 807–815.