Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAnonymous Official: I'm begging you to understand this..(20.09.2026 um 21:30 Uhr)
Sichere ProgrammierungHow to Monitor Cron Jobs with a Simple HTTP Health Check(20.09.2026 um 23:14 Uhr)
Sichere ProgrammierungWhy my builds don't run on my laptop(20.09.2026 um 23:15 Uhr)
Sichere ProgrammierungDesigning offline-first when there's no server(20.09.2026 um 23:16 Uhr)
Sichere ProgrammierungSearching for Better Game Recommendations with Jev(20.09.2026 um 23:19 Uhr)
Linux Tipps & HardeningUbuntu 26.10 stops low memory from killing your desktop session(20.09.2026 um 19:55 Uhr)
YouTube Security VideosAnonymous Official: I'm begging you to understand this..(20.09.2026 um 21:30 Uhr)
Sichere ProgrammierungHow to Monitor Cron Jobs with a Simple HTTP Health Check(20.09.2026 um 23:14 Uhr)
Sichere ProgrammierungWhy my builds don't run on my laptop(20.09.2026 um 23:15 Uhr)
Sichere ProgrammierungDesigning offline-first when there's no server(20.09.2026 um 23:16 Uhr)
Sichere ProgrammierungSearching for Better Game Recommendations with Jev(20.09.2026 um 23:19 Uhr)
Linux Tipps & HardeningUbuntu 26.10 stops low memory from killing your desktop session(20.09.2026 um 19:55 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How to Embed User Preferences

Reagiere als Erste:r — dein Feedback zählt!

An embedding isn’t just useful for search — it’s also a powerful way to represent user preferences.

Think about how a feed works, like on YouTube. How do you recommend content to someone who loves funny cat videos versus someone who’s into programming tutorials?

Funny cat

Each video usually has tags, right? We can convert those tags into embeddings — mathematical representations of the video’s content.

Once everything is represented as embeddings, we can calculate similarity scores between the user's interests and available content.

But here’s the catch: if a user interacts with multiple videos, how do we combine those interests into a single preference embedding?

The answer: use a decay technique.

This means that recent interactions weigh more, while older ones slowly lose influence over time.

The code is as simple as it sounds.

First, you’ll need a column to store the user’s preference embedding — basically, a vector that represents their tastes.
👉 If you don’t know how to create one, check my previous tutorial! 😄

Now, let’s talk about the decay factor. I usually keep it between 0.1 and 0.25, meaning that we preserve 90% to 75% of the current preferences and update the rest based on the user’s latest action.

💡 Tip: If it’s the user’s first time, just save the embedding as is — no decay needed.

Here’s the full code:

const decayFactor = 0.1;
const decayEmbedding = preferenceEmbedding.map((value, index) => {
  return value * (1 - decayFactor) + actionEmbedding[index] * decayFactor;
});

That’s it. Simple and effective.

Now, every time the user interacts with something — like watching a video or clicking on a product — you update their embedding using this formula.

Then, when they visit the feed, you simply run a similarity search based on their latest preferences.

A pro tip I highly recommend (and personally use) is to cache the user’s preference embedding using Redis, so you don’t need to fetch or compute it from scratch every time.

And guess what? That’ll be the topic of my next post.

See you soon, folks! 🚀

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Embed User Preferences

Thematisch verwandte Begriffe: Embed, User, Preferences · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick