R2GQA: Retriever-Reader-Generator Question Answering System to Support Students Understanding Legal Regulations in Higher Education
Phuc-Tinh Pham Do Duy-Ngoc Dinh Cao Khanh Quoc Tran Kiet Van Nguyen


R2GQA System for Legal Regulations in Higher Education]R2GQA: Retriever-Reader-Generator Question Answering System to Support Students Understanding Legal Regulations in Higher Education

















1,2]Phuc-Tinh Pham Do20522020@gm.uit.edu.vn

1,2]Duy-Ngoc Dinh Cao20521661@gm.uit.edu.vn

1,2]Khanh Quoc Trankhanhtq@uit.edu.vn

[1,2]Kiet Van Nguyenkietnv@uit.edu.vn

[1]University of Information Technology,  Ho Chi Minh City, Vietnam

[2]Vietnam National University,  Ho Chi Minh City, Vietnam




In this article, we propose the R2GQA system, a Retriever-Reader-Generator Question Answering system, consisting of three main components: Document Retriever, Machine Reader, and Answer Generator. The Retriever module employs advanced information retrieval techniques to extract the context of articles from a dataset of legal regulation documents. The Machine Reader module utilizes state-of-the-art natural language understanding algorithms to comprehend the retrieved documents and extract answers. Finally, the Generator module synthesizes the extracted answers into concise and informative responses to questions of students regarding legal regulations. Furthermore, we built the ViRHE4QA dataset in the domain of university training regulations, comprising 9,758 question-answer pairs with a rigorous construction process. This is the first Vietnamese dataset in the higher regulations domain with various types of answers, both extractive and abstractive. In addition, the R2GQA system is the first system to offer abstractive answers in Vietnamese. This paper discusses the design and implementation of each module within the R2GQA system on the ViRHE4QA dataset, highlighting their functionalities and interactions. Furthermore, we present experimental results demonstrating the effectiveness and utility of the proposed system in supporting the comprehension of students of legal regulations in higher education settings. In general, the R2GQA system and the ViRHE4QA dataset promise to contribute significantly to related research and help students navigate complex legal documents and regulations, empowering them to make informed decisions and adhere to institutional policies effectively. Our dataset is available[Link for accessing to the dataset.] for research purposes.




[
    *
    
=====





§ INTRODUCTION

The educational regulations of universities consist of documents regarding training regulations, provisions, and guidelines on current training programs that students must adhere to to complete their academic programs. However, a significant challenge lies in the potential length and complexity of these educational regulations, making it difficult to read and extract information. Searching for specific information from these documents can be time-consuming, posing difficulties for students and lecturers. Alternatively, students may search for the wrong document, leading to misinterpretations and consequential adverse effects on students.

The question-answering system (QAS) can help address the above problem. Similarly to search engines such as Google or Bing, the output of such a system is the answer to the input question based on the information available in the database. A question-answering system typically comprises two main components: a Document Retriever and a Machine Reader (or Answer Generator for abstractive questions). The document retriever queries relevant information related to the question, which is then passed to the Reader/Generator along with the question to generate an answer. Figure <ref> shows the input of the USER question and the output of the BOT Assistant of the question answering system.



In the field of legal in Vietnamese, several question-answering systems have been developed. For example, in 2014, the vLawyer system was proposed by <cit.>, a simple question-answering system with words in the answers directly extracted from documents. Therefore, it can be seen that very few question-answering systems in Vietnamese can provide answers with a human-like style.

When addressing abstract responses using language models, there are several approaches. An approach involves extracting multiple spans from the context and concatenating them as part of the MUSST framework <cit.>. However, this method renders the responses less natural and diverse in language than human-like expressions. Another approach consists of passing the question and context through a generator module to produce complete answers (RAG). This method may result in less accurate output answers due to contextual overload, leading to noise. Furthermore, current answer generator models primarily perform text summarization tasks, which are not always suitable for answer extraction tasks. Enhancing performance can be achieved by using a machine reader module to extract answers before passing them through the answer generator models.

An essential component for implementing a question-answering system is training data. For the Vietnamese legal document, there are currently a few datasets available to build question answering systems. The dataset from Kien et al. (2020) <cit.> and the dataset from Pham and Le (2023) <cit.> are two typical examples. However, the output of the two tasks is a set of ranked texts related to the question. Therefore, in Vietnamese, there is still a lack of datasets with answers extracted from various positions within the context or with natural language styles. Hence, constructing a training dataset with answers synthesized from multiple spans appearing in different positions within the context or having a natural, human-like style is very necessary. In this paper, we have three contributions:

    
  * Question-answering system: We designed a Retriever-Reader-Generator system named R2GQA, the first question-answering system for abstractive answers in Vietnamese, leveraging answers from the Machine Reader. Leveraging answers from the Reader and combining them with questions for the Generator to generate answers helps reduce noise compared to incorporating all information from the context.

    
  * Dataset construction: We create a machine reading comprehension dataset named ViRHE4QA based on the legal regulations in higher education. This is the first Vietnamese dataset in the domain of university regulations, including various types of answers: multi-span extracted answers, abstractive answers. This dataset comprises 9,758 question-answer pairs that will be used to train the Reader and Generator models in our systems.

    
  * Experiments and evaluation: We conduct experiments to evaluate models in the Document Retriever module. We also evaluate extractive reading comprehension models in the machine reader module and text generation models in the Generator module. Additionally, we analyze and compare the performance of our system with open-book question-answering systems, such as RAG <cit.>.



The sections of the paper include Section <ref> that provides an overview of the R2GQA system and the ViRHE4QA dataset. Section <ref> reviews studies related to question-answering systems and datasets in the world and Vietnam. Section <ref> describes the creation and characteristics of the ViRHE4QA dataset. Section <ref> details the design and implementation of our R2GQA system. Section <ref> presents the experimental setup and findings. Section <ref> interprets the results and highlights their implications. Section <ref> examines the limitations and challenges encountered. Finally, Section <ref> summarizes the study and suggests directions for future research.



§ RELATED WORKS




 §.§ Related Question Answering System

A question-answering system is a challenging task in natural language processing (NLP). Various types of systems have been developed to date. Based on the type of output answers, there are two popular systems in the field of NLP. 

First, question-answering systems with answers extracted from context (extractive question-answering). Some question-answering systems of this type include vLawyer <cit.>, a simple question-answering system on Vietnamese legal texts proposed by Duong and Ho (2014) <cit.>. vLawyer consists of two components: Question Processing and Answer Selection. 

DrQA, which is designed for reading comprehension in open-domain question-answering, as proposed by Chen et al. (2017) <cit.>. BERTserini <cit.> is a question-answering system that combines two models: BERT <cit.> and Anserini. Anserini is an information retrieval tool that identifies relevant documents that are likely to contain the answer. BERT <cit.> (Bidirectional Encoder Representations from Transformers) is a language model that understands context and the relationships between words to extract answers from context retrieved by Anserini. MUSST <cit.> is a framework that is used to automatically extract answers from a given context. The answers of this framework are formed from multiple spans in the context to create human-like answers. This framework has two main modules: Passage Ranker and Question Answering. 

XLMRQA <cit.> is the first Vietnamese question-answering system with three modules: document retriever, machine reader, and answer selector). This question-answering system outperforms DrQA and BERTserini on the UIT-ViQuAD dataset <cit.>.  ViQAS is a question-answering system proposed by Nguyen et al. (2023) <cit.>. In addition to the three retriever-reader-selector modules similar to XLMRQA, ViQAS includes an additional preprocessing rule step before the retriever module. Additionally, in the retriever module, the authors implemented smaller steps including evidence extraction and re-ranking. These changes contributed to ViQAS outperforming DrQA, BERTserini, and XLMRQA in the datasets UIT-ViQuAD <cit.>, ViNewsQA <cit.>, and ViWikiQA <cit.>. 

