Evidence-Based QA Lab — From finding answers to recognizing insufficient evidence

Cover of the evidence-based QA experiment

Why Reproduce This Experiment? Make Correct Answers Verifiable

Giving a model a passage and asking it to find the answer seems easier than open-ended chat. The answer is already in the text, so there is no need to look up anything else. But the answer being in the original passage, making it into the model's input window, and being selected by the model are three separate events. This article establishes a minimal QA baseline using real data and records each event separately, providing a common starting point for later studies of abstention, truncation, distractors, and retrieval errors.

We ran the experiment on 128 answerable questions from a public English reading comprehension dataset. Of the model's predictions, 107 met the official exact-match standard, and the mean token F1 was 91.01%. Every question had at least one officially annotated answer span fully within the retained input. The 21 predictions without an exact match therefore cannot be attributed directly to truncation of the gold answer spans. They also do not establish that the model failed to understand the passage. Answer boundaries and scoring conventions can affect these results and need to be examined separately.

This experiment asks what per-question baseline we get when we fix the checkpoint, keep only the first window, and hold the decoding rules constant. We do not add windows or change the answer length limit after seeing the scores, and we do not switch models based on the errors. Readers can inspect each question's identity, input positions, start and end scores, final answer, and evaluation score alongside the aggregate results.

Core Idea — Extractive QA Selects Spans

An extractive QA model assigns two scores to each token in the input, one for starting the answer and one for ending it. A token is a unit in the model's tokenization and may be a whole word or part of one. The program selects a contiguous span from the valid start–end pairs and uses character offsets to map it back to the original passage. The model does not generate explanations in this process, so these scores cannot be used as a measure of factual accuracy in chat models.

We use SQuAD 2.0. The paper and official site describe a dataset with both answerable questions and questions that cannot be answered from the supplied passage. This baseline uses only the officially answerable subset, so its scope is narrower than a full SQuAD 2.0 evaluation. The unanswerable questions remain in the registry for later experiments on empty answers and abstention. Today's high scores tell us nothing about whether the model can recognize insufficient evidence. Dataset and task definition

We use the MiniLM QA checkpoint released by deepset. Its model card explicitly lists SQuAD 2.0 as training and evaluation data, so the public validation set may already have played a role in upstream model development. Our own split controls how we tune the model in this study. Prior exposure is still possible, so we cannot claim that this is an entirely unseen test. Publisher's model card

Data partitioning, first-window extraction, and independent recomputation

Formulas and Components — Constraints on Valid Answer Spans

For a batch of inputs, the model returns start and end score matrices, both of shape B×LB\times L. Here, BB is the batch size and LL is the padded sequence length for the batch. Let uu and vv be the score vectors for one example from the first and second matrices, respectively. We select the answer as follows.

(s∗,e∗)=arg⁡max⁡(s,e)∈C(us+ve)(s^*,e^*)=\arg\max_{(s,e)\in\mathcal{C}}(u_s+v_e)

Here, ss and ee are the start and end token positions, and C\mathcal{C} is the set of valid candidates. Both endpoints must lie in the passage, the start must be at or before the end, and the span must contain at most 30 tokens. Ties go to the earlier start position, then to the earlier end position. Question tokens, padding, and special tokens are ineligible. We fixed all of these constraints before inference.

Taking the highest-scoring start and end independently is insufficient. They can appear in the wrong order or form a span longer than the limit. The runner explicitly enumerates all valid pairs and saves the scores and offsets for every position. The 30-token limit is a decoding choice. It can cap performance when a gold answer is longer, a possibility that needs a separate audit.

Exact match, or EM, checks whether the answers are identical after normalization by the official script. Token F1 measures word overlap between the prediction and the reference.

F1=2PRP+RF_1=\frac{2PR}{P+R}

Here, PP is the number of overlapping words divided by the number of predicted words, and RR is the number of overlapping words divided by the number of reference words. Repeated words are counted according to their multiplicity. With no overlap, the score is zero. A question can have multiple official references. We take the maximum across references separately for EM and F1, then average each metric across all 128 questions. F1 measures word overlap between strings and does not assess semantic entailment.

