ProgramPromptExample

Models & Types · AiDotNet.Evolution.Prompts

One other program shown in a prompt, together with why it was chosen and how it scored.

For Beginners

This is one of the other programs the AI is shown alongside yours, bundled with its score, its measured characteristics, and a note about why it is in the prompt — because it scored well, because it solves the problem differently, or because it drifted in from elsewhere in the search. Giving the AI a couple of good examples and a couple of different ones is what stops it from making the same small tweak over and over.

How It Works

A prompt shows other programs for two distinct reasons: to demonstrate what currently scores well, and to demonstrate that other shapes of solution exist. Kind records which, so the model is told what an example is for rather than left to infer it. The reference OpenEvolve implementation instead labels an example from its score band whenever no metadata flag is set, which presents a deliberately diverse low-scoring program to the model as “Exploratory” — a judgement about its quality rather than a statement about its role.

Descriptors carries the archive coordinates that placed this program in its cell, which is what lets the prompt say how an example differs rather than merely that it does.

Constructors

Constructor Summary
ProgramPromptExample(ProgramGenome genome, ProgramPromptExampleKind kind, double? quality, IReadOnlyDictionary<string, double> descriptors, string changesDescription) Initializes an example program.

Properties

Property Summary
IReadOnlyDictionary<string, double> Descriptors { get; } Gets the example’s archive coordinates; empty when none were supplied.
ProgramGenome Genome { get; } Gets the program being shown.
ProgramPromptExampleKind Kind { get; } Gets why this example is in the prompt.
double? Quality { get; } Gets the example’s fitness score, or null when it was never scored.
string ChangesDescription { get; } Gets a short note about what this example changed, or null for none.

Methods

Method Summary
string ToString() Returns a description that never echoes the program source.