Shadowing Practice: Recommendation System Infra Basics 1 - Learn English Speaking with Video

Kies een oefenmodus

Elke modus opent een volledig scherm oefenruimte.

131 zinnen
Als zinnen te kort of te lang zijn, klik op Bewerken om ze aan te passen.
1
Hey everyone, we're trying something new with shorter form content to teach you important concepts.
2
This is a bit different than our longer form problem breakdowns or deep dives, but I'm hoping you learned something new and it helps you to grow as an engineer.
3
Let us know what you think in the comments if we should be doing more of this.
4
Today, I want to make a quick video to walk you through some of the architecture behind recommendation systems.
5
This isn't going to be an ML focus video, we'll get to those later, but I wanted to share a few of the techniques used in modern systems
6
because they end up being broadly useful in designing systems that both operate at scale and don't necessarily have correct answers.
7
Just to be clear, I'm focusing on the software engineering side here.
8
If you think about recommendation systems, they usually have a pretty simple objective.
9
You have a user and you want to find all the things that we might think the user is going to want.
10
This might be YouTube videos or a buyable item on an e-commerce platform or social media posts or whatever.
11
There's really two big challenges here.
12
First, how can we know what the user wants?
13
That seems ill-defined and might require a bunch of different input.
14
What do we know about the items?
15
What do we know about the user?
16
What about their relationships?
17
Fundamentally, this is an ML problem and I'm going to skip it for now
18
because it's not the thrust of what we want to focus on for this video.
19
But the second item is pressing.
20
How do we make this system scale?
21
If we have billions of videos or trillions of posts, how can we possibly find the one the user actually wants in a reasonable amount of time?
22
This seems like an especially hard needle in a haystack problem, and it is.
23
But this isn't about making machine learning models run fast.
24
There's more to it.
25
Let me illustrate the problem quickly for video recommendations and then we'll move on to some solutions.
26
If you were to approach this problem, you might start with a blackbox ml function, which takes a user and a video and tells me how likely the user is to watch the video.
27
In this case, my black box outputs a score after several milliseconds.
28
This is an important building block which will tell me that a given user will hate this particular cat video, but love Evan's Ticketmaster breakdown.
29
Great!
30
With this function available, I can now try to make my recommendation system.
31
Let's apply this function to every video in the catalog.
32
This will give us a score for every possible video.
33
We can then sort the scores and return the video which is most likely to be watched.
34
But wait, billions of videos means I need to run through my ML black box billions of times.
35
This means I need a ton of time, maybe two weeks to figure out the best video for them to watch.
36
Crap, that's not going to work.
37
Since this is really slow, maybe we take it offline.
38
Let's pre-calculate our recommendations for each user and then when they come online we can feed them out of a cache.
39
Easy, right?
40
No, if we have billions of items and billions of users, suddenly we need a data center the size of Texas in order to make recommendations.
41
This is untenable and it's slow.
42
I don't want to wait two weeks after I register for my TikTok videos to start streaming in.
43
Okay, okay, you get the gist.
44
So we need to do a little trickery here and the naive approach won't work.
45
Modern recommendation systems really have three stages.
46
Candidate generation, ranking and re-ranking.
47
What we've been talking about so far is ranking.
48
Taking a bunch of videos and applying an ML model to score them, which results in an ordering for us to return to our clients.
49
But ranking can't really scale to billions of possibilities, as we've just seen.
50
It's just too time consuming and resource intensive.
51
We need a better way.
52
Enter candidate generation.
53
Candidate generation is a simple idea.
54
We know some classes of videos are much more likely to be watched than others.
55
As an example, if I'm subscribed to MrBeast, it's likely that I'm going to watch other videos he creates.
56
Similarly, the most viewed videos on the platform have very broad appeal.
57
If you wanted a dead simple recommendation system, you'd just take the top videos in the platform and feed those to users on a loop.
58
That's still how radio works today.
59
But we can do a bit better now that we have our ranker.
60
We'll take each of these heuristics that we just talked about and call them candidate generators.
61
A candidate generator will take in some information about the user to generate a list of candidates
62
or videos we think the user will want to watch.
63
We can union together all of the candidates from each of the candidate generators.
64
Then we'll take our ML function we had earlier, which we now call a Ranker, to score each of these candidates.
65
Since we now have order a thousand rather than a billion items, this is much more tractable.
66
The videos that emerge with the highest scores are the ones that we want to recommend.
67
And as long as our candidate generators are reasonably exhaustive, this approximates the much more expensive system.
68
I'll say it again for emphasis here.
69
we're taking some heuristics to cut the problem down and make it more feasible.
70
We don't have to rank every video ever to get good results.
71
That's the essence of candidate generation.
72
Before we move on, there's one other type of candidate generator which is worth discussing.
73
The top videos on the platform or videos from channels I've subscribed to are pretty easy to get.
74
We can do this with basic database queries.
75
But how can I build candidate generators for things like a video similar to the one I just liked
76
or videos watched by users like me?
77
The answer to this is to use what are called embeddings or vector of numbers.
78
I'm going to simplify a bit and invoke the black box of ML here.
79
But let's pretend we have a function which takes in an input, in this case a video, and outputs an embedding or a series of numbers.
80
These numbers are special in that videos with smaller distance, you could think of this like distance in 3D space here, have some property.
81
It could be that we've trained our model, our black box, so that videos which are liked by similar users are clustered together.
82
Or we could try to group them semantically based on their content, like I've done here.
83
Or we could try to find videos which irritated the same people, the options are literally What we can see is that the cat video and dog video have smaller distance.
84
If you calculate the Euclidean distance in 3D space, then the cat video and a chess match,
85
they aren't as semantically similar as the cat video and the dog video.
86
Just like before, if we want to find the smallest distance, our most naive approach is to calculate the distance between our input video and every other video in the catalog.
87
This is way too slow, but it's going to find the video that is most semantically similar or liked by similar users or whatever.
88
A more efficient way to do this is we can generate embeddings for our entire catalog of videos, including the new ones that are created.
89
Once we have embeddings, we store them in a vector database.
90
Popular options here include commercial offerings like Pinecone or open source solutions like Face or In this case,
91
I want all my videos together with their embeddings in this database.
92
Vector databases are optimized with algorithms like hierarchical navigable small worlds, which enable very fast approximate nearest neighbor search.
93
Basically, they're much, much faster than trying to calculate distances on each item.
94
With my database constructed, I can query it.
95
So for videos similar to the one I just liked,
96
I'll grab the embedding for that video I just liked and query the database for the nearest neighbors of that embedding.
97
This will return to me the IDs of all the videos which have embeddings with small distance to my input.
98
In effect, my database now answers which videos are similar to this one.
99
Those are my candidates, which I can feed to my ranker just like I fed the top 100 most viewed platform videos.
100
I can have separate tables or databases for each style of embedding.
101
So I can have a separate database of users to answer questions about videos liked by users similar to me.
102
It's common inside ranking and recommendation systems to have dozens of these indexes
103
or candidate generators and managing them is an important problem for the software engineers working on these systems.
104
That's candidate generation.
105
Now that we've completed candidate generation and hand-waved past ranking, we'll get to that later, let's talk briefly about re-ranking.
106
There are a lot of behaviors of recommendation systems that we want to tweak.
107
We probably want to give new videos a boost so
108
that they get a chance to get exposure and for us to learn about them.
109
This is fundamental to the trade-off between exploration and exploitation.
110
We not only want to show you the video you're most likely to like, but we also want to expand your horizons a bit.
111
We also want to make sure we're not recommending videos that a user has blocked or they might be sensitive to.
112
Adjusting the full recommendation stack for each of these use cases would be really expensive.
113
If we needed special indexes that don't contain videos from creators the user is blocked, that candidate generator is much less efficient.
114
Instead, in the re-ranking phase, we're going to apply tweaks post hoc.
115
If we need to provide the user with 10 ordered recommendations,
116
our ranking stage might produce 25 and our re-ranking stage can reorder or remove based on business rules,
117
privacy settings, etc. This is actually an implementation of a very common pattern you'll see in real-world system design
118
and it applies to search engines, privacy solutions, ranking systems and more.
119
Sometimes it's easier to design for the 99% case
120
and have a layer to fudge the final results
121
and make them how you want rather than build a system which solves 100% of the problem.
122
I'm going to stop there from going too long.
123
There's obviously a lot more we can get into.
124
Let me know if you want to see more in the comments.
125
But just to recap some key points here, we've covered how a multi-stage architecture, in this case using candidate generation,
126
enables scalability for massive systems and makes seemingly impossible problems possible.
127
Next, we showed how you can use embeddings and vector search to solve fuzzy problems cheaply.
128
And finally, we showed how production systems are often layered with fine-grained adjustments applied at the last level.
129
This makes problems more tractable.
130
I hope you found this video valuable and if you'd like more please subscribe.
131
Otherwise until next time talk to you later.

