Elamur Research

Multi-stage Information Retrieval for Vietnamese Legal Texts

Paper · 2022 · Nhat-Minh Pham, Ha-Thanh Nguyen and Trong-Hop Do

Summary

A legal question can use familiar words while the provision that answers it uses specialized language. The search can also fail in the opposite direction. Several provisions may repeat the words in the question, even though only some apply to the issue it raises. “Multi-stage Information Retrieval for Vietnamese Legal Texts” examines how to find the articles that can support an answer to a Vietnamese legal question. The system ranks articles from a legal collection containing 114,177 articles after cleaning. Its task is to recover every article associated with a question in the benchmark, a specialized form of information retrieval.

The authors combine a term-matching method called BM25+ with a sentence encoder. BM25+ scores articles using the words they share with a query. The encoder represents the query and each article as vectors, allowing the system to compare them even where their wording differs. Training begins with articles that BM25+ ranks highly but that the benchmark does not mark as relevant. Later rounds draw these negative examples from the preceding encoder’s rankings. Each round therefore uses the mistakes that the preceding scorer is liable to make. The authors also compare representations built from written syllables with ones that join syllables into Vietnamese words, a choice that affects tokenization.

The strongest configuration on both evaluation measures uses word-segmented text and the large version of PhoBERT. The best way to combine the scores depends on what the evaluation asks the system to return. Multiplying the lexical score directly by vector similarity gives the best macro recall@20, which measures how much of the reference material appears among the top 20 articles. Taking the square root of the lexical score before multiplying gives the best F2, which rewards recovering relevant articles while also accounting for irrelevant ones in the returned set. The authors report that both configurations outperform the earlier systems on their respective measures in the same question-answer benchmark.

The comparisons also identify where the approach remains fragile. Word segmentation works better with encoders whose pretraining used words, while syllable-level input works better with ViBERT, whose pretraining used syllables. F2 tends to fall for queries with more relevant articles, and the authors connect part of that pattern to a narrow score threshold that can exclude valid results. In one difficult example, the clause that answers the question has a cosine similarity of 0.351 even when compared with the query on its own. The paper therefore shows both the value of combining lexical and semantic evidence and the difficulty of getting a ranker to recognize the connection between a legal question and the particular provision that resolves it.

Deep dive: Multi-stage Information Retrieval for Vietnamese Legal Texts

This study combines word matching and sentence embeddings to find Vietnamese legal articles and tests which rankings work best for F2 and recall. · about 32 minutes to read

The problem and its context

The answer to a legal question may be spread across several articles. A retrieval system must identify the provisions a person would need to consult, even when a question describes a situation in different language from the provisions themselves. The authors set the target at the article level. The search collection contains legal documents, each of which can contain multiple articles. A query is evaluated against the articles associated with it, and returning a closely related article from the same document can still leave part of the question unresolved. Locating that evidence is the retrieval step in question answering.

The distinction between a document and an article matters because the object searched and the evidence a reader needs can differ in scale. An article is already a more specific target than an entire legal document, yet an article can still be lengthy and contain several clauses. The clause that resolves a question may occupy little of the text submitted to the ranker. A score assigned to the whole article must somehow reflect the importance of that clause, alongside everything else in the article. The paper describes long, complicated provisions and questions that can require legal expertise even when a person has the relevant text in hand.

Wording adds a separate difficulty. A question can describe the practical effect of a rule, while the article expresses that rule using specialized terms. Conversely, a question and a provision can share a substantial amount of vocabulary because they discuss the same broad subject, while dealing with different situations. The ranker faces both kinds of error. It can overlook a valid provision with little word overlap, or favor an invalid provision because the words match. The paper’s method combines term matching with a measure intended to capture semantic similarity.

The authors describe a substantial English-language research setting for legal retrieval and mention two venues to illustrate it. COLIEE is an annual competition covering legal information extraction and entailment, and JURIX is an annual conference concerned with legal artificial intelligence. The paper describes Vietnamese legal retrieval as a smaller area of research. Its closest predecessors include attentive convolutional systems and work with a multilingual transformer, both of which provide points of comparison for the capabilities the authors want to test in Legal AI.

Vietnamese input creates a design choice before ranking even begins. A written syllable separated by spaces can be part of a word that spans several syllables. A procedure that splits at those spaces and a procedure that identifies whole words can therefore present different units for the same text. In a legal article, the choice matters both for term overlap and for how a pretrained encoder receives the text. The paper treats segmentation as an experimental factor because the Vietnamese encoders it compares were pretrained with different units.

From counting words to comparing meanings

The paper’s account of earlier retrieval starts with methods that score a query against a text using the occurrence and frequency of words. It identifies BM25 and related scores as established approaches and draws on BM25+ for its own lexical component. It also discusses a method whose name refers to term frequency and inverse document frequency, two ways to account for how a word is distributed within a text and across the collection. TF-IDF.

Term-based retrieval can make good use of words that the question and the provision have in common. It has less direct evidence when the connection depends on different expressions. In the authors’ account, latent semantic indexing represents an earlier effort to address this mismatch by moving from explicit word matches toward representations that can express more general relationships between texts. The paper connects this line of work to the use of dense embeddings, where a text is represented by a vector and proximity between vectors supplies evidence of a match. Latent semantic indexing.

