# Deduplikacja semantyczna (po embeddingach)

EN: **Semantic deduplication with embeddings** · id `semanticdedup` · aliases: embedding-based deduplication, semantic dedup, deduplikacja semantyczna, deduplikacja po znaczeniu

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Dane dla AI](https://aiatlasgraph.com/t/data.md) › [Czyszczenie i jakość](https://aiatlasgraph.com/t/cleaning.md) › [Deduplikacja i dekontaminacja](https://aiatlasgraph.com/t/dedup.md) › Deduplikacja semantyczna (po embeddingach)

## Description

- PL: Usuwanie semantycznych prawie-duplikatów przez klastrowanie embeddingów z wytrenowanego modelu i odcięcie par powyżej progu podobieństwa.
- EN: Removing semantic near-duplicates by clustering embeddings from a pretrained model and pruning pairs above a similarity threshold.

## In one sentence

- PL: Usuwanie przykładów, które nie są kopiami, ale znaczą prawie to samo, np. to samo zdjęcie w innym kadrze.
- EN: Removing examples that are not copies but mean nearly the same, like the same photo cropped differently.

## Problem it solves

- PL: Zwykłe porównanie znaków nie wyłapie parafraz i przyciętych zdjęć, więc model marnuje czas na te same treści.
- EN: Plain character matching misses paraphrases and cropped photos, so a model wastes time on the same content.

## What it does

- PL: Zamienia każdy przykład na punkt na mapie znaczeń i z ciasnych skupisk zostawia tylko po jednym przedstawicielu.
- EN: It turns each example into a point on a map of meaning and keeps just one representative from each tight cluster.

## Everyday example

- PL: Z tysiąca prawie identycznych zdjęć tej samej wieży w zbiorze zostaje kilka, a trening trwa krócej.
- EN: Of a thousand near-identical photos of the same tower, only a few stay in the collection, and training is shorter.

## This concerns you if you…

- PL: twój zbiór puchnie od podobnych przykładów
- PL: chcesz skrócić trening bez utraty jakości
- EN: your dataset is bloated with similar examples
- EN: want shorter training without losing quality

## Keywords

SemDeDup · D4 · k-means clustering · FAISS · cosine similarity threshold · NeMo Curator

## How it works

- PL: Każdy przykład koduje się wytrenowanym enkoderem, embeddingi grupuje k-średnimi, a w obrębie klastra liczy podobieństwa kosinusowe par. Z par powyżej progu zostaje jeden przykład. Na webowych zbiorach obraz–tekst pozwala to usunąć dużą część danych przy niewielkiej stracie jakości i krótszym treningu.
- EN: Each example is encoded with a pretrained encoder, embeddings are grouped with k-means, and pairwise cosine similarities are computed within clusters. From pairs above a threshold one example is kept. On web image–text data this removes a large share of data with little quality loss and shorter training.

## Limits

- PL: Wynik zależy od enkodera: co dla niego „to samo”, może różnić się istotnymi szczegółami. Liczenie embeddingów dla miliardów przykładów kosztuje, a zbyt niski próg wycina rzadkie warianty.
- EN: Results depend on the encoder: what it sees as “the same” may differ in important details. Embedding billions of examples is costly, and too low a threshold removes rare variants.

## Key terms

- PL: **embedding**: Wektor liczb opisujący znaczenie przykładu; podobne znaczenia leżą blisko.
- PL: **k-średnie**: Algorytm dzielący punkty na zadaną liczbę skupisk.
- EN: **embedding**: Number vector describing an example's meaning; similar meanings lie close.
- EN: **k-means**: Algorithm splitting points into a chosen number of clusters.

## Know first

- [Embeddingi zdań i dokumentów (modele embeddingowe) (Sentence and document embeddings (embedding models))](https://aiatlasgraph.com/t/textembeddings.md)
- [Klasteryzacja (Clustering)](https://aiatlasgraph.com/t/clustering.md)

## Sources

- [SemDeDup: Data-efficient learning at web-scale through semantic deduplication](<https://arxiv.org/abs/2303.09540>) `abbas-2023-semdedup` · by Amro Abbas, Kushal Tirumala, Dániel Simig, Surya Ganguli, Ari S. Morcos

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/semanticdedup · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