How to Read the Official Code

Start with the official evaluation script. normalize_answer lowercases the text, removes punctuation and English articles, and normalizes whitespace. compute_exact and compute_f1 define the score for each answer, and get_raw_scores iterates over the references. These functions show exactly how an extra modifier or a difference in capitalization affects the score. A separately written metric based on the function names alone may look similar while producing scores that cannot be compared directly with the official results.

Next, look at BertForQuestionAnswering in the pinned version of Transformers. The checkpoint is named MiniLM, and its configuration specifies the BERT question-answering architecture. A linear classification layer maps each position's hidden representation to two outputs, which become the start and end scores. We call this official model implementation directly. Candidate enumeration, identity registration, and auditing are implemented separately for teaching purposes. The source map identifies which implementation each component comes from.

Finally, read this experiment's run.py. It fixes the dataset identities, then handles tokenization, the model forward pass, valid-span selection, character slicing, and output. audit.py implements its own enumeration and scoring without importing the runner's decoder. audit_data.py checks labels and slices against the original public data. This division helps pinpoint which layer introduced an error. Agreement between the scripts still leaves semantic judgment to human reviewers.

Minimal Experiment — Lock the Splits Before Looking at Predictions

The original resource is the official dev-v2.0.json, with SHA-256 80a5225e94905956a6446d296ca1093975c4d3b3260f1d6c8f68bc2ab77182d8. We first sorted the source articles by hashes computed with a fixed prefix, then assigned them by sorted position to development, threshold selection, and confirmation pools. Articles sharing a normalized context were grouped into the same component to keep duplicate material from crossing pool boundaries. The three pools ended up with 7,973, 1,865, and 2,035 registered questions, respectively.

We cross-checked article, context, and question identities across all three pools. Questions from the same article stay together. For this run, we used a second fixed hash order to select the first 128 officially answerable questions from the development pool. For the confirmation pool, we registered only identities and existing labels. We neither ran the model on it nor selected examples from it, reserving it for the final confirmation in this study. Future interval estimates should account for correlations among questions from the same article.

We pinned the model to revision 934656cdda79824eabf503ed56e15c01ddbdbe3f. We recorded hashes for the configuration, vocabulary, tokenizer settings, and weights. The weights download was approximately 134 MB. We ran on CPU with float32, eager attention, four threads, and batches of eight. We first limited each question to 64 WordPieces, then paired it with the passage. We capped the sequence at 384 tokens and retained only the first window, with no sliding-window pass.

We ran an eight-example smoke test to check tensor shapes, finite values, and resource usage before running all 128 examples. The full run took about 4.30 seconds, including tokenization, the forward pass, candidate enumeration, and record construction. Model loading and downloads were outside the timed interval. Peak process resident memory was about 1.03 GB. The environment record includes system, Python, and framework versions and the shape of every batch. The timing applies to this run and setup.

Evaluation Protocol and Results

The program passed the predictions and the selected questions' official reference answers to the unmodified official script. All answerable questions remained in the denominator. We excluded no rows for errors, long answers, or possible truncation, and we did not tune an abstention threshold on these examples. The complete results are below.

Measure Result Interpretation
Exact match 107 / 128, 83.59375% Full match after official normalization
Mean token F1 91.01040% Highest word-overlap score across the references for each question
Partial overlap without an exact match 14 / 128 These 14 cases have yet to be classified as semantic errors
Zero word overlap 7 / 128 Each case still needs individual review
At least one gold answer span fully visible 128 / 128 Other parts of the original passage may have been truncated

Baseline results plotted from saved logs

EM and F1 describe the same predictions differently. Partial overlap and other scoring behavior account for the gap, so the higher F1 does not indicate that the model supplied additional correct information. A model can also select the wrong boundaries or an entirely different span even when the gold span is visible. Here, “visible” means only that the full character span made it into the window. Some context needed to understand the answer may still have been cut off.

