Dsxir.Optimizer.MIPROv2.Proposer.Grounded (dsxir v0.2.0)

Copy Markdown

Asks the proposer LM to produce n_candidates candidate instructions for a single predictor, grounded in a program summary, a dataset summary, and an optional stylistic tip.

One LM call per invocation. The current instruction is prepended outside this module so the baseline always survives in the search space.

On parse, the result is truncated or padded with empty strings so the returned list is always exactly n_candidates long; padding signals a degraded slot to the surrounding optimizer.

Summary

Functions

Generate candidate instructions. See module doc for the argument map shape.

Types

args()

@type args() :: %{
  program_summary: String.t(),
  dataset_summary: String.t(),
  predictor_decl: map(),
  tip: Dsxir.Optimizer.MIPROv2.Proposer.Tips.tip(),
  n_candidates: pos_integer(),
  lm: {module(), keyword()}
}

Functions

run(map)

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

Generate candidate instructions. See module doc for the argument map shape.