問題解決器・ルールエンジンとLLM
- 記事ID
- EA-078
要点
「計算、制約充足、最適化、policy判定は、LLMの自然言語生成に直接委ねるより、solverやrule engineをauthoritative decision boundaryとして接続できる。LLMは要求をtyped modelへ翻訳し結果を説明する役割に向くが、翻訳誤りはsolverが自動的に検出できない。したがってformalizationとsolver/rule resultを別artifactとして検証・監査する。」
現在の判断
solver-backed構成の価値は「LLMを賢くする」ことではなく、feasibility/optimality/policy decisionを検証可能な別engineへ移すことにある。
どこまで当てはまるか
OR-Toolsの求解結果の状態が何を意味するかと、OPA/Regoによる運用ルールの評価が保証する範囲を明示する。これらのツールを使っても、LLMが生成した問題の定式化の正しさが保証されるわけではない。
詳しく理解する
検討ポイント
- solver/rule engineへ計算・判定を委譲する構成は現行OSSで実装可能か。
- LLM direct reasoningとsolver-backed reasoningのfailure差は何か。
- solver output/rule decisionをLLMが説明する際に何をauthoritative artifactとして保持すべきか。
根拠資料
- [仕様確認済み / OSS_PRACTICE / support] Google OR-Tools, “CP-SAT Solver”, Google for Developers, accessed 2026-09-16. https://developers.google.com/optimization/cp/cp_solver — integer constraint modelを解き、OPTIMAL / FEASIBLE / INFEASIBLE / MODEL_INVALID / 未確認を区別する。
- [仕様確認済み / OSS_PRACTICE / context] Google OR-Tools, “OR-Tools”, accessed 2026-09-16. https://developers.google.com/optimization — routing、flows、integer/linear programming、constraint programmingを扱うOSS suite。current exact release/tagは本RUNでは固定せず再確認対象。
- [仕様確認済み / limit] Google OR-Tools, “Vehicle Routing”, accessed 2026-09-16. https://developers.google.com/optimization/routing — large VRPでは最適解証明が困難でgood but not optimal solutionを返す場合がある。solver使用=常にoptimalではない。
- [仕様確認済み / OSS_PRACTICE / support] Open Policy Agent, “Policy Language”, accessed 2026-09-16. https://www.openpolicyagent.org/docs/policy-language — Regoでstructured dataに対するdeclarative policy decisionを定義可能。
- [OSS_PRACTICE / 製品情報は要再確認 / version] open-policy-agent/opa Releases, accessed 2026-09-16. https://github.com/open-policy-agent/opa/releases — latest observed v1.20.2, release 2026-09-03, commit b2c2670。v1.20.0由来parser regression fixを含む。version pinningとregression testの必要性を示す。
- [仕様確認済み / support] Open Policy Agent, “Policy Testing”, accessed 2026-09-16. https://www.openpolicyagent.org/docs/policy-testing — policyをtest caseとして検証するframeworkを提供。
- [RESEARCH / counter] Joseph Tso et al., “ConstraintBench: Benchmarking LLM Constraint Reasoning on Direct Optimization”, arXiv:2602.22465, 2026-02-25. https://arxiv.org/abs/2602.22465 — 200 constrained optimization tasks/10 OR domainsで、best modelのconstraint satisfaction 65.0%、joint feasibility+0.1% optimality以内は30.5%以下。ground truthはGurobiで検証。direct LLM optimizationのfailure evidenceであり商用品質へ外挿しない。
- [RESEARCH / support+limit] Pascal Kesseli, Peter O'Hearn, Ricardo Silveira Cabral, “Logic.py: Bridging the Gap between LLMs and Constraint Solvers”, arXiv:2502.15776, 2025-02-17. https://arxiv.org/abs/2502.15776 — LLMにlogic-focused DSLへformalizeさせconstraint solverで解く方式がZebraLogicBenchでbaseline Llama 3.1 70B比65 percentage-point改善、90%超accuracyを報告。特定benchmarkでありenterprise最適化一般への保証ではない。
- [RESEARCH / counter] Anjiang Wei et al., “SATBench: Benchmarking LLMs' Logical Reasoning via Automated Puzzle Generation from SAT Formulas”, arXiv:2505.14615, 2025-05-20. https://arxiv.org/abs/2505.14615 — solver-validated SAT由来2,100 puzzlesでhard UNSATに強いmodelでも65% accuracyと報告。search-based reasoningをLLM単独へ委ねる限界の補助証拠。
EVIDENCE CONTRACT
Core候補: FORMAL DECISION CONTRACT。最低field: request_id, input_schema_version, parsed_entities, variable/unit definitions, constraint set+hash, objective+priority, formalization_model/version, solver_or_rule_engine/version, policy/model bundle version, time/memory limit, status(OPTIMAL/FEASIBLE/INFEASIBLE/未確認等), solution/decision, objective value/gap, violated constraints, explanation_model/version, final narrative, approval/action state, provenance。
確認できていること
LLMの適切な役割は natural language → typed variables/constraints/objective/rule inputs のformalization、tool selection、結果説明である。authoritative decisionはsolver/rule engine outputとする。
solverにも未確認、timeout、FEASIBLE-but-not-proven-optimal、model invalid等があるため、solver結果を単純なtrue/correctへ潰さない。
policy engineではpolicy versionとinput data versionがdecision provenanceの中心。LLMがpolicy textを要約・説明してもallow/denyのauthoritative sourceにしない。
よくある失敗・反証
LLM→DSL変換が誤ればsolverは誤った問題を正確に解く。formalization errorはsolver correctnessでは検出できない。
objective omission、unit mismatch、constraint polarity inversion、entity hallucination、default value挿入、soft/hard constraint混同が主要failure。
solver timeout/heuristic解はoptimality保証と区別する。
rule engineもpolicy bug、stale bundle、semantic change、input omissionで誤る。OPA v1.20.xのparser regression修正はversion pinning/testの重要性を示すが、OPA全体の不安定性へ一般化しない。
実務での使い方
LLMで問題を形式化し、型を定めた入力へ変換する接続処理を、決まった規則に従う問題解決器や運用ルールの判定処理と組み合わせる。解決器の実行状態、制約を定義したモデル、運用ルールの版、条件を満たす解があるか・最適性が確認できたかという判定状態、検証の根拠を保持する。
solver/library version、supported variable/domain types、license、runtime/platform、time/memory limit、commercial solver dependency、policy engine version、policy bundle/version、input schema、LLM tool-calling runtime、execution permission。
[仕様確認済み + OSS_PRACTICE] OR-Tools CP-SAT/MPSolver/routing、OPA/Rego等によりsolver/policy boundaryは現行実装可能。LLM接続部はadapter/tool schemaとして構成する。
fixtureを (1) natural-language requirement、(2) canonical formal model、(3) verified expected solution/decision の三層で保持。LLM direct、LLM→solver、human-authored solver modelを比較し、formalization exactness、constraint coverage、feasibility、objective gap、policy decision accuracy、timeout/未確認 handling、explanation consistency、latency/costを別計測する。adversarial fixtureとしてnegation、unit conversion、conflicting constraints、infeasible case、missing input、policy deny-by-defaultを含める。
LLMにpolicy bypass権限を与えない。solver/policy call前にtyped schema validationを行い、decision/actionを分離する。auditでは user request、parsed variables、formal model hash、solver/policy engine+version、policy/model version、status、objective/decision、constraint violations、LLM explanation、human overrideを保存。high-impact actionはsolver outputだけで自動実行せず既存authorization/approval gateを通す。
まだ確認できていないこと
- OR-Toolsの2026-09-16 current exact release/tag/commitは本RUNで一次release locatorを十分固定できず未確認。更新時に再採集。
- OPA以外のDMN/business rule enginesとの比較、commercial solver availability/licensingはprovider/implementation mappingへ送る。
- Logic.py等研究方式のproduction robustnessは未確認。
外部根拠の再確認日が正式な本文・公開管理情報で確定していないため、現行性は未確認のまま保持する。確認日を推測して補わない。
根拠資料
この根拠欄には、主張に対応づけて登録された外部出典がありません。本文中の引用・参考資料がある場合は、適用条件や未確認事項とあわせて確認してください。
このページから探す
種類
主題
やりたいこと
読み終えたら、次の判断へ
この記事で確かめた条件を、関連する用語・道具・手段・運用知識に接続して確認できます。実装や更新の判断には、各記事の確認時点・根拠・未確認事項を引き継いでください。
最初の知見から実務判断まで、3つの読み方を見る