The earlier Vietnamese systems discussed in the paper use attention with convolutional networks. Convolution helps represent local contexts, and attention lets the system give greater influence to informative parts of the input. The paper describes those systems as capable of incorporating local and global context in their text representations. This makes them a relevant baseline for a new method that also builds representations before assigning a relevance score. The authors also note earlier Vietnamese legal retrieval work with a fine-tuned XLM-RoBERTa encoder.

Transformer retrieval offers a choice about when the question and article interact. A cross-encoder takes them together as input and can build its representation of each in the context of the other. The paper describes Birch as combining this approach with lexical retrieval and names BERT-PLI as a legal retrieval system in this line of work. Joint processing gives the network an opportunity to attend to relationships within a particular pair, but repeating that processing for many candidate articles is computationally demanding. The authors trace this approach to BERT and the Transformer and attention architecture.

A bi-encoder processes each side of the pair independently. Once the vectors exist, a similarity calculation can compare them. The authors draw on Sentence-BERT, which uses a Siamese arrangement to learn separate sentence representations that can be compared in this way. The independent representations matter for retrieval because the same article is a candidate for many questions. Its vector can be reused across those comparisons. The paper adopts this approach through Sentence-BERT.

The related work also raises a question about how readily a pretrained transformer can serve as a dense encoder. The authors cite Gao and Callan’s argument that the attention structure learned in ordinary pretraining may need further preparation for that role. Condenser addresses the problem with a different pretraining architecture, and the Vietnamese legal retrieval study tests Condenser variants alongside encoders trained more directly from PhoBERT. The paper places these efforts in a Vietnamese bi-encoder literature that it describes as limited, including work on finding similar questions and a competition entry. Condenser.

The method, step by step

How the rankings are built

The lexical scorer has two jobs. During training it finds plausible negative examples. During retrieval it supplies a score that is combined with the encoder’s judgment. The encoder also has two jobs. An intermediate encoder produces a new ranking from which the authors can choose harder training examples. Once training is finished, the encoder supplies the similarity score used in the final ranking. This explains why lexical retrieval appears early in the training process and again at the end of the system.

The training examples are pairs of questions and articles. A reference article associated with a question is a positive example for that question. For a negative example, the authors look among articles already placed high in a ranking. Such an article is a useful test of what the current scoring rule can distinguish. If a question and an unlabelled article share conspicuous vocabulary, BM25+ may put them close together. After training moves to dense retrieval, an unlabelled article can become a strong candidate because the encoder sees a relationship that goes beyond matching words. Both cases give the next round a specific reason to learn a finer distinction.

At retrieval time, each scoring method sees the same question and article through its own representation. BM25+ works on segmented words after stopword removal. The sentence encoder works with the input units used for its training, which can be words or syllables. The article receives a lexical score and a cosine similarity. The authors combine those values to rank articles, then use the ranking in different ways according to the evaluation measure.

Training and retrieval for Vietnamese legal articles

The steps in order.

Training and retrieval for Vietnamese legal articlesStep 1: Join each article's title and body1. Join each article's title and bodyStep 2: Adapt Vietnamese encoders on the legal corpus2. Adapt Vietnamese encoders on the legal corpusStep 3: Rank articles by lexical relevance3. Rank articles by lexical relevanceStep 4: Train with labelled positives and ranked negatives4. Train with labelled positives and ranked negativesStep 5: Mine harder negatives for later training rounds5. Mine harder negatives for later training roundsStep 6: Combine lexical scores and vector similarities6. Combine lexical scores and vector similaritiesStep 7: Select articles for the evaluation measure7. Select articles for the evaluation measure

The authors begin with the legal corpus and question-answer data used by Kien and colleagues. They clean the search collection by removing laws and articles that do not appear as references in the question-answer data. They keep the questions and their existing reference labels. The cleaned corpus has 8,436 documents and 114,177 articles. The unit that enters the ranking is the article, and its input text joins its title to its body. Even though the encoder is called a sentence transformer, that input can be far longer than an ordinary sentence.

For word-level input, the authors use VNCoreNLP to join syllables into words. They illustrate the distinction with the Vietnamese expression for a scientific paper. The written sequence spans 4 syllables, while word segmentation treats it as 2 words. In this example, one word denotes the paper and the other denotes its scientific character. When the text is segmented at word level, a multi-syllable word can be presented as a single unit to the procedure receiving the segmented input. In the syllable-level condition, the units remain separate.

The corpus description groups article lengths into the bands < 100, 101-256, 257-512 and 513+, separately for the syllable and word representations. The authors tie that analysis to the capacities of the encoders. PhoBERT accepts sequences of up to 256 tokens, and ViBERT accepts up to 512 tokens. Counting syllables and counting segmented words can place the same article in different length groups. The reported length groupings characterize how much text the system has to deal with. They do not by themselves specify what portion of an article was used in a particular query comparison.

The lexical branch uses BM25+ from the rank_bm25 package. It uses VNCoreNLP word segmentation and removes stopwords so that common words receive less attention in the matching process. For each query, it produces a ranking of articles by lexical evidence. In the first round of training, the highest-ranked eligible articles provide the negative examples. The same scoring method is used again when the finished system combines lexical evidence with dense similarity.

The authors start with pretrained Vietnamese encoders. PhoBERT follows the RoBERTa pretraining approach, which uses dynamic masking to choose the tokens hidden during training. To obtain ViBERT, a multilingual BERT checkpoint undergoes further training using 10 GB of Vietnamese news. The two starting points therefore differ in their pretraining histories, and the study also identifies PhoBERT with word-level pretraining and ViBERT with syllable-level pretraining. The PhoBERT lineage uses the approach of RoBERTa.