My inference is that we should examine answer boundaries, reference sets, and question structure before deciding whether to increase the input length. We did not compare two input lengths, so these results cannot show that the short window is sufficient or that extra context would be ineffective. We also did not manually classify the 21 non-exact matches by meaning. This article reports only structural facts that can be checked automatically.

Troubleshooting and Reproducible Evidence

The first attempt to fetch resources failed at the proxy connection, and a later download ended prematurely at the TLS layer. Retrying through an approved public download channel let us complete the file checks with the original model and data. The tokenizer emitted a warning about process forking, but the run exited successfully. We retained the logs. These recovery steps left the sample unchanged and have no bearing on model quality.

An independent arithmetic audit re-enumerated every valid start–end pair, checked the maximum and tie-breaking rule, repeated the answer normalization and word counts, and compared the results with the official aggregates. The data audit checked question identities, source article hashes, reference answers, character slices, and visibility against the original JSON. Both audits passed. These checks establish deterministic consistency. Questions such as whether an answer could still be inferred from elsewhere in the passage after its removal require a separate review.

When debugging, check input identities first, then the token-to-character mapping, and finally the scoring. Two offset errors could cancel out in the overall EM. Looking only at the extracted string could also hide the fact that it came from the question instead of the passage. Saving scores for each position takes more space than saving final answers alone, but it lets later decoding experiments reuse real model outputs without rerunning inference every day.

Source Code and Reproduction

The complete code, dependencies, configuration, official evaluation script, and licenses are public. The public copy matches the local archive file for file and passed reruns of the offline evaluation, independent recomputation, and eight-example smoke test with the actual model. Pinned source directory, README with run instructions, and SOURCE_MAP code reference.

For a minimal offline reproduction, run python official_evaluate.py formal_eval_input.json formal_predictions.json --out-file official_results.json, then python audit.py. This should produce the official results and an independent verification record. To verify the original data, run python audit_data.py /path/to/dev-v2.0.json.

To reproduce the run from the model, install the pinned dependencies and run the fetch, register, smoke, and formal subcommands of run.py in order. Downloads use the pinned model revision and dataset file hash. You can also supply a verified cache. The source package includes the custom modules and outputs needed to recompute the results. Model weights and full passages are omitted. The small set of public answers and predictions retains its source and licensing information, and reproduction requires no paths on the author's machine.

Research Questions and Conclusion

This article establishes a baseline with a public, compact QA model, real answerable questions, first-window extraction, official scoring, and independent recomputation. It shows what the model produced under fixed rules. How it handles unanswerable passages remains open, and generative answering and retrieval systems are outside this experiment's scope. The next article will hold the predictions fixed and examine the scores from a different angle to show which examples account for the gap between EM and F1.

The series will build on errors that readers can inspect. Windowing, abstention, distractors, and retrieval involve different mechanisms, so each new experiment needs to state what changes and what stays fixed. The sealed pool will remain reserved for the final confirmation and will play no role in threshold selection or in determining the direction of the research. This baseline gives each later change a verifiable point of comparison.

References

Sources retrieved and opened on 2026-12-01.

  1. Rajpurkar, P., Jia, R., Liang, P. (2018). Know What You Don't Know: Unanswerable Questions for SQuAD. ACL.
  2. Official SQuAD data, license, and evaluation resources. Data licensed under CC BY-SA 4.0.
  3. Official evaluation script at the pinned commit. Code licensed under MIT.
  4. Pinned deepset MiniLM QA model card. The publisher lists CC BY 4.0.
  5. Pinned BERT QA implementation in Transformers. Apache-2.0.

Apps by the author

Alongside this blog, I build small tools to make everyday life more manageable. Here are two apps I developed independently:

  • Daily Expense Journal: Track income and expenses, give each amount a purpose, and plan budgets and savings goals. View on the App Store.
  • One Small Action: Start with a small action that fits the time and energy you have, then record how it felt and what you noticed. View on the App Store.

More technical articles and independent projects