Keywords
Recommender System, RAG, Lightweight LLM, Knowledge-Base, QLoRA
Document Type
Article
Abstract
When choosing a cryptographic block cipher, several factors must be considered, including security, performance, implementation feasibility, and application environment. However, such choices should often be made with professional expertise. The paper shows a domain-specific conversational recommendation system, which consists of a lightweight Large Language Model (Llama 3.2-1B) fine-tuned using Quantized Low-Rank Adaptation (QLoRA) and Retrieval-Augmented Generation (RAG) based on a structured knowledge base of block-cipher properties. During inference, the user query (with requirements) is embedded using all-MiniLM-L6-v2 and used to retrieve the most relevant cipher entries from a FAISS index, which is built offline by using the structured knowledge base. To reduce hallucinations and ensure accurate recommendations, the retrieved metadata of the cipher is injected into the prompt to ground the model's reasoning. The proposed system was evaluated on a custom dataset of 10,000 queries (80/20 split) by using the same fine-tuned LLM without retrieval augmentation and the content-based recommender. The results of the proposed system were 92.4% (top-1 accuracy), 90.1% (macro-F1), 123ms (latency), and 87.5% (robustness to prompt paraphrasing). These findings show that the lightweight LLMs, when used together with a structured knowledge retrieval, can provide credible and real-time cryptographic guidance.
Recommended Citation
Ahmed, Ahmed M.; Sadiq, Ahmed T.; and Farhan, Alaa K.
(2026)
"Domain-Specific Conversational Recommendation With Lightweight LLMs and Knowledge Retrieval: A Case Study in Cryptography,"
Engineering and Technology Journal: Vol. 44:
Iss.
4, Article 1.
DOI: https://doi.org/10.30684/2412-0758.1540
DOI
10.30684/2412-0758.1540
First Page
1
Last Page
18





