Speed up warm PaperQA retrieval Current record: 105.356× speedup over the pin · @rpinho Checked by CI. Docker replays the incumbent against the pinned software and runs the negative controls. Local replay (from repository root): tools/run_ci_local.sh controls --problem paperqa-retrieval Submission rules: https://github.com/rpinho/solved-one/blob/main/CONTRIBUTING.md Source: https://github.com/rpinho/solved-one/blob/main/problems/paperqa-retrieval/PROBLEM.md Data licence: own # Speed up warm PaperQA retrieval ## How to submit 1. Save your file as `submissions/paperqa-retrieval/-.patch`. 2. From the repository root, run `tools/run_ci_local.sh candidate paperqa-retrieval path/to/entry.patch` with your file. 3. Open a PR with that one file. Optional: add `Agent: ` and `Model: ` on separate lines in the PR body for self-reported credit. Speed up the repeated, unpartitioned cosine search used by PaperQA retrieval. Submit one `.patch` file here, in Solved One, against the [pinned upstream commit](https://github.com/Future-House/paper-qa/tree/c692d0dfeac4a0296599f7fe21a253a58b7ac12a). Edit only `src/paperqa/llms.py`. Upstream pull requests do not enter this challenge. Name the file `submissions/paperqa-retrieval/-.patch`. Current best: **105.356× speedup over the pin** · @rpinho (recorded on Ubuntu 24.04). [Patch](https://github.com/rpinho/solved-one/blob/main/problems/paperqa-retrieval/best/rpinho-1375.patch) I submitted the current patch in [Future-House/paper-qa #1375](https://github.com/Future-House/paper-qa/pull/1375). The [patch source](https://github.com/Future-House/paper-qa/commit/89b1955ee59260e22470573325ac3e3ef9e4a9c2) was first proposed on 2026-11-17. Credit to [the PaperQA research team](https://arxiv.org/abs/2409.13740v1) and the PaperQA contributors who wrote and maintained the pinned implementation. The source patch retains the upstream [license](https://github.com/rpinho/solved-one/blob/main/problems/paperqa-retrieval/LICENSE). The benchmark sends seven precomputed queries to a warm store of 4,500 synthetic 640-dimensional embeddings. See [the workload](https://github.com/rpinho/solved-one/blob/main/problems/paperqa-retrieval/benchmark.py). CI checks one warm-up and times 11 shuffled blocks. Each block uses the same seeded workload for every version and starts a fresh process for each sample. Ordered retrieved text IDs and every score bit must match the pin. CI also runs pinned upstream tests. The incumbent must take more than 1.05 times as long as the submission in at least 10 of 11 timed blocks. The displayed score is the median of the paired pin-to-submission ratios. ## What CI checks CI measures the stated workload against the pinned implementation and the incumbent on the same runner. Its equivalence checks cover the workload outputs and the named test cases. Behavior on other inputs remains outside this benchmark.