Repository navigation
Add experimental ReAnchor calibration optimizer for Predict - #10475
Merged
Merged
Conversation
Contributor
|
isaacbmiller
added this pull request to stack #10476
September 22, 2026 19:51
dbreunig
force-pushed
the
feat/decide-optimizer
branch
from
September 23, 2026 06:13
3a7c8bd to
761de23
Compare
This comment has been minimized.
This comment has been minimized.
dbreunig
force-pushed
the
feat/decide-optimizer
branch
3 times, most recently
from
September 23, 2026 22:24
78714d0 to
e914801
Compare
isaacbmiller
force-pushed
the
feat/decide-optimizer
branch
3 times, most recently
from
September 24, 2026 21:10
efe4aca to
97d165c
Compare
isaacbmiller
force-pushed
the
feat/decide-optimizer
branch
2 times, most recently
from
September 24, 2026 23:37
eedb9e7 to
588dab0
Compare
ReAnchor fits every Decide's numeric settings against a whole-program metric: Boolean thresholds, rich Score cuts, and Choice weights. Each setting changes how Decide reads the System One model's probabilities and leaves the request unchanged, so the search runs on cached answers. Outputs the metric never reads are detected and skipped. A valset is scored before and after calibration and never fitted on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
dspy.experimental now exports ReAnchor, as its docs and tests expect. Threshold calibration now scores the starting threshold before sweeping the grid, and keeps it unless a grid value scores strictly better. A threshold off the 0.05 grid, such as 0.73, was previously replaced by the best grid value even when that scored worse. The report row gains train_score_at_start, as cuts and weights rows already have. The docs add a section on calibrating with ReAnchor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Calibrate every Predict with decision outputs now that Decide is gone. Fill partial field entries from the type defaults before fitting. On a generative LM, give native bool and Literal outputs a fields entry and keep it only when the fitted setting beats the native output. Raise when a client does not cache responses, unless require_cache=False. Move the docs to their own page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Record the evidence each decision output is decoded from, and try the midpoints between neighbouring observed values in place of fixed grids. This covers every distinct outcome, including probabilities bunched near 0 or 1, and Choice multipliers outside 0.1 to 10. Ties go to the widest gap. Reports now summarize the observed values and the candidates tried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Read evidenced outputs and effective settings from DecisionState directly. Drop the derived choice key from the Choice fake, since decoding no longer adds it. Document that ReAnchor stops at the first error and does not support RLM, and link ReAnchor from the TypeSafe compatibility notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
A candidate threshold, cut, or weight now replaces the current setting only when picking it on four fifths of the training set also scores better on the held-out fifth, over five folds. Promotion of native outputs uses the same check. Gains that rest on one or two examples no longer move a setting. Report rows gain a fold_check count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Remove unused calibration filters and silently ignored compile arguments. Search outputs instead of inferring metric independence from extreme settings, with a regression for repeated predictor calls. Preserve separate observation and scoring passes. Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Isolate evidence collectors through DSPy execution contexts, preserving worker propagation. Include zero as a threshold candidate when observed and clarify cache and fold-check guarantees. Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Try probability-based execution for every compatible output and restore its original configuration unless calibration is accepted. Keep client inspection confined to the optional cache check. Skip unrepresentable gap midpoints to prevent duplicate Score cuts found in the live trend benchmark. Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
isaacbmiller
force-pushed
the
feat/decide-optimizer
branch
from
September 24, 2026 23:43
588dab0 to
5f81f45
Compare
Try the upper observed probability when no interior float exists, while preserving the shared midpoint guard for Score cuts. Amp-Thread-ID: https://ampcode.com/threads/T-01a0bf8d-a1dd-7603-906c-ea06c46ff7f7 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
AtlantisPleb
added a commit
to OpenAgentsInc/openagents
that referenced
this pull request
Sep 25, 2026
Add `coder-one study run decision-fit`, a tier 0 study that fits Noul thresholds, Score cuts, and Choice weights on recorded Jev answers and labeled outcomes, with no Jev call. Candidates are midpoints between neighboring observed probabilities, at most 40 per setting; Choice weights are searched on a log scale between the points where a pick flips. A candidate replaces the current value only when it scores strictly better on the fit partition and passes a 5-fold held-out check that keeps each group in one fold. Ties go to the widest gap. The study reads the stall detector's checkpoints (`control.stall`), the truthful-check rows (`checks.verdict`), or any question set with one recorded answer per line, and writes the fitted settings as a proposal in the `decision` block format. No policy changes. `checks::verdict::corroborated_at` takes the corroboration threshold as an argument; `corroborated` calls it with the setting in effect. The offline run is in docs/terminal-bench/2026-09-25-decision-fit.md. On each component's own objective, no fitted setting beat the hard-coded one: the stall fit moved `stall.progress` to 0.97, which reproduces the code-suspect-only detector, with an evaluation interval that includes zero, and the truthful check's candidate failed the held-out check, so 0.8 stays. Reimplemented from DSPy 3.4.0's ReAnchor (stanfordnlp/dspy#10475, MIT); no source copied. Refs #9659 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #10463.
dspy.experimental.ReAnchorcalibrates decision outputs inPredictprograms against a whole-program metric. It works with TypeSafe and generative LMs, without changing instructions, criteria, or demos.Noul/boolthresholdScorecuts.level; leaves continuous.valueunchangedChoice/LiteralweightsSearch and acceptance
Candidates come from observed probabilities. Threshold search also tries zero when P(True)=0 is observed. A setting changes only when it improves the training score and passes a fold check: settings selected on the other folds must improve the combined held-out score. This discourages gains confined to small portions of the dataset, but can accept them when they recur across folds.
On generative LMs, ReAnchor can ask native
boolandLiteraloutputs for probabilities while preserving their Python return types. It keeps this change only when the calibrated output beats the native output under the same fold check.Execution and saved state
compilereturns a copy; the original program is unchanged.fieldsand use normal program save/load.reportincludes training scores, fitted settings, observed evidence summaries, and fold-check results. Optional validation data is scored but never fitted.log_dirwritesreport.json.Author-reported Jev results
Calibration-only results from the original PR evaluation; these benchmarks have not been rerun for the subsequent implementation changes.