Second, question-answering systems with abstractive answer (abstractive question-answering). For this type of system, there are two common systems: open-book question answering and closed-book question answering.  Open-book question-answering systems typically have two modules: retriever and generator. The generator module in these systems is a sequence-to-sequence model such as T5 <cit.> or BART <cit.>. Some systems proposed based on open-book question answering include Fusion-in-Decoder <cit.> and RAG <cit.>. In the past two years, RAG has become very popular due to the strong development of large language models (LLMs) such as Gemini, GPT-4, or Copilot. These LLMs significantly enhance the performance of RAG due to their ability to generate accurate answers. 

Closed-book question-answering systems typically have one module, the generator. These generator models are usually generative language models like seq2seq pre-trained on a large collection of unsupervised texts. With enough parameters, these models can memorize some factual knowledge within their parameter weights. Therefore, these language models can freely generate answers to input questions without needing context. Some studies have used this method, such as the paper <cit.>, and CGAP <cit.>. Recently, with the boom of LLMs such as GPT-3.5, GPT-4, Gemini, and LlaMa, closed-book question-answering has been widely applied in practice, and chatbots are increasingly appearing. However, the closed-book question-answering method can sometimes result in hallucination, causing confusion and inaccuracies in the answers.

Both of these methods have different advantages and disadvantages. Therefore, in this paper, we design a question-answering system with three modules (Retriever-Reader-Generator) to leverage the strengths and overcome the limitations of the aforementioned methods. This is the first question-answering system for abstractive answers in Vietnamese.


 §.§ Related Dataset

Developing question-answering (QA) systems for specific domains requires specialized datasets tailored to domain knowledge and language. In the legal domain, several renowned datasets have been established and widely used. JEC-QA <cit.> is a comprehensive dataset comprising 26,365 multiple-choice questions, encompassing 13,341 single-answer questions (further divided into 4,603 knowledge-driven and 8,738 case-analysis questions) and 13,024 multi-answer questions (including 5,158 knowledge-driven and 7,866 case-analysis questions). BSARD <cit.>: BSARD was created by legal experts, BSARD comprises 1,108 questions derived from 22,633 legal articles. The dataset exhibits an average article length of 495 words, while questions range from 23 to 262 words, with a median length of 83 words. PRIVACYQA <cit.>: PRIVACYQA comprises 1,750 questions spanning 335 policies and 4,947 sentences, meticulously crafted by experts. The dataset is characterized by its long texts, with an average document size of 3,237.37 words. In particular, PRIVACYQA encompasses a diverse range of question types, including unanswerable and subjective questions.

For Vietnamese, some work on legal QA datasets has recently been published. The QA data set was created by Kien et al. (2020) <cit.> and includes 5,922 questions with 117,545 related articles. This is a large legal dataset for Vietnam. Each question has an average length of 12.5 words and is associated with 1.6 relevant articles. The dataset from Pham and Le (2020) <cit.> consists of 4,547 questions and 5,165 passages. The length of each pair of questions and answers is mostly less than 100 words. For the domain of university education regulations, the dataset from Phuc et al. (2023) <cit.> comprises 10,000 data points in the training set and 1,600 in the test set, constructed based on the guidelines of the Ho Chi Minh City University of Industry. The answers in this dataset are extracted from contextual passages.

Therefore, currently there are few Vietnamese machine reading comprehension datasets containing answers that span multiple positions and exhibit human-like style in the domain of higher education regulations. We hope that our dataset will contribute additional resources for Vietnamese in creating and developing systems in this domain.


§ DATASET



 §.§ Dataset Creation

In this section, we introduce how we constructed the dataset. Our dataset creation process consists of 6 phases: context collection (Section <ref>), guidelines creation (Section <ref>), creator agreement (Section <ref>), question-answer creation (Section <ref>), data validation (Section <ref>), and data splitting (Section <ref>). These six phases are illustrated in Figure <ref>.





  §.§.§ Context Collection
 
