| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Shikumi.Optimize.COPRO
Description
COPRO (EP-21): coordinate-ascent prompt optimization. Where
instructionSearch is one-shot per node, COPRO
improves each node's instruction over several rounds (depth), proposing several
candidates per round (breadth) and feeding the scored attempt history forward so
later rounds learn from what scored well. It is the principled generalization of
instructionSearch (depth-1, no-history COPRO ≈ instructionSearch), kept
alongside it rather than replacing it.
COPRO consumes EP-19's grounded proposer (proposeInstructions)
directly: each round's call passes the node's current instruction and its scored
PastInstruction history, and the proposer returns ranked candidates with the
current effective instruction always retained. Keeping that candidate writes no
redundant override, preserving the safety property that a node never degrades.
Output is V1's CompiledProgram via freezeProgram, invoked
through optimize and serialized unchanged (integration point #4).
Synopsis
- data CoproConfig = CoproConfig {}
- defaultCoproConfig :: CoproConfig
- copro :: (ToJSON i, ToJSON o) => CoproConfig -> Optimizer i o
Documentation
data CoproConfig Source #
COPRO's two knobs plus the shared Budget.
Constructors
| CoproConfig | |
Instances
defaultCoproConfig :: CoproConfig Source #
Breadth 4, depth 3, the default budget.
copro :: (ToJSON i, ToJSON o) => CoproConfig -> Optimizer i o Source #
Coordinate-ascent instruction optimization. Visits each node in foldParams
order, optimizing it over depth rounds against the already-improved earlier
nodes. Proposer calls and candidate scoring reserve their predicted cost through
one shared Budget, so the search returns the best-so-far before the next spend
would exceed either ceiling.