Core Concepts
Understand the philosophy behind QWED.
The Trust Modelβ
QWED is built on a fundamental insight:
LLMs are probabilistic translators, not reasoning engines.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β QWED TRUST MODEL β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββ βββββββββββββββ βββββββββββ β
β β USER β β LLM β β QWED β β
β β (Trusted) βββββββββΆβ (Untrusted) βββββββββΆβ(Trusted)β β
β βββββββββββββββ βββββββββββββββ βββββββββββ β
β β β β β
β Query Probabilistic Verified β
β Output Result β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
How Translation Worksβ
This is the key to understanding QWED. Let's walk through a real example:
Example: Verifying a Mathematical Claimβ
User asks: "Is it true that the sum of interior angles in a triangle equals 180 degrees?"
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 1: Natural Language Query β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β "Is it true that the sum of interior angles in a triangle β
β equals 180 degrees?" β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 2: LLM Translation (Untrusted) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β LLM converts to QWED-Logic DSL: β
β β
β (EQ (PLUS angle_a angle_b angle_c) 180) β
β β
β β οΈ This translation MIGHT be wrong - LLM is not trusted! β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 3: QWED Verification (Deterministic) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β Z3 Solver: Given angle_a + angle_b + angle_c = 180 β
β Is this satisfiable? β YES (SAT) β
β Model: {angle_a: 60, angle_b: 60, angle_c: 60} β
β β
β β
Mathematically proven. Deterministic. Repeatable. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 4: Response β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β { β
β "verified": true, β
β "status": "SAT", β
β "model": {"angle_a": 60, "angle_b": 60, "angle_c": 60}, β
β "proof": "Sum of angles = 60 + 60 + 60 = 180 β" β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Translation Examplesβ
| Natural Language | QWED-Logic DSL | Engine |
|---|---|---|
| "x is greater than 5" | (GT x 5) | Z3 |
| "Is 2+2 equal to 5?" | (EQ (PLUS 2 2) 5) | SymPy |
| "x squared plus y squared = 25" | (EQ (PLUS (POW x 2) (POW y 2)) 25) | Z3 |
| "If raining, take umbrella" | (IMPLIES raining umbrella) | Z3 |
Key Principlesβ
1. Determinism over Probabilityβ
QWED uses symbolic engines (Z3, SymPy) that provide mathematical guarantees:
| Engine | Technology | Guarantee |
|---|---|---|
| Math | SymPy | Algebraic correctness |
| Logic | Z3 | SAT/UNSAT proof |
| Code | AST | Pattern matching |
| SQL | Parser | Syntax validity |
2. Verification, Not Generationβ
QWED doesn't generate answersβit verifies them:
# β Wrong approach (generation)
answer = llm.ask("What is 2+2?") # Might hallucinate
# β
QWED approach (verification)
answer = llm.ask("What is 2+2?")
verified = qwed.verify(answer) # Deterministic check
3. Transparent Proofsβ
Every verification produces a verifiable proof:
result = client.verify("x^2 - 1 = (x-1)(x+1)")
print(result.proof)
# {
# "type": "algebraic_identity",
# "steps": [...],
# "hash": "sha256:abc123..."
# }
Verification Statusesβ
| Status | Meaning |
|---|---|
VERIFIED | Claim is correct, proof generated |
FAILED | Claim is incorrect |
CORRECTED | Claim was wrong, correction provided |
BLOCKED | Security violation detected |
ERROR | Verification engine failed |
Attestationsβ
QWED can produce cryptographic attestations (signed JWTs) that prove a verification occurred:
result = client.verify("2+2=4", include_attestation=True)
print(result.attestation)
# eyJhbGciOiJFUzI1NiIs...
Attestations can be:
- Embedded in documents
- Stored on blockchain
- Verified by third parties
Agent Verificationβ
For AI agents, QWED provides pre-execution verification:
# Agent wants to execute SQL
decision = agent_service.verify_action({
"type": "execute_sql",
"query": "DELETE FROM users"
})
if decision == "APPROVED":
execute(query)
elif decision == "DENIED":
abort("Dangerous query blocked")