← back
Analysis of Gemini Embed Task-Based Dimensionality Deltas

Analysis of Gemini Embed Task-Based Dimensionality Deltas

An analysis of Gemini Embed optimization modes, including classification, retrieval, and semantic similarity, through vector embedding dimension visualization.

When generating vector embeddings for your text using Gemini Embed there are several embedding optimisation modes:

  1. CLASSIFICATION
  2. CLUSTERING
  3. RETRIEVAL_DOCUMENT
  4. RETRIEVAL_QUERY
  5. QUESTION_ANSWERING
  6. FACT_VERIFICATION
  7. CODE_RETRIEVAL_QUERY
  8. SEMANTIC_SIMILARITY

For each one you get slightly different embeddings, each optimised for the task at hand.

A bar chart showing Euclidean distance by task type, with semantic similarity having the highest drift from the mean.

The embeddings for semantic similarity are the most unique from all other types while retrieval query, retrieval document and fact verification embeddings are most similar to all others.

This is the visual representation of the full spectrum of Gemini’s embedding dimensions for the following sentence:

“DEJAN AI uses mechanistic interpretability to understand how Gemini works.”

Top 10 most variable dimensions across task types (by range):

A bar chart shows the range values for the top ten most variable dimensions of Gemini text embeddings.

[0:14841:9182:13743:634:27815:9346:8987:12918:26909:964]

Top 10 least variable dimensions across task types (by range):

A bar chart plots the range of values for the top ten least variable dimensions of Gemini vector embeddings.

[0:4671:5452:20283:10644:20805:536:1307:4548:2769:155]

Vector Embedding Visualisation

A quick visual inspection immediately gives a clue into just how similar the embeddings are between different task types with only a slight shift in values showing faint but perceptible lanes between the task types.

X = Task Type

Y = Dimension

A grayscale heatmap visualization shows Gemini vector embedding dimensions as horizontal bands with minor variations across different task types.

Reveal Full Image (2MB)

A tall, narrow grayscale heatmap compares vector embedding dimensions across different Gemini task optimization types.


Dan Petrovic · Jul 16, 22:11