# DoubleTake: a local, independent adaptation

Research question: does focused visual verification improve document answers over
direct answering and over general rereading with the same pages and call count?

## Frozen inputs

40 questions, reference answers, evidence-page annotations and question categories
were written in data/cases.json before the primary evaluation. data/cases.sha256 records the
freeze. Three public publisher PDFs are identified by source URL, page count and
SHA-256 in data/sources.json. The source versions are fixed to the downloaded files;
the project does not claim their specifications are current purchasing advice.

A separate one-question model-loading smoke check used the Pi 4 ambient-temperature
page before the primary evaluation. Its output is excluded from all scores and
timings. No successful primary response is retried to select a preferred answer.

The question set deliberately includes footnotes, table-column choices, calculations,
scope distinctions, easy lookups and unanswerable questions. It is a small designed
pilot, not a random or representative benchmark. There is no training or fine-tuning.

## Implementation

Paper: https://arxiv.org/abs/2611.17853 (v1, 2026-11-13).
Model: Ollama qwen3-vl:8b-instruct, digest recorded in environment.json.
All roles use the same frozen model. Temperature 0, seed 42, context 8192,
maximum generation 300 tokens per call. Images are original pages rendered at
1120 pixels wide. Source-extracted text is used ONLY to rank pages; vision calls
receive the images, not OCR text or gold answers.

Retrieval adaptation: BM25 over embedded PDF text, top two pages within the chosen
document per search. The paper uses ColPali and up to five pages. The local model
is quantized; the paper used BF16. Prompts are independently implemented from the
described role contracts, not claimed to be the authors' original prompts.

## Conditions

Direct answer: first retrieval, first Thinker call (one call).

Shared preparation (six calls): initial answer, initial evidence extraction,
supplementary query, supplementary evidence extraction, supplementary answer,
verification plan. The retriever's supplementary query receives evidence but no
candidate answer. The final verification pages are the ordered union of both
retrievals.

Focused check: an independent image reading answers the planner's focused question;
a text-only synthesis combines both candidate answers, records and the observation.
Eight calls total. The verifier sees the original question, focused question, source
IDs and page images. Candidate-answer objects and evidence records are not passed
directly. This is an input boundary, not a guarantee of semantic independence:
the generated checking question can still carry a candidate's assumption.
The synthesizer receives the short answers but omits the Thinker reason fields.

General rereading: same six preparation calls, same images, same verifier prompt
except that its reading task is the original question. Its final synthesis uses
that reading task and observation. Eight calls total. The planner still runs, but
its focused question is unused. This is the paper's general-rereading control.

The six shared calls are reused exactly between the two branches and charged to
both. Branch execution order is deterministically alternated by question hash.
This does not eliminate warm-cache, thermal or host-load effects.

## Evidence and scoring

Each run stores exact text prompts, source page IDs, raw responses, outputs, token
counts, elapsed durations, request hash, model configuration and case-set hash.
Gold answers, annotation boxes and reviews never enter the inference engine.
Failures and incomplete JSON responses are recorded separately and not counted as
successful answers. Checkpoints permit resumption, without selecting a preferred
response among repeated successful runs.

Scoring is developer/assistant review against the frozen reference and source,
not blind independent human review. The supported-response metric grades both the short answer and its explanation.
A correct answer field with a material false explanation fails this metric; answer-field
correctness is retained separately in the results. A correct response must provide the requested
answer, including material conditions and units. Missing required quantities,
unsupported assertions, wrong values, or abstention on an answerable question fail.
A justified abstention succeeds for a question whose requested fact is absent.
Citation formatting and page-ID accuracy are not part of this metric. Known citation
issues are recorded in individual reviews; correct answer content is not a guarantee
of a correct citation. Printed page numbers can differ from PDF page indices.
Reference or scoring corrections must be recorded separately; never silently
rewrite the frozen cases after observing model outputs.

## Timing

Each recorded HTTP call includes prompt processing and generation; excludes local
image rendering/base64 preparation, retrieval and warm-up performed outside that
call. Report model-call time, not full application latency. Each condition's time
is the sum of its constituent calls; shared preparation counts in both branches.
The median spans reviewed questions. This is a single-run pilot on a 16 GB Mac,
not a repeat-trial speed benchmark. No claim about API pricing or production scale.

## Presentation

The UI is a replay of recorded inference. It does not simulate live computation.
The reference source crop is an editorial aid, not the model's attention map.
The original full page and all retrieved verification pages are accessible.
Default examples are selected only after scoring. Aggregate counts include all
reviewed cases; all completed examples remain browsable. Show corrections, new
errors and ties. Do not require a win or a regression to exist.

## Reproduce

1. Install Ollama and run: ollama pull qwen3-vl:8b-instruct
2. Create .venv and install requirements.lock.txt.
3. Place the publisher PDFs at data/documents/{pi4,pi5,esp32}.pdf, verifying hashes.
4. Run: .venv/bin/python scripts/prepare.py
5. Run: .venv/bin/python scripts/run.py
6. Review outputs against the frozen references; record reviews in data/reviews.json.
7. Run: .venv/bin/python scripts/export.py
8. Run: ./start.sh and open http://127.0.0.1:47833

This preview is local. No external upload, publication, analytics or user account
is required. All inference takes place on the local Ollama service.

## Separate exploratory follow-up

After the 40-question primary run, two observed failures (q01 and q09) were selected
for a neutral-question rewrite. One added call received the original question and
the proposed check and was asked to remove assumptions while preserving constraints.
It received neither the gold answer nor an editorial source crop. The rewritten
check used the same source images, then the same synthesis contract. This amounts
to nine logical calls (six shared original calls plus three new ones).

Both retries failed the same source-grounded review. They remain separate from all
primary scores. The check rewrite is an attempted intervention, not a guarantee of
neutrality. These are observed development examples, not held-out validation.

The separate custom-PDF CLI was also exercised with one real direct-answer call on
the Raspberry Pi 5 PDF. That functional smoke check is excluded from evaluation.