Before learning retrieval from question-article pairs, the encoders train on the legal corpus with a masked-token objective. In this task, part of the input is hidden and the encoder learns to recover it from the surrounding text. The surrounding legal text provides the supervision for this adaptation. The question-answer labels come into play later, when the system must learn which article belongs with which query. The paper gives a training batch size of 8, an evaluation batch size of 8, gradient accumulation of 4 steps and a run of 20 epochs for this phase of fine-tuning.

The authors also start Condenser training from both versions of PhoBERT after masked-token training. They use the Condenser project’s code to prepare the inputs in the expected format and to carry out this adaptation. The resulting sentence encoders are described as SConPBB for the PhoBERT-base-derived variant and SConPBL for the PhoBERT-large-derived variant. These names matter when reading the comparisons because a Condenser variant and a direct PhoBERT variant can share the same backbone lineage while following different preparation routes.

The paper trains word-level and syllable-level conditions independently through the relevant steps. This is more consequential than changing how an already trained system displays its output. It changes the units on which the legal adaptation and the sentence encoder operate. For PhoBERT, the comparison asks whether keeping word segmentation from pretraining carries an advantage. For ViBERT, it asks whether the analogous advantage belongs to syllable-level input. The two families thus give the authors a way to examine alignment with pretraining as well as the segmentation choice itself.

Learning from increasingly competitive negatives

The authors assign a label of 1 to a question paired with one of its reference articles and a label of 0 to a selected negative pair. The negative candidates come from the highest-ranking articles produced by the preceding scorer, subject to the positive labels. The paper uses k for the number of negatives chosen per query in a round. If the benchmark gives a query several reference articles, each remains a positive pair. The number of pairs for a query therefore depends on both the round’s value of k and the query’s reference set.

In the first round, BM25+ supplies 35 negatives per training query. These are articles selected for strong lexical overlap. They can include articles that use the terms in the question while applying to a different issue. Training with those pairs teaches the sentence encoder to distinguish relevant provisions from candidates already favored by term matching. The lexical scorer thereby determines which mistakes the encoder first has the opportunity to correct.

In the second round, the authors choose 20 negatives per training query using the ranking from the first sentence encoder. A high rank at this point reflects a learned vector comparison. A candidate can survive near the top because the representation finds a similarity connected with its meaning, even where the original lexical evidence would have been weaker. The authors expect these negatives to resemble the query more closely in meaning than the initial set. This is a rationale for the selection procedure, instead of a separate assessment of the meaning of each chosen article.

In the third round, the preceding encoder’s ranking supplies 15 negatives per training query. The same selection idea is applied after another opportunity to learn from the rankings. The schedule changes the number of examples as well as their source. The progression consequently moves from a larger set of high lexical matches toward a smaller set of candidates favored by the latest dense scorer. Whether an individual candidate is useful still depends on the reference labels and on what the preceding ranker has learned.

The sentence-transformer training uses a batch size of 8, runs for 4 epochs and uses a learning rate of 1e-5. The objective is contrastive loss. Its role is to reward representations that bring relevant pairs closer and distinguish them from negative pairs. In this pipeline, the training signal comes from article relevance to a specific question, even though the learned representation is used independently on each side at ranking time. The paper names the loss and gives the main training settings, while the description of the mining procedure explains which pairs supply the signal.

Combining the scores and returning articles

The encoder compares the query vector with the article vector using cosine similarity. Cosine compares the direction of the vectors, which allows the score to reflect how their representations align without directly rewarding the length of either vector. The paper gives its range as [-1,1]. BM25+ produces a lexical score on a different scale. The authors examine the average of the top 3 BM25+ scores and observe that the lexical scores there are much larger in magnitude than cosine similarity. They also describe the semantic scores as providing a substantial gap in ranking.

A weighted sum is the point of comparison for their proposed score combinations. In the notation below, the paper’s lexical score and semantic score are abbreviated to L and S.

Slinear = (1 − α) × L + α × S

Slinear is the score produced by the weighted sum. L is the lexical score of the query-article pair, S is its semantic score, and α controls the weight assigned to S. The factor 1 − α gives the weight on L. The multiplication and addition signs specify how the weighted contributions are combined. The paper discusses the difficulty of choosing α for the two score scales and centers its experiments on the product rules.

Sroot = √B × C

Sroot is the combined ranking score when the lexical score is square-rooted. B is the BM25+ score for the query and article, √ denotes the square root, and C is the cosine similarity of their vectors. The multiplication sign joins the transformed lexical score with the cosine score. The square root compresses the scale of the lexical factor, so differences in BM25+ have less leverage than in the direct product.

Sproduct = B × C

Sproduct is the combined score with the original lexical factor. B is again the BM25+ score, C is cosine similarity, and × denotes multiplication. This version gives the untransformed lexical score a direct role in scaling the semantic comparison. Both rules use the scores attached to the same query-article pair. Changing from one rule to the other can alter the order of articles that receive different amounts of lexical and semantic support.

To return a variable number of articles, the authors compare each score with the highest score for that question. They keep articles whose scores lie in this interval.

[H − τ, H]