App downloaden

Alles wat je nodig hebt om vloeiend te spreken

AI UitspraakScoor elke zin
IPA OefeningBeheers elk geluid
WoordenschatBouw je woordenschat op
WoordenspelLeren terwijl je speelt

Zelfde Kanaal

FOR YOU

Aanbevolen Video

Woordenschat en spreektips bij deze les

Deze spreekles op niveau C1 is gebaseerd op de video “Recommendation System Infra Basics 1”. Deze woorden komen het vaakst terug: user, candidate, recommendation, ranking, embedding. Deze video bevat 131 zinnen en 1909 woorden om na te spreken. Het gesproken deel duurt 9:44. De spreker praat snel, ongeveer 196 woorden per minuut, dus reken op verbonden en ingeslikte klanken. 83% van de woorden hoort bij de 3.000 meest gebruikte Engelse woorden; de rest kun je beter vooraf bekijken.

Belangrijke woorden in deze video

De 15 moeilijkste woorden uit de video, met uitspraak en betekenis:

WoordUitspraakBetekenis
recommendation zelfstandig naamwoord/ˌɹɛkəmɛnˈdeɪʃən/aanbeveling, recommandatie
generator zelfstandig naamwoord/ˈdʒɛnəɹeɪtə(ɹ)/generator
embed werkwoord/ɪmˈbɛd/vastleggen, inbedden
calculate werkwoord/ˈkælkjʊleɪt/berekenen, uitwerken
vector zelfstandig naamwoord/ˈvɛktɚ/vector
query zelfstandig naamwoord/ˈkwɪɹ.i/vraag, verzoek
catalogue zelfstandig naamwoord/ˈkæt.əˌlɔɡ/catalogus, cataloog
subscribe werkwoord/səbˈskɹaɪb/abonneren
heuristic bijvoeglijk naamwoord/hjuˈɹɪstɪk/heuristisch
tweak zelfstandig naamwoord/twiːk/bijstelling
approximate bijvoeglijk naamwoord/əˈpɹɑk.sə.mət/benaderend
naive bijvoeglijk naamwoord/naɪˈiv/naïef, tegen beter weten in
exhaustive bijvoeglijk naamwoord/ɪɡˈzɔstɪv/volledig
haystack zelfstandig naamwoord/ˈheɪˌstæk/hooiberg
hierarchical bijvoeglijk naamwoord/ˌhaɪəˈɹɑːkɪkəl/hiërarchisch

