Manuscript Offprint

arXiv:2609.08372

Reading a Legal Question Word by Word: Embedding Trajectories of 2,144 Vietnamese Legal Headlines

Tran Minh Quan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Tran Minh Quan

Figure

Figure 1: Three headlines walking to their answers, one word at a time. Each panel is the plane of the gold article (star), its twenty strongest competitors (grey) and the word-prefix path of a headline in Nemotron-3-Embed-8B (green, one dot per word; squares mark the second sub-question). Every word is written where the prefix ending in it is encoded; bold words are the ones needed to bring the gold article to rank 1 (red ring: the insight point), grey words—the interrogative frame, greeting and attribution—move the point but not the ranking. Thin blue lines are the second sub-question encoded on its own; they land elsewhere. (a) Nguyên tắc kỳ luật học sinh ... (Principles for disciplining pupils ...): rank 1 after four content words. (b) Biên số xe 38 ở đâu? (Where is licence plate 38 from?): four words, the number does the work. (c) Hệ số lượng của biên tập viên ... (Salary coefficient of editors ...): six words.

ABSTRACT

A dense retriever encodes a question as one vector, but the question arrives one word at a time. We read every one of 2,144 held-out headlines from the Vietnamese legal library Thư Viện Pháp Luật (Legal Library) word by word through four decoder embedders —NVIDIA's Nemotron-3-Embed-8B and Nemotron-3-Embed-1B, Alibaba's Qwen3-Embedding-8B and Qwen3-Embedding-0.6B—encoding all 65,444 word prefixes, ranking each against the 20,034-article corpus, and keeping the full vector of every prefix. We then split the 1,112 multi-question headlines into their 3,438 sub-questions, encode every prefix of every sub-question on its own, and do the same for 168 answers read word by word. The trajectories show one behaviour with a few well-defined variants. (i) The gold article becomes rank 1 after a median of 6–7 content words in every encoder (quartiles 4–10), before the interrogative frame is read, and stays there to the end of the headline in 78–85% of cases. (ii) In a multi-question headline the lock happens inside the first sub-question 94–98% of the time; the second sub-question leaves the rank unchanged in 89–95% of headlines, and its own words encoded alone reach rank 1 only 42–58% of the time against 91–96% for the first. The word at which the first sub-question locks is the same whether it is read alone or inside the headline (95–97% identical). (iii) Numbers, dates and instrument identifiers move the embedding twice as far as ordinary content words and four times as far as interrogative words at equal position; 72–78% of all steps move toward the gold article, and the interrogative frame that closes a question displaces the vector against the direction the content words built in 95–99% of headlines. (iv) Clustering the rank and cosine curves yields six archetypes—instant, typical, unstable, late and never-locking paths—whose mix differs by legal area, question form and sub-question count (all χ2p<10−8\chi^2 p < 10^{-8}): real-estate and litigation headlines never lock on a number, environmental and accounting headlines do so a third of the time. (v) Read word

by word, an answer retrieves its own article after 8–16 words and addresses the sub-questions in the order they were asked in 83–89% of cases. (vi) The walk is neither an independent word-embedding walk nor a wholesale rewrite at every word: the step a word contributes keeps a consistent direction across headlines (cosine 0.25–0.33 between occurrences, 0.44–0.60 for numbers, 0.00 for unrelated words), a preceding question rotates that step by about 60° and a greeting by about 30°, steps shrink as i−0.8i^{-0.8} under mean pooling and last-token pooling alike, and the vector of a two-question headline is reproduced to within 12–17° by a linear mix of its two questions' standalone vectors. We call this a context-modulated additive walk. Trajectories are presented as a token-granularity visual idiom whose ground truth is the rank in the full index rather than proximity in a projection; we show galleries of annotated trajectories for every question form and every one of the 27 legal areas (Appendix A).

1 INTRODUCTION

Retrieval-augmented systems treat a query as an atom: the whole string is encoded, one vector is compared with an index, the best passages are returned. Yet a query is a sequence, and a decoder-based embedder reads it left to right. Somewhere along the sequence the vector crosses from the region of the index where it is nobody's neighbour into the region where the right passage is its nearest neighbour. Where that crossing happens, whether it happens once, and which words cause it are empirical questions with practical consequences: they decide how much of a question one needs before retrieval can start, how much of it can be dropped, and whether a compound question is better sent whole or in pieces. Vietnamese legal question answering is a good place to ask these questions. The editorial headlines of Thư Viện Pháp Luật (Legal Library) [30, 38] are long (a mean of 32 words), 52% of them contain two or more questions separated by question marks, 19% open with a greeting (Cho tôi hỏi (Let me ask)) and 22% close with an attribution (Câu hỏi của anh Sơn (Hà Giang)) (Question from Mr Sơn (Hà Giang))). They therefore contain, in one string, exactly the ingredients whose contribution we want to separate: a topic noun phrase, an interrogative frame, a second question, and words that carry no information at all. Decoder embedders fine-tuned for retrieval [2, 15, 26, 44] place the gold article at rank 1 for 93–96% of these headlines; the interesting question is not whether they work but how the answer is reached.

Text visualization has moved, over the last decade, from mapping explicit lexical statistics—tag clouds, word trees, term matrices [14]—to interpreting the latent spaces of neural language models [18]: attention routes [1, 41], layer-by-layer hidden-state geometry [3], prompt perturbation [20], and corpus cartography by non-linear projection [8]. Almost all of these idioms treat a text as a point (or a sequence of points across layers); the object we study is the path a single text traces as it is read, and its coordinate system is not a projection but the retrieval index itself: the quantity attached to every word is the rank of the correct article among 20,034, which no two-dimensional layout can distort.

This paper is about that path. Its contribution is a complete word-by-word account of one retrieval benchmark in four encoders: the embedding of every prefix of every headline (65,444 vectors per encoder), of every prefix of every sub-question read alone (61,568), and of stride-8 prefixes of 168 answers (15,839), with the rank of the gold article, its cosine, the two strongest competitors and the full vector of each prefix retained. From this we derive the insight point of every headline, test whether the point survives when a headline is split into its sub-questions, measure which word classes move the vector, cluster the trajectories into archetypes, map the archetypes onto the site's 27 editorial legal areas, and—because we keep every prefix vector—ask what kind of process the walk is: whether each word adds a step of its own or rewrites the vector in the light of everything before it. Every claim is illustrated with annotated trajectories drawn in the plane of the gold article and its competitors; more than seventy such panels appear in the paper, at least one for each legal area and each question form.

References (21)