AdaLLM: A Subject-Adaptive RAG Framework Designed for the Question Answering Process of NCTB’s Class-8 Science & BGS Subjects
Abstract
Bangladesh has over 160 million Bengali speakers where the students study from the textbooks offered by the National Curriculum Textbook Board of Bangladesh (NCTB). General-purpose AI chatbots give unreliable answers to these students because they are not trained on NCTB content and hallucinate confidently wrong facts, which poses a serious risk in education. This paper presents AdaLLM, a subject-adaptive Retrieval-Augmented Generation (RAG) system for NCTB Class 8’s Bangladesh and Global Studies (BGS) and Science subjects. The proposed system uses an eight-layer pipeline (L0–L7) in which L0 rewrites informal or Banglish student queries into academic Bengali, L1 detects the school subject (95% accuracy), L2 performs hybrid dense+sparse retrieval with subject-adaptive weighting (α = 0.60 for BGS, 0.40 for Science), L3 re-ranks chunks by curriculum relevance, L4 validates context quality, L5 triggers a cross-subject fallback on failure, L6 generates a Bengali answer using Gemma 3 4B, and L7 applies 5-axis confidence scoring. Textbooks were digitized via a multi-step OCR pipeline achieving CER 4.65% and WER 8.84%. We collected a human-annotated evaluation dataset of 100 Q&A pairs with 1,000 student-written answers and 1,000 informal query variants verified by subject-matter teachers. Our full system achieves ROUGE-L score of 0.1654 and BERTScore F1 of 0.7120 on informal student queries, outperforming RAG without rewriting (ROUGE-L 0.1088) and direct LLM generation without RAG (ROUGE-L 0.1225). On formal academic queries the system achieves a Hit Rate of 0.71, MRR of 0.5603, and Faithfulness of 0.7859 with a hallucination rate of 0.0.