LLM LATENCY OPTIMIZATION ON NON-STANDARD QUERIES USING HYBRID SEMANTIC CACHE MIDDLEWARE

Authors

  • Agry Alfiah Universitas Gunadarma, Indonesia Author

DOI:

https://doi.org/10.5281/zenodo.21129261

Keywords:

Semantic Cache, Latency, LLM, Non-Standard Language, FAISS

Abstract

This research aims to optimize Large Language Model (LLM) latency in handling non-standard language queries through a Hybrid Semantic Cache Middleware architecture. The primary challenges in cloud LLM integration are high network latency and semantic matching failures on noisy text. The proposed method integrates the all-MiniLM-L6-v2 model with a static dictionary-based Text Normalization module and threshold optimization in FAISS. Experimental results show that the system successfully increased the Hit Rate from 11.00% to 58.00% under optimal conditions (Threshold 0.65). Furthermore, the average response latency was reduced from 4,494.00 ms (Cloud Baseline) to 17.98 ms, achieving a 99.6% speedup. This implementation proves that local caching with normalization effectively minimizes operational costs and network bottlenecks for Generative AI services in Indonesia.

Downloads

Download data is not yet available.

References

Fu, B. dan Feng, D. 2023. GPTCache: An Open-Source Semantic Cache for LLM Applications Enabling Faster Answers and Cost Savings. 212–218. https://aclanthology.org/2023.nlposs-1.24/.

Google. 2025. Generative AI Beginner’s Guide. Google Cloud Documentation. https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview.

Google Cloud. 2025. Tiered Hybrid Pattern. Google Cloud Documentation. https://cloud.google.com/architecture/hybrid-multicloud-patterns-and-practices/tiered-hybrid-pattern.

HuggingFace. 2023. Sentence-Transformers: all-MiniLM-L6-v2 Model. https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2.

Meta AI. 2024. FAISS: A Library for Efficient Similarity Search and Clustering of Dense Vectors. https://faiss.ai/.

Wibowo, H.A., dkk. 2021. IndoCollex: A Testbed for Morphological Transformation of Indonesian Colloquial Words. Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. 3170–3183.

Wilie, B., dkk. 2020. IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding. Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics. 843–857.

Zilliz. 2023. GPTCache: A Library for Creating Semantic Cache for LLM Queries. https://gptcache.readthedocs.io/en/latest/.

Downloads

Published

2026-07-02