-
Notifications
You must be signed in to change notification settings - Fork 132
ask whether the text says it
Before asking a yes/no question the text might not answer, ask a gate question first: "Does the message say when the parcel was delivered?" If the gate says no, the real question has no answer in the text, and whatever probability the model gives it is a guess. jevos is good at the gate: 0.847 on questions about whether a text states something, on our 999-question test set, with an average P(yes) of 0.23 on those whose answer is no.
The reason this matters is that a yes/no model always answers. There is no "I don't know" in a probability, and a question about a fact that is not in the text still comes back as a number between 0 and 1. It may land near 0.5, which at least looks uncertain. Nothing forces it to, and a confident-looking answer to an unanswerable question is the worst output a decision system can produce, because nothing downstream will question it.
This page is why the missing case is different from the no case, how to write a gate, how to wire it in code, and what the measurements say.
Take a refund rule that depends on the delivery date and a message that never mentions it:
{
"model": "jev-latest",
"state": "Hi, my order came but the charger inside is broken. Can you help?",
"questions": {
"within_window": {"type": "noul", "instructions": "Was the order delivered less than 30 days ago?"}
}
}The true answer to "within_window" is neither yes nor no: the text does not say. A low probability would read as "outside the window, decline the refund", which is a wrong decision built on a missing fact. A high one would approve a refund on nothing.
Your system needs three outcomes here, not two: yes, no, and ask for more information (or look it up in the order database). A single yes/no question cannot produce the third outcome, so you add a question that can.
A gate question asks about the presence of information, not its value:
"questions": {
"states_delivery": {"type": "noul", "instructions": "Does the message say when the order was delivered?"},
"states_order_id": {"type": "noul", "instructions": "Does the message include an order number?"},
"states_problem": {"type": "noul", "instructions": "Does the customer describe what is wrong with the item?"}
}Three habits make gates work:
- Ask about the text, not the world. "Does the message say..." or "Does the customer mention..." points the model at the words on the page. "Was the order delivered?" asks about reality, and the model may answer from what usually happens.
- Ask one fact per gate. The rule is the same as for any question, covered on one condition per question.
- Ask positively. "Does the message include an order number?" rather than "Is the order number missing?", and take 1 minus P(yes) in code if you need the other side. The reason is on negation in yes/no questions.
The gate and the real question can go in the same request, since they share one reading of the text. The logic that uses them is yours:
p = {k: a["noul"] for k, a in answers.items()}
if p["states_problem"] < 0.5:
action = "ask the customer what is wrong"
elif p["states_delivery"] < 0.5:
action = "look up the delivery date"
else:
action = "apply the refund rule"In most systems the second branch is the common one, and the best design is to not ask the model at all: the delivery date lives in your order database, and code computes the window exactly. Gates are most useful for facts that exist only in the message, such as what is wrong, what the customer wants, or whether they gave a reason.
On the 999 yes/no questions written after the model was finished, 98 were "not stated"
questions, and jevos q4_k_m was right on 0.847 of them. When the right answer was no, the
average P(yes) it gave was 0.23, low next to 0.59 on arithmetic questions and 0.53 on dates.
On a second set of 1,000 template questions, with answers computed by code from structured
texts about orders, leave requests, loans, bookings and similar records, it answered every
"not stated" question correctly.
Two caveats. The template set is regular by construction, so its perfect score says more about easy cases than about messy customer mail; the 0.847 is the number to plan with. And the gate does not fix the other failure, a question the text answers but that needs computing. That lean toward yes is measured on why a small LLM says yes when the answer is no.
The gate is also a natural input to a review band. A case where the gate is uncertain, say between 0.3 and 0.7, is a case where even the model is not sure the fact is there, and that is a good case to send to a person. How to set those bands is on human in the loop AI with a review band, and the general rule of putting policy text in the question, which gates protect, is on LLM policy decisions: put the rule in the question.
Being straight about the limit: a gate reduces confident answers to unanswerable questions; it does not make them impossible. It is one more probability, with its own error rate. For decisions that cost money, the missing-information branch should lead to a person or a lookup, never to an automatic no.
How do I stop an LLM from answering when the text has no answer? Ask first whether the text states the fact. Act on the real question only when the gate says yes.
Does a probability near 0.5 mean the information is missing? Not reliably. A missing fact can produce a confident answer. Ask the gate question explicitly.
How good is jevos at spotting missing information? 0.847 on 98 not-stated questions in our 999-question test set, and all correct on the not-stated questions of a 1,000-question template set.
Should the gate and the question be in the same request? Yes. They share one reading of the text, so the gate adds a fraction of the cost of the first question.
What should the code do when the fact is missing? Look it up in your own data, or ask the customer. Do not treat missing as no.
See also: how to write yes/no questions an LLM answers well, what P(yes) means and hallucination detection with a local LLM.
- 0.847 on 98 not-stated questions and the mean P(yes) values on no-answer questions: our
999-question test set,
jevos-q4_k_m. - All-correct result on not-stated questions: our second test of 1,000 template questions with answers computed by code.
From the notes of jev, a model that always returns a number, which is exactly why the question of whether there is anything to answer has to be asked out loud.
- Ask a local LLM a yes/no question and get P(yes)
- Zero-shot text classification with yes/no questions
- LLM policy decisions: put the rule in the question
- LLM as a judge on a CPU
- Why a small LLM says yes when the answer is no
- Small LLMs and arithmetic in yes/no questions
- Our held-out benchmark said 0.855, new questions said 0.757
- jevos vs Jev vs Laya for yes/no decisions
- An open-source alternative to Jev for yes/no decisions
- jevos vs the OpenAI API for yes/no classification
- jevos vs Ollama for yes/no decisions
- jevos vs bart-large-mnli for zero-shot classification
- A yes/no LLM vs a fine-tuned BERT classifier
- jevos vs SetFit: zero-shot vs few-shot classification
- jevos vs Llama Guard for content safety checks
- jev serve vs llama.cpp server for classification
- jevos vs LM Studio: a decision server, not a chat app
- Local vs hosted LLM decisions: latency, cost, privacy
- A yes/no LLM vs a business rules engine
- LLM decisions vs keyword rules and regex
- The fastest AI model for yes/no decisions
- What makes a local LLM fast on a CPU
- Why one forward pass beats generating an answer
- Prefill vs decode: where LLM latency comes from
- Why LLM latency grows with the length of the text
- Why a hosted LLM API cannot answer in 50 ms
- Many questions about one text: why the extra ones are cheap
- CPU or GPU for a small LLM
- Latency budgets: where a 200 ms model fits
- Measuring LLM latency: median, p90 and warm-up
- Q4_K_M vs Q8_0: speed and size for a small model
- Throughput vs latency for a decision server
- What P(yes) means, and what it does not
- LLM calibration explained with yes/no answers
- Expected calibration error (ECE), explained
- Temperature scaling for LLM probabilities
- Platt scaling for a yes/no model
- Reading a reliability diagram
- How to choose a threshold for P(yes)
- Thresholds when a wrong yes costs more than a wrong no
- Human in the loop AI with a review band
- Precision and recall at a P(yes) threshold
- Base rates: why a 0.9 yes can still be wrong often
- Combining yes/no answers with AND, OR and NOT
- Logits, log-odds and P(yes)
- LLM confidence scores: probabilities vs self-reports
- How to write yes/no questions an LLM answers well
- Negation in yes/no questions for an LLM
- One condition per question: splitting compound questions
- Ask whether the text says it at all
- Scores as yes/no thresholds: is it at least high?
- Sending JSON as the text: designing the state
- Why wording changes an LLM's answer, and how to test it
- Mainly about: questions for messages with several topics
- Yes/no questions about tone and emotion
- Asking about intent: what does the writer want?
- Yes/no questions about long documents
- Using an English-only LLM with other languages
- Content moderation with a local LLM
- A Discord moderation bot with a local LLM
- Spam detection with yes/no questions
- Review moderation with a local LLM
- Email triage with a local LLM
- Support ticket routing with yes/no questions
- Urgency detection in customer messages
- Sentiment analysis with yes/no questions
- Intent detection with a local LLM
- Lead qualification with yes/no questions
- Fraud case triage with a local LLM
- Phishing email screening with a local LLM
- Log and alert triage with a local LLM
- Checking text for personal data with yes/no questions
- Prompt injection screening with a small model
- Document classification with a local LLM
- Product categorization with yes/no questions
- Contract clause detection with a local LLM
- Refund request triage with a local LLM
- Detecting cancellation intent in customer messages
- RAG evaluation with yes/no questions
- RAG faithfulness check with a local LLM
- Hallucination detection with a local LLM
- LLM regression tests in CI with yes/no checks
- Rubric design for an LLM judge
- Pairwise comparison with a yes/no judge
- LLM judge bias and how to control it
- Evaluation metrics for yes/no classifiers
- Building a yes/no test set for your own data
- Accuracy by kind of question: why one number hides failures
- Generating test questions with answers computed by code
- Benchmark contamination and truly held-out tests
- An LLM router with yes/no questions
- A model cascade: small model first, large model on doubt
- Semantic routing vs yes/no questions
- Gating AI agent tool calls with yes/no checks
- AI agent guardrails with yes/no questions
- Stop conditions for AI agents
- Logging LLM decisions for audit
- Reducing LLM cost with local yes/no decisions
- Replacing chat LLM calls with yes/no questions
- Structured output vs a probability
- A Python client for local LLM decisions
- Calling a local LLM decision server from JavaScript
- Local LLM yes/no decisions in n8n
- A Slack bot that uses local LLM decisions
- Home Assistant automations with local LLM decisions
- A LangChain tool for local yes/no decisions
- Batch decisions from files with jev decide
- Running LLM yes/no checks in GitHub Actions
- Securing a local LLM server with an API key
- curl examples for a local LLM decision API
- Self-hosted AI for decisions
- A private LLM for text classification
- On-premise LLM for business decisions
- GDPR and automated decision-making with an LLM
- Offline AI for decisions: no network needed
- Edge AI decisions on a CPU
- Run an LLM locally without a GPU
- Small language models explained
- When a small model is enough, and when it is not
- An LLM on a laptop: what it can do in real time
- What is GGUF, for someone deploying a classifier
- GGUF quantization types explained: Q4_K_M, Q8_0 and others
- GGUF vs safetensors
- llama.cpp vs Ollama for a classification service
- llama-cpp-python vs calling llama.cpp through ctypes
- llama.cpp on Windows without compiling
- Running llama.cpp CPU only
- Using llama.cpp prebuilt binaries instead of building