通过提出辅助问题优化决策模型
Optimizing Decision Models by Asking Side Questions

原始链接: https://www.cmpnd.ai/blog/optimizing-decision-models-side-questions.html

SideQuestions 是一种面向决策模型的新 DSPy 优化器——这类模型快速、低成本,返回类型化概率答案,但不具备 LLM 那样的推理能力。ReAnchor 调整阈值和权重,而 SideQuestions 则通过发现有助于模型决策的额外“是/否”问题来提升性能。 该优化器在训练数据上运行程序,对输出打分,使用反思型 LLM 提出辅助问题,让决策模型回答这些问题,并训练一个小型回归模型,将有用的回答与原始预测结合起来。GEPA 会迭代演化出更好的问题集,留出集检查则负责在原始输出、重锚定输出和辅助问题增强输出之间做出选择。 在基准测试中,十个辅助问题将酒店评论欺诈检测准确率从 57% 提升至接近 80%,将 AI 响应检测准确率从 50% 提升至 78%,并将学生作文 AI 检测准确率从 51% 提升至 100%。由于决策模型会缓存共享状态,成本大约翻了一倍,而延迟仅增加约 7%。 SideQuestions 可适用于多种决策模型,发现的问题也能在它们之间迁移。目前它仍是一个原型,仅限于包含单个 Predict 调用的程序。

黑客新闻 最新 | 往期 | 评论 | 提问 | 展示 | 工作 | 提交 登录 通过提出辅助问题优化决策模型 (cmpnd.ai) 4 分 由 dbreunig 1 小时前 | 往期 | 收藏 | 2 条评论 帮助 dashee 1 小时前 [–] 很有意思。基本上不是回答一个问题,而是提出各种相关问题,并将这些概率用于回归模型以做出决策。我想一个可能的缺点是,回归输出默认可能未经校准。 回复 dbreunig 20 分钟前 | 父评论 [–] 如果你运行优化器,它会自动执行该校准。 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Introducing SideQuestions, an optimizer for decision models that works by identifying additional helpful questions.

Decision models, also called system one models, are different from LLMs. They’re fast, cheap, and they return typed answers as probabilities. They cache differently, storing a state that is shared by many questions. They don’t reason. Unlike large LLMs, they don’t explore a search space from multiple angles before answering.

These unique qualities deserve new optimizers. When we shipped support for decision models in DSPy, we included ReAnchor, an optimizer for models like Jev that adjusts the thresholds, weights, and cuts of a DSPy program. For many programs, this is sufficient. ReAnchor is cheap, quick, and effective.

But if we want to push our programs further (and can’t or don’t want to adjust the models’ weights) we can do better. Today we’re introducing SideQuestions, an optimizer for decision models that works by identifying additional helpful questions.


Suppose we want to identify fraudulent hotel reviews for a travel platform. We might have a program that asks

  • Was this hotel review written by someone who did not actually stay at the hotel?

If we ask a reasoning model we can see how the model reasons towards an answer. We posed the above, with an example review, to deepseek-4.1-flash. During its reasoning it noted:

  • The hotel name is garbled, a common sign the review is fabricated.
  • The reviewer gives no specifics about the actual location or features of the hotel. All complaints are general and could apply to any hotel.
  • The review contains internal contradictions.
  • The review is written to argue a point, rather than report an experience.

These stops along the way fill the context window and influence the model’s final response.

Decision models can’t do this. But we can do it for them, by evaluating their performance and suggesting additional questions that could inform the final response. Running SideQuestions on the program above, GPT-6.1-Sol identified ten questions that could inform the response. Here’s a sample:

  • Does the review identify a booking intermediary or a rewards program used to arrange the stay?
  • Does the review state a specific monetary amount for a room, upgrade, parking, food, or another hotel-related expense?
  • Does the review rely mainly on broad evaluations such as comfortable, dirty, friendly, luxurious, or disappointing?
  • Does the review compare this hotel with the reviewer’s previous experience of other hotels?

On held-out hotel reviews, ten side questions raised Jev’s accuracy from 57% to 80%. And thanks to the caching behavior of decision models, asking ten additional questions only doubled our cost per call, and latency rose by just 7%.

