Skip to content

Research Articles

Semantic Answer Caching with Version Boundaries: Bursty Inputs

Beatriz Eastmarsh (Data Engineering Group, Cairnwell Research Institute), Niko Kestrelby (Data Engineering Group, Cairnwell Research Institute), Zoya Hartfen (Machine Learning Laboratory, Ivermere University), Uma Belmere (Machine Learning Laboratory, Ravenmere Technical University)

Vol. 6 No. 1 (2025) · pp. 1–12 · Published 29 January 2025

Abstract

We ask whether checking embedding similarity and the evidence snapshot before reusing a generated answer performs better than reusing the nearest cached answer by similarity alone in an input stream alternating between quiet periods and peaks. The evaluation is synthetic. Each configuration is evaluated on the same 200 cases. In the 50 stress cases, nearly identical prompts must refer to different policy editions; peak and quiet intervals are retained at their original lengths rather than being normalized to the same arrival rate. A case counts as a pass only if it meets this criterion: a cache hit must still be correct for the current corpus and requested date. The replay retains source versions and arrival order. A reference output built from the complete synthetic history is used to distinguish a fast response from one that is both current and correct. The first configuration passes 168 of 200 cases, versus 159 for the comparator. In the stress subset, the respective counts are 36 and 30 of 50. The alternative exceeds the comparator overall by 4.5 percentage points. The practical trade-off is that a version-aware cache invalidates some answers that would still be valid. A subsequent evaluation should set tolerances independently and repeat the comparison on workloads not used to select the configuration.

Keywords: semantic caching, retrieval-augmented generation, snapshot consistency, bursty inputs, synthetic evaluation

References

  1. Chen, J., Lin, H., Han, X., & Sun, L. (2024). Benchmarking large language models in retrieval-augmented generation. Proceedings of the AAAI Conference on Artificial Intelligence, 38(16), 17754–17762.
  2. Es, S., James, J., Espinosa Anke, L., & Schockaert, S. (2024). RAGAs: Automated evaluation of retrieval augmented generation. Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations, 150–158. DOI
  3. Gao, Y., et al. (2023). Retrieval-augmented generation for large language models: A survey. arXiv:2312.10997.
  4. Izacard, G., et al. (2022). Atlas: Few-shot learning with retrieval augmented language models. arXiv:2208.03299.
  5. Jiang, Z., et al. (2023). Active retrieval augmented generation. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, 7969–7992.
  6. Krishna, K., Song, Y., Karpinska, M., Wieting, J., & Iyyer, M. (2023). Paraphrasing evades detectors of AI-generated text, but retrieval is an effective defense. Advances in Neural Information Processing Systems, 36.
  7. Lewis, P., et al. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33, 9459–9474.
  8. Li, Z., Li, C., Zhang, M., Mei, Q., & Bendersky, M. (2024). Retrieval augmented generation or long-context LLMs? A comprehensive study and hybrid approach. arXiv:2407.16833.
  9. Ma, J., Korotkov, I., Yang, Y., Hall, K., & McDonald, R. (2021). Zero-shot neural passage retrieval via domain-targeted synthetic question generation. Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics, 1075–1088.
  10. Ma, X., Gong, Y., He, P., Zhao, H., & Duan, N. (2023). Query rewriting for retrieval-augmented large language models. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, 5303–5315.
  11. Peng, B., et al. (2024). Graph retrieval-augmented generation: A survey. arXiv:2408.08921.
  12. Ram, O., et al. (2023). In-context retrieval-augmented language models. Transactions of the Association for Computational Linguistics, 11, 1316–1331.
  13. Shi, W., et al. (2023). REPLUG: Retrieval-augmented black-box language models. arXiv:2301.12652.
  14. Yan, S.-Q., Gu, J.-C., Zhu, Y., & Ling, Z.-H. (2024). Corrective retrieval augmented generation. arXiv:2401.15884.