1 of 35

Bridging Search and Recommendation in Generative Retrieval

Marco

Ali

Enrico

Hugues

Gustavo

2 of 35

Retrieval task

For a given textual query retrieve K items out of the entire corpus.

workout music

query

Item collection

Model

1

2

K

3 of 35

Recommendation task

Given the previous history of item interactions from a user retrieve K items out of the entire corpus.

Item collection

Model

1

2

K

user

item_1→ item_3→ item_4

4 of 35

Dense vs generative approaches

5 of 35

Dense models: bi-encoder (search)

bi-encoder

Item collection

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ↓

→ Embedding dim (e.g. 512)

Can be done offline

6 of 35

Dense models: bi-encoder (search)

bi-encoder

Item collection

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ↓

→ Embedding dim (e.g. 512)

workout music

bi-encoder

0.02

0.01

0.09

query

Embedding dim (e.g. 512) →

online/cache

7 of 35

Dense models: bi-encoder (search)

bi-encoder

Item collection

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ↓

→ Embedding dim (e.g. 512)

workout music

bi-encoder

0.02

0.01

0.09

query

Find closest items

Embedding dim (e.g. 512) →

8 of 35

Dense models: bi-encoder (search)/two-tower (rec.)

bi-encoder

two-tower

Item collection

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ↓

→ Embedding dim (e.g. 512)

workout music

“Gustavo Penha”

(previous interactions: item1, item2, etc..)

Items ↓

→ Embedding dim (e.g. 512)

bi-encoder

0.02

0.01

0.09

two-tower

query

user

Find closest items

Find closest items

Embedding dim (e.g. 512) →

Embedding dim (e.g. 512) →

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

0.02

0.01

0.09

Recommendation pipeline can be quite similar

9 of 35

Generative retrieval and recommendation

“workout music”

Gen retrieval

Gen recs

query

Items ( |item collection| )

bi-encoder

two-tower

Item collection

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ↓

→ Embedding dim (e.g. 512)

Items ↓

→ Embedding dim (e.g. 512)

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ( |item collection| )

user

Not needed with generative retrieval

“Gustavo Penha”

(previous interactions: item1, item2, etc..)

“Extreme classification problem”

10 of 35

Generative retrieval and recommendation

“workout music”

Gen retrieval

Gen recs

query

Items ( |item collection| )

bi-encoder

two-tower

Item collection

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ↓

→ Embedding dim (e.g. 512)

Items ↓

→ Embedding dim (e.g. 512)

0.01

0.03

0.50

0.42

0.54

0.09

0.31

0.03

0.00

Items ( |item collection| )

user

This work:

joint learning

“Gustavo Penha”

(previous interactions: item1, item2, etc..)

11 of 35

Joint generative model

12 of 35

Generative retrieval

LM

“bossa nova music”

query

Tokenizer

item1

relevant item

ID strategy

labels

<item_1>

bossa nova music

(4 tokens)

(1 token)

In this work we used ‘atomic IDs’, so each item has its own token

new_vocab_size = vocab_size + num_items

13 of 35

Generative recommendation

Tokenizer

LM

item3→ item4→ item2

user

ID strategy

labels

<item_3> <item_4> <item_2>

<item_1>

(3 tokens)

(1 token)

item1

relevant item

‘atomic ids’

14 of 35

Generative retrieval and recommendation

LM

“bossa nova music”

query

Tokenizer

item1

relevant item

item3→ item4→ item2

user

ID strategy

labels

labels

<item_3> <item_4> <item_2>

<item_1>

<item_1>

bossa nova music

(4 tokens)

(3 tokens)

(1 token)

(1 token)

item1

relevant item

Joint model: same LM and multi-task learning

15 of 35

But why would joint training improve effectiveness?

16 of 35

Multi-task learning increases effectiveness over single-task models if tasks are similar

But what does it mean for two tasks to be similar?

17 of 35

Let’s try to be more specific for search and recommendation…

Hypothesis 1 Regularization of item’s popularity estimation.

Hypothesis 2 Regularization of item’s latent representations.

Let’s see some examples to motivate the hypotheses next…

18 of 35

H1 Regularization of item’s popularity estimation

PopSearch

item0

1000

item1

119

item2

3300

item3

10

itemN

11

19 of 35

H1 Regularization of item’s popularity estimation

What if item3 should be retrieved more than what the search train data shows ?

PopSearch

item0

1000

item1

119

item2

3300

item3

10

itemN

11

Due to distribution shifts, incomplete sample of dataset, problems with current search stack, retrievability bias, or other reasons …

20 of 35

H1 Regularization of item’s popularity estimation

The distribution from the recommendation data might regularize the output distribution and fix this gap !

