# RAG Trick: Embeddings are Spheres

DevFeed: [RAG Trick: Embeddings are Spheres](<https://devfeed.tech/articles/rag-trick-embeddings-are-spheres-33430.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2024/07/10/spheres>)

Published: 2024-07-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [embeddings](<https://devfeed.tech/tags/embeddings.md>), [make](<https://devfeed.tech/tags/make.md>), [model](<https://devfeed.tech/tags/model.md>), [rag](<https://devfeed.tech/tags/rag.md>), [software-design](<https://devfeed.tech/tags/software-design.md>)

## AI overview

This tutorial explains that normalized embeddings lie on a hypersphere and shows how that simplifies similarity calculations. It recommends dot product over other distance measures, notes that cosine similarity is equivalent for normalized vectors, and relates average embeddings to logistic regression.

## Source excerpt

This post offers some helpful simplifications you can make when working with RAG or embeddings that help build a working mental model around them. Embeddings typically form a (hyper)sphere, because they're normalized.