EmbeddingModelOptions

Options & Configuration · AiDotNet.NeuralNetworks.Options

Shared configuration for text embedding and retrieval models (BGE, ColBERT, SGPT, SPLADE, SimCSE, Instructor, Matryoshka, Word2Vec, GloVe, FastText).

Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → EmbeddingModelOptions

Known derived types: FastTextOptions, GloVeOptions, TransformerEmbeddingOptions, Word2VecOptions

For Beginners

An embedding model turns a piece of text into a list of numbers so that similar texts end up with similar lists. Search engines use this to find documents that mean the same thing as your query even when they use different words. The settings here are the model’s size, and each model’s own options class ships the values from its paper.

How It Works

Derived options classes assign their paper’s values in their parameterless constructor. See ModelHyperparameterOptions for why these properties are non-nullable.

Pooling strategy is deliberately absent. Two unrelated EmbeddingPoolingStrategy enums exist in this codebase — one nested inside TransformerEmbeddingNetwork<T> and one in AiDotNet.VisionLanguage.Encoders. Choosing between them, or unifying them, is part of wiring the embedding models rather than of declaring this base, so the property is added then rather than guessed at now.

Properties

Property Summary
int EmbeddingDimension { get; set; } Gets or sets the length of the vector the model produces for a piece of text.
int FeedForwardDim { get; set; } Gets or sets the width of the feed-forward sub-layer inside each block.
int MaxSequenceLength { get; set; } Gets or sets the longest text, in tokens, the model will encode.
int NumHeads { get; set; } Gets or sets the number of attention heads per block.
int NumLayers { get; set; } Gets or sets the number of stacked transformer blocks.
int VocabSize { get; set; } Gets or sets the number of distinct tokens the model’s tokenizer covers.