PopSearch

PopRecommendation

item0

1000

1010

item1

119

205

item2

3300

2000

item3

10

1300

itemN

11

9

21 of 35

Search data

Test query: q1

Rel: item3, item5, item1

H2 Regularization of item’s latent representations

Let’s say for this test query the item5 is not very close to the query q1 using the models learned representation, so it would not rank it highly.

item5

22 of 35

Search data

Recommendation data

Test query: q1

Rel: item3, item5, item1

User1: item3item5item1

User2: item3→item9item5

User3: item5item3

H2 Regularization of item’s latent representations

item5

But if we have recommendation data where users often interact with both item3 and item5 we can fix this!

23 of 35

GenS

GenS+R

H2 Regularization of item’s latent representations

item5

item5

The joint model would correctly place item5 close to q1 , as it would be close to item3!

24 of 35

Content-based and collaborative-filtering information

Recommendation ‘similar due to co-interaction’

  • Users that interact with different items can indicate how they are related in other aspects besides their content.

Search similar due to semantics’

  • Broad queries that are relevant to different items can indicate how the content of two items are related.

adventure-filled audiobooks

is relevant to

co-occurs in user profile with

25 of 35

Experiments

26 of 35

Simulated datasets

💡Let’s control variables in simulated search and recommendation datasets to train and test generative models.

H1: Control the divergence between popularity distributions.�

H2: Control co-occurence of items between queries and users.

Let’s look closer into one simulated dataset …

27 of 35

Simulated dataset for H2

S→R

Five clusters of items C0, C1, C2, C3, and C4.

Users only interact with items from a single cluster in the recommendation data.

Recommendation

u1: C0_item_0C0_item_1

u2: C1_item_1C1_item_0

u3 C0_item_3C0_item_2

28 of 35

Simulated dataset for H2

S→R

Five clusters of items C0, C1, C2, C3, and C4.

Users only interact with items from a single cluster in the recommendation data.

�In the search data, queries related to items from a single cluster match according to the variable we are controlling.

Recommendation

Control Variable

Search

u1: C0_item_0C0_item_1

u2: C1_item_1C1_item_0

u3 C0_item_3C0_item_2

0%

C0_item_0: q1, q2, q3, q4

C0_item_1: q5, q6, q7, q8

C0_item_2: q9, q10, q11, q12

C0_item_3: q13, q14, q15, q16

50%

C0_item_0: q1, q2, q3, q4

C0_item_1: q1, q2, q5, q6

C0_item_2: q1, q2, q7, q8

C0_item_3: q1, q2, q9, q10

100%

C0_item_0: q1, q2, q3, q4

C0_item_1: q1, q2, q3, q4

C0_item_2: q1, q2, q3, q4

C0_item_3: q1, q2, q3, q4

Queries for which

the item is relevant to

29 of 35

Results for SIM2

GenR

Effectiveness

Control variable →

0%

25%

50%

75%

100%

If queries are randomly distributed across item clusters (<50%) they just add noise to the task-specific model

GenR+S

30 of 35

Results for SIM2

GenR

GenR+S

Effectiveness

Control variable →

With more queries matching inside each cluster we have effectiveness improvements!

0%

25%

50%

75%

100%

31 of 35

Results for SIM2

The search data helps to learn better representations, which are aligned with the clusters used in this simulation

32 of 35

Real-world datasets

ML: Based on MovieLens 25M. Genres and tags as queries. Ratings to movies from ML25M.

MPD: Based on Million Playlist Dataset. Tracks inside a playlist used as user interactions and playlist titles as queries.

Podcasts: Based on a sample of Spotify search logs (focused on broad queries) and sequential interactions with podcast shows.

movies

music

podcasts

33 of 35

Effectiveness (R@30) for head entities of joint model vs task-specific models

Search

ML

MPD

Podcasts

Generative retrieval

0.053

0.040

0.148

Joint-model

0.060* (+12%)

0.044* (+11%)

0.171* (+16%)

Recommendation

ML

MPD

Podcasts

Generative recommender

0.267

0.269

0.334

Joint-model

0.307* (+15%)

0.333* (+24%)

0.345* (+3%)

34 of 35

Analyses of model predictions (Tables 6 and 7 of paper)

H1 Popularity

The distribution of the predicted entities did not change much when comparing the task-specific vs joint model:

-1.12 % on average in popularity increase across the 3 datasets

H2 Latent representations

The co-occurrences statistics changed significantly when comparing the task-specific vs joint model:

204.63 % on average in co-occurrence increase across the 3 datasets

This indicates that H2 (regularization of item’s representation) might have a bigger impact on the joint model than H1 (regularization of item’s popularity).

35 of 35

Thank you