Phrasal verbs die je zult horen

WoordBetekenis
end up werkwoordbelanden, terechtkomen
figure out werkwoorduitvogelen, er achter komen

Zinnen om te herhalen

Korte, volledige zinnen uit de video die je in alledaagse gesprekken kunt gebruiken:

  • First, how can we know what the user wants?
  • What do we know about the items?
  • What do we know about the user?
  • How do we make this system scale?
  • What we've been talking about so far is ranking.

Grammatica in deze video

De structuren die de spreker het meest gebruikt, met de exacte woorden uit de video:

StructuurIn de video
Lijdende vorm be + voltooid deelwoord — het gaat om wat er gebeurt, niet om wie het doetbe watched · are called · are liked
Present perfect have/has + voltooid deelwoord — iets uit het verleden dat nu nog teltwe've just seen · I've subscribed · we've trained
Betrekkelijke bijzinnen who / which + zin — extra informatie over een persoon of dingblock which will · video which is · generator which is

Uitspraak om op te letten

De spreker gebruikt 39 samentrekkingen en verkorte vormen, zoals I'm, we'll, we've. Spreek ze kort uit, zoals je ze hoort.

  • De “th”-klanken: thrust /θɹʌst/, algorithm /ˈælɡəɹɪðm̩/
  • De klanken “sh” en “zh”: recommendation /ˌɹɛkəmɛnˈdeɪʃən/, cache /kæʃ/, exploitation /ˌɛksplɔɪˈteɪʃn̩/
  • Lange woorden — let op de klemtoon: recommendation /ˌɹɛkəmɛnˈdeɪʃən/, generator /ˈdʒɛnəɹeɪtə(ɹ)/, approximate /əˈpɹɑk.sə.mət/, hierarchical /ˌhaɪəˈɹɑːkɪkəl/, millisecond /ˈmɪlɪˌsɛkənd/

