AI engineering glossary · RAG vector search

What is hamming distance?

Hamming distance: The number of positions at which two equal-length binary strings differ. It is very fast to compute on bit vectors, making it useful for comparing binary-quantised embeddings or hash signatures.

Level: intermediateTopic: RAG vector search

Hamming distance: an example

Comparing 10110 and 10011 gives Hamming distance 2.

Related terms

More RAG vector search terms

Where you learn it

Hamming distance is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.