Hello everyone! My name is Sasha, I am CTO & Co-Founder at LoyaltyLab. Two years ago, I went with friends, like all poor students, in the evening for a beer to the nearest convenience store. We were very upset that the retailer, knowing that we would come for a beer, did not offer a discount on chips or crackers, although this is so logical! We did not understand why this situation was happening and decided to make our company. Well, as a bonus, write yourself discounts every Friday for the very chips.
![image](https://habrastorage.org/webt/8i/l_/fj/8il_fjdqcdscdkmkymoijiscvrk.jpeg)
And it all went so far that I speak at NVIDIA GTC with material on the technical side of the product . We are happy to share our best practices with the community, so I am posting my report in the form of an article.
Introduction
Like everything at the beginning of the journey, we started with a review of how recommendation systems are made. And the most popular was the architecture of the following type:
![image](https://habrastorage.org/webt/p1/ys/ih/p1ysihudcy4mrcr19wauvqncwua.png)
:
- , .
- c .
:
- candidate/ β user-product, .
- candidates extraction/extractor/ β β β .
. β ALS. , , . , , . , ALS, baselineβ.
, , , realtime , , 30 , , , . , , , , β , .
baseline , ALS . , , :
- Precision β .
- Recall β , target .
- F1-score β F-, .
. 3 :
- precision@5 β -5 .
- response-rate@5 β ( 5 ).
- avg roc-auc per user β roc-auc .
, time-series -, k , test k+1 . / . -, β . , .
, , baseline, ALS .
:
![image](https://habrastorage.org/getpro/habr/post_images/07f/379/634/07f379634f5e6798b45598ac77bd6e1c.png)
:
![image](https://habrastorage.org/webt/em/zh/7w/emzh7wf3h0l4izudamg0cgkrs9o.png)
, . , , , , β , β. , , :
- .
- , .
- .
- /.
- ( ).
- , , (Word2Vec, DSSM, etc.).
, . , K ( 1-3 ), K . , :
![image](https://habrastorage.org/webt/jb/bz/hy/jbbzhyad6oi5gprlueoi6n4mp6m.png)
, , , recall precision . β 2 β.
,
, β β , , , - . . , ALS, , . β β , , / , , , , , . 2 :
![image](https://habrastorage.org/webt/hp/wp/cu/hpwpcuio0qtrkusiejnuxatm2eg.png)
k β , 14 .
, , .
, - . , //. , - . β , k . , . :
![image](https://habrastorage.org/webt/wt/tu/rs/wttursimwerbrz3zg1pufwkwty0.png)
, , , . :
![image](https://habrastorage.org/webt/zn/ym/os/znymostug2fwhg-u6gf94ypjile.png)
2 , :
- , , K .
- , .
, :
![image](https://habrastorage.org/webt/uf/rl/ni/ufrlnixb_wn7giniixxal-kxkie.png)
ft β , K ( K=5)
tm β ,
, (0, 0) recall precision, . , , k , .
β , . -k ββ / ββ /. ββ ββ . . , , , . . :
![image](https://habrastorage.org/webt/lo/qv/qp/loqvqpkcwsduv1jin48dn-atvjm.png)
βcategoryβ .
, , , ββ .
, β . 2 , [ i]-[ j], j > i, . producti-productj , producti . -k , . :
![image](https://habrastorage.org/webt/qn/1h/7g/qn1h7g6w7ib6as34ovdoq1zzebu.png)
:
![image](https://habrastorage.org/webt/fo/jf/sn/fojfsnnjafpwug6l3qtnbichbpe.png)
, : , , . , , , .
:
![image](https://habrastorage.org/webt/4h/uv/mw/4huvmwolwo88lip-xcoz3v4w_ms.png)
k β , .
, k=4. 4 .
, ,
β , . 3:
- ALS
- Word2Vec (Item2Vec )
- DSSM
ALS , , . Word2Vec, gensim. , , . , , ββ ( ). ecommerce , Ozon. DSSM . Microsoft, , research paper. :
![image](https://habrastorage.org/webt/zb/xn/n5/zbxnn56hdkgqf5mpygm8amvfyiw.png)
Q β query, , D[i] β document, -. , . (multilayer perceptron). , .
, , β . :
![image](https://habrastorage.org/webt/zx/c3/qg/zxc3qg_qwpw9-jnot_4etg_sj80.png)
β ALS DSSM , Word2Vec . 3 :
- , , .
- .
- TF-IDF .
, , , , . 1, , Β½, β
, .:
![image](https://habrastorage.org/webt/il/s5/j4/ils5j4ul2kodk-7jgf4waxcarcs.png)
TF-IDF , TF-IDF , , , , β . , . :
![image](https://habrastorage.org/webt/r8/b1/sa/r8b1say3j7ime-mbrirxz4xq14a.png)
. ALS:
![image](https://habrastorage.org/webt/xz/1a/jk/xz1ajkhsu_zhylaw0l29bxa91bm.png)
Item2Vec :
![image](https://habrastorage.org/webt/hr/gh/w9/hrghw9cp9d4qe7juxjfcdfrcnoa.png)
, baseline. , k . , , 50-70 .
DSSM:
![image](https://habrastorage.org/webt/dx/mu/zp/dxmuzpry5qr27x0qdru5w9nwanm.png)
?
, , ? ? :
- - . , , , .
- ?
, : , . , , , β β β β.
, , : (recall). , , . .
![image](https://habrastorage.org/webt/lc/zm/ec/lczmecnenayn88z0kakkecslfjq.png)
β , recall β . 2 , :
, Β«, Β» , . , β β . , . , .
:
![image](https://habrastorage.org/webt/fg/_i/3q/fg_i3qwyamwq1kav4qo4dreufhg.png)
:
![image](https://habrastorage.org/webt/3c/wf/c3/3cwfc3duictsz4gpwbwqdwwqhug.png)
, , . , , , . , . , , :
- / .
- .
- .
, , . , . . , :
- / .
- , . , -.
- , , .
:
![image](https://habrastorage.org/webt/0d/3_/_p/0d3__pctiv04yhmht56zfjwb2og.png)
overall products conversion β , .
. , , , . , , .
, , , , β 3-4%:
![image](https://habrastorage.org/webt/bf/9z/xx/bf9zxxhzhlztrokvhdkeyig2jes.png)
, , realtime , . , .
, . telegram. AI/ telegram β welcome :)