H denotes the highest article score for the current query. The symbol τ is the score threshold, expressed as a permitted drop below H, and the brackets include the two endpoints. Subtracting τ from H gives the lowest score eligible for selection. A small τ keeps the output close to the highest-scoring article, whereas a larger τ can admit articles farther below it. The authors use a threshold for F2 with the stand-alone scorers and with the combined rankers. For recall@20, the cutoff is a fixed position in the ranked list.

Experiments and results

The benchmark and the comparison systems

The corpus provides the search space, while the question-answer data identifies the articles to recover. The authors report that 1,709 articles occur as references in the question-answer data, about 1.5% of the cleaned legal collection. The rest of the collection can still compete in a ranking. A system must therefore distinguish a small set of benchmark references from many articles, some of which can be plausible because they discuss related legal topics. The proportion also describes coverage of the collection by this benchmark. It does not supply labels about the general usefulness of an article outside the recorded questions.

About 95% of questions in both the training and test sets have one to three relevant articles, according to the dataset description. The results discussion characterizes such questions as more than 95% of the questions when motivating a look at the top BM25+ scores. The important feature of the distribution is that most questions require only a small group of articles, while the benchmark also contains questions with more references. This makes a short thresholded answer set plausible for many queries and gives the later analysis a reason to look separately at questions with larger reference sets.

The stand-alone baselines within the study are BM25+ and the appropriate sentence encoder used by itself. The first ranks with lexical evidence, and the second uses cosine similarity. Comparing these with the combined rankers asks whether the evidence from the unused component improves the retrieval outcome. The authors also compare their best configurations with the previous Vietnamese legal retrieval systems reported by Kien and colleagues and by Nguyen. The discussion identifies Attentive CNN as the previous leading system on this question-answer dataset.

All training runs use a single NVIDIA Tesla P100 GPU through Google Colaboratory. This describes the hardware setting for the reported experiments. The encoders also have different input capacities, which is relevant because the indexed article text joins title and body. The chart gives that numerical comparison for the legal-article experiment. The stars in this article mark the configuration used in the paper’s strongest retrieval system, and the higher direction here denotes a larger permitted input. Retrieval quality is evaluated separately.

Encoder input capacity in the Vietnamese legal-article experiment

ViBERT permits longer input sequences than the backbone of the strongest retrieval system.

Encoder input capacity in the Vietnamese legal-article experimentViBERT: 512ViBERT512PhoBERT-large (this paper): 256PhoBERT-large (this paper)256
The numbers
System or settingmaximum supported input tokens
ViBERT512
PhoBERT-large (this paper)256

What recall and F2 measure

Macro recall@20 asks what fraction of a question’s reference articles is present in the first 20 results, then averages the fractions across questions. A question with a long reference list and a question with a short one each contribute a query-level value. This measure suits the case where a reader or a later retrieval stage can inspect a shortlist. Within the cutoff, finding a reference article raises recall whether it appears first or farther down the list. A reference below the cutoff contributes nothing to that query’s recall@20.

F2 evaluates the actual set chosen by the score threshold. The set can have a different size for each query. Its value depends on both precision, the share of the returned set that is relevant, and recall, the share of the reference set that is recovered. The paper calculates these quantities per query before averaging the resulting F2 values.

Pᵢ = Cᵢ / Aᵢ

Pᵢ is precision for query i. The subscript i identifies the query being evaluated. Cᵢ is the number of its benchmark reference articles that the system returns, and Aᵢ is the total number of articles it returns for that query. The division gives the proportion of the returned articles that agree with the reference set.

Rᵢ = Cᵢ / Gᵢ

Rᵢ is recall for query i. Cᵢ again counts the retrieved reference articles for that query, and Gᵢ is the total number of reference articles associated with it. Dividing by Gᵢ expresses how much of the reference set the system recovers. In the fixed-cutoff evaluation, the count of retrieved references considers only the top 20 results.

F2ᵢ = (5 × Pᵢ × Rᵢ) / (4 × Pᵢ + Rᵢ)

F2ᵢ is the F2 value for query i. Pᵢ and Rᵢ are its precision and recall. The constants 5 and 4 set the form of the combination, with the result weighted toward recall. The multiplication, addition and division signs indicate how the terms are combined. The parentheses place 5 × Pᵢ × Rᵢ in the numerator and 4 × Pᵢ + Rᵢ in the denominator.

F2 = meanᵢ(F2ᵢ)

F2 is the aggregate score. F2ᵢ is the value for an individual query, and meanᵢ denotes the arithmetic average over the evaluated queries indexed by i. Because the averaging happens after calculating F2 for each query, it preserves the query as the unit of evaluation. An aggregate calculated by first pooling all article decisions would answer a different question about the system.

A ranking can fare differently under the two measures because the score threshold uses the distances between values and recall@20 uses rank positions. An article can count towards recall@20 while still falling outside a narrow F2 threshold. Conversely, a wider F2 threshold can add relevant articles and irrelevant articles together. That tradeoff explains why a ranking rule that produces a useful fixed-length shortlist can differ from the rule that does best when the scores also determine which articles to return.

Which systems led the comparisons

The authors first report that the stand-alone sentence encoders outperform BM25+. On this benchmark, encoding the question and article and comparing their vectors provides a stronger retrieval signal than relying on the lexical ranking alone. The next comparison asks whether lexical evidence retains value as part of a combined system. The authors report that combining BM25+ with the encoder improves on the encoder used by itself. In those results, the weaker stand-alone method can still supply information useful to the stronger one.