SideQuestions on Jev

Deceptive hotel reviewsaccuracygainlatencycost

“Was this hotel review written by someone who did not actually stay at the hotel?”

Jev57.3%0.06 s$0.026

GPT-6-Luna72.0%+14.71.74 s$0.136

Jev + SideQuestions79.5%+22.20.07 s$0.059

Beemo, raw model outputaccuracygainlatencycost

“Was this response written by an AI language model rather than a person?”

Jev50.2%0.06 s$0.032

GPT-6-Luna53.7%+3.51.53 s$0.169

Jev + SideQuestions78.2%+28.00.07 s$0.064

Ghostbuster essaysaccuracygainlatencycost

“Was this essay written by an AI language model rather than a student?”

Jev51.2%0.06 s$0.041

GPT-6-Luna79.8%+28.62.07 s$0.221

Jev + SideQuestions100.0%+48.80.07 s$0.053

0%20%40%60%80%100%

Accuracy on held-out test sets. Median latency of 40 sequential calls, cost per 1,000 calls.

How SideQuestions Works

The optimizer works like this:

  1. SideQuestions runs the program on training examples and scores each output with your metric.
  2. A reflection LLM reviews the results and suggests yes/no side questions that could help the program answer correctly.
  3. The decision model answers the suggested questions on the training examples. A small regression model combines those answers with the original answer, weighting each question and dropping those that add nothing.

GEPA runs this loop several times, evolving new lists of side questions from the best lists so far. At the end, a held-out check set decides for each output whether to use the side questions, a reanchored answer or the student’s original answer.

Getting Started with SideQuestions

To use SideQuestions, install it with pip or uv:

pip install dspy-side-questions

If you have an existing DSPy program that uses a decision model like Jev, swapping ReAnchor out for SideQuestions is simple:

import dspy
from dspy.experimental import Noul
from dspy_side_questions import SideQuestions

Verdict = Noul[(True, "A phishing attempt"), (False, "Legitimate")]

class Phish(dspy.Signature):
    """Classify an email."""

    email: str = dspy.InputField()
    is_phishing: Verdict = dspy.OutputField(
        desc="Is this email phishing?"
    )

def accuracy(example, pred, trace=None):
    return float(pred.is_phishing.value == example.is_phishing)

student = dspy.Predict(Phish)
student.set_lm(dspy.LM("typesafe:jev-latest"))

optimizer = SideQuestions(
    accuracy, reflection_lm=dspy.LM("openai/gpt-6-luna")
)
program = optimizer.compile(student, trainset=train, valset=val)

SideQuestions Results Across Decision Models

SideQuestions works well with all decision models, not just Jev (heck, with DSPy you can run it on an LLM program, too). Take a look:

Deceptive hotel reviews, by decision model

Jevaccuracygain

Baseline57.3%

SideQuestions79.5%+22.2

clef-flashaccuracygain

Baseline50.2%

Jev’s questions75.0%+24.8

SideQuestions75.9%+25.8

djevaccuracygain

Baseline50.2%

Jev’s questions74.5%+24.4

SideQuestions73.0%+22.8

pplx-decider-v1.3accuracygain

Baseline56.6%

Jev’s questions82.3%+25.8

SideQuestions83.6%+27.0

0%20%40%60%80%100%

Accuracy on 640 held-out hotel reviews. “Jev’s questions” are the side questions found on Jev, with the regression model refitted to each model’s answers.

The side questions also transfer between models. The questions found on Jev, with the regression model refitted to each model’s answers, score 75.0% on clef-flash, 74.5% on djev and 82.3% on pplx-decider. Each of those scores is within 1.6 points of a fresh compile on the same model.


Like dspy-wsp, SideQuestions is a prototype optimizer. There’s a few limitations, including the ability to only optimize programs consisting of a single Predict call, but the scores it achieves are very impressive. We would appreciate your feedback and suggestions, where SideQuestions works well, and where it could be improved. The GitHub repository has more detailed usage instructions, benchmarks to replicate, and more.

联系我们 contact @ memedata.com