Improving Question Generation with Retrieval-Augmented Generation and Semantic Search Using Cosine Similarity Validation
摘要
The traditional approach of manually creating questions from educational materials has proven time-consuming and inefficient for educators. While Large Language Models (LLMs) offer automation potential, they frequently produce questions lacking contextual precision and relevance to the source material. This paper presents a Smart Question Answer Generation System that leverages Retrieval Augmented Generation (RAG) combined with artificial intelligence to significantly enhance contextual accuracy in generated questions. Our system transforms PDF content into vector embeddings stored in a specialized database, enabling sophisticated semantic search capabilities that correctly interpret context-dependent terms. For instance, the system can distinguish whether “Apple” refers to the technology company or the fruit based on surrounding context. The implementation incorporates Bloom’s taxonomy for cognitive classification, cosine similarity scoring for comprehensive answer validation, and intelligent image classification for question- relevant visual content. Users can efficiently save, search, and repurpose generated question-answer pairs for various educational applications, including examination preparation and question bank development. Comprehensive experimental evaluation demonstrates that our RAG+DeepSeek R1 (70B) model achieves remarkable 94.5% accuracy with 800ms response time, substantially outperforming the baseline Gemini-only LLM approach which achieves 78.2% accuracy with 1200 ms response time. These results clearly establish both the superior performance and enhanced accuracy of our system compared to traditional LLM-only methodologies.