The best F2 configuration uses the word-level SPhoBERT-large encoder and multiplies its cosine score by the square root of the BM25+ score. The best recall@20 configuration uses the same encoder with direct multiplication. The outcome is specific about the encoder and input in both cases. It also puts the choice of fusion rule in context. For F2, the rule is evaluated together with a selection threshold. For recall@20, its job is to place reference articles high enough in the ordering to make the shortlist.

The authors report that each of these configurations leads the comparison with earlier Vietnamese legal retrieval systems on the measure for which it was selected. The text identifies the winners and the order of the comparisons. Numerical F2 and recall@20 values for the systems are absent from the result-table descriptions, so the size of the improvement over BM25+, the stand-alone encoder or prior systems cannot be stated. The numerical evidence that can be reported directly concerns the corpus, the evaluation cutoffs, the training settings and the individual error example.

That error example tests a narrower comparison than the main rankings. The authors take the language in clause c) of a reference article, compare it directly with the question using SPhoBERT-large and obtain a cosine similarity of 0.351. This is a score for one question-clause pair. It is neither a corpus-wide retrieval measure nor the score the usual full-article pipeline necessarily assigns to the pair. Its value to the analysis is that the encoder can still have difficulty with relevant language after attention is restricted to the clause that provides the answer.

What the ablations show

Why the segmentation result depends on the encoder

The paper presents several controlled comparisons of system settings, including the granularity of the input, the use of lexical evidence and the rule for combining scores. The comparison of words and syllables is especially informative because the preference reverses with pretraining. Word-level input gives better retrieval results for the PhoBERT and CondenserPhoBERT lines. Syllable-level input gives better results for ViBERT. Across these families, the favored input is the one used during pretraining.

The reversal matters for how the word-level result should be interpreted. The overall winner uses words, but a designer choosing a representation for a different encoder would have reason to look at its training history. The vocabulary and sequence patterns an encoder learned originally affect what its legal-corpus adaptation starts from. If that adaptation receives the text in units familiar from pretraining, it can reuse those patterns more directly. The family-specific direction of the results supports that explanation. The study does not independently manipulate the granularity of original pretraining while holding the backbone and its training data fixed.

Sequence length complicates the interpretation in a useful way. Segmenting several syllables into a word can affect how much written text fits in a sequence, and the supported lengths of PhoBERT and ViBERT differ. That difference gives ViBERT a larger input capacity in token units. Yet the strongest overall retrieval setup uses the shorter-capacity PhoBERT family. The comparisons therefore make system quality and sequence capacity separate properties. They leave open how much the result owes to the treatment of long articles, the input granularity or the representations learned by the different backbones.

The Condenser variants broaden the set of preparations compared in the study. They use PhoBERT as their starting point and include an additional training step intended to prepare the encoder for dense retrieval. The strongest overall configuration is the directly named SPhoBERT-large system with word segmentation. That ranking identifies the best tested configuration. Estimating the isolated effect of the extra Condenser training would require comparing individual matched variants and their scores, and the descriptions give no numerical effect sizes for those comparisons.

What the lexical component adds

The lexical-only and dense-only results address different aspects of the system. The first comparison shows that the stand-alone dense score leads the lexical baseline. The second shows that combining BM25+ with an encoder improves on the corresponding dense ranker. The authors’ reason for keeping lexical retrieval is therefore grounded in its contribution alongside the encoder. A vocabulary match can help distinguish articles whose embeddings are similarly placed, and a strong vector match can supply evidence when shared vocabulary is limited.

The combined score also makes the system sensitive to how strongly each kind of evidence is expressed. In the direct product, a larger BM25+ value has its full effect as a multiplier. Taking the square root reduces the spread of the lexical factor. Where an article has strong semantic support and modest lexical overlap, that compression can change how it competes with an article that has stronger overlap. The experiments associate the compressed lexical factor with the better F2 result and the untransformed factor with the better recall@20 result.

The threshold is part of how to read that finding. Switching multiplication rules changes the separation between scores as well as the order in which they appear. In recall@20, only crossing the rank cutoff changes whether a reference contributes. Under the F2 rule, an article can stay in the same rank position and move into or out of the returned set because its score is now a different distance below the leader. The experiment identifies a useful combination of score rule and selection policy. It does not establish the numerical share of the F2 improvement attributable to either one.

The mining schedule is a different part of the method. It changes the number of negatives and moves from BM25+ rankings to rankings by successive encoders. Those changes are presented as a way to increase the difficulty of training pairs. The reported comparisons do not include a matched control for mining depth or a schedule that holds the number of negatives fixed. The rationale for the stages is consequently clearer than their individual effects. The paper shows how the final system was trained, while leaving the contribution of each round unmeasured in isolation.

What changes when a question has more references

The authors take the best retrieval setup associated with each sentence encoder and group queries by the number of relevant articles. This analysis asks whether the overall ordering of systems holds for different kinds of question. It is particularly relevant in a collection where most queries have a small reference set. A configuration can do well in the aggregate while encountering difficulty with questions whose evidence is distributed across more articles.

F2 tends to decline as the number of associated articles rises. The authors point to the relatively narrow score window as one explanation. Suppose the highest-scoring item is relevant and additional relevant articles receive appreciably lower scores. The threshold can produce a clean short list while leaving some of the required provisions outside it. As the reference set grows, recovering only the leading results can leave a larger share of the necessary evidence unrecovered. The comparison shows how score-based selection can interact with reference-set size even when the underlying task remains the same.