Klanken die Nederlandstaligen lastig vinden:

  • Stemhebbende eindmedeklinker — /b/, /d/, /g/, /z/, /v/ niet verscherpen: embed /ɪmˈbɛd/, catalogue /ˈkæt.əˌlɔɡ/, subscribe /səbˈskɹaɪb/, naive /naɪˈiv/, exhaustive /ɪɡˈzɔstɪv/
  • /æ/ — opener dan de Nederlandse “e”: calculate /ˈkælkjʊleɪt/, catalogue /ˈkæt.əˌlɔɡ/, tractable /ˈtɹæk.tə.bəl/, haystack /ˈheɪˌstæk/, navigable /ˈnævɪɡəbəl/
  • /g/ — een harde plofklank, geen Nederlandse “g”: catalogue /ˈkæt.əˌlɔɡ/, exhaustive /ɪɡˈzɔstɪv/, navigable /ˈnævɪɡəbəl/, algorithm /ˈælɡəɹɪðm̩/

Zo oefen je met deze video

  1. Luister de hele video één keer zonder te spreken en noteer de woorden die je niet kent.
  2. Begin op 0,75× snelheid, spreek zin voor zin na en ga terug naar normale snelheid zodra het makkelijk gaat.
  3. Neem jezelf op en vergelijk met het origineel; let daarbij op woorden als recommendation, generator, embed.

Wat is de Shadowing-techniek?

Shadowing is een wetenschappelijk onderbouwde taalleermethode die oorspronkelijk is ontwikkeld voor professionele tolkentraining en gepopulariseerd door polyglot Dr. Alexander Arguelles. De methode is eenvoudig maar krachtig: je luistert naar native Engelse audio en herhaalt het onmiddellijk hardop — als een schaduw die de spreker volgt met slechts 1–2 seconden vertraging. In tegenstelling tot passief luisteren of grammaticadrills, dwingt shadowing je hersenen en mondspieren om echte spraakpatronen tegelijkertijd te verwerken en te reproduceren. Onderzoek toont aan dat het de uitspraaknauwkeurigheid, intonatie, ritme, verbonden spraak, luisterbegrip en spreekvaardigheid aanzienlijk verbetert — waardoor het een van de meest effectieve methoden is voor IELTS Speaking-voorbereiding en echte Engelse communicatie.

Shadowing-techniek: lees de volledige stap-voor-stap-gids →