Vector Arithmetic Playground

Perform add, subtract, and interpolate operations on embedding vectors.

Ad placeholder (leaderboard)

Explore the geometry of embeddings

Embeddings turn words and concepts into vectors, and one of their most striking properties is that meaning behaves like geometry: relationships become directions you can add and subtract. This playground lets you run those operations directly — the famous king − man + woman ≈ queen analogy, simple vector sums, and smooth interpolation between two points — and inspect the result.

How it works

You enter vectors as comma-separated numbers or JSON arrays, and the tool parses them and checks that every vector shares the same dimension. For an analogy it computes A − B + C; for add and subtract it does the element-wise operation; for interpolation it computes A·(1−t) + B·t with a slider for t. Alongside the resulting vector it reports the magnitude and the cosine similarity between the result and each input, so you can see how the operation moved you through the space. Everything runs client-side with no network calls.

Tips and notes

The analogy effect is clearest with real embedding vectors from a model, but you can build intuition with small hand-made vectors here. Cosine similarity is the right lens for embeddings — magnitude often matters less than direction, since most embedding models normalize their outputs. Try interpolating between two opposite concepts and watch the cosine similarity to each endpoint cross over at the midpoint. For real analogy tasks, embed your words with a model first, paste the vectors in, and compare the result to candidate vectors with a nearest-neighbor search.

Ad placeholder (rectangle)