Selection and Prediction of Retrieval Strategies for RAG Systems Based on Machine Learning Algorithms
Abstract
The popularization speed of generative artificial intelligence technology is accelerating. The Retrieval Augmented Generation (RAG) system, with its feature of enhancing output accuracy by integrating external knowledge bases, has been widely applied in fields such as intelligent question answering and professional document generation. This study first conducted a correlation analysis and then carried out comparative experiments using multiple machine learning algorithms. The results showed that the KELM-LSTM-Transformer algorithm proposed in this paper demonstrated significant advantages in the comparison: Its accuracy rate, recall rate, precision rate and F1 value all exceed 99.5%, with some indicators approaching 100%, and the AUC is also close to 100%. This algorithm not only significantly outperforms relatively weak algorithms such as AdaBoost, decision tree, and KNN, but also outperforms medium and high-performance algorithms like GBDT, ExtraTrees, SVM, and XGBoost. Even compared with the outstanding random forest and multi-head attention LSTM, its core classification index still maintains a higher level, and the AUC index has a particularly prominent advantage, fully demonstrating its superiority in complex feature capture and sequence information modeling. This achievement provides an efficient algorithmic solution for the performance optimization of the RAG system and also offers a reference for technical research in related fields. It is of great significance for promoting the precise application of generative AI in professional scenarios.
References
- Veturi, Sriram, et al. "Rag based question-answering for contextual response prediction system." arXiv preprint arXiv: 2409.03708 (2024).
- Ning, Kanghui, et al. "Ts-rag: Retrieval-augmented generation based time series foundation models are stronger zero-shot forecaster." arXiv preprint arXiv: 2503.07649 (2025).
- Lin, Leqi, et al. "DeepSeek-LLM with Adaptive RAG for Pharmaceutical Dissolution Prediction." Pharmaceutical Research (2025): 1-15.
- Abo El-Enen, Mohamed, Sally Saad, and Taymoor Nazmy. "A survey on retrieval-augmentation generation (RAG) models for healthcare applications." Neural Computing and Applications 37.33 (2025): 28191-28267.
- Joshi, Ashutosh, et al. "Reaper: Reasoning based retrieval planning for complex rag systems." Proceedings of the 33rd ACM International Conference on Information and Knowledge Management. 2024.
- Zhang, Song, et al. "AI-Driven Post-Earthquake Emergency Material Demand Prediction: Integrating RAG with Reasoning Large Language Model." IEEE Access (2025).
- Zhao, Siyun, et al. "Retrieval augmented generation (rag) and beyond: A comprehensive survey on how to make your llms use external data more wisely." arXiv preprint arXiv: 2409.14924 (2024).
- Jin, Bowen, et al. "Long-context llms meet rag: Overcoming challenges for long inputs in rag." arXiv preprint arXiv: 2410.05983 (2024).
- Oche, Agada Joseph, et al. "A systematic review of key retrieval-augmented generation (rag) systems: Progress, gaps, and future directions." arXiv preprint arXiv: 2507.18910 (2025).
- Xiao, Mengxi, et al. "Retrieval-augmented large language models for financial time series forecasting." arXiv preprint arXiv: 2502.05878 (2025).