Two MoTacon attendees are on the left. The MoTaacon logo is in the center, and to the right a prompt to Get Your Ticket.

Embeddings

Embeddings image
Embeddings are numerical representations of data that capture meaningful relationships between items such as text, images, audio, or code. Similar items are represented by vectors that are closer together in an embedding space, allowing systems to compare and find relationships between data mathematically.

Embeddings are commonly used for semantic search, recommendations, clustering, retrieval-augmented generation (RAG), and classification. For example, two pieces of text can use different words but have similar meanings, and their embeddings may still be close to each other.

From a testing perspective, embeddings introduce a different challenge because there is rarely a single correct vector or exact expected value. Testing focuses more on whether similar inputs remain meaningfully close, unrelated inputs remain sufficiently separated, and small changes to input do not cause unexpected changes in relationships. The choice of distance or similarity measure can also affect how these relationships are interpreted.

Testers can evaluate embeddings using similarity measures, representative datasets, nearest-neighbour checks, clustering behaviour, and task-specific evaluation. Testing should consider sensitivity to spelling, language, formatting, domain-specific terminology, and changes to the embedding model.

Embeddings from different models or model versions are generally not directly comparable, even when they have the same dimensions. This can create silent failures in systems that store vectors over time. For example, upgrading an embedding model without re-embedding existing data can reduce retrieval quality in a RAG system while the underlying application continues to appear functional.

Testers should also consider whether embeddings encode unwanted bias from their training data, such as associating unrelated concepts based on historical or cultural patterns.

An embedding model can produce technically valid vectors while still producing poor results for the application using them. A useful testing question is therefore not simply β€œIs the embedding correct?”, but β€œDoes the embedding preserve the relationships the system depends on?”

Explore MoT
Influence, from the other side of the table image
What I learned about influence by becoming a stakeholder
Prompting for Testers image
Unleash the power of generative AI to boost your software testing and day-to-day tech tasks
This Week in Quality image
Debrief the week in Quality via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter