Skip to main content

What are embeddings?

The AI Glossary

In our classes, we often pause to explain the ideas behind AI and the language used to describe it. These posts grew out of those conversations. They’re for anyone who would like to understand AI better, with no technical background assumed.

An embedding is a numerical representation of something, such as a word, a document or an image. It is usually an ordered list of numbers, called a vector. A model learns these representations so that they are useful for a particular task, such as comparing the meanings of sentences.

Think of placing items on a map. Items that the model treats as similar may lie close together, although the real representation uses many more dimensions than a paper map. Each dimension is one position in the list of numbers; it does not necessarily correspond to an easily named property.

Embeddings can help find related material even when the wording differs. A search for “ending a membership” may retrieve a document about “canceling a subscription.” The search system converts the query and documents into compatible representations, then compares them using a mathematical measure of similarity.

The model used to produce the representation matters. Embeddings from unrelated models generally cannot be compared as though they occupied the same map. A representation trained for one purpose may also be poorly suited to another. Similarity for finding photographs is not automatically similarity for identifying a medical condition.

Some models are trained to relate different kinds of information, such as images and text. This can support searching an image collection with a written description. It still depends on what the training process encouraged the model to associate.

An embedding is not a fact check. Two documents can be numerically similar while disagreeing about an important detail. Representations may also capture irrelevant patterns, including the institution that produced a document or image rather than its clinical meaning.

In a multilingual care-navigation service, embeddings could help staff match patient questions to approved educational materials or community support policies even when phrasing varies. The application should then check dates, language versions and exact eligibility conditions. A close match may concern the wrong clinical program or an obsolete rule. Embeddings help narrow a search; the retrieved source and the actual question still determine whether the match is useful.

Sources: Reimers and Gurevych — Sentence-BERT (2019); Sentence Transformers — Semantic Search; Radford and colleagues — Learning Transferable Visual Models from Natural Language Supervision (2021)

To learn more, take a look at the AI in Health Care Certificate of Specialization from the Advanced Learning Academy at Harvard T.H. Chan School of Public Health. You can take an individual course or work toward the full certificate.


AI is a fast-moving field. This explanation reflects our class discussions and related material at the time of writing. Terminology, capabilities and tools may change.

For suggested additions or corrections, please email me at tpanch@hsph.harvard.edu.

Dr. Trishan Panch
Program Director, AI in Health Care
Harvard T.H. Chan School of Public Health — Advanced Learning Academy

Lead with AI in Health Care

The AI Pragmatist is a monthly newsletter from ALA faculty, with new explainers & essays from the Advanced Learning Academy