The trends for recall@20 are less regular. The authors describe weaker recall for groups with 3, 5 and 7 relevant articles than for those with 2, 4 and 6. They also attribute much of the reduction in overall recall to the groups with 2, 4 and 6. These statements concern distinct possible summaries of the results, one about within-group performance and one about the contribution of groups to an aggregate. The paper gives neither group sizes nor numerical scores in the discussion, so it is difficult to establish how the statements fit together. The pattern should be read as a description of these particular groups, with limited grounds for attributing it to the number of references alone.

The authors identify SViBERT as particularly strong on recall@20 for questions with 5 and 6 reference articles. They associate the overall advantage of SPhoBERT-large with its better results for groups with 3, 5 and 7. The accounts can coexist because a system can do well across a set of groups while a competitor excels in a group within that set. The central point is that the strongest system in the aggregate is only one answer to the question of which system works best for a given kind of query.

What the examples reveal about errors

One investigated error concerns the reference data. The question deals with the return of paperwork when a judgment has gone unimplemented. The stored reference concerns principles governing auctions of land-use rights. After examining the example, the authors judge the association to be a crawling error. A retrieval measure still treats that article as the reference. In that case, a ranker that avoids the unrelated article can be penalized by the evaluation, because its result disagrees with the recorded label.

The other example concerns genuinely difficult retrieval. The question and its article are long, use specialized vocabulary and have limited lexical overlap. The authors single out the Vietnamese legal term pháp nhân and describe “corporation” as the closest English rendering they found. The answer is located in clause c) of the article. A term-based component has little shared wording to exploit, and the encoder’s similarity for the relevant clause alone is 0.351. This shows a concrete situation where the dense component still struggles after the relevant clause has been identified by a reader.

Together, the examples separate two sources of difficulty that a single benchmark score combines. The judgment-enforcement example calls the reference into question. The example involving clause c) shows a difficult relationship the ranker is meant to recover. Those are individual diagnoses. The paper does not supply the frequency of either error type across the collection, so the examples establish how failures arise without establishing which source accounts for the largest portion of measured error.

Limitations

Limits the authors identify

The authors see long legal articles as an unresolved input problem. The retrieval unit concatenates title and body, while the encoders support bounded input lengths. A clause that matters to a question may be surrounded by material on other conditions, procedures or exceptions. The planned use of article summaries and keyword extraction is meant to explore ways of representing that long input more selectively. The paper presents those techniques as future work. Its experiments establish the behavior of the article inputs it actually compares.

The authors also distinguish having an encoder that handles many semantic matches from having one that handles exceptionally complex connections between questions and articles. The error involving clause c) illustrates the latter challenge. Selecting the pertinent clause gives the encoder a more focused input, yet the authors still consider the resulting cosine score low for a pair they judge to be relevant. They identify improvement on very difficult question-rule relationships as future work. The example provides a reason to pursue that goal without establishing how reliably the system can recognize such cases.

The selected threshold is another limit the authors acknowledge. A small allowable drop from the leading score can restrict the number of returned articles, which works against queries with several relevant provisions at different scores. This matters directly for F2 because the reference articles outside the window count against recall. The best fusion rule for F2 is therefore a finding about a complete retrieval setup that includes a threshold. Its result does not by itself establish that a particular score window will transfer to questions with a different distribution of relevant articles.

Finally, the authors identify errors in the reference collection. Cleaning away unreferenced material and retaining the question-answer labels preserves the benchmark’s labelled targets, including any mistakes in those targets. The example pairing judgment enforcement with land auctions shows the practical consequence. The study’s retrieval measures quantify agreement with the recorded reference set. Where the reference is wrong, that agreement is an imperfect stand-in for finding the provision a legal reader would actually use.

Limits visible in the experimental setup

The evaluation is bounded by the inherited question-answer dataset and its cleaned search collection. It establishes relative performance for Vietnamese legal article retrieval in that setting. The authors give both training and testing patterns for the number of relevant articles, but the paper does not present a second legal collection or a separate source of queries as an external test. A corpus with different provisions, phrasing or label coverage could change both the usefulness of the mined negatives and the behavior of the score threshold. The study leaves such transfer unmeasured.

Preserving the questions and labelled articles also has a narrower meaning than preserving every original retrieval condition. Cleaning changes which unlabelled articles can act as distractors. A removed provision could have competed with a reference article in the earlier search collection even though it had never been marked relevant for a benchmark question. The paper reports that cleaning leaves the query data intact. It does not report a direct comparison of rankings before and after cleaning, so the effect of the changed candidate collection is unquantified.

The training pipeline relies on the benchmark for both positive and negative decisions. An article ranked highly by a preceding scorer can be informative as a negative because it looks superficially or semantically plausible. That logic assumes the recorded references are complete enough to distinguish genuinely incorrect candidates from relevant provisions that the dataset omitted. The documented crawling error establishes that the labels can be imperfect. The paper gives no audit of the mined negative pairs, so it remains unclear how often the system was trained to distance a query from an article that a legal reader might also consider relevant.

Some details relevant to reproducing the strongest settings remain open in the description. The paper states the token capacities and discusses article lengths, but it does not specify how every overlength title-and-body input was shortened or otherwise handled. It explains the threshold relative to the maximum score but gives no numeric threshold or explicit split for choosing it. It also motivates multiplication by the mismatch between the lexical and cosine scales without detailing how the system deals with negative cosine values in the combined ranking. These details matter because they govern which text reaches the encoder, which articles are selected and how the scores order candidates.

