Code Verification
The revolutionary idea: don't trust AI output — generate test code and prove the answer is correct.
Don't Trust — Test
Standard AI gives you an answer and says "trust me." Turbo says "let me prove it."
For each candidate answer, Turbo asks the AI to write verification code — a JavaScript program that independently tests whether the answer is correct. This code runs in a secure sandbox, and its output determines whether the candidate passes or fails.
This is the same approach scientists use: form a hypothesis (the candidate answer), design an experiment (the verification code), run the experiment (sandbox execution), and observe the result (pass/fail). It's the scientific method applied to every AI response.
The Verification Pipeline
Here's a complete walkthrough of how verification works for a math question:
const expected = 3901;
result === expected; // → true
How Verification Code Is Generated
Turbo sends a specialised prompt to the AI asking it to write verification code. The prompt instructs the model to:
- Extract the testable claim from the candidate answer
- Write pure JavaScript that independently computes or checks the answer
- Return a boolean —
trueif verified,falseif not - Be self-contained — no external dependencies, no network calls
What Can Be Verified
Verification works best when the answer can be independently computed or checked with code:
Verification works best for objectively testable claims. Subjective questions ("Is this poem good?"), creative writing, and opinion-based answers rely more on the fuzzy scoring system rather than code verification.
Verification in Action
Here's a real verification scenario showing both a passing and failing candidate:
The verification code is independently generated — it doesn't just check string equality. It actually computes the answer from scratch and compares. This means even if the AI's reasoning was flawed, the verification code can catch the error.
See verified answers in real time
⚡ Try Turbo in Synapse