EmbeddingNoveltyOptions
Options & Configuration · AiDotNet.Configuration
Immutable, constructor-validated thresholds for the structural, embedding, and judge novelty stages.
For Beginners
These numbers decide when a new candidate counts as “different enough to be worth trying”. The first one is a cheap text comparison and does almost all the work. The second only matters if you supplied an embedding model, and the last two say what should happen when that model or the judging model is unreachable — accept the candidate and risk a duplicate, or reject it and risk losing a good idea. The defaults accept.
How It Works
Every value is checked in the constructor and every property is read-only, so an instance that exists is an instance that is valid. That matters here more than it does for a mutable options bag: these thresholds gate spending, and a value validated only when a run starts would let a mistyped threshold sit dormant until the first candidate arrives — by which time the cheap gate might be admitting everything and paying for an embedding request per proposal.
The stages form a cost ladder. A candidate whose nearest structural neighbour is at least
StructuralNoveltyThreshold away is novel immediately, with no embedding request and no model call;
this rung has no equivalent upstream, where the very first thing the insertion path does is embed the candidate.
Only a structural near-duplicate reaches the embedding rung, which compares it against at most
MaxEmbeddingComparisons of its nearest neighbours rather than every member of its island, and only
a candidate whose cosine similarity reaches EmbeddingSimilarityThreshold reaches the judge.
FailOpenOnEmbeddingFailure and FailOpenOnJudgeFailure default to true, which
reproduces the reference implementation’s effective behaviour — there, an embedding error yields an empty vector
whose similarity to everything is zero, and a judge error returns “novel” — but here it is a decision the run
makes explicitly and can reverse. Set either to false when spending an evaluation on a duplicate costs
more than discarding a possibly-new candidate.
Constructors
| Constructor | Summary |
|---|---|
EmbeddingNoveltyOptions(double structuralNoveltyThreshold, double embeddingSimilarityThreshold, int maxEmbeddingComparisons, bool failOpenOnEmbeddingFailure, bool failOpenOnJudgeFailure, int maxTrackedGenomes) |
Initializes a validated set of novelty thresholds. |
Properties
| Property | Summary |
|---|---|
bool FailOpenOnEmbeddingFailure { get; } |
Gets whether an unreachable embedding provider admits the candidate. |
bool FailOpenOnJudgeFailure { get; } |
Gets whether an unusable judge answer admits the candidate. |
double EmbeddingSimilarityThreshold { get; } |
Gets the cosine similarity at or above which a structural near-duplicate is a possible duplicate. |
double StructuralNoveltyThreshold { get; } |
Gets the structural distance at or above which a candidate is novel without any paid comparison. |
int MaxEmbeddingComparisons { get; } |
Gets how many nearest neighbours are compared by embedding. |
int MaxTrackedGenomes { get; } |
Gets how many accepted genomes a novelty gate remembers before discarding the oldest. |
Methods
| Method | Summary |
|---|---|
string ToVersionString() |
Gets a stable hash of these thresholds for checkpoint and version comparison. |
Fields
| Field | Summary |
|---|---|
double DefaultEmbeddingSimilarityThreshold |
The default cosine similarity at or above which a candidate is treated as a possible duplicate. |
double DefaultStructuralNoveltyThreshold |
The default structural distance at or above which a candidate is novel without further checks. |
int DefaultMaxEmbeddingComparisons |
The default number of nearest neighbours compared by embedding. |
int DefaultMaxTrackedGenomes |
The default number of accepted genomes a gate remembers. |