[Paper Review] Enhancing textual textbook question answering with large language models and retrieval augmented generation
This paper proposes a retrieval-augmented generation (RAG) framework fine-tuned on Llama-2 to enhance textbook question answering (TQA), specifically addressing the 'out-of-domain' problem where key concepts span multiple lessons. By retrieving relevant topics from a vector database and integrating them with the full lesson context, the model achieves a 9.84% accuracy gain on the test set for non-diagram multiple-choice questions over the baseline Llama-2 without fine-tuning.
Textbook question answering (TQA) is a challenging task in artificial intelligence due to the complex nature of context needed to answer complex questions. Although previous research has improved the task, there are still some limitations in textual TQA, including weak reasoning and inability to capture contextual information in the lengthy context. We propose a framework (PLRTQA) that incorporates the retrieval augmented generation (RAG) technique to handle the out-of-domain scenario where concepts are spread across different lessons, and utilize transfer learning to handle the long context and enhance reasoning abilities. Our architecture outperforms the baseline, achieving an accuracy improvement of 4. 12% in the validation set and 9. 84% in the test set for textual multiple-choice questions. While this paper focuses on solving challenges in the textual TQA, It provides a foundation for future work in multimodal TQA where the visual components are integrated to address more complex educational scenarios. Code: https://github.com/hessaAlawwad/PLR-TQA
Motivation & Objective
- To address the 'out-of-domain' problem in textbook question answering, where relevant information is distributed across multiple lessons.
- To improve reasoning and contextual understanding in long, complex textbook passages using large language models (LLMs).
- To enhance the accuracy of multiple-choice question answering in the CK12-QA dataset through retrieval-augmented generation (RAG) and supervised fine-tuning.
- To evaluate the impact of RAG with and without re-ranking on model performance in long-context TQA scenarios.
Proposed method
- Fine-tuned Llama-2 via supervised fine-tuning (SFT) on the CK12-QA dataset to adapt it to the textbook question-answering task.
- Implemented a retrieval-augmented generation (RAG) pipeline using a vector database to store embeddings of lesson topics.
- Used dense vector similarity (dot product) to retrieve relevant topics from the entire dataset for each question, expanding context beyond the question’s source lesson.
- Integrated both the full lesson and retrieved topics as context in the LLM prompt to improve answer generation.
- Applied a re-ranking mechanism to refine retrieved topics, aiming to improve relevance and reduce noise.
- Evaluated model performance using accuracy on validation and test sets for non-diagram multiple-choice questions.
Experimental results
Research questions
- RQ1Can retrieval-augmented generation (RAG) improve the performance of LLMs on textbook question answering when concepts are spread across multiple lessons?
- RQ2How does incorporating retrieved topics from other lessons affect the reasoning and accuracy of LLMs in long-context TQA tasks?
- RQ3Does the use of a re-ranking module in RAG enhance or degrade model performance in TQA due to potential introduction of irrelevant context?
- RQ4To what extent does supervised fine-tuning of Llama-2 improve its performance on domain-specific textbook QA compared to the base model?
Key findings
- The baseline Llama-2 model achieved only 38.09% accuracy on the validation set and 38.54% on the test set for all text questions, indicating poor zero-shot performance on TQA.
- Integrating RAG without re-ranking improved accuracy to 83.58% on validation and 83.80% on test set, demonstrating a significant performance boost.
- Using both the full lesson and retrieved topics with RAG yielded 83.78% accuracy on validation and 81.73% on test, showing a slight drop on test due to context window saturation.
- Incorporating the re-ranked topics reduced performance to 80.74% on validation and 79.22% on test, indicating that noisy or irrelevant retrieved topics can degrade model inference.
- The proposed RAG-enhanced, fine-tuned Llama-2 model achieved a 4.12% accuracy improvement on the validation set and a 9.84% improvement on the test set for non-diagram multiple-choice questions compared to the base Llama-2.
- The analysis revealed that only 44% of questions retrieved their correct lesson’s topic, and even with re-ranking, only 52.43% achieved retrieval from the correct lesson, underscoring the need for RAG in out-of-domain scenarios.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.