We collected regulatory documents regarding the curriculum of a university in Vietnam. The documents were gathered in various formats, such as Word, PDFs, or images, so we converted them to Word using smallpdf.com[<https://smallpdf.com/pdf-to-word>] or manually retyped them if the PDF file contains images. After converting all documents to the Docs format, we converted the tables into paragraphs using a predefined format. 

Following this process, we obtained 21 documents with an average length of 10.67 pages and 3,881 words per document. As the word count in each document is too large for language models, we divided the documents into smaller paragraphs (called articles) for convenience in dataset construction and model training. In the result, we obtained 294 articles (referred to as contexts below) with an average length of 234.49 words.



  §.§.§ Guidelines Creation
 

We relied on the guidelines from two datasets, UIT-ViQuAD <cit.> and ViRe4MRC <cit.>. These guidelines describe and provide detailed examples to help creators understand how to create questions and answers for the given problem consistently. The guidelines clearly outline different question types including "How", "What", "Which", "Where", "Why", "When", "Who", Yes/No, and other types such as "How long", "How many". Definitions and examples of each type of question are presented in the Table <ref>.



 
The guidelines cover various strategies for asking questions, such as asking questions from general to specific, asking questions in the order of the context before posing questions whose answers appear at multiple places, and posing "Wh" questions before "Yes/No" questions.

In this paper, we divide the answers into two categories: "Extraction answers" and "Abstract answers". The extractive answers have two types: single-span and multi-span. The extractive answers must contain complete information and be as concise as possible while present in the context (article). In the case of multi-span answers, the spans must be semantic equivalence and should not be concatenated from different parts of the context to form a complete sentence. In Table <ref>, the correct extractive answers should be "học kỳ chính" ("regular semester") and "học kỳ hè" ("summer semester") because these two phrases have semantic equivalence. The answer "Trường có" ("The University has"), "học kỳ chính" (regular semester), "và" ("and"), "học kỳ hè" ("summer semester") is not acceptable because this answer attempts to form a complete sentence, resulting in the extracted words lacking semantic equivalence. Abstractive answers are rewritten answers from the question and extractive answers that resemble how a human would answer, with additional words and meanings to smooth out the extractive answer without changing the meaning or adding new information. We encourage creators to be creative with their writing style for abstract answers. In the example at Table <ref>, the abstractive answer could be: "Trường có các loại học kỳ: học kỳ chính và học kỳ hè" ("The university has semester types: regular semesters and summer semesters."). In this case, the abstractive answer does not include a counting number like "Trường có hai loại học kỳ: học kỳ chính và học kỳ hè" ("The University has two types of semesters: regular semesters and summer semesters.") as this adds information not present in the question or extractive answer.




For reason types, our guidelines provide definitions and examples for reason types such as "Word-matching", "Paraphrasing", "Math", "Coreference", "Causal relation", and "Logic" based on the paper by Sugawara et al. (2018) <cit.>. These types of reasoning are defined as follows:

    
  * Word matching: This involves exact word matching between words in the question and words in the context, or the answer connected to the question matches a sentence in the context.
    
  * Paraphrasing: Questions rephrase the meaning of a context by altering vocabulary and grammar or using different knowledge to formulate the question.
    
  * Math: Questions involving mathematics, where the answer requires applying mathematical operations or comparisons to solve the question.
    
  * Coreference: This reasoning type involves answers that are entities. To identify these entities, one must refer to words or phrases in one or more different sentences that represent the entity being sought.
    
  * Causal relation: The answer may explain the cause leading to the result mentioned in the question, or the question might inquire about the cause leading to the result mentioned in the answer.
    
  * Logic: Utilizing knowledge from the context and the question to infer the answer, commonly seen in Yes/No questions.


We encourage creators to focus on creating questions that involve paraphrasing, math, coreference, causal relations, and logic. We do not encourage creators to create word-matching questions. Because word-matching is the easy reasoning type, a sufficient amount of training data can still achieve good results.





  §.§.§ Creator Agreement
 

We have 7 creators, all university students from the same institution. These creators underwent training on the guidelines and performed multiple rounds of checks. The question-answer pairs must adhere to the guidelines, spelling, and structure of the sentence, ensuring diverse usage of reason types and question types. During each round of evaluation with 100 context-question pairs, creators must independently formulate answers. After that, creators will cross-check each other, provide feedback, and agree on answer writing in the regular meetings. We evaluated the similarity between the creators based on F1-score and BERTScore <cit.> metrics. After three rounds of evaluations with 300 questions, the average results of the 7 creators will be presented as shown in Table <ref>.





  §.§.§ Question-answer Creation
 


The dataset consists of 294 articles divided into two parts: Part 1 includes the first 146 articles labeled by 4 creators, while Part 2 comprises the remaining 148 articles labeled by the remaining 3 creators. This division of annotations and articles ensures diversity throughout the question-answer creation process. This approach allows us to maximize information extraction from the articles across different aspects while preventing duplication in question-answer pairs as in the case of all 7 people labeling all 294 contexts.

Each creator is required to generate at least 300 question-answer pairs in one week. The guidelines are strictly to ensure consistency across the dataset. We encourage creators to pose questions that involve challenging forms of inference, such as paraphrasing, inference from multiple sentences, and inference from a single sentence.



  §.§.§ Data Validation
 

After each week of data creation, the creators will perform self-checks and cross-checks similar to the training phases in Section <ref>. During the self-check process, each creator will review the question-answer pairs from the previous week and make corrections if any errors are found. In the cross-check process, each creator will examine the work of others to ensure adherence to the guidelines and identify errors in the data created by others. Throughout the cross-check process, we will review data from all creators to ensure no errors remain.

Upon completion of the cross-check process, we will hold discussions to address any issues encountered by the creators, propose solutions, and reach a consensus among all creators regarding these errors. In addition, we will update the guidelines weekly to address errors or exceptions.

In addition to the weekly evaluation and error correction processes, we will conduct a final review and error correction after completing the dataset in the last week to ensure consistency once again. Following this process, the dataset can be used for training and testing models.



  §.§.§ Data Splitting
 

After validating the data, we partitioned the data set into three subsets: training, development (validation), and testing, with an 8:1:1 ratio. The balanced allocation between the development and testing subsets is intended to ensure a fair and precise evaluation of the model.



 §.§ Dataset Analysis




  §.§.§ Overall Statistics


In this section, we conducted an overview analysis of the dataset regarding aspects such as the number of articles and the length of texts within the dataset. The ViRHE4QA dataset comprises 9,758 question-answer pairs from 294 articles within the domain of university training regulations. We conducted statistical analysis on the dataset regarding aspects such as the number of documents, number of articles, number of question-answer pairs, average word count[We count words based on whitespace segmentation.] in documents, articles, questions, extractive length, and abstractive length of the ViRHE4QA dataset, comparing these with the UIT-ViQuAD 1.0 dataset as shown in Table <ref>.






Due to the close-domain dataset, the number of articles and question-answer pairs in ViRHE4QA is lower compared to the UIT-ViQuAD dataset. However, the average length of the articles in ViRHE4QA is longer than that of the UIT-ViQuAD dataset. Furthermore, the average length of the questions and the extractive answers in ViRHE4QA is higher than in UIT-ViQuAD. This poses a challenge for language models to locate and extract information accurately within longer contexts.



  §.§.§ Length-based Analysis


To understand more about our dataset and domain, we performed statistics on the number of question-answer pairs grouped by ranges of article length (Table <ref>), question length (Table <ref>), and answer length (Table <ref>). Articles with lengths ranging from 101 to 256 words accounted for the largest proportion, with 3,422 question-answer pairs. However, it should be noted that articles with lengths less than 100 words had the smallest number of pairs, and articles longer than 512 words ranked second highest with 2,306 question-answer pairs. This poses a challenge in our dataset as most current language models accept a maximum input of 512 tokens. 





Regarding question length, most are between 8 and 14 words, with a significant number also ranging from 15-21 words, showing relatively little difference compared to the 8-14 word range. Regarding the length of the answer, the highest proportion of extractive answers was less than 21 words, considerably more than other lengths. Meanwhile, abstractive answers predominantly fell within the 21-40 word range. This can be understood because of our guidelines, where extractive answers are expected to be the shortest answers, and abstractive answers represent a combination of the question and an extractive answer. This analysis shows that our dataset presents significant challenges regarding text length for current language models.









  §.§.§ Type-based Analysis



In this section, we conducted an analysis of the question types and the answer types in the test set (976 samples). To ensure accuracy, we manually classified the questions following the guidelines in section <ref>, which include 9 question types: What, Who, When, Where, Which, Why, How, Yes/No, and Others; and 6 reason types: Word-matching, Paraphrasing, Math, Coreference, Causal relation, and Logic.



Figure <ref> shows that the "What" type of question had the highest proportion at 40.78%, followed by the "Yes/No" type at 18.14%. Questions categorized as "When", "Where", "Which", and "Why" accounted for a very small proportion (together less than 10%). Compared with the UIT-ViQuAD and UIT-ViNewsQA datasets, our dataset exhibits similar characteristics, with the "What" type of question being predominant (40.78% compared to 49.97% in UIT-ViQuAD and 54.35% in UIT-ViNewsQA).



For reasoning types, according to Figure <ref>, Paraphrasing had the highest proportion at 54.46%, followed by Logic at 20.46%, and then Word-matching at 19.60%. Math, Causal relation, and Coreference types had relatively low proportions at 5.48% total. We request creators limit the use of word-matching question-answer formats to enhance diversity and challenge the dataset. Logical reasoning types are more prevalent because this type of reasoning is closely related to yes/no questions.






§ OUR PROPOSED METHOD



In this section, we will present the question-answering system for abstract answers that we propose. This system consists of three modules: Document Retriever, Machine Reader, and Answer Generator. We named this system R2GQA, with an overall structure depicted in Figure <ref>.




 §.§ Document Retriever


The Retriever module uses questions to retrieve contexts that contain answers or relevant information. These contexts are then fed into the machine reader module to extract answers. Additionally, the question scores corresponding to each context will be used to combine with the scores of the answers after the Reader module is executed to select the most accurate answer for the input question.


  §.§.§ Lexical Retrieval

Retrieval methods based on lexical similarity employ the degree of overlap between a question and a document to determine relevance. BM25 and TF-IDF are two popular examples of this approach. However, these methods often fail when dealing with queries and documents that exhibit intricate semantic structures due to the limited extent of lexical overlap. This limitation arises from the inability of vectors to capture the true meaning of words.

TF-IDF: TF-IDF, which stands for "Term Frequency-Inverse Document Frequency" is a widely used technique in natural language processing (NLP) for preprocessing text data. This statistical method assesses the significance of a term within a document or dataset. TF-IDF is calculated by two factors: tf(w, c) and df(w, C).

    TF-IDF(w,c,C) = tf(w, c) · idf(w, C)



  * TF (term frequency) is the frequency of occurrence of a word in a document. The TF value of a word w in context c is calculated according to the following formula:


    tf(w,c) = n(w,c)/n(c)


n(w, c) denotes the number of occurrences of the term w in the context c.
n(c) denotes the total number of occurrences of all terms in context c.

  * Inverse Document Frequency (IDF) is the inverse frequency of a term within a dataset. In the document collection, each term has a unique IDF value computed by the formula.

    idf(w, C) =  log| C |/| c_w ∈ C∈ C |


| C | denotes the total number of documents in dataset C. | c_w ∈ C∈ C |  is the number of documents c that contain the term w in the dataset. If the term does not appear in any context within the dataset C, the denominator would be 0, leading to an invalid division. Therefore, it is commonly replaced with the formula 1+ | c_w ∈ C∈ C |.




TF-IDF transforms each document in a dataset into a vector representation, often referred to as document embedding. By combining the TF-IDF scores of each term in a document, a vector is formed that places the document within a high-dimensional space. This vector can be used as input for various machine learning models or for computing similarities between documents.

BM25: BM25 is a widely used ranking function in information retrieval to compute and rank the similarity between two texts. BM25 is a simple method commonly employed in question-answer tasks to search the context relevant to the input question. Similarly to TF-IDF, BM25 computes a score for each context in a dataset based on the frequency of the question terms in the context. BM25 also considers document length and term frequency saturation.

    BM25(q, c) =  ∑_i=1^| q | IDF(q_i) ·f(q_i, c) (k + 1)/f(q_i, c) + k - (1 - b + b ·| c |/C_avgl)

Where:

    
  * q represents the question.
    
  * c signifies a context within the dataset.
    
  * |q| indicates the question length.
    
  * IDF(q_i) stands for the Inverse Document Frequency of the i-th question (q_i).
    
  * f(q_i, d) is the frequency of the i-th question (q_i) within the context c.
    
  * k and b are adjustable parameters used in certain weighting frameworks.
    
  * |c| denotes the length of context c.
    
  * C_avg refers to the average context length within the dataset.


The BM25 formula diverges from TF-IDF in several significant aspects. Firstly, it employs a non-linear approach to calculate term frequency weights, which leads to an exponential increase in weighting with higher term frequencies. Secondly, it normalizes context lengths based on specific terms, decreasing the weighting of frequently occurring terms in extensive contexts. Additionally, the parameters k and b are tunable to adjust the emphasis on term frequency and context length normalization in the calculation. 




  §.§.§ Contextualized-based Retrieval
 
Bi-Encoder: Reimers and Gurevych <cit.> proposed the Bi-Encoder in 2019. Bi-Encoder are utilized across various tasks such as NLI, STS, Information Retrieval, and Question Answering systems. For the question-answer system task, the contexts in the dataset are encoded independently into vectors. The input question is then encoded and embedded in the vector space of the contexts to compute similarity scores with each context. Based on these scores, relevant contexts related to the question can be determined. 

One of the training methods for bi-encoders involves using the MarginMSE loss function. MarginMSE is based on the paper of Sebastian et al. (2020) <cit.>. Similarly to MultipleNegativesRankingLoss, to train with MarginMSE, triplets (question, context 1, context 2) are required. However, unlike MultipleNegativesRankingLoss, context 1 and context 2 do not need to strictly be positive/negative; both can be relevant or irrelevant to a given question. 

For training the bi-encoder with MarginMSE, the following procedure is undertaken: First, scores are computed for each pair (question, context 1) and (question, context 2). The distance of score (ScoreDistance) between the two pairs serves as the label for the triplet (question, context 1, context 2).  The ScoreDistance is calculated using the formula: 

    ScoreDistance = Score_(question, context 1) -  Score_(question, context 2)



In training the bi-encoder, question, context 1, and context 2 are encoded into vector spaces, and then the score of (question, context 1) and (question, context 2) is computed. Subsequently, the BDistance is computed by subtracting the score of (question, context 2) from the score of (question, context 1). The purpose of training is to optimize the error between ScoreDistance and BDistance.



  §.§.§ Lexical-Contextual Retrieval
 
Weight Ensemble: We combined the scores of each context when querying by lexical and Bi-Encoder using a weight α for each top_k. The scores calculated from the bi-encoder model were normalized to values in the range [0; 1]. After combining, we extracted the top_k contexts with the highest scores. The combination formula is as follows:

    Score=
        ScoreBM25_(question, context)·α + (1-α) · ScoreBE_(question, context)



Multiplication Ensemble: We calculated the product of the scores from each context calculated by TF-IDF and Bi-Encoder. Similarly to the weight ensemble, the scores calculated from the Bi-Encoder model were normalized to values in the range [0, 1]. Finally, we extracted the top_k contexts with the highest scores.

    Score_(question, context) = ScoreBM25_(question, context)· ScoreBE_(question, context)

We retrieve contexts using a combined method through the following main steps: First, we score the contexts in the database using the BM25 method. Second, we retrieve the scores of the contexts using the Bi-Encoder method and normalize them to the range [0,1]. Third, we obtain the combined scores of the contexts using the combined method. Finally, we extract the top_k highest scores and their corresponding contexts. Algorithm <ref> details our combined querying process.





 §.§ Machine Reader
 
In this study, we implement a Reader module based on the sequence tagging approach - BIO format (B - beginning, I - inside, O - outside). The BIO approach means that tokens in the input will be classified into B, I or O labels. If a token is labeled B or I, it means that the token is part of the answer; otherwise, it does not appear in the answer. This approach is commonly used as a method for extracting answers for extractive reading comprehension tasks <cit.>. Figure <ref> illustrates this approach in detail.

There are various methods for training models using the BIO approach. In recent years, transfer learning methods have proven to be effective for MLP tasks due to their pre-training on large datasets. For machine reading comprehension tasks, several state-of-the-art (SOTA) high-performance models have been trained on multilingual datasets, such as multilingual BERT (mBERT) <cit.> and XLM-RoBERTa <cit.>. Currently, there are also models specifically designed for Vietnamese, such as CafeBERT <cit.>, ViBERT <cit.>, and vELECTRA <cit.>. Therefore, we utilize these models to implement the Reader module.




   
  * XLM-RoBERTa <cit.> is a pre-trained multilingual language model. It was trained on the CommonCrawl dataset, which includes text data from over 100 languages (including more than 137GB of Vietnamese text data). XLM-RoBERTa comes in two versions: large (with 24 layers) and base (with 12 layers).

    
  * CafeBERT <cit.> is a language model built on top of XLM-RoBERTa. This model was trained on approximately 18GB of Vietnamese text data. CafeBERT outperforms XLM-RoBERTa on the VLUE benchmark <cit.> (including the reading comprehension task).

    
  * vELECTRA <cit.> is a model trained on a massive dataset of Vietnamese text data, reaching 58.4GB in size. The authors used BERT as the foundation for the generator module and ELECTRA for the discriminatory module.

     
  * ViBERT <cit.> is a model trained on 10GB of Vietnamese text data. Its architecture is based on the BERT model. In addition to using similar layers to BERT, the authors added two layers before the final linear layer: a bidirectional RNN layer and an Attention layer. This results in ViBERT having a total of 5 layers.




 §.§ Answer Generator


In the Retrieval-Reader-Generator system, the Generator module operates at the final stage of the answer generation process. The main function of this module is to merge the information from the question and the extractive answer. This module uses a sequence-to-sequence structure, often seen in tasks such as machine translation or summarization, shown in Figure <ref>. This helps generate a complete, human-like answer.

Mathematically, the function f representing the Generator module is expressed as follows:

    A_abstractive = f ( Q, A_extractive)


Here, the inputs (Q, A_extractive) represent:

    
  * Q: the question.
    
  * A_extractive: the extractive answer taken from the Reader module.


The output A_abstractive is the generated answer, refined, coherent, and synthesizes information from the question and the extracted context in a more understandable form.

Vietnamese language generator models are evolving, employing transfer learning methods to enhance performance. In this paper, we use state-of-the-art (SOTA) generator models for Vietnamese, including multilingual models such as mBART-50 <cit.>, mT5 <cit.>; and monolingual models such as BARTpho <cit.> and ViT5 <cit.>.






    
  * mBART-50 <cit.>: mBART-50 is an extension of BART (Bidirectional and Auto-Regressive Transformers), supporting multiple languages, including 137.3GB of Vietnamese data. mBART-50 is a denoising autoencoder trained with masked language modeling and permutation language modeling objectives. It has shown strong performance in various language generation tasks, such as translation and summarization.
    
  * mT5 <cit.>: mT5 is an adaptation of T5 model for multilingual text generation tasks. The key to the innovation of mT5 lies in its ability to perform diverse Natural Language Processing (NLP) tasks within a unified framework, including text generation, translation, summarization, question answering, and more. This unified architecture simplifies NLP application deployment across languages, making it valuable for global communication and multilingual content generation. mT5 is trained on the mC4 dataset, including Vietnamese with 116B tokens, 79M pages, and constituting 1.86% of the training data for the mT5 model.
    
  * BARTpho <cit.>: BARTpho utilizes a "large" architecture and pre-training scheme similar to sequence-to-sequence denoising autoencoder of BART. It leverages a Vietnamese dataset of 20GB from PhoBERT, showing improved performance over mBART in Vietnamese text summarization tasks. BARTpho has two versions: BARTpho_word and BARTpho_syllable, with the word version performing better.
    
  * ViT5 <cit.>: ViT5 is a monolingual model developed for Vietnamese based on the T5 structure. It is built on 138GB of Vietnamese data from the CC100 dataset and is trained for Vietnamese abstractive summarization and Named Entity Recognition tasks. ViT5 significantly improves over current SOTA models in Vietnamese text summarization and competitive results in NER tasks.




§ EXPERIMENTS AND RESULTS



 §.§ Metrics



  §.§.§ P@k

To evaluate the performance of the retrieval methods, we use the P@k measure. P@k measure is commonly used in information retrieval tasks, and some works such as XLMRQA <cit.>, SPBERTQA <cit.>, LegalCQA <cit.> have utilized it. In formula <ref>, P@k is the proportion of questions for which the relevant corresponding context appears in the contexts returned by the retrieval module. C_i_pos is the relevant context corresponding to question q_i, and C_k(q_i) are the contexts returned by the retrieval module corresponding to question q_i. n is the number of questions.

    P@k = 1/n∑_i=1^n
     1     if  C_i_pos∈ C_k(q_i)  
     
     0     if  C_i_pos∉ C_k(q_i)




  §.§.§ F1

The F1-score is a widely used metric in natural language processing and machine reading comprehension. Evaluates the accuracy of the predicted answers by comparing individual words with those in the correct answers. The F1-score measures the overlap in words between the predicted answers and the ground-truth answers.

    Precision =  the number of overlap words/the total number of tokens in the predicted answer


    Recall =  the number of overlap words/the total number of tokens in the gold answer



    F1-Score = 2 ·Precision·Recall/Precision + Recall





  §.§.§ BLEU

BLEU (Bilingual Evaluation Understudy) <cit.> is a scoring method to measure the similarity between two texts in machine translation. BLEU compares contiguous word sequences in the machine-generated text with those in the reference text, counting matching n-grams with weighted precision. These matches are position independent. BLEU is described by the following formula:


    BLEU_Score = BP×exp( ∑_i=1^N (w_i ·log(p_i)) )

Where:

    
  * BP (Brevity Penalty) is a brevity penalty factor to account for shorter translations compared to the reference translations.
    
  * exp denotes the exponential function.
    
  * ∑_i=1^N (w_i ·log(p_i)) represents the weighted sum of the logarithm of precisions p_i, where w_i is the weight for the n-gram precision of order i, and N is the maximum n-gram order considered in the calculation.





  §.§.§ ROUGE

In addition to comparing model outputs directly, we assess their agreement by measuring the overlap in content. To do this, we leverage the ROUGE framework (Recall-Oriented Understudy for Gisting Evaluation) <cit.>. ROUGE metrics are popular tools for automating text summarization and machine translation and analyze both the structure and vocabulary of the generated text compared to a reference answer. This study utilizes several ROUGE metrics, including:




    
  * ROUGE-N: This metric focuses on counting matching sequences of words (n-grams) between the answer of the system and the ideal answer. Higher ROUGE-N scores indicate a greater degree of overlap in wording.
    
  * ROUGE-L: This metric prioritizes finding the longest string of words that appears in the same order in both the predicted answer and the gold answer. It emphasizes the importance of word order compared to ROUGE-N.




  §.§.§ BERTScore

BERTScore <cit.> is a metric used to evaluate the performance of text generation models, including machine translation and text summarization. This metric leverages the contextual understanding ability of language models to encode predicted answers and gold answers into embedding vectors and then computes the cosine similarity between these embeddings to provide a score for the quality of the generated text. The higher the score, the greater the similarity, indicating better performance of the answers of model.

BERTScore focuses on assessing semantic similarity rather than just lexical similarity like traditional metrics. This helps to evaluate the overall quality of text generation models more comprehensively. Additionally, BERTScore is available for multiple languages, allowing cross-lingual evaluation of text generation models.


 §.§ Experimental Design

In this section, we provide detailed configurations of the three modules in R2GQA system: Document Retriever, Machine Reader, and Answer Generator. We conducted all experiments on the RTX 3090 GPU with 24GB VRAM from VastAI[<https://vast.ai/>].


  §.§.§ Document Retriever

The purpose of the Document Retriever module is to question for context that may contain answers to the questions.  We assign IDs to the contexts, which are used to map to the IDs of the contexts with the highest retrieval scores returned after performing the retrieval methods. For the Retriever module, we conduct experiments with 3 methods: lexical retrieval, contextual retrieval, and lexical-contextual retrieval with top_k = [1, 5, 10, 15, 20, 25, 30].

 Lexical retrieval: We experiment with TF-IDF and BM25 methods. To enhance performance, we apply word segmentation using the Pyvi library [<https://pypi.org/project/pyvi/0.0.7.5/>] when conducting query experiments with TF-IDF and BM25.

 Contextual retrieval: We employ 2 approaches. In both approaches to contextual retrieval, we utilize word segmentation with Pyvi. LME: We only use pre-trained models (ViEmb[<https://huggingface.co/dangvantuan/vietnamese-embedding>], ViSBERT[<https://huggingface.co/keepitreal/vietnamese-sbert>], ViSimCSE[<https://huggingface.co/VoVanPhuc/sup-SimCSE-VietNamese-phobert-base>], ViBiEncoder[<https://huggingface.co/bkai-foundation-models/vietnamese-bi-encoder>]) from Huggingface to encode the question and context, then employ cosine similarity to calculate similarity scores and re-rank based on these scores. Bi-Encoder <cit.>: We continue to fine-tune pre-trained models from Huggingface with our data using the MarginMSE loss function. We train with epochs = 10, batch_size = 24. The score for each pair, Score(question, context1), Score(question, context2) in Section <ref>, is computed by BM25 instead of Cross-Encoder.

 Lexical-Contextual retrieval: 
For both combination methods in Section <ref>, we experimented using an exhaustive search of α values in the range [0.1; 0.9] with a step size of 0.1. Through this process, we determined the α value with the highest performance. For the combination with TF-IDF, the highest performance was at α = 0.3, and for BM25, it was α = 0.1.



  §.§.§ Machine Reader

For the Reader models, we implemented experiments with models and approaches as in Section <ref>. The models were trained with epochs = 5, batch_size = 8, learning_rate = 5e-5, max_seq_length = 512. The optimizer used was AdamW. The evaluation metrics used were F1, BLEU1, and BERTScore.

Our data contains many contexts longer than 512 tokens, while the maximum length of the models we experimented with is 512 tokens. Therefore, we split each context longer than 512 tokens into multiple input features. To minimize information loss and preserve the semantics of the input features, we use the stride hyperparameter to create overlapping segments between two input features.



  §.§.§ Answer Generator
 
We use the following generator models with specific configurations: mBART-large-50, mT5-base, ViT5-base and BARTpho_word. We added the token </s> to the model input to separate the question and extractive answer in the format Question </s> Extractive answer </s>. For the BARTpho model, the input was formatted as <s> Question </s></s> Extractive answer </s>. We perform word segmentation on BARTpho_word using VncoreNLP before training the model. The model parameters were set as similarly as possible with epoch = 5, learning rate = 4e-05, max_seq_length = 1024 (512 for mT5 due to model limitations), batch_size = 2, and using the AdamW optimizer. The metrics used in this section included: BLEU1, BLEU4, ROUGE-L, and BERTScore.



 §.§ Experiment Results


This section initially assesses the performance of our Document Retriever and Machine Reader modules independently. Subsequently, it details experiments involving their integration into the R2GQA system, which is applied to close-domain question answering concerning legal regulations in higher education.





  §.§.§ Document Retriever
 

Based on Table <ref>, it can be seen that the lexical query method combined with the contextual method produces the highest results for all values of the top_k. The LME method consistently produces the lowest results as it has not been trained to understand context within our data domain. Comparing the two ensemble methods, we can observe that the weighted combination method between BM25 and Bi-Encoder provides the highest results for 5 out of the 7 top_k values tested. Thus, it can be concluded that this method has the highest stability. Therefore, we will use this method for our end-to-end system (ViEmb[<https://huggingface.co/dangvantuan/vietnamese-embedding>], ViSBERT[<https://huggingface.co/keepitreal/vietnamese-sbert>], ViSimCSE[<https://huggingface.co/VoVanPhuc/sup-SimCSE-VietNamese-phobert-base>], ViBiEncoder[<https://huggingface.co/bkai-foundation-models/vietnamese-bi-encoder>]).





  §.§.§ Machine Reader
 

Table <ref> shows that the XLM-RoBERTa-Large model achieves the best results on most metrics and answer types. The second-best-performing model is CafeBERT. Across the entire ViRHE4QA test dataset, XLM-RoBERTa-Large outperforms CafeBERT by 0.04% on the F1 metric and 0.5% on BLEU1, while CafeBERT surpasses XLM-R-Large by 0.69% on BERTScore. However, overall, the XLM-R-Large model demonstrates more consistent results, outperforming CafeBERT on 2 out of 3 metrics. The ViBERT model performs the worst in all metrics and answer types, showing a significant gap compared to the other models.




Questions with single-span (1 span) answers achieve significantly better results than questions with multi-span (> 1 spans) answers across all models and metrics. For the XLM-R-Large model, performance on single-phrase answers exceeds that on multi-phrase answers by 13.15%, 17.38%, and 0.06% on F1, BLEU, and BERTScore, respectively. This significant difference indicates that finding answers to questions where the answer appears in multiple locations in the context is much more challenging than when the answer is located in a single position.


  §.§.§ Answer Generator
 



According to the results in Table <ref>, the BARTpho model achieved the highest score on the BLEU1 metric, but mBART outperformed the remaining three metrics, including BLEU4, BERTScore, and ROUGE-L. Compared to mBART, the BARTpho and ViT5 models exhibited slightly lower performance, ranging from 1% to 3%. However, the mT5 model performed significantly worse than the other three models. This could be attributed to the mT5 model having an input length limit of only 512 tokens, while the other three models accept input lengths of up to 1024 tokens. This limitation notably affects the performance, especially with datasets containing contexts longer than 512 tokens, such as ViRHE4QA.




  §.§.§ End-to-End System




Based on the results in Section <ref>, Section <ref>, and Section <ref>, we used a weighted combination of Bi-Encoder and BM25 for the Retriever module, the XLM-R-Large model for the Reader module, and the mBART model for the Generator module to evaluate the performance of the R2GQA system.

Table <ref> demonstrates that as the number of retrieved contexts (top_k) increases, the performance of system improves. However, the difference between top_k = 10 and top_k < 15 is greater than that for top_k > 10. The performance of system  at top_k = 10 surpasses that at top_k = 5 on BLEU1, BLEU4, ROUGE-L, and BERTScore by 0.78%, 0.65%, 0.81%, and 1.01%, respectively. Similarly, the performance of system at top_k = 30 exceeds that at top_k = 10 on BLEU1, BLEU4, ROUGE-L, and BERTScore by 0.56%, 0.43%, 0.62%, and 0.71%, respectively. Consequently, it can be concluded that the performance nearly reaches saturation at the value of top_k = 10.



§ DISCUSSION
 


 §.§ Impact of Context Length In The Reader Module

To validate the challenge posed by large context length in the dataset, we conducted an experiment to assess the impact of context length on the performance of models in the Reader module. The specific length ranges used for this experiment are detailed in Table <ref>.



Figure <ref> shows that longer context passages result in lower performance compared to shorter ones. The highest results for all models are achieved in the 0-100 word interval, while the other length intervals yield significantly lower results. In particular, in an interval longer than 512 words, almost all models perform the worst. This length interval exceeds the length limits of all models, causing the models to perform poorly due to the lack of information and context.


 §.§ Impact of Training Sample Number


To assess the impact of the number of samples in the training set, we trained the model with different quantities: 2000, 4000, 6000, and 7806 questions.



  §.§.§ Machine Reader



From Figure <ref>, we can observe that increasing the number of samples in the training set significantly improves the performance of all models. Models such as ViBERT and XLM-R-Base show the most significant improvement, whereas models such as CafeBERT and XLM-R-Large show less improvement, as they already perform well even with a small number of training samples. Therefore, the amount of training data has a significant impact on model performance and will continue to increase as the amount of training data increases. Increasing the training data leads to an increase in the number of contexts and vocabulary, which helps the model learn more real-world scenarios.


  §.§.§ Answer Generator





For the Generator module, we focus on the BERTScore metric for analysis. According to Figure <ref>, it can be observed that as the number of samples in the training set increases, the performance of all models improves slightly. However, for the mT5 model, there is a significant improvement in effectiveness from step 2000 to step 4000; after step 4000, the improvement of the model slows down gradually. This can be explained by the fact that at 2000 data points, the mT5 model has not learned much information yet, but by step 4000, it has accumulated enough information to represent better results. For the BARTpho model, the highest score is achieved when the number of training samples is 4000. It appears that when provided with more data, the information for the model may become noisy, leading to no improvement in results. In contrast to the Reader module, the Generator module shows little improvement with an increasing number of samples in the training set. Performance curves remain relatively flat as the training set size increases. This indicates that the transformer models in this module perform very well with less data.



 §.§ Impact of Context in Answer Generator Module


We experimented with the influence of context on the Generator module using different types of input: Question and Context (Q+C); Question, Extractive answer, and Context (Q+E+C); Question and Extractive answer (Q+E). We added the token </s> to the model input as described in Section <ref>.

From Table <ref>, Table <ref>, Table <ref>, and Figure <ref>, it can be observed that the performance of the Generator module is highest when the input is Q+E, followed by Q+E+C, and lowest for Q+C. The differences between Q+E and Q+E+C are not significant but are markedly higher than the scores for Q+C. This section reveals that incorporating context into the module is not particularly effective and increases the input length to the Generator module, leading to inaccurate results. 









For the Q+E method, the input is more concise, focusing on the main point (extractive answer) to provide the final answer for the system. In addition, using a shorter input reduces costs and resources when operating the system.





 §.§ Performance of QA Systems


In this section, we will compare the performance of our system with other QA systems, Naive RAG. The main metrics used for the evaluation include BLEU1, BLEU4, ROUGE1, ROUGE-L, and BERTScore. The experiments were conducted on an NVIDIA RTX 3090 GPU with 24GB VRAM from VastAI[<https://vast.ai/>].

System Configurations:

    Naive RAG: RAG is a question-answering system proposed by <cit.>. In the past two years, RAG has been widely used as large language models (LLMs) have developed. Therefore, we compare our system with this method. We use the text-embedding-3-large model to create the vector database and encode the questions. The vector database we use is Chromadb, designed by Langchain, and the large language model used to generate the final answer is GPT-3.5-turbo-instruct. For the prompt method, we use one-shot prompting, meaning that the prompt includes one sample example and the question to be answered. The model can refer to the sample example to answer the question more accurately. We use the text-embedding-3-large model and the GPT-3.5-turbo-instruct model from Microsoft Azure AI[<https://azure.microsoft.com/en-us/solutions/ai>]. The system is illustrated in Figure <ref>.





Comparison Results:

Table <ref>  shows that our system achieves higher performance compared to Naive RAG across most metrics, specifically with only top_k = 1. In addition to comparing response times, we also consider operational costs. For the RAG system, the use of APIs incurs $0.021 for the vectorization of the database and $0.0029 per question. In contrast, our system does not generate operational costs per answer. This indicates the high potential application of the R2GQA in real-world QAs tasks.



§ ERROR ANALYSIS


To perform error analysis, we surveyed 200 question-answer pairs predicted by the R2GQA system from the test set and classified errors into the following 5 main types:

Repetition in extractive answers: in the Reader module, we use a BIO format model, which often leads to extractive answers containing one or more repeated words, resulting in grammatically incorrect phrases in Vietnamese. 



Context: 

Điều 1. Phạm vi điều chỉnh và đối tượng áp dụng

1. Mỗi học kỳ, Trường Đại học A (Trường) tổ chức 01 lần thi lý thuyết giữa kỳ và 01 lần thi lý thuyết cuối kỳ tập trung trực tiếp hoặc trực tuyến (gọi chung là thi) cho các môn học được mở trong học kỳ đó. Thời gian tổ chức thi được qui định trên biểu đồ giảng dạy năm học. Quy định này quy định chung về việc tổ chức các đợt thi bao gồm các công tác: chuẩn bị thi, tổ chức thi, chấm thi, công bố điểm, phúc khảo, chế độ lưu trữ và xử lý vi phạm. Quy định này áp dụng đối với hệ đại học chính quy. Các chương trình đặc biệt có thể có kế hoạch thi riêng tùy theo đặc thù của chương trình.

2. Các hình thức thi bao gồm:

Tự luận (hoặc tự luận kết hợp với trắc nghiệm) 

Trắc nghiệm 

Vấn đáp 

Đồ án

3. Việc tổ chức thi theo hình thức trực tuyến thực hiện theo quy định riêng. 

(Article 1. Scope of Regulation and Applicable Subjects

1. Each semester, the University A (the University) organizes one mid-term theoretical exam and one final theoretical exam, either in-person or online (collectively referred to as exams), for the courses offered in that semester. The exam schedule is determined on the academic year teaching schedule. This regulation provides general provisions on organizing exam sessions, including exam preparation, administration, grading, result announcement, appeals, storage, and violation handling. This regulation applies to regular undergraduate programs. Special programs may have their own exam plans depending on the program's characteristics.

2. Exam formats include:

Essay (or a combination of essay and multiple-choice)

Multiple-choice

Question and answer

Project

3. Online exam organization follows separate regulations.)

Question: 
    Mỗi học kỳ, Trường Đại A (Trường) tổ chức mấy lần thi lý thuyết cuối kỳ cho các môn học được mở trong học kỳ đó? (How many end-of-term theoretical exams does the University A organize for subjects offered in each semester?)

Predicted extractive: 
    01 01 lần (01 01 times)


True extractive:
    01 (01)




Incorrect information extraction: this error occurs when the Reader module extracts inaccurate information or information that does not match the context of the question.

Context: 

    Điều 14. Chế độ lưu trữ

    Toàn bộ biên bản, hồ sơ bảo vệ KLTN được Thư ký Hội đồng bàn giao cho Khoa và được các Khoa lưu trữ tối thiểu trong vòng năm năm. 

    Khoa tổng hợp điểm vào danh sách các SV đã đăng ký làm KLTN (kể cả các SV không hoàn thành KLTN) do P. ĐTĐH cung cấp và gởi lại cho P. ĐTĐH không quá 2 tuần sau ngày bảo vệ.
 
    (Article 14. Storage Regime

    The entire minutes, records of thesis defense are handed over by the Council Secretary to the Faculty and are archived by the Faculties for a minimum of five years.

    The Faculty consolidates the scores into the list of students who have registered to do their thesis (including students who have not completed their thesis) provided by the Academic Affairs Office and returns it to the Academic Affairs Office no later than 2 weeks after the defense date.)
Question: Thời gian để Khoa tổng hợp điểm vào danh sách sinh viên tham gia KLTN và gởi cho P. ĐTĐH được tính từ khi nào? (From when is the time for the Faculty to compile grades into the list of students participating in the graduation thesis and send it to the Undergraduate Training Department calculated?)

Predicted extractive: không quá 2 tuần sau ngày bảo vệ. (not more than 2 weeks after the defense day.)

True extractive: sau ngày bảo vệ. (after the defense day.)

Predicted abstractive: Thời gian để Khoa tổng hợp điểm vào danh sách sinh viên tham gia KLTN và gởi cho P. ĐTĐH không quá 2 tuần sau ngày bảo vệ. (The time for the Faculty to compile grades into the list of students participating in the graduation thesis and send it to the Undergraduate Training Department is not more than 2 weeks after the defense day.)

True abstractive: Thời gian để Khoa tổng hợp điểm vào danh sách sinh viên tham gia KLTN và gởi cho P. ĐTĐH được bắt đầu tính sau ngày bảo vệ. (The time for the Faculty to compile grades into the list of students participating in the graduation thesis and send it to the Undergraduate Training Department is calculated from the day after the defense.)




Over-extraction/Under-extraction of information: this error occurs when the system extracts more or less information than required by the question, confusing for the user.

Context: 

    Điều 17. Quản lý điểm thi

    1.	Cán bộ chấm thi chịu trách nhiệm về tính chính xác của thông tin điểm thi được nhập và công bố cho SV trên Hệ thống quản lý điểm trong thời hạn chấm thi và nộp điểm.

    2.	P.ĐTĐH/VPĐB chịu trách nhiệm kiểm tra thông tin điểm thi trên Hệ thống quản lý điểm so với điểm được ghi trên bài thi, tiếp nhận và xử lý khiếu nại của SV về điểm thi và cấp bảng điểm theo yêu cầu.

    3.	Phòng Dữ liệu và Công nghệ Thông tin có trách nhiệm đảm bảo an toàn cho dữ liệu điểm trên Hệ thống quản lý điểm; đảm bảo chỉ cấp quyền nhập và chỉnh sửa điểm cho cán bộ chấm thi đối với thành phần điểm và lớp mà mình phụ trách chấm thi trong thời hạn chấm thi và nộp điểm. Mọi thao tác trên dữ liệu điểm phải được ghi nhận lại đầy đủ và chính xác (người nhập điểm, người chỉnh sửa điểm, thời gian và lý do chỉnh sửa). 

    (Article 17. Examination Score Management

    1. The examiners are responsible for the accuracy of the exam score information entered and announced to students on the Grade Management System within the grading and score submission period.

    2. The Academic Affairs Office/Department is responsible for verifying the exam score information on the Grade Management System against the scores recorded on the exam papers, receiving and handling student complaints about exam scores, and issuing transcripts upon request.

    3. The Data and Information Technology Department is responsible for ensuring the security of the exam score data on the Grade Management System, ensuring that only examiners responsible for grading their assigned components and classes have the authority to enter and edit scores within the grading and score submission period. All operations on exam score data must be recorded accurately and completely (person entering the score, person editing the score, time, and reason for the edit).)


Question: Phòng Dữ liệu và Công nghệ Thông tin cấp quyền nhập và chỉnh sửa điểm cho ai? (To whom does the Data and Information Technology Department grant the right to enter and edit scores?)
Predicted extractive: cán bộ chấm thi trách (exam graders responsible)
True extractive: cán bộ chấm thi (exam graders)
Predicted abstractive: Phòng Dữ liệu và Công nghệ Thông tin cấp quyền nhập và chỉnh sửa điểm cho cán bộ chấm thi trách. (The Data and Information Technology Department grants the right to enter and edit scores to the responsible exam graders.)
True abstractive: Phòng Dữ liệu và Công nghệ Thông tin chỉ cấp quyền nhập và sửa điểm cho cán bộ chấm thi. (The Data and Information Technology Department grants the right to enter and edit scores only to the exam graders.)




Incorrect context extraction: the retrieval system returns a text segment that is unrelated or does not contain the necessary information to answer the question.

Question: BĐH tổ chức lấy ý kiến sinh viên về việc gì? (What does the Management Board organize to collect student opinions about?)
True context: 

    Điều 10. Giảng dạy các môn CTTN

    CTTN phải được thực hiện trên quan điểm lấy người học làm trung tâm. Người học phải được tạo điều kiện để thể hiện vai trò chủ động trong tiến trình học tập. Người học phải đóng vai trò chủ động trong hoạt động học tập, thay vì thụ động tiếp nhận kiến thức.

    Sinh viên CTTN sẽ học cùng với sinh viên các lớp chương trình chuẩn trong các môn được đào tạo chung, các môn học cốt lõi dành riêng cho sinh viên CTTN được tổ chức lớp học riêng.

    Khoa quản lý chuyên môn có trách nhiệm chọn các cán bộ có kinh nghiệm để phụ trách giảng dạy. Các môn học tài năng và KLTN phải do CBGD có học vị tiến sĩ hoặc giảng viên chính, hoặc thạc sĩ tốt nghiệp ở các trường Đại học thuộc các nước tiên tiến, đúng ngành hoặc thuộc ngành gần đảm nhiệm.

    Trong tuần đầu tiên của học kỳ, CBGD phải thông báo công khai cho sinh viên về đề cương giảng dạy môn học; trong đó đặc biệt chú ý các thông tin, các phần học bổ sung tăng cường; số cột điểm và tỷ lệ tính của từng cột điểm vào điểm tổng kết môn học.

    CBGD phải cung cấp đầy đủ đề cương môn học, tài liệu và công bố nội dung bài giảng trước cho sinh viên trên trang web môn học. 	

    Đầu mỗi học kỳ, đại diện đơn vị quản lý chương trình và các CVHT phải gặp gỡ đại diện sinh viên (ít nhất 3 SV/lớp – do lớp bầu chọn) tất cả các lớp CTTN để trao đổi và nhận phản hồi về tình hình giảng dạy và sinh hoạt. Cuối học kỳ, BĐH phối hợp với phòng Thanh tra - Pháp chế - Đảm bảo chất lượng tổ chức lấy ý kiến sinh viên (dùng phiếu thăm dò, qua trang web,…) về giảng dạy môn học và tổ chức cho CBGD rút kinh nghiệm về các góp ý của sinh viên.

    Ngoài nội dung bắt buộc theo đề cương, các môn CTTN có thể có thêm các nội dung tăng cường và một số lượng hạn chế các buổi ""seminar ngoại khóa"". Lịch dạy và lịch dạy bổ sung tăng cường, dạy bù được báo cáo và kiểm tra theo quy trình chung như lớp đại học chính quy đại trà. 

    (Article 10. Teaching CTTN Courses

    Teaching CTTN must be based on the learner-centered approach. Learners must have conditions to play an active role in the learning process. Learners must take an active role in learning activities, rather than passively receiving knowledge.

    CTTN students will study alongside students of standard programs in jointly taught subjects; core subjects specifically for CTTN students will have separate class arrangements.

    The specialized management department is responsible for selecting experienced personnel to teach. Talent courses and thesis projects must be taught by instructors with a doctoral degree or lecturers who have graduated from universities in advanced countries, in the relevant field or closely related fields.

    In the first week of the semester, instructors must publicly announce to students the course syllabus, paying particular attention to additional information, supplementary learning sections, the number of columns for grading, and the weighting of each column in the overall grade of the course.

    Instructors must provide complete course syllabi, materials, and pre-announce lecture contents to students on the course website.

    At the beginning of each semester, program management representatives and class advisors must meet with student representatives (at least 3 students per class – elected by the class) from all CTTN classes to exchange and receive feedback on teaching and activities. At the end of the semester, the Faculty Board must coordinate with the Inspection and Quality Assurance Department to collect student opinions (using surveys, websites, etc.) on course teaching and organize instructors to learn from student feedback.

    In addition to the mandatory content outlined in the syllabus, CTTN courses may include additional supplementary content and a limited number of extracurricular seminars. Teaching schedules and additional teaching schedules, makeup classes must be reported and monitored according to the general procedures for regular undergraduate classes.)

    

Predicted context: 

    Điều 16. Đảm bảo chất lượng

    - Đơn vị chuyên môn có trách nhiệm chọn các cán bộ đạt yêu cầu theo quy định và có kinh nghiệm giảng dạy để phụ trách giảng dạy các môn học cho các lớp thuộc CT CLC.

    - Trong vòng 02 tuần đầu của mỗi học kỳ, đơn vị quản lý và các cố vấn học tập gặp gỡ sinh viên tất cả các lớp CT CLC để trao đổi và nhận phản hồi về tình hình giảng dạy và sinh hoạt.

    - Cuối học kỳ, đơn vị quản lý phối hợp với phòng Thanh tra - Pháp chế - Đảm bảo chất lượng tổ chức lấy ý kiến sinh viên (dùng phiếu thăm dò, qua website, …) về việc giảng dạy môn học và có trách nhiệm trao đổi với giảng viên để rút kinh nghiệm về các góp ý của SV.

    - Tổ chức lấy ý kiến sinh viên tối thiểu 01 lần mỗi học kỳ về công tác quản lý, phục vụ, điều kiện cơ sở vật chất và tổ chức trả lời những ý kiến phản ánh của sinh viên.
 
    (Article 16. Quality Assurance

    - The specialized unit is responsible for selecting qualified personnel as required by regulations and with teaching experience to be in charge of teaching courses for classes under the CT CLC program.

    - Within the first two weeks of each semester, the management unit and academic advisors meet with students from all CT CLC classes to exchange and receive feedback on teaching and activities.

    - At the end of the semester, the management unit collaborates with the Inspection and Quality Assurance Department to collect student opinions (via surveys, websites, etc.) on course teaching and is responsible for exchanging feedback with instructors to learn from student suggestions.

    - Student feedback sessions should be organized at least once per semester on management activities, services, facilities, and addressing student feedback.)    
Predicted extractive: công tác quản lý, phục vụ, điều kiện cơ sở vật chất và (management work, services, facilities, and)
True extractive: giảng dạy môn học (teaching of the course)
Predicted abstractive: BĐH tổ chức lấy ý kiến sinh viên về công tác quản lý, phục vụ, điều kiện cơ sở vật chất và các vấn đề khác có liên quan đến việc dạy bù từ cán bộ giảng dạy. (The Management Board organizes to collect student opinions about management work, services, facilities, and other issues related to makeup teaching by lecturers.)
True abstractive: BĐH tổ chức lấy ý kiến sinh viên về giảng dạy môn học. (The Management Board organizes to collect student opinions about the teaching of the course.)



No information in the Machine Reader module: The approach of the Reader Module is sequence tagging, hence there are instances where information cannot be extracted from the retrieved context.

The R2GQA system performs well in generating user-friendly free-form answers, but it still contains many basic errors. These errors include repeating information, extracting redundant or missing information, retrieving incorrect context segments, and extracting information from inaccurate context segments. These issues reduce the accuracy and efficiency of the system, potentially causing confusion for users.



§ CONCLUSION AND FUTURE WORK
  

In this paper, we introduce the ViRHE4QA dataset, a QA dataset based on academic regulations in higher education. The dataset comprises 9,758 meticulously constructed data samples, created by seven well-trained and closely monitored annotators. Furthermore, we proposed the R2GQA system, which consists of three modules: Retrieval, Reader, and Generator. This system leverages state-of-the-art language models, delivering high performance and efficiency for the QA task without relying on any third-party services. We conducted various experiments on both the dataset and the system to demonstrate their effectiveness and practical applicability.

However, the ViRHE4QA dataset and the R2GQA system face several challenges that need to be addressed in the future. These challenges include managing the length of the input data and improving the accuracy of the Retrieval and Reader systems. We also plan to focus on optimizing and fine-tuning the language models to better fit the context and linguistic characteristics of the Vietnamese language.

Moreover, expanding and enriching the dataset with a broader variety of questions and diverse contexts will enhance the versatility of the system. We aim to explore and integrate advanced techniques such as deep learning and reinforcement learning to further improve the accuracy and performance of the system. Reducing processing time while maintaining high accuracy is a crucial goal in ensuring the practical application of automated QA systems.

Finally, deploying the system in real-world environments will provide valuable feedback, helping us to understand its strengths and weaknesses and propose appropriate improvements. We hope that this work will make a significant contribution to the field of automated QA and open up new research directions in the future.




§ ACKNOWLEDGEMENT

This research was supported by The VNUHCM-University of Information Technology's Scientific Research Support Fund.



§ DECLARATIONS


Conflict of interest The authors declare that they have no conflict of interest.



§ DATA AVAILABILITY


Data will be made available on reasonable request.




