## 3 Methodology
### Entropy-Optimized Dynamic Text Segmentation  
In RAG systems, when external knowledge, particularly documents, is vectorized and stored, it is typically segmented into knowledge chunks. These chunks serve as the fundamental units for retrieving contextual knowledge from the vector database in subsequent stages. Consequently, the size of these knowledge chunks significantly impacts the quality of retrieval and response generation. Smaller chunks capture more specific semantic meanings but carry less contextual information, potentially causing critical information to be absent from the top retrieved chunks. Larger chunks preserve more complete contextual coherence but may introduce semantic dilution during vectorization, where fine-grained details are obscured by the broader context [33]. Thus, there is no universally optimal strategy for text segmentation. The choice depends on balancing trade-offs between specificity and context retention, requiring analysis and experimentation tailored to the specific application scenario. Table 2 provides examples of several common text segmentation methods. This study proposes a text segmentation method named entropy-optimized dynamic text segmentation (EDTS), which dynamically partitions a text into semantically coherent chunks by minimizing local information entropy. This method ensures that each segmented unit exhibits self-contained informational completeness while maintaining contextual independence, thereby optimizing downstream tasks such as retrieval and semantic analysis. Entropy is a measure in thermodynamics that expresses the degree of disorder in a system. [PERSON] introduced entropy into information theory to represent the uncertainty of an information source, where it serves as a measure of the uncertainty associated with the occurrence of a random event [39]. The definition of entropy is as shown in Equation (1). \[H(X)=-\sum_{x\in X}p(x)\text{log}_{2}\,p(x), \tag{1}\]  
where \(H(X)\) denotes the Shannon entropy of the random variable \(X\), \(X\) is the set of possible values of a random variable, and \(p(x)\) is the probability that the random variable \(X\) takes the value \(x\). In text analysis, entropy can reflect the complexity, information redundancy, or regularity of linguistic structures within a text. While there is a relationship between text length (i.e., the number of symbols in the text) and entropy, it is not a simple linear correlation; instead, it depends on the text's statistical properties, linguistic structure, and contextual dependencies [40]. Generally, higher entropy corresponds to greater uncertainty and richer information content in the text, whereas lower entropy indicates higher predictability and increased redundancy [41]. The core methodology in this study involves:  
1. Sentence as core unit: utilizing sentences as foundational semantic units to preserve intrinsic coherence. 2. Dynamic context expansion: bidirectionally extending contextual windows (forward/backward) from each sentence boundary through a controlled growth mechanism. 3. Entropy-driven boundary detection: Iteratively identifying optimal segmentation points by locating lexical positions with minimal local entropy within the expanded window. Equation (2), which calculates the local information entropy, is defined as follows: \[H(W|c_{i})=-\sum_{w\in W}p(w|c_{i})\text{log}_{2}p(w|c_{i}),\] (2) where \(W\) represents the set of words within a core unit, and \(c_{i}\) represents the set of expanded words extended to the boundary position \(I\). 4. Entropy reduction: Systematically minimizing the entropy of the entire core statement through dynamically adjusting chunk boundaries, ensuring maximally self-contained information units. As shown in Equation (3), select the candidate position \(i_{b}\) that minimizes the conditional entropy as the segmentation boundary. \[i_{b}=\underset{i}{\text{argmin}}H(W|c_{i}),\] (3)