The reported outcome combines several choices. The encoders differ in pretraining lineage, granularity and supported input length. The mining schedule changes both the source and the number of negative examples. The F2 comparison includes a threshold whose effect depends on the distribution of scores. The study tests useful configurations of these choices and provides evidence about how they behave together. It gives a more limited basis for attributing an improvement to any one change in isolation. The absence of numerical values for the main comparisons in the paper’s result descriptions also limits what can be said about the practical size of the gains or the size of the subgroup differences.

Retrieving the reference articles is the endpoint of the evaluation. The system could give a reader a useful set of provisions and still leave the task of identifying the operative clause, interpreting exceptions or applying the rule to the question. F2 and recall@20 measure properties of article retrieval. The corpus, labels and measures support conclusions about finding sources for a legal answer. They leave the correctness of the eventual legal answer outside the experiment.

What came after

The first later work is the 2024 study Improving Vietnamese Legal Document Retrieval using Synthetic Data. Its title identifies synthetic data as the means of improving retrieval in the same domain. This places the emphasis on the examples available for a retrieval system. The earlier paper also makes the supply of examples a central design choice, through its use of benchmark reference articles and ranked negatives from the legal collection. The connection is clearest at that level. In both research questions, the material available for training or evaluating a search system is part of the investigation. Improving Vietnamese Legal Document Retrieval using Synthetic Data.

The earlier study obtains new training pairs by changing which articles accompany an existing question. It starts with lexical rankings and later draws negatives from the encoder’s own rankings. A study of synthetic data introduces a distinct way to change the material available to a retrieval system. The bibliographic record establishes the use of synthetic data and the citation relationship. Details about what was synthesized, how it was used, which parts of the earlier pipeline were adopted and what gains were measured remain unspecified. The continuation that can be established is the shared problem of improving Vietnamese legal retrieval and the move toward a different source of data for addressing it.

Following the representation of a question as it unfolds

The second later work is the 2026 study Reading a Legal Question Word by Word: Embedding Trajectories of 2,144 Vietnamese Legal Headlines. Its title puts the emphasis on how an embedding changes across the words of a legal question. A trajectory treats the successive representations as an ordered sequence, allowing the investigation to ask how information arriving later in the question changes its representation. The subject is related to the earlier paper’s use of an embedding for a completed legal query, while the focus is on the development of that representation as the text unfolds. Reading a Legal Question Word by Word: Embedding Trajectories of 2,144 Vietnamese Legal Headlines.

In the retrieval pipeline, the query embedding is judged by which articles it helps bring into the shortlist and which ones it helps select. A word-by-word trajectory directs attention to the query representation itself. The earlier paper’s segmentation comparisons give a reason to care about the units used to construct that representation, and its difficult-query example gives a reason to care about whether specialized words are represented in a way that connects with the relevant article. The later title establishes the trajectory study and the set of Vietnamese legal headlines. It leaves the encoder, the experimental outcomes and any reuse of BM25+, the mining schedule or the fusion rules unspecified.

The citing works thus pursue two identifiable questions raised by the earlier retrieval setting. The synthetic-data study centers on the material a retrieval system can learn from. The trajectory study centers on how a legal query becomes an embedding as its words accumulate. Both questions bear on what the 2022 experiments asked their encoder to do. Those experiments used ranked examples to shape the representation of a question and judged that representation by whether it helped recover the legal articles needed to answer it.

Cite

Cite as Nhat-Minh Pham, Ha-Thanh Nguyen and Trong-Hop Do. 2022. Multi-stage Information Retrieval for Vietnamese Legal Texts. arXiv:2209.14494.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2209.14494 · arXiv 2209.14494

@misc{pham2022multi,
  title = {{Multi-stage Information Retrieval for Vietnamese Legal Texts}},
  author = {Nhat-Minh Pham, Ha-Thanh Nguyen and Trong-Hop Do},
  year = {2022},
  doi = {10.48550/arxiv.2209.14494},
  eprint = {2209.14494},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2209.14494}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/pham-2022-multi-stage-information-retrieval-vietnamese/

References

