Dsxir.Optimizer.COPRO.Proposer.GivenAttempts (dsxir v0.4.0)

Copy Markdown

Later-round COPRO proposer. Asks the proposer LM for improved instructions for a single predictor, grounded in that predictor's signature and the sorted attempt history (worst-first, so the strongest instruction reads last and anchors the LM). Parse shortfalls are padded with the best attempt's instruction. Returns exactly n instructions.

Summary

Functions

Generate exactly ctx.n candidate instructions. See the module doc.

Types

attempt()

@type attempt() :: %{instruction: String.t(), score: number()}

ctx()

@type ctx() :: %{
  kind: :given_attempts,
  decl: map(),
  attempts: [attempt()],
  n: pos_integer(),
  temperature: float(),
  lm: {module(), keyword()}
}

Functions

run(map)

@spec run(ctx()) :: {:ok, [String.t()]} | {:error, Exception.t()}

Generate exactly ctx.n candidate instructions. See the module doc.