TL;DR: QWED uses deterministic solvers (SymPy, Z3, AST, SQLGlot) wherever possible. When LLM fallback is required, the response is explicitly marked as HEURISTIC.
Engine Classification
Every QWED verification engine falls into one of three categories:| Category | Engines | Technology | Reproducible? |
|---|---|---|---|
| 100% Symbolic | Math, Logic, Code, SQL, Schema, Taint | SymPy, Z3, AST, SQLGlot | β Yes |
| Hybrid | Fact, Stats | TF-IDF / Sandbox β LLM fallback | β οΈ Conditional |
| Heuristic | Image, Consensus, Reasoning | VLM / Multi-LLM voting | β No |
Detailed Breakdown
| Engine | Mode | Primary Technology | LLM Fallback? |
|---|---|---|---|
| Math | Symbolic | SymPy (symbolic algebra) | β Never |
| Logic | Symbolic | Z3 Theorem Prover (SMT) | β Never |
| Code | Symbolic | Python AST + Bandit | β Never |
| SQL | Symbolic | SQLGlot AST parser | β Never |
| Schema | Symbolic | Pydantic + SymPy | β Never |
| Taint | Symbolic | Data Flow Analysis (AST) | β Never |
| Fact | Hybrid | TF-IDF similarity | β When TF-IDF confidence < threshold |
| Stats | Hybrid | Wasm/Docker sandbox | β When sandbox execution fails |
| Image | Heuristic | Vision LLM (GPT-4V, Claude) | β Always |
| Consensus | Heuristic | Multi-LLM voting | β Always |
| Reasoning | Heuristic | Chain-of-thought LLM | β Always |
How to Know Which Mode Was Used
Every API response includes averification_mode field:
verification_mode Values
| Value | Meaning | Trust Level |
|---|---|---|
SYMBOLIC | Result proven by deterministic solver (SymPy/Z3/AST) | π’ 100% reproducible |
HEURISTIC | Result from LLM fallback or multi-model voting | π‘ Best-effort, not guaranteed |
Why This Matters
For Regulated Industries
Banks, healthcare, and legal systems require audit trails and reproducibility:- β
SYMBOLICresults can be independently verified - β οΈ
HEURISTICresults should be flagged for human review
For Production Systems
Design Philosophy
βProbabilistic systems should not be trusted with deterministic tasks.βQWED treats LLMs as untrusted translators:
- LLM converts natural language β formal specification
- Deterministic solver verifies the formal specification
- If solver cannot verify, result is marked
HEURISTIC
Frequently Asked Questions
Q: Can I filter responses by verification_mode?
A: Yes! Use therequire_symbolic option in your request:
Q: Why is Fact verification sometimes HEURISTIC?
A: Fact verification uses TF-IDF (deterministic) to find evidence. If TF-IDF confidence is below threshold, it falls back to NLI (LLM-based), marking the result asHEURISTIC.
Q: Is Consensus useful if itβs HEURISTIC?
A: Yes! Consensus detects disagreement between multiple LLMs. While not deterministic, it catches cases where models are uncertain β useful as a safety net, not a formal verifier.See Also
- Engines Overview β Full engine documentation
- API Endpoints β Response schema reference
- Whitepaper β Academic justification for neurosymbolic approach