Skip to main content

A Handshake Protocol for Cross-Model Embedding Interoperability

The Problem with Embeddings

If you have ever studied a foreign language, you know that learning the vocabulary is only part of the challenge. Different languages encode meaning through different sounds, structures, and conventions. Knowing a word in one language does not automatically tell you how to express the same idea in another.

Embedding models face a similar problem.

In artificial intelligence, embeddings represent words, documents, images, or other data as coordinates in a high-dimensional mathematical space. Items with related meanings tend to appear closer together within that space. The difficulty is that each embedding model constructs its space differently.

A word such as “cat,” for example, might occupy one set of coordinates in one model and an entirely different set in another. Both models may represent the concept correctly within their own spaces, but their coordinates are not inherently interchangeable.

For most AI users, this distinction is invisible. For engineers working with Retrieval-Augmented Generation (RAG), vector databases, and AI agents, however, it can become a significant architectural problem.

A vector database is generally built using a particular embedding model. If another model later attempts to query those vectors, differences in dimensions or representation can make the vectors incompatible or produce poor retrieval results. Changing embedding models may therefore require regenerating and re-indexing large collections of data.

I began exploring whether two independently created embedding spaces could instead negotiate a way to understand one another.

A Handshake Between Models

The approach I developed uses a cryptographic handshake protocol for cross-model embedding interoperability.

The idea is similar to protocols already used throughout computer networking: before two systems exchange information, they first establish how they will communicate and verify that the interaction can be trusted.

In this proposed protocol, two embedding systems exchange initialization messages containing policies and cryptographic nonces—random values used only once. The systems then identify a collection of shared anchors: concepts that both models can independently embed and use as reference points.

Those anchors provide the mathematical basis for translating between the two vector spaces.

Using Orthogonal Procrustes analysis and Singular Value Decomposition (SVD), the protocol calculates a transformation that rotates one embedding space toward the other while preserving much of its underlying geometric structure.

Cryptographic commitments, message authentication codes, and nonce validation can then provide integrity protections around the negotiation process.

The result is not that the two models suddenly create identical embeddings. Rather, one model's vectors can be transformed into a representation that more closely corresponds to the other model's space.

Why Add a Protocol Layer?

Methods for embedding alignment and vector-space transformation already exist. My research explores what happens when those mathematical techniques are incorporated into a stateful communication and security protocol.

That distinction matters.

If autonomous AI agents or distributed AI systems increasingly communicate across organizational and technical boundaries, interoperability alone is not sufficient. The systems also need mechanisms for determining what transformation was negotiated, which reference points were used, whether those reference points were modified, and whether a previous exchange is being maliciously replayed.

The handshake therefore combines two concerns that are often treated separately: mathematical alignment and communication security.

Early Results

I tested the approach using two different embedding models and compared retrieval performance before and after alignment.

In one test, cosine similarity between corresponding representations increased from -0.021 before alignment to 0.637 afterward, with some comparisons reaching approximately 0.744.

These results do not establish universal interoperability between embedding models, and additional testing across larger datasets and model families is necessary. They do, however, suggest that negotiated vector-space alignment may provide a useful avenue for further research.

The example below shows the difference between query and retrieval behavior before and after applying the handshake and alignment process.

Why This Matters

This problem becomes increasingly important as organizations adopt AI agents and Retrieval-Augmented Generation systems.

Different companies—and even different systems within the same organization—may use different embedding models. Today, those choices can create architectural boundaries that are difficult to cross. Migrating from one model to another may require rebuilding vector stores, while agents operating across systems may encounter incompatible representations.

A standardized method for negotiating transformations between embedding spaces could eventually make those systems more portable and interoperable.

There are also broader questions worth investigating: How well does alignment hold across different model architectures? How many anchor concepts are necessary? How resistant is the negotiation process to malicious anchors? How much semantic information is lost during transformation?

Those questions are now part of the next stage of my research.

Continuing the Research

I filed a provisional patent covering the protocol while continuing to develop and evaluate the concept. I am also preparing the work for formal academic publication.

For me, the project represents one of the things I find most compelling about applied AI research: identifying a practical engineering limitation, examining the mathematics beneath it, and then asking whether techniques from another discipline—in this case, cybersecurity and network protocol design—can offer a different way of approaching the problem.

The source code for a demonstration implementation is available on GitHub:

https://github.com/VickM12/llmhs_demo

A more detailed technical description of the embedding-model handshake protocol is also available with the original publication.

 



The views expressed in this article are those of the author and are for informational purposes only. They do not necessarily reflect the views of Honor Society®, a private membership organization. Participation is voluntary and does not guarantee specific outcomes, including scholarships or employment. Readers should independently evaluate all information.