Leveraging In-Context Learning and Retrieval-Augmented Generation for Automatic Question Generation in Educational Domains
Subhankar Maity, Aniket Deroy and Sudeshna Sarkar
Indian Institute of Technology Kharagpur
The 16th meeting of Forum for Information Retrieval Evaluation
DA-IICT, Gandhinagar
12th-15th December
Motivation
Contributions
TASK DEFINITION
Problem Statement & Input-Output Representation
𝑓 (𝑃) = 𝑄
where 𝑃 is the input passage, and 𝑄 is the generated question.
In-Context Learning (ICL)
In the In-Context Learning (ICL) paradigm, given an input passage 𝑃new and a set of 𝑘 few-shot examples {(𝑃1, 𝑄1), (𝑃2, 𝑄2), . . . , (𝑃𝑘 , 𝑄𝑘 )}, the model generates a new question 𝑄new corresponding to 𝑃new:
Here, the few-shot examples serve as prompts to guide the question generation process for the new passage.
Retrieval-Augmented Generation (RAG)
For Retrieval-Augmented Generation (RAG), the task is extended by incorporating an external retrieval mechanism.
Given a passage 𝑃, the model retrieves a set of relevant documents {𝑅1, 𝑅2, . . . , 𝑅𝑘 } from an external corpus. These documents provide additional context, and the final question 𝑄 is generated as:
Hybrid Model
Our proposed Hybrid Model combines the advantages of both ICL and RAG.
The model first retrieves a set of documents {𝑅𝑖} 𝑘𝑖=1 for the input passage 𝑃, and then uses few-shot learning to generate the question 𝑄 based on both the passage and retrieved documents:
Here, the retrieval step enriches the context for question generation, while the few-shot examples (i.e., 𝑚 examples) help guide the model towards generating pedagogically relevant questions.
Dataset
[1] Maity et al.: Harnessing the Power of Prompt-based Techniques for Generating School-Level Questions using Large Language Models. In Proceedings of the 15th Annual Meeting of the Forum for Information Retrieval Evaluation (Panjim, India) (FIRE ’23). Association for Computing Machinery, New York, NY, USA, 30–39. https://doi.org/10.1145/ 3632754.3632755
METHODOLOGY
In-Context Learning (ICL) Approach
For the ICL approach, we use the GPT-4 model to generate questions based on a few-shot prompt.
Each prompt consists of 𝑘 example input-output pairs {(𝑃1, 𝑄1), . . . , (𝑃𝑘 , 𝑄𝑘 )}, where each pair consists of a passage and a corresponding question.
Given a new passage 𝑃new, the model generates a question 𝑄new using the few-shot examples (K = 3, 5, 7) as context. The general structure of the ICL prompt is as follows:
Retrieval-Augmented Generation (RAG) Approach
Hybrid Model
Our Hybrid Model combines the retrieval-based context enrichment of RAG with the few-shot learning mechanism of ICL using GPT-4.
First, relevant documents are retrieved for a given passage 𝑃.
Then, the few-shot learning mechanism uses these retrieved documents alongside the input passage to generate a more contextually accurate and pedagogically meaningful question. The hybrid approach can be mathematically defined as:
Here, 𝑃 is the input passage, {𝑅𝑖}𝑘𝑖=1 are the retrieved documents (K = 5), and {(𝑃𝑖 , 𝑄𝑖)}𝑚𝑖=1 are the few-shot examples (m = 5) used to guide the question generation process.
Baseline Models
We fine-tune the best-performing models (based on automated evaluation), such as the T5-large [1] and BART-large [1] architectures, on the EduProbe training dataset.
[1] Maity et al.: Harnessing the Power of Prompt-based Techniques for Generating School-Level Questions using Large Language Models. In Proceedings of the 15th Annual Meeting of the Forum for Information Retrieval Evaluation (Panjim, India) (FIRE ’23). Association for Computing Machinery, New York, NY, USA, 30–39. https://doi.org/10.1145/ 3632754.3632755
Automatic Evaluation Results
Human Evaluation Results
Output Samples
Output Samples
Conclusions
Thank you!