Measure · Apply

Embedding & cosine distance

Meaning is represented as vectors (embeddings), and similarity between two pieces of meaning is measured by cosine distance — the atomic operation behind every later retrieval and association step.

Two sentences point in almost the same direction in embedding space — the angle between their vectors is tiny. Are they similar or dissimilar in meaning?

Two sentences point in almost the same direction in embedding space — the angle between their vectors is tiny. Are they similar or dissimilar in meaning?

Similar. Cosine looks at the ANGLE between two vectors, not their length. A small angle means a cosine near 1.0 — high similarity. A right angle means cosine 0 — unrelated. So "small angle ⇒ close in meaning" is the atomic move every later verb is built on.

Meaning becomes a direction in space

To compare meanings by machine, you first turn each input into an embedding — a vector, a list of numbers that places the input at a point in a high-dimensional space. Inputs that mean similar things land in similar directions.

Cosine distance: similarity is an angle

Once meanings are directions, “how alike are these two?” becomes a geometry question. Calyx measures it with cosine — the cosine of the angle between the two vectors:

Cosine cares about direction, not magnitude, which is why it’s the right tool for comparing meaning rather than length. This single operation is the atom: every later step — building the agreement graph, grounding an answer, searching a vault — is cosine applied in a structured way. The math itself runs on Forge, Calyx’s vector runtime.

Teach it back — in your own words, explain why Calyx measures the similarity of two meanings by the ANGLE between their embedding vectors rather than by how far apart the points are.

Teach it back — in your own words, explain why Calyx measures the similarity of two meanings by the ANGLE between their embedding vectors rather than by how far apart the points are.

Model explanation:

Each input is turned into an embedding — a vector, a direction in a high-dimensional space — so "what does this mean?" becomes "which way does it point?". Cosine takes the angle between two such directions: a small angle (cosine near 1.0) means the meanings line up, a right angle (cosine 0) means they are unrelated, and opposite directions (cosine −1) means they contrast. The angle is used instead of the straight-line distance because magnitude (vector length) carries things like text length or emphasis, not meaning — two vectors can point the same way yet differ in length. By comparing direction only, cosine ignores that magnitude and reads pure meaning-alignment, which is exactly why it is the atom every later verb (associating, grounding, searching) is built on.

Practise to master it

Where this sits in the concept graph

Graph node C1 · tier F · target level Apply.

Build on first

Leads next

  • Forge (math runtime)
  • Lens

Related

Sources