23 references, from the paper's own bibliography.

  1. Akkalyoncu Yilmaz, Z., Wang, S., Yang, W., Zhang, H., Lin, J.: Applying BERT to document retrieval with birch. In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): System Demonstrations. pp. 19–24. Association for Computational Linguistics, Hong Kong, China (Nov 2019). , https://aclanthology.org/D19-3004 OpenAlex ↗ · Scholar ↗
  2. Condor, A., Litster, M., Pardos, Z.: Automatic short answer grading with sbert on out-of-sample questions. International Educational Data Mining Society (2021) OpenAlex ↗ · Scholar ↗
  3. Deerwester, S.C., Dumais, S.T., Landauer, T.K., Furnas, G.W., Harshman, R.A.: Indexing by latent semantic analysis. J. Am. Soc. Inf. Sci. 41, 391–407 (1990) OpenAlex ↗ · Scholar ↗
  4. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018) our card
  5. Gao, L., Callan, J.: Condenser: a pre-training architecture for dense retrieval. In: Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. pp. 981–993. Association for Computational Linguistics, Online and Punta Cana, Dominican Republic (Nov 2021). , https://aclanthology.org/2021.emnlp-main.75 our card
  6. Ha, T.T., Nguyen, V.N., Nguyen, K.H., Nguyen, K.A., Than, Q.K.: Utilizing sbert for finding similar questions in community question answering. In: 2021 13th International Conference on Knowledge and Systems Engineering (KSE). pp. 1–6. IEEE (2021) OpenAlex ↗ · Scholar ↗
  7. Hadsell, R., Chopra, S., LeCun, Y.: Dimensionality reduction by learning an invariant mapping. In: 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06). vol. 2, pp. 1735–1742. IEEE (2006) OpenAlex ↗ · Scholar ↗
  8. Karpukhin, V., Oguz, B., Min, S., Lewis, P., Wu, L., Edunov, S., Chen, D., Yih, W.t.: Dense passage retrieval for open-domain question answering. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). pp. 6769–6781. Association for Computational Linguistics, Online (Nov 2020). , https://aclanthology.org/2020.emnlp-main.550 our card
  9. Kien, P.M., Nguyen, H.T., Bach, N.X., Tran, V., Nguyen, M.L., Phuong, T.M.: Answering legal questions by learning neural attentive text representation. In: Proceedings of the 28th International Conference on Computational Linguistics. pp. 988–998. International Committee on Computational Linguistics, Barcelona, Spain (Online) (Dec 2020). , https://aclanthology.org/2020.coling-main.86 OpenAlex ↗ · Scholar ↗
  10. Laskar, M.T.R., Huang, J.X., Hoque, E.: Contextualized embeddings based transformer encoder for sentence similarity modeling in answer selection task. In: Proceedings of the 12th Language Resources and Evaluation Conference. pp. 5505–5514. European Language Resources Association, Marseille, France (May 2020), https://aclanthology.org/2020.lrec-1.676 OpenAlex ↗ · Scholar ↗
  11. Lee, K., Chang, M.W., Toutanova, K.: Latent retrieval for weakly supervised open domain question answering. In: Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. pp. 6086–6096. Association for Computational Linguistics, Florence, Italy (Jul 2019). , https://aclanthology.org/P19-1612 our card
  12. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., Stoyanov, V.: Roberta: A robustly optimized bert pretraining approach. ArXiv abs/1907.11692 (2019) our card
  13. Nguyen, D.Q., Tuan Nguyen, A.: PhoBERT: Pre-trained language models for Vietnamese. In: Findings of the Association for Computational Linguistics: EMNLP 2020. pp. 1037–1042. Association for Computational Linguistics, Online (Nov 2020). , https://aclanthology.org/2020.findings-emnlp.92 our card
  14. Nguyen, H.T.: Toward improving attentive neural networks in legal text processing. arXiv preprint arXiv:2203.08244 (2022) OpenAlex ↗ · Scholar ↗
  15. Reimers, N., Gurevych, I.: Sentence-bert: Sentence embeddings using siamese bert-networks. arXiv preprint arXiv:1908.10084 (2019) our card
  16. Robertson, S., Zaragoza, H., Taylor, M.: Simple bm25 extension to multiple weighted fields. In: Proceedings of the Thirteenth ACM International Conference on Information and Knowledge Management. p. 42–49. CIKM '04, Association for Computing Machinery, New York, NY, USA (2004). , https://doi.org/10.1145/1031171.1031181 OpenAlex ↗ · Scholar ↗
  17. Robertson, S.E., Walker, S.: Some simple effective approximations to the 2-poisson model for probabilistic weighted retrieval. In: SIGIR’94. pp. 232–241. Springer (1994) OpenAlex ↗ · Scholar ↗
  18. Salton, G., Buckley, C.: Term-weighting approaches in automatic text retrieval. Information Processing & Management 24(5), 513–523 (1988). , https://www.sciencedirect.com/science/article/pii/0306457388900210 OpenAlex ↗ · Scholar ↗
  19. Shao, Y., Mao, J., Liu, Y., Ma, W., Satoh, K., Zhang, M., Ma, S.: Bert-pli: Modeling paragraph-level interactions for legal case retrieval. In: Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20. pp. 3501–3507 (2020) OpenAlex ↗ · Scholar ↗
  20. Thakur, N., Reimers, N., Daxenberger, J., Gurevych, I.: Augmented SBERT: Data augmentation method for improving bi-encoders for pairwise sentence scoring tasks. In: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. pp. 296–310. Association for Computational Linguistics, Online (Jun 2021). , https://aclanthology.org/2021.naacl-main.28 our card
  21. Tran, T.O., Le Hong, P., et al.: Improving sequence tagging for vietnamese text using transformer-based neural models. In: Proceedings of the 34th Pacific Asia Conference on Language, Information and Computation. pp. 13–20 (2020) OpenAlex ↗ · Scholar ↗
  22. Vu, T., Nguyen, D.Q., Nguyen, D.Q., Dras, M., Johnson, M.: VnCoreNLP: A Vietnamese natural language processing toolkit. In: Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Demonstrations. pp. 56–60. Association for Computational Linguistics, New Orleans, Louisiana (Jun 2018). , https://aclanthology.org/N18-5012 our card
  23. Wang, B., Kuo, C.C.J.: SBERT-WK: A sentence embedding method by dissecting bert-based word models. arXiv preprint arXiv:2002.06652 (2020) OpenAlex ↗ · Scholar ↗