Start here
The honest starting point
The first version of DocDec was caught out. A member of the AI Craftspeople Guild re-ran our benchmark and showed that, at the same setting, it did no better than a plain cosine similarity search with a tuned cut-off, and refused fewer unanswerable questions. Its refusals came from that cut-off, not from its structure. We re-ran the comparison on the same questions: …
So the baseline every claim on this page must beat is exactly that one: a single-vector cosine search plus a cut-off tuned on the same data. Where DocDec v2 does not beat it, the claim is marked FAIL and not made. The rules were fixed and published before any held-out number was computed.
- Read the claims board. Every claim, with its number, the baseline's number, a significance test and a verdict; where a claim failed and a new design was tried, the new design is a new claim with its own rule (C7b), and the failure stays. Claims
- Watch the mechanism. Real questions from the test sets, picked by a fixed rule (not by hand): where one vector misses and token matching finds the fact, the gate refusing, an answer with its exact words highlighted, two sources combined, an old fact replaced by a new one, and the failures. See it
- Ask your own question. Load the real model into this tab and type anything; watch it find the passage word by word, or refuse. Ask
- Re-run it yourself. One button re-derives every number in your browser from the shipped data and checks it against what this page shows. Re-run it
- Read what it means for your business, including the cost against a cloud setup, computed from sourced prices, with your own question volume. For your business
Words used on this page
- RAG (retrieval-augmented generation)
- The usual way to put AI over documents: cut them into chunks, turn each chunk into one list of numbers (a vector), find the chunks whose vectors sit closest to the question's, and ask a language model to answer from them.
- Single vector / cosine
- One vector per passage; "closeness" is the cosine of the angle between two vectors. Fast, but a whole paragraph squeezed into one point loses the specific word a question hinges on.
- Late interaction (ColBERT)
- One vector per word-piece instead of per passage. Every word of the question looks for its best match anywhere in the passage, and the passage's score adds those best matches up. A missing specific term shows up as one weak match instead of being averaged away.
- The gate
- The checks an answer must pass before it leaves. Each refusal names the check that stopped it.
- The reader
- A small language model running on your machine. It is only allowed to copy the answering phrase out of the passage, or say NONE. The gate then checks the phrase really is in the passage, word for word. The model is never the source of an answer.
- Tune split / eval split
- Every setting is chosen on a first slice of the questions, in file order (tune). Every result is reported on the rest (eval), which the settings never saw.
- McNemar test
- A standard test for two systems answering the same questions: it looks only at the questions where they disagree and asks whether one wins those more often than chance would give. A claim passes only below p = 0.05.
- Unanswerable / near-miss
- SQuAD 2.0's unanswerable questions were written by people to look answerable from a specific paragraph that does not actually contain the answer. They are the hardest refusals there are.
The claims board
Each claim and its pass rule were published before the held-out numbers existed. PASS means it beat the baseline under that rule; FAIL means it did not, and the claim is not made.
| Claim | DocDec v2 | Baseline | Test | Verdict |
|---|
See it: the mechanism on real test questions
Every example below was picked by a fixed rule from the held-out questions, in file order. The rules are in
src/examples.mjs; the re-run checks that they pick these same examples. Failures are picked the same way.
1 · One vector misses, token matching finds the fact
2 · The gate refusing
3 · A grounded answer: the exact words, at offsets anyone can check
4 · Two sources composed
5 · Current, not stale
6 · Gets better with use, without serving stale answers
7 · Failures, kept
8 · The whole picture: what the documents hold, and what they were asked that they do not
Ask your own question: the real model, in your browser
This box runs the same late-interaction model the measurements used (answerai-colbert-small-v1, a 34 MB download from Hugging Face, checked against its pinned fingerprint before it runs) inside this tab. Your question is matched word by word against the guild corpus, then the gate's first three checks run with the settings chosen on the tune split. Nothing you type leaves the page.
How it works
Five layers. In the measured system, late interaction scores every passage, and everything after it is about making the answer trustworthy. On a very large corpus, plain vector search can become the cheapest first step instead: a shortlist that late interaction then re-ranks. Whether that shortlist loses answers is measured too, in the conductor table below, not assumed.
One real question, traced step by step
All the numbers
Everything the measurement produced, including the systems that lost. "B1" is the baseline (cosine plus a tuned cut-off). "+R" adds the reader gate. "v2" is DocDec v2 single-hop: late interaction, the evidence check and the reader.
Single-hop routing and refusal: SQuAD 2.0, the guild's own corpus, and the same questions in a haystack nine times bigger
Questions about other subjects entirely (off-topic)
Multi-hop (HotpotQA)
Fresh facts
The memory (repeat questions in other words)
The conductor
Speed on an ordinary laptop
The frontier prototype: hyperbolic memory (measured, not claimed)
The idea: put the corpus inside a curved space (a Poincaré ball) where room grows exponentially toward the edge, as a tree branches. General things sit near the centre, specific things near the edge, so "how specific is this" becomes a distance. The published version trains a model to do it. We built the training-free version (direction from the ordinary embedding, radius from depth: article, paragraph, sentence) and measured it against plain cosine on a mixed index of articles, paragraphs and sentences. It is never a product claim either way.
Re-run it yourself
Press the button and your browser downloads the shipped data and re-derives every number on this page with the same code: the threshold searches, every gate decision, the graph walk, the memory, the significance tests and the example picks. It then compares its result with what is published, field by field. Quick uses the shipped score tables. Full first re-scores the guild corpus, the off-topic set, the fresh set and the paraphrases from the shipped vectors: several minutes of work in a background thread (11 minutes on our test laptop while it was busy with other jobs; quick took from 10 seconds to 4 minutes there, depending on that load).
Re-run it from scratch on your own machine (the encoders and the reader too)
The page cannot run the reader model or re-encode the large corpora, but you can. Everything below runs on your own computer; nothing is sent anywhere.
git clone https://github.com/sjgant80-hub/docdecdemo && cd docdecdemo/bench npm install # transformers.js (tokenizer), onnxruntime-node, a parquet reader # put the two public files in bench/raw/ (their SHA-256 values are pinned; anything else is refused): # SQuAD 2.0 dev-v2.0.json https://rajpurkar.github.io/SQuAD-explorer/ # HotpotQA distractor validation parquet https://huggingface.co/datasets/hotpotqa/hotpot_qa # and the ColBERT model files in bench/models/answerai-colbert-small-v1/ (model_int8.onnx + tokenizer) ollama pull nomic-embed-text && ollama pull qwen2.5:7b node build-sets.mjs && node encode.mjs # the sets, then the ColBERT and nomic encodings bash pipeline.sh # scores, the reader calls, the measurement, speed, browser parity
The reader's outputs depend on the model build, so they are shipped. Every number on this page is re-derived from shipped data on every push by GitHub's servers (the CI gate), and the encoders' outputs can be re-made with the commands above.
Blueprint: how it is built, part by part
Each part is a small, pure module with no network access. Each is mutation-tested: a tool rewrites the code one operator at a time (< to <=, && to ||, and so on) and the tests must catch every change. A change the tests miss is a line nobody really checked.
| Part | File | What it does | Mutation gate |
|---|
DocDec also carries the estate genome: a
seed.json that says what it is and what it takes, and genome/ hooks that a
birth check runs on every push. Its judge is the audit above (claim C6). Its lane is a word-overlap check against the index,
so an agent can tell before asking whether a question is one DocDec covers. On held-out questions the lane takes
… of on-topic questions and turns away … of off-topic ones
(the measurement).
For your business
In one breath
DocDec gives your people answers from your own documents that they can check in seconds: the exact words, the passage they came from, and a refusal when the documents do not support an answer. It runs on hardware you already own, so the documents never leave the building and there is no per-question bill.
What it does for each role
Chief executive
An AI answer you can put in front of a customer or a regulator, because it shows its source and refuses rather than invents. The failure that ends careers, a fluent wrong answer believed, is the one it is built to prevent.
Finance
No per-question API bill and no per-seat AI subscription for this job. The comparison below is computed from sourced, dated list prices and your own volume. The running cost is electricity on machines you already have.
Operations
Answers come with the exact sentence, so checking one takes seconds instead of re-reading a page. When a policy changes, the new version supersedes the old one on its date and the old rule is not served (none was in the measurement; it can still pick the wrong paragraph, which is why claim C5 fails).
What your people still do: read the cited sentence before acting on an answer (that time is counted in the cost below), answer the questions it refuses, and fill the gaps the refusal log lists. It removes the searching and the re-reading, not the judgement.
Technology and security
Runs offline on CPU: a 34 MB token-matching model and a 7-billion-parameter local reader. No document, question or answer is sent to any vendor. Pure modules, mutation-tested, MIT-licensed: you can read, run and keep all of it.
Compliance, risk and legal
Every answer is an audit record: question, source, version, the exact character offsets of the words relied on, and the date. Every refusal names the check that stopped it. Old versions are closed, never deleted, so "what did we say was true on that date" has an answer.
The teams who use it
Ask in plain words. If the answer is there you see it highlighted in its passage; if not, you are told so straight, and the refused question is logged as a gap in the documents someone can fill.
The cost, this against that
A cloud setup sends every question and its passage to a hosted model and bills per token. DocDec does the same job on your own machine. Set your volume; every price is read from the price lock (copied from the estate's sourced registry, each with its source and the date it was checked), and every quantity is measured on this page.
What it replaces
A cloud RAG stack: a hosted embedding service, a vector database subscription and a hosted language model billed per token, with the documents copied to each. DocDec replaces the whole answer path at the retrieval seam. Your document stores stay where they are; DocDec indexes them where they are.
Security, data protection and compliance, answered straight
| Question | Answer |
|---|---|
| Where do our documents go? | Nowhere. Indexing, matching, reading and answering all run on your own hardware. The measurement on this page was produced the same way, on one laptop. |
| Is there a data processor or an international transfer? | Not for DocDec. With no vendor receiving the data, there is no processor contract to sign and no transfer to justify for this path under UK GDPR. Your existing controls over your own machines still apply. |
| Can it invent an answer? | The reader can only copy words out of the passage, and the gate refuses any phrase it cannot find there word for word, so an answer's words always exist in your documents. It can still pick the wrong passage or the wrong phrase; how often it does is measured on this page, not promised away. |
| Can we audit an answer later? | Yes: source, version, character offsets and date for every answer; the reason for every refusal; old versions kept with their end dates. Each answer comes back as a plain record with those fields; you keep it in your own log store, under your own retention and access rules. Nothing is kept anywhere else. |
| Does it need a GPU or the internet? | No. The numbers on this page were measured on an ordinary laptop's CPU, offline. |
| Is it a regulated AI system under the EU AI Act? | That depends on what you use it for, not on DocDec. As a document-answering tool it is not in the Act's high-risk list by itself; if you put it inside a high-risk use, that use brings its own duties. We do not certify compliance on your behalf. |
Rolling it out
- Your corpus, your questions. Index a slice of your own documents on a machine you own. Write down real questions, including ones you know the documents do not answer.
- Measure it against what you have. Run the same questions through your current setup and through DocDec with this page's harness: wrong answers, refusals, citations. Your numbers, your call.
- Set the bar on your data. The thresholds are chosen on a tune split of your own questions by the same rule used here, then checked on questions they never saw.
- Replace the seam. Put DocDec where the answers are produced. The refusal log becomes your list of gaps in the documents.
Support, ownership, exit
Supplied by AI Native Solutions; start a conversation through that site. Support, service levels, warranty and liability are agreed per deployment, in each deployment's agreement. The software is MIT-licensed: no licence fee, and it keeps running without us. There is no lock-in: your documents, your index and your audit log are plain files on your own machines.
Risks, answered straight
| Risk | Answer |
|---|---|
| It refuses questions it could have answered. | Yes, sometimes: that is the price of refusing what it cannot ground. The rate is on this page, and you set the bar on your own data. |
| It answers some unanswerable questions anyway. | Yes, on deliberately misleading questions it still does sometimes. The rate is on this page. The words it gives are always really in the cited passage, so a reader can see what it relied on. |
| Public benchmarks are not our documents. | Correct. This page shows the mechanism and the method on public data. The roll-out starts by measuring on yours. |
| A small local model is weaker than a frontier cloud model. | At writing answers, yes. Here it is only allowed to copy a phrase or say NONE, and the gate checks the copy. That is a task a small model can do, and doing it locally is what keeps the data in the building. |
The case for the board
White paper: subsuming RAG instead of replacing it
The problem. The usual RAG pipeline cuts documents into chunks, embeds each as one vector, retrieves the nearest chunks to the question and asks a model to answer from them. Its failures are structural, not a matter of tuning. Cutting into chunks breaks facts apart. One vector per passage blurs the specific term a question hinges on. Retrieving once misses questions that need two facts. A frozen index cannot tell a superseded fact from a current one. And nothing stops the model answering confidently from the wrong text.
The approach. Keep cosine retrieval, but only as the cheapest first step, and surround it with layers that each fix one failure:
- L1, late interaction (ColBERT, Khattab and Zaharia, SIGIR 2020), here the 33-million-parameter answerai-colbert-small-v1, int8, on CPU.
- L2, a graph over the corpus's own entities, so a two-fact question becomes a walk.
- L3, a dated memory: versions with validity windows, verified answers with their provenance, re-checked before reuse, and pruned when unused.
- L4, a verifier gate whose refusal is the product: a local reader may only copy, and the copy is checked word for word.
- L5, a conductor that reads the question's shape and routes it.
The evaluation. The hypotheses, the sets, the selection rules and the pass rules were published before the held-out numbers were computed (PREREG.md). The sets:
- SQuAD 2.0 dev (Rajpurkar, Jia and Liang, ACL 2018), whose unanswerable questions were written to look answerable: the guild's own corpus, then nine times the corpus.
- HotpotQA (Yang et al., EMNLP 2018) for two-fact questions.
- Changed facts in real paragraphs, for freshness.
- Paraphrases for the memory.
The baseline is the one that caught the first version: cosine plus a cut-off tuned on the same data. Its prefix variant is chosen in its own favour. Every threshold is searched exhaustively on the tune split, and every claim is decided by an exact McNemar test on the eval split.
The results are on the claims board above. They are generated from the record, not typed here, so this paragraph cannot disagree with them: …
The frontier. Hyperbolic memory, with radius as specificity (Poincaré embeddings, Nickel and Kiela, NeurIPS 2017; the hyperbolic-RAG line of work, 2025), was prototyped without training and measured. Its result is above, whichever way it fell.
Reproducibility. The shipped data, the measurement code and the CI gate re-derive every number on every push. The encoders and the reader can be re-run from scratch on any machine with the published commands.
Honest limits
- These are public benchmarks, not a client's documents. They show the mechanism and the method; your corpus gets its own measurement.
- The freshness test changes real paragraphs synthetically: the new value is not meant to be true, only different. It tests the mechanism, not world knowledge.
- The paraphrases were written by the local model, not by people.
- The reader is a 7-billion-parameter model on a laptop CPU. A larger local model may read better; its numbers would have to be measured, not assumed.
- The hyperbolic prototype is training-free. A trained version is the published idea; we have not built or measured one.
- The speed figures were measured on one laptop, and the speed table says whether other jobs were sharing it at the time. Yours will differ.
- The in-browser re-run was checked identical, quick and full, in Chrome. In another browser the button reports any field that differs; it never hides one.
The first version's page is kept as it was: DocDec v1.