Embedding
Definition
An embedding is a learned numerical representation of an object—such as a word, sentence, image, user, or product—as a point in a multidimensional vector space.
What it represents
Instead of storing an item only as a name or identifier, an embedding expresses useful features and relationships as a sequence of numbers. Items that are similar in meaning or behavior are generally placed near one another in the vector space, while unrelated items are placed farther apart.
How it is created
A machine-learning model learns embeddings from examples. During training, it adjusts the vector values so they become useful for a particular objective—predicting surrounding words, matching questions with answers, recognizing images, or recommending products. The individual dimensions usually do not have simple human-readable labels; meaning is distributed across the vector as a whole.
Similarity and retrieval
Once objects are embedded, their semantic similarity can be estimated mathematically. Measures such as cosine similarity, dot product, or Euclidean distance compare their vectors. Vector databases use these measurements to retrieve the nearest items efficiently, even when the user's wording does not exactly match the stored text.
Common uses
- Semantic search that retrieves results by meaning rather than exact keywords.
- Retrieval-augmented generation, where relevant documents are selected before an AI model answers.
- Recommendation systems that match users with products, music, films, or other content.
- Clustering, classification, anomaly detection, deduplication, and visualization.
Example
The sentences “How do I reset my password?” and “I cannot access my account” share few exact words, but a good text-embedding model places them close together because they express related intent.
정의
임베딩은 단어, 문장, 이미지, 사용자 또는 상품 같은 대상을 다차원 벡터 공간의 한 점으로 나타내는, 학습된 수치 표현이다.
무엇을 표현하는가
대상을 이름이나 식별자로만 저장하는 대신, 임베딩은 그 대상의 유용한 특징과 관계를 일련의 숫자로 표현한다. 의미나 행동이 비슷한 대상은 일반적으로 벡터 공간에서 서로 가까운 위치에 놓이고, 관련성이 낮은 대상은 더 멀리 떨어진다.
어떻게 만들어지는가
머신러닝 모델은 예시 데이터로부터 임베딩을 학습한다. 학습 과정에서 모델은 주변 단어 예측, 질문과 답변 연결, 이미지 인식, 상품 추천 같은 특정 목표에 유용하도록 벡터 값을 조정한다. 각 차원이 사람이 이해하기 쉬운 하나의 이름을 갖는 경우는 드물며, 의미는 대개 벡터 전체에 분산되어 표현된다.
유사도와 검색
대상을 임베딩으로 변환하면 의미적 유사도를 수학적으로 추정할 수 있다. 코사인 유사도, 내적 또는 유클리드 거리 같은 방법으로 벡터를 비교한다. 벡터 데이터베이스는 이러한 측정값을 사용해 가장 가까운 항목을 효율적으로 검색하므로, 사용자의 표현이 저장된 문장과 정확히 일치하지 않아도 의미가 비슷한 결과를 찾을 수 있다.
주요 활용
- 정확한 키워드가 아니라 의미를 기준으로 결과를 찾는 시맨틱 검색
- AI 모델이 답변하기 전에 관련 문서를 선택하는 검색 증강 생성(RAG)
- 사용자와 상품, 음악, 영화 또는 기타 콘텐츠를 연결하는 추천 시스템
- 클러스터링, 분류, 이상 탐지, 중복 제거 및 시각화
예시
“비밀번호를 어떻게 재설정하나요?”와 “계정에 접속할 수 없어요”는 정확히 겹치는 단어가 거의 없지만 관련된 의도를 표현한다. 좋은 텍스트 임베딩 모델은 이 두 문장을 벡터 공간에서 서로 가까운 위치에 배치한다.