DySem: Uncovering Dynamic Semantic Components of Large Language Models for Calculating Semantic Textual Similarity Kaijie Zheng, Weiqin Wang, Yile Wang, Hui HuangCollege of Computer Science and Software Engineering, Shenzhen University Abstract Calculating semantic textual similarity is a foundational task in natural language processing. Current large language models (LLMs) based methods typically rely on extracting last-layer hidden states with fixed dimensions to compute similarity for every text pairs. We argue that this paradigm is suffer from two limitations: (i) The last hidden layer encodes more general knowledge rather than just semantic knowledge, making it suboptimal for semantic similarity computation; (ii) The hidden layer dimensions of LLMs are generally very large, which introduces some redundancy and noise for representing semantics. In this work, we propose DySem , a novel training-free framework that investigates more semantic-related internal components of LLMs via multilingual consensus , and shifts away from static representation spaces in favor of dynamic, sample-specific semantic dimensions by constructing text-dependent joint semantic set and computes similarity over this shared dimensional subset. Extensive experiments across various LLMs show that our method consistently outperforms recent baselines while maintaining lower dimensions for similarity calculation. The code is released at https://github.com/szu-tera/DySem . 1 1 footnotetext: Equal contribution. 2 2 footnotetext: Corresponding to wangyile@szu.edu.cn . 1 Introduction Evaluating the relationship between two texts and calculating their semantic textual similarity (STS; 6 ) plays an important role in natural language processing, serving as the backbones of applications such as semantic search, clustering, and information retrieval. Conventional pre-trained models (PTMs; 11 ; 27 ; 14 ) and large language models (LLMs; 18 ; 23 ; 10 ) based methods typically map all text into a vector using the same last-layer hidden states with fixed dimensions for similarity calculation, as shown in Figure 1 (a). Figure 1: Illustration of different ways for calculating semantic similarity: (a) conventional methods use last hidden states and full dimensions; (b) our DySem investigates semantic components and flexible dimensions. However, we argue that this default design has two limitations: First, the last-layer hidden states of LLMs typically encodes highly generalized information optimized for next-token prediction, which inevitably entangles core semantics with broader unrelated information. Studies also show that semantics are also captured by internal neurons of LLMs 28 ; 37 . This motivates us to explore direct internal semantic components of LLMs for similarity computation. Second, representing texts using the entire high-dimensional states can introduces information redundancy, and the semantic integrity is largely preserved after dimensionality reduction 31 ; 16 ; 32 . Considering that the hidden state sizes of LLMs are often very large, this brings unnecessary overhead in textual similarity computation and downstream applications. This motivates us to consider using a more flexible number of dimensions to compute the STS between two texts. In this work, we propose DySem , a training-free method that aims to extract semantic components of LLMs beyond last-layer hidden states and shifts away from fixed representation dimensions in favor of dynamic, sample-specific semantic dimensions, as shown in Figure 1 (b). In particular, DySem first extracts a sample-specific set of semantic components and dimensions via multilingual consensus , drawing from the straightforward intuition that a text’s core semantic meaning remains invariant across its translated versions. Then, DySem dynamically construct a pair-dependent joint semantic set by taking the union of the semantic dimensions from both texts, and compute the STS over this joint semantic set. This dynamic alignment effectively filters out irrelevant background noise, ensuring that the metric evaluates the shared semantic concepts between texts. Experiments on seven standard STS benchmarks across various LLMs show that, DySem can effectively uncovers attention-based semantic components of LLMs and demonstrates superior STS performance compared with recent baselines without model training. Moreover, DySem maintains flexible computational dimensions and can achieve competitive results using only around 1,000 dimensions or fewer on average across all samples. 2 Preliminaries and Notations 2.1 Internal Components of Transformer Consider a decoder-only Transformer model \mathcal{M} with layers L and hidden size d . Let N denotes the sequence length and h_{n}^{l}\in\mathbb{R}^{d} denotes the hidden state of token n at layer l , where n\in\{0,1,\dots,N\} , l\in\{0,1,\dots,L\} . At layer l , the input state h_{n}^{l-1} is first processed by the multi-head attention module and the attention output a_{n}^{l} is calculated by: a_{n}^{l}=\mathrm{MHA}^{l}(h_{n}^{l-1}), (1) where \mathrm{MHA}^{l} denotes masked multi-head self-attention computed by the standard query-key-value mechanism. The resulting attention output a_{n}^{l} is added by residual connection, and gives the output of feedforward network f_{n}^{l} : f_{n}^{l}=\mathrm{FFN}^{l}(h_{n}^{l-1}+a_{n}^{l}). (2) The final hidden state h_{n}^{l} at layer l is calculated by the summation of the attention output, FFN output, and the hidden states from previous layer: h_{n}^{l}=h_{n}^{l-1}+a_{n}^{l}+f_{n}^{l}, (3) where a_{n}^{l} and f_{n}^{l} represent the contributions of the MHA and FFN at layer l , respectively. Expanding the residual updates over all layers yields: h_{n}^{L}=h_{n}^{0}+\sum_{l=1}^{L}a_{n}^{l}+\sum_{l=1}^{L}f_{n}^{l}. (4) For convenience, define the cumulative attention and FFN contributions as: A_{n}^{L}=\sum_{l=1}^{L}a_{n}^{l},\qquad F_{n}^{L}=\sum_{l=1}^{L}f_{n}^{l}. (5) Thereby, the final-layer hidden state can be re-written equivalently as: h_{n}^{L}=h_{n}^{0}+A_{n}^{L}+F_{n}^{L}. (6) Figure 2: Overview of DySem . The process involves (a) extracting semantic component dimension via multilingual consensus (§ 3.1 ), (b) constructing a pair-dependent joint semantic set \mathcal{U}(x,y) by merging the individual semantic component dimension sets (§ 3.2 ), and (c) calculating the semantic similarity in the selected joint dimensions (§ 3.3 ). 2.2 Semantic Textual Similarity Calculation Given text pair (x,y) , conventional encoder-based methods such as SimCSE 14 perform contrastive learning with the hidden state h_{n}^{L} of special token (e.g., [CLS]) as text representation and calculate their similarity using cosine distance: s(x,y)=\cos(h_{n}^{L}(x),h_{n}^{L}(y)), (7) where h_{n}^{L} can also be replaced by the pooling results of all hidden states h_{0}^{L},\ldots,h_{n}^{L} . To extract the text meaning from decoder-based LLMs without training, PromptEOL 18 wraps each text x with template \mathcal{T} and extract the last hidden state h_{N}^{L} as text representation: \mathcal{M}(\mathcal{T}(x))=[h_{0}^{L},\ldots,h_{N}^{L}], (8) where \mathcal{T} is used to extract text meanings as follows: \mathcal{T}=\text{{This sentence: ``$x$'' means in one word:}} (9) Our Motivations. Whether using the hidden states from the special token or the last token, the above methods both use a fixed hidden state to represent the semantics of any given text x , and they utilize the full dimensionality of the states, i.e., the pre-defined hidden size d , when computing the semantic similarity. This motivates us to explore the following two questions. (1) Representation Selection : Can alternative internal components such as attention or FFN vectors in Eq. 4 and Eq. 5 be used for better representing semantics? (2) Dimension Selection : Do we really need two d -dimensional (typically 4096 or more for LLMs) vectors to compute textual similarity? 3 Method Our method DySem proceeds in three stages: (i) extracting semantic components and dimensions for each text via multilingual consensus (§ 3.1 ), (ii) constructing a pair-dependent joint semantic set by merging these individual dimensions (§ 3.2 ), and (iii) computing a restricted cosine similarity over the union of these dimension sets (§ 3.3 ). The overall framework is shown in Figure 2 . 3.1 Extracting Semantic Components Given a text x , we first translate it into a predefined set of m target languages \mathcal{L}=\{\ell_{1},\dots,\ell_{m}\} , yielding a collection of language-specific renderings: x^{(\ell)}=T_{\ell}(x),\quad\ell\in\mathcal{L}, (10) where T_{\ell} is the translator with target language \ell . To extract the semantic representation of x , we wrap each language version x^{(\ell)} in the prompt template \mathcal{T} to get their corresponding representations. We consider two prompt strategies: (1) English Prompt , which uses the same English template in Eq. 9 as the prompt for LLMs, and (2) Language-Specific Prompt , which uses translated version of the template \mathcal{T} using the translator T_{\ell} as the prompt. Then, we can get the internal state vector \mathbf{s}^{(\ell)}(x)\in\mathbb{R}^{d} from the last-token, constructing a set of multilingual text vectors \mathcal{E}(x)=\{\mathbf{s}^{(\ell)}(x)\mid\ell\in\mathcal{L}\} . For the internal state vector \mathbf{s}^{(\ell)}(x)\in\mathbb{R}^{d} , we consider three components h_{n}^{L} , A_{n}^{L} , and F_{n}^{L} as defined in § 2.1 . We analyze these components in § 5.2 . Methods #Dim. STS12 STS13 STS14 STS15 STS16 STS-B SICK-R Avg. Sentence-BERT (110M) † 27 \phantom{{}^{*}}768\phantom{{}^{*}} 70.97 76.53 73.19 79.09 74.30 77.03 72.91 74.89 SimCSE (110M) † 14 \phantom{{}^{*}}768\phantom{{}^{*}} 68.40 82.41 74.38 80.91 78.56 76.85 72.23 76.25 PromptBERT (110M) † 19 \phantom{{}^{*}}768\phantom{{}^{*}} 71.56 84.58 76.98 84.47 80.60 81.60 69.87 78.54 LLaMA2-7B Mean Pooling \phantom{{}^{*}}4096\phantom{{}^{*}} 35.43 53.63 39.88 54.69 52.99 42.66 49.45 46.96 PromptEOL † 18 \phantom{{}^{*}}4096\phantom{{}^{*}} 58.80 77.00 66.34 73.22 73.53 71.72 70.19 70.11 LLM2Vec 7 \phantom{{}^{*}}4096\phantom{{}^{*}} 65.39 79.26 72.98 82.72 81.02 78.32 71.77 75.92 Token Prepending † 13 \phantom{{}^{*}}4096\phantom{{}^{*}} 66.90 83.12 74.31 79.87 80.03 80.67 75.40 77.19 Contrastive Prompting † (Scaling; 10 ) \phantom{{}^{*}}4096\phantom{{}^{*}} 63.34 82.15 71.73 79.68 77.23 78.71 74.04 75.27 Contrastive Prompting † (Recovering; 10 ) \phantom{{}^{*}}4096\phantom{{}^{*}} 63.37 81.95 71.90 79.54 77.29 78.36 74.00 75.20 SemPA 9 \phantom{{}^{*}}4096\phantom{{}^{*}} 68.77 83.73 74.73 82.08 77.48 79.76 77.26 77.69 AlignedWVA 37 \phantom{{}^{*}}4096\phantom{{}^{*}} 67.94 84.97 75.93 81.68 79.98 80.39 74.45 77.91 DySem (English Prompt, Ours) \phantom{{}^{*}}1238^{*} 70.20 85.09 77.39 82.64 79.73 80.67 74.75 78.64 DySem (Language-specific Prompt, Ours) \phantom{{}^{*}}1240^{*} 72.68 84.75 77.28 83.47 79.19 80.06 75.39 78.98 LLaMA3.1-8B Mean Pooling \phantom{{}^{*}}4096\phantom{{}^{*}} 35.33 53.63 43.63 56.74 53.27 45.90 50.75 48.46 PromptEOL 18 \phantom{{}^{*}}4096\phantom{{}^{*}} 60.77 80.16 69.64 76.90 78.23 72.74 70.45 72.70 AlignedWVA 37 \phantom{{}^{*}}4096\phantom{{}^{*}} 64.13 83.98 72.66 80.41 80.64 78.91 72.99 76.25 DySem (English Prompt, Ours) \phantom{{}^{*}}1103^{*} 66.75 83.70 73.41 81.47 80.70 79.49 74.23 77.11 DySem (Language-specific Prompt, Ours) \phantom{{}^{*}}995^{*} 74.95 84.18 76.22 83.02 81.30 81.79 77.25 79.82 Qwen2.5-7B Mean Pooling \phantom{{}^{*}}3584\phantom{{}^{*}} 37.62 44.31 32.01 43.36 46.62 33.84 42.49 40.04 PromptEOL 18 \phantom{{}^{*}}3584\phantom{{}^{*}} 65.50 79.70 70.62 79.05 78.73 76.44 70.46 74.36 AlignedWVA 37 \phantom{{}^{*}}3584\phantom{{}^{*}} 71.56 80.19 69.61 75.63 78.69 74.45 73.06 74.74 DySem (English Prompt, Ours) \phantom{{}^{*}}978^{*} 76.92 83.20 75.48 83.51 79.57 80.29 78.43 79.63 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}940^{*} 75.12 82.66 73.94 81.74 79.80 78.42 77.94 78.52 Qwen3-8B Mean Pooling \phantom{{}^{*}}4096\phantom{{}^{*}} 44.04 38.44 31.63 46.34 43.39 29.86 38.04 38.82 PromptEOL 18 \phantom{{}^{*}}4096\phantom{{}^{*}} 59.30 74.19 61.56 72.36 74.64 73.41 66.90 68.91 AlignedWVA 37 \phantom{{}^{*}}4096\phantom{{}^{*}} 64.91 80.90 70.56 77.38 78.90 76.15 74.75 74.79 DySem (English Prompt, Ours) \phantom{{}^{*}}1027^{*} 75.22 83.22 76.82 83.49 79.54 80.09 79.16 79.65 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}675^{*} 77.54 84.33 76.95 83.91 81.19 81.26 78.56 80.54 Table 1: Comparison between baselines and our method on base models. In each column, the best results are in bold , and the second-best results are underlined . Our method’s performance is highlighted in blue. † denotes results from the original paper. ∗ indicates the average dimension of vectors across all samples for similarity computation. We define multilingual consensus as the consistent activation patterns shared across these diverse linguistic renderings. By leveraging this consensus, we can effectively filter out language-specific surface artifacts and isolate the core text-relevant semantics. Specifically, this consensus is operationalized by identifying dimensions that are consistently activated across all language versions. Assuming a dimension is activated when its value is positive 29 ; 26 ; 21 , the consensus index set is defined as: \mathcal{I}(x)=\left\{j\;\middle|\;s_{j}^{(\ell)}(x)>0,\;\forall\,\ell\in\mathcal{L}\right\}, (11) where s_{j}^{(\ell)}(x) is the j -th component of \mathbf{s}^{(\ell)}(x) . Among the co-activated dimensions \mathcal{I}(x) , we rank each dimension by its mean activation across all languages: \bar{s}_{j}(x)=\frac{1}{m}\sum_{\ell\in\mathcal{L}}s_{j}^{(\ell)}(x),\quad j\in\mathcal{I}(x), (12) and retain the top- k dimensions with the highest mean activation: \mathcal{S}(x)=\operatorname{TopKIdx}\!\left(\left\{\bar{s}_{j}(x)\right\}_{j\in\mathcal{I}(x)}\right), (13) where \operatorname{TopKIdx} returns indices of the top k values. The index set \mathcal{S}(x)\subset\{1,\dots,d\} constitutes the semantic component set of text x : a compact summary of the dimensions most reliably encoding its meaning based on the multilingual consensus. An analysis of the choice of k is provided in § 5.6 . 3.2 Constructing the Joint Semantic Set The size of index set \mathcal{S}(x) depends on the text x . For a given text pair (x,y) , to facilitate calculating their similarity practically, we construct joint semantic set as the union of their index set \mathcal{S}(x) and \mathcal{S}(y) from their semantic components: \mathcal{U}(x,y)=\mathcal{S}(x)\cup\mathcal{S}(y). (14) This union preserves dimensions important to either text, allowing the comparison to capture both semantic overlap and difference. Since \mathcal{U}(x,y) is derived directly from the text-specific sets \mathcal{S}(x) and \mathcal{S}(y) , it is inherently determined dynamically for each text pair. 3.3 Calculating by Joint Semantic Dimensions For any text z , let \mathbf{v}(z) denote the internal state vector from the model. We further consider two variants of such vector: (i) using the source-language vector, and (ii) using the multilingual mean vector: \mathbf{v}(z)=\begin{cases}\mathbf{s}^{(\ell_{z})}(z),&\text{source},\\ \tfrac{1}{m}\sum_{\ell\in\mathcal{L}}\mathbf{s}^{(\ell)}(z),&\text{mean},\end{cases} (15) where \ell_{z} is the source language of z . We then construct text-specific joint semantic representation on \mathcal{U}(x,y) : \mathbf{v}_{\mathcal{U}}(z)=\mathbf{v}(z)\big|_{\mathcal{U}(x,y)},\quad z\in\{x,y\}, (16) where \mathbf{v}(z)\big|_{\mathcal{U}(x,y)} selects the components indexed by \mathcal{U}(x,y) . The cosine similarity is computed as: \operatorname{sim}(x,y)=\cos\!\left(\mathbf{v}_{\mathcal{U}}(x),\mathbf{v}_{\mathcal{U}}(y)\right). (17) Considering that the dimensions of vectors \mathbf{v}_{\mathcal{U}}(x) and \mathbf{v}_{\mathcal{U}}(y) are determined by the joint semantic set \mathcal{U}(x,y) and depend on the input texts x and y , thus the cosine similarity is computed over flexible dimensions. Methods #Dim. STS12 STS13 STS14 STS15 STS16 STS-B SICK-R Avg. LLaMA2-7B-it Mean Pooling \phantom{{}^{*}}4096\phantom{{}^{*}} 41.07 58.26 47.07 61.63 58.99 48.42 53.16 52.66 PromptEOL 18 \phantom{{}^{*}}4096\phantom{{}^{*}} 59.19 78.18 67.77 75.57 71.35 72.69 70.45 70.74 AlignedWVA 37 \phantom{{}^{*}}4096\phantom{{}^{*}} 60.95 79.83 69.90 80.56 75.57 76.97 75.58 74.20 DySem (English Prompt, Ours) \phantom{{}^{*}}968^{*} 64.07 79.62 71.91 82.04 76.01 77.99 75.99 75.38 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}1193^{*} 70.84 80.52 74.85 82.69 74.61 79.23 77.39 77.16 LLaMA3.1-8B-it Mean Pooling \phantom{{}^{*}}4096\phantom{{}^{*}} 38.65 55.28 45.32 60.04 56.36 48.23 51.96 50.84 PromptEOL 18 \phantom{{}^{*}}4096\phantom{{}^{*}} 62.27 78.30 69.53 76.32 78.80 74.99 71.97 73.17 AlignedWVA 37 \phantom{{}^{*}}4096\phantom{{}^{*}} 64.89 80.89 71.97 81.04 82.35 80.28 75.67 76.73 DySem (English Prompt, Ours) \phantom{{}^{*}}1176^{*} 74.41 83.62 76.11 82.77 81.01 82.56 77.84 79.76 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}772^{*} 76.38 84.87 77.23 83.92 82.50 83.77 79.74 81.20 Qwen2.5-7B-it Mean Pooling \phantom{{}^{*}}3584\phantom{{}^{*}} 41.56 45.39 33.67 44.40 50.63 35.35 43.60 42.09 PromptEOL 18 \phantom{{}^{*}}3584\phantom{{}^{*}} 66.90 78.21 69.38 77.24 76.05 74.65 67.02 72.78 AlignedWVA 37 \phantom{{}^{*}}3584\phantom{{}^{*}} 68.20 77.49 68.47 72.73 75.26 74.35 67.40 71.98 DySem (English Prompt, Ours) \phantom{{}^{*}}1001^{*} 77.54 82.28 75.35 83.49 78.89 80.49 78.08 79.44 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}900^{*} 75.12 82.03 74.55 82.20 79.05 79.82 78.99 78.82 Qwen3-8B-it Mean Pooling \phantom{{}^{*}}4096\phantom{{}^{*}} 58.44 37.51 33.99 47.62 46.30 29.27 41.05 42.03 PromptEOL 18 \phantom{{}^{*}}4096\phantom{{}^{*}} 50.62 66.34 55.32 68.43 75.46 72.63 64.44 64.75 AlignedWVA 37 \phantom{{}^{*}}4096\phantom{{}^{*}} 63.73 79.34 68.70 76.55 79.05 77.25 73.29 73.99 DySem (English Prompt, Ours) \phantom{{}^{*}}1066^{*} 74.04 83.18 76.03 82.80 79.31 79.93 76.44 78.82 DySem (Language-specific Prompt, Ours) \phantom{{}^{*}}728^{*} 76.43 84.13 76.29 83.81 81.20 81.75 77.50 80.16 Phi3-mini-it Mean Pooling \phantom{{}^{*}}3072\phantom{{}^{*}} 58.57 52.75 45.73 46.02 50.30 39.33 41.99 47.81 PromptEOL 18 \phantom{{}^{*}}3072\phantom{{}^{*}} 57.20 70.04 60.80 71.21 73.51 70.73 63.72 66.74 AlignedWVA 37 \phantom{{}^{*}}3072\phantom{{}^{*}} 67.25 80.05 69.24 78.47 80.28 77.03 72.08 74.91 DySem (English Prompt, Ours) \phantom{{}^{*}}987^{*} 71.63 82.20 74.00 81.30 76.37 77.15 75.22 76.84 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}869^{*} 72.39 82.41 74.02 82.81 79.98 81.20 76.77 78.51 Phi3.5-mini-it Mean Pooling \phantom{{}^{*}}3072\phantom{{}^{*}} 53.55 54.63 46.27 51.68 53.20 43.63 44.05 49.57 PromptEOL 18 \phantom{{}^{*}}3072\phantom{{}^{*}} 63.30 75.42 65.57 73.81 76.04 72.85 68.33 70.76 AlignedWVA 37 \phantom{{}^{*}}3072\phantom{{}^{*}} 66.35 78.00 68.61 78.05 79.47 76.82 74.26 74.51 DySem (English Prompt, Ours) \phantom{{}^{*}}997^{*} 71.87 81.40 73.49 80.48 77.27 78.10 77.36 77.14 DySem (Language-Specific Prompt, Ours) \phantom{{}^{*}}658^{*} 71.36 81.41 73.65 81.21 74.65 78.67 75.76 76.67 Table 2: Comparison between baselines and our method on instruct models. 4 Experiments 4.1 Experimental Settings Models. We use ten LLMs covering both base and instruction-tuned variants from three families: (1) LLaMA 30 ; 15 : LLaMA2-7B, LLaMA2-7B-it, LLaMA3.1-8B, and LLaMA3.1-8B-it; (2) Qwen 34 ; 33 : Qwen2.5-7B, Qwen2.5-7B-it, Qwen3-8B, and Qwen3-8B-it; (3) Phi 1 : Phi3-mini-it, and Phi3.5-mini-it. Baselines. We compare our method against pre-trained model based methods 27 ; 14 ; 19 and recent LLMs base methods including: PromptEOL 18 , LLM2Vec 7 , Token Prepending 13 , Contrastive Prompting 10 , SemPA 9 , and AlignedWVA 37 . See Appendix A for introduction of these baselines. Datasets. Seven STS datasets are evaluated, STS 2012 \sim 2016 6 ; 5 ; 3 ; 2 ; 4 , STS-B 8 , and SICK-R 25 , see Appendix B for examples. We reported Spearman correlation ( \times 100 ). Implementations. For the main results, we use cumulative attention components A_{n}^{L} in Eq. 5 and top-1024 semantic dimensions in Eq. 13 across all models. Both English prompt and language-specific prompt are used. See Appendix C for detailed settings of the vector selection in Eq. 15 and the specific number of languages used. 4.2 Main Results The results are shown in Table 1 and 2 , respectively. DySem achieves the best and second-best average results across all ten LLMs while requiring lower dimensions, demonstrating its effectiveness. Base Models. For LLaMA2-7B base model, DySem achieves the highest average score of 78.98 among all compared methods. For Qwen3-8B, it further exhibits outstanding results of 80.54, surpassing AlignedWVA by 5.75 points and PromptEOL by 11.63 points. We also find that while achieving the best results, the dimensionality required by the model can be as low as 658, indicating that in the Qwen3-8B model, DySem has indeed identified valuable internal components with significant semantic knowledge. Instruct Models. A similar pattern holds on instruct models, where DySem achieves the best average score in all settings and maintains a computational dimensionality of around 1,000 or fewer. Applying our method to LLaMA3.1-8B-it yields an average score of 81.20, with gains of 4.47 points over AlignedWVA and 8.03 points over PromptEOL. The improvement is also substantial on Qwen3-8B-it, where DySem achieves an average score of 80.16 and outperforms AlignedWVA and PromptEOL by 6.17 and 15.41 points, respectively. Across instruction-tuned models, the average improvement over AlignedWVA is 4.55 points on instruct models, which is larger than the 3.82 point gain on base models. The reason can be that instruction tuning introduces more non-semantic variation inside models and DySem is able to uncover more relevant semantic information to enable better semantic computation. 5 Analyses and Discussions We further analyze the effectiveness of DySem . Below we report the results using representative LLMs, and see Appendix D for additional ones. 5.1 Validity of Semantic Components Figure 3: STS performance comparison between random components and semantic components. To verify the effectiveness of semantic components, we compare them with a random component baseline. The random baseline uniformly samples 1024 dimensions from the text representation. Results are shown in Figure 3 . The results show that semantic components consistently outperform random components across all 70 model-task comparisons, yielding a clear performance gap. On average, the random baseline scores only 52.70, whereas DySem achieves 78.24 and 79.04 with English and language-specific prompts, respectively. This indicates that the gains of DySem come from identifying meaningful semantic components rather than merely using a smaller subset of features. 5.2 Semantic Components Selection Figure 4: STS performance by selecting different internal components for semantic similarity calculation. Figure 5: STS performance with texts in different candidate languages based on attention-based components. To identify the best internal representation for STS calculation, we systematically evaluate three components across ten models: the final-layer hidden states ( h_{n}^{L} ), the cumulative FFN outputs ( F_{n}^{L} ), and the cumulative attention outputs ( A_{n}^{L} ). Results are shown in Figure 4 . The results demonstrate that h_{n}^{L} is not universally optimal, while A_{n}^{L} performs better in most cases. Across 70 comparisons spanning different models and tasks, A_{n}^{L} achieves the best performance in 61 cases, while h_{n}^{L} takes the lead in 9, and F_{n} never ranks first. Overall, our analyses indicate that attention-based representation A_{n}^{L} is better suited to semantic similarity than the conventional default hidden states h_{n}^{L} . The results reveal that A_{n}^{L} could also capture the semantic-level features that can be used for textual similarity computation. 5.3 Language Selection Strategies To select the language set \mathcal{L} in Eq. 10 for aggregation, we rank candidate languages based on their independent performance and retain the top- m of them. Figure 5 shows that English consistently ranks first across models, with French and Spanish usually near the top. The reason can be that the model is more thoroughly trained on this type of Latin texts, resulting in a better understanding of them. We also find that the ordering of mid-tier languages varies substantially across models, so that language selection should be model-specific rather than relying on a fixed universal set. Figure 6 illustrates how varying the pool size m affects different configurations. Under the language-specific prompt and mean vector, performance is highly sensitive to m . Models like LLaMA2-7B peak early at m=4 , suggesting that incorporating lower-ranked languages introduces semantic noise. Conversely, models with stronger multilingual ability, such as Qwen3-8B, benefit from larger language pools. In contrast, the English prompt and source vector yields flatter performance curves. Together, these trends demonstrate that both careful language selection and the tuning of m play a critical role in determining performance across various models and configurations. 5.4 Impacts of Prompts and Semantic Vector Figure 6: Comparison across different top- m language selections on language-specific prompt with mean vector (left) and source vector (right). We analyze the impact of English and language-specific prompts, alongside two semantic vector constructions, namely source and mean vectors. As illustrated in Figure 7 , mean vector generally outperform source vector, especially under language-specific prompts, indicating that vector construction is the primary driver of performance. The combination of a language-specific prompt and a mean vector achieves the highest average score on seven of the ten models. Notably, the choice of prompt language strongly interacts with vector construction. With the mean vector, language-specific prompts improve performance by 1.24 points on average, whereas with the source vector, prompt language differences are negligible, within 0.39 points. This suggests that language-specific prompts are most effective when translated-language representations are explicitly aggregated into the final semantic vector. Overall, our method significantly outperforms baselines across different settings, demonstrating that we indeed extracts more effective semantic features. Figure 7: Comparison of English and language-specific prompts under source and mean vectors settings. Figure 8: Comparison between layer-wise attention and cumulative attention aggregation strategies on LLaMA2-7B (left) and Qwen3-8B-it (right). 5.5 Comparing Two Attention Components We further compare two ways to construct attention-based semantic components: (1) layer-specific attention a_{n}^{l} , which uses only the output of layer l , and (2) cumulative attention A_{n}^{l} , which accumulates outputs from the bottom layer up to layer l . The results with language-specific prompt and mean vector settings are shown in Figure 8 . Overall, the cumulative strategy outperforms the layer-specific strategy with more stable trends, especially in the middle-to-upper layers. For instance, peak performance over layer-specific attention rise from 76.43 to 80.09 on Qwen3-8B-it. These findings indicate that semantic information is distributed across layers rather than concentrated in one. We therefore use the final cumulative attention A_{n}^{L} defined in § 2.1 to better capture semantics. Figure 9: Analysis of top- k semantic dimension selection on language-specific prompt (left) and English prompt (right) with mean vector . 5.6 Impacts of Semantic Dimension Sizes We compare top- k dimension selections for k\in\{256,512,768,1024,1280\} in Eq. 13 . As illustrated in Figure 9 , performance patterns are primarily dictated by the prompt language. Under language-specific prompt settings, performance improves sharply up to k=512 and then saturates. By contrast, English prompt benefit from retaining significantly more dimensions, exhibiting an almost monotonic improvement up to k=1280 . These results indicate that semantic computation can be performed in lower dimensions, without necessarily using full dimensions of the hidden states (e.g., the typical size of 4096 for LLMs). 5.7 Discussion on Further Applications Multi-modal Applications. Although our dynamic semantic extraction framework is currently evaluated on text representation based on multilingual consensus, its core principle of identifying invariant dimensions across varied surface expressions can be naturally extended to broader vision domains. For example, treating images with operations like rotations or 3D point clouds with different camera angles as parallel “translations” can also used for extract shared semantic components. Practical Deployments. Our method can also be used for practical deployment such as text indexing and retrieval. By caching just the semantic dimension set \mathcal{S}(y) alongside the representation vector for each database sample, the joint semantic set \mathcal{U}(x,y) for a new query x can be dynamically constructed on the fly. This allows for direct similarity computation without the computational overhead of re-encoding existing database samples. Ultimately, dynamic dimension selection serves as a lightweight and general processing step before similarity calculation and text retrieval. 6 Related Work Semantic Representation with LLMs. Decoder-based LLMs originally target generation and recent works have leveraged them for extracting semantic representations. PromptEOL 18 and MetaEOL 23 both extract text semantics solely through prompt templates, with the latter further introducing multi-perspective prompts to enrich representations. 13 and 10 improve prompt-based LLM sentence embeddings through training-free inference-stage modifications, respectively by prepending decoded sentence embeddings to mitigate causal-attention limitations and by contrastively steering hidden states to emphasize core semantics over non-essential information. Recent embedding models, including NV-Embed 20 , Qwen3-Embedding 36 , and Gemini Embedding 22 , often rely on proprietary training data. These works rely on fixed, full-dimensional hidden states for text representation. Our work addresses these issues by directly mining internal LLM modules to extract dynamic semantics in a training-free manner. Semantic Knowledge of Models. Studies have shown that linguistic information is hierarchically organized across model layers: shallow layers predominantly capture surface-level and syntactic features, while deeper intermediate layers encode richer semantic and conceptual content 17 ; 12 ; 24 . Recent evidence further suggests that intermediate representations can provide stronger feature quality than final-layer embeddings across a wide range of text-embedding tasks, indicating that semantic information is not confined to the output end of the model 28 . Recent work by 37 shows that attention value vectors also encode some semantic knowledge. Inspired by them, we further investigate internal dynamic semantic component via multilingual consensus and novelly calculate semantic relationships with flexible dimensions, an aspect unexplored in prior work. 7 Conclusion We propose DySem , a training-free framework for better calculating semantic textual similarity beyond the vanilla way of text representation which uses fixed final-layer hidden states and static full-dimensional vectors. DySem uncovers dynamic sample-specific semantic component via multilingual consensus, and uses flexible dimensions from semantic sets for similarity calculation. Extensive experiments demonstrate that DySem achieves superior performance across standard STS benchmarks, consistently outperforming a variety of base and instruction-tuned LLMs while maintaining lower dimensions. We hope that this work will provide new directions for better representing texts and evaluating their relationships with LLMs. Limitations While our method demonstrates strong performance, extracting semantic dimensions introduces an O(m) inference overhead due to the required m translations and independent LLM forward passes. However, this cost is primarily concentrated in the offline database building phase; online queries remain highly efficient by dynamically constructing the joint semantic set \mathcal{U}(x,y) from cached dimensions. Nonetheless, the initial encoding cost poses a challenge for massive-scale, cold-start applications compared to traditional single-pass encoders. Additionally, our work thoroughly validates STS and conducts extensive experiments. Although STS directly measures text representation quality, future work can apply it on a broader suite of representation-heavy downstream tasks, such as large-scale information retrieval, text clustering, and zero-shot classification. Moreover, our framework primarily focuses on semantic computation between two texts, rather than high-quality embedding of a single text; therefore, we focus on extract semantics in a training-free way of LLMs and do not compare it with pure embedding models. Appendix A Details of Baselines We compare our method against following baselines: PromptEOL 18 , a standard hidden-state-based prompt approach; Token Prepending 13 , a training-free method that prepends tokens to mitigate causal-attention bias; Contrastive Prompting 10 , an inference-time method that steers semantic encoding with contrastive prompts; LLM2Vec 7 , an unsupervised method that converts decoder-only LLMs into strong text encoders by enabling bidirectional attention, masked next-token prediction, and contrastive learning; SemPA 9 , a semantic preference alignment method that improves sentence representations with sentence-level DPO; AlignedWVA 37 , a training-free LLM-based embedding method that leverages attention outputs vectors for sentence representation and serves as our main attention-based baseline. Moreover, we compare with classical BERT-based sentence embedding baselines: Sentence-BERT 27 , which employs Siamese and triplet network structures to derive semantically meaningful sentence embeddings; SimCSE 14 , a simple contrastive learning framework that learns sentence embeddings using dropout-based augmentation in the unsupervised setting and NLI supervision in the supervised setting; and PromptBERT 19 , a prompt-based contrastive learning method that improves BERT sentence embeddings by reformulating sentence representation with prompts and template denoising. Appendix B Example of Datasets Table 3 provides representative sentence pairs from the evaluation datasets, with dataset sizes shown in parentheses. Type Content STS12 (3108) Sentence1 the problem likely will mean corrective changes before the shuttle fleet starts flying again . Sentence2 he said the problem needs to be corrected before the space shuttle fleet is cleared to fly again . Score [formula] Link https://huggingface.co/datasets/mteb/sts12-sts STS13 (1500) Sentence1 this frame contains words that describe an item ’s static position on a scale with respect to some property variable . Sentence2 lacking in specific resources , qualities or substances ; Score [formula] Link https://huggingface.co/datasets/mteb/sts13-sts STS14 (3750) Sentence1 how about some testimonies from real health experts ? Sentence2 also , who ’s to say there aren ’t testimonies from " real " health experts on there ? Score [formula] Link https://huggingface.co/datasets/mteb/sts14-sts STS15 (3000) Sentence1 you ’ll need to check the particular policies of each publisher to see what is allowed and what is not allowed . Sentence2 if you need to publish the book and you have found one publisher that allows it . Score [formula] Link https://huggingface.co/datasets/mteb/sts15-sts STS16 (3108) Sentence1 what is the best way to store fresh berries ? Sentence2 what is the best way to fix this garage floor ? Score [formula] Link https://huggingface.co/datasets/mteb/sts16-sts STSBenchmark (1379) Sentence1 A girl is styling her hair. Sentence2 A girl is brushing her hair. Score [formula] Link https://huggingface.co/datasets/mteb/stsbenchmark-sts STS-R (9927) Sentence1 A group of kids is playing in a yard and an old man is standing in the background Sentence2 A group of boys in a yard is playing and a man is standing in the background Score [formula] Link https://huggingface.co/datasets/mteb/sickr-sts Table 3: Examples of sentence pairs and similarity scores from the STS evaluation datasets. Appendix C Implementation Details Models & Links Prompt Setting Semantic Vector Language Counts LLaMA2-7B English Source 9 Language-Specific Mean 4 LLaMA3.1-8B English Source 11 Language-Specific Mean 6 Qwen2.5-7B English Mean 11 Language-Specific Mean 7 Qwen3-8B English Mean 12 Language-Specific Mean 12 LLaMA2-7B-it English Source 12 Language-Specific Mean 6 LLaMA3.1-8B-it English Mean 12 Language-Specific Mean 10 Qwen2.5-7B-it English Mean 11 Language-Specific Mean 8 Qwen3-8B-it English Mean 12 Language-Specific Mean 10 Phi3-mini-it English Mean 8 Language-Specific Mean 4 Phi3.5-mini-it English Mean 10 Language-Specific Mean 8 Table 4: Detailed parameter settings for the main experiments across different models, including the chosen prompt setting, semantic vector construction method, and language counts. For the main experiments, our method uses a fixed Semantic Component A_{n}^{L} and a selection budget of the top-1024 semantic dimensions across all models. The remaining configurations, namely the prompt setting, semantic vector, and the number of languages, are detailed as follows. Specifically, the English prompt applies a shared English template across all translations, whereas the language-specific prompt tailors the template to the native language of each target translation. For semantic vector construction, source denotes using the representation from the original input text, while mean denotes averaging the representations across the selected languages. The language count indicates how many languages are utilized for semantic dimension selection. As shown in the Table 4 , the optimal configuration varies by model, suggesting that different model families and instruction-tuning approaches exhibit distinct degrees of multilingual representation stability. Generally, the combination of language-specific prompt and mean semantic vectors is frequently selected, indicating that aggregating multilingual representations helps identify more robust semantic dimensions. Appendix D Additional Experimental Results D.1 Validity of Semantic Components Figure 10: STS performance comparison between random components and semantic components on the remaining models. Figure 10 shows the complementary results on the remaining six models. The same pattern holds consistently across these models: prompt-selected semantic components substantially outperform random components in all evaluated settings. For example, on Qwen3-8B, language-specific selection improves the average score from 53.41 to 80.53; on LLaMA2-7B-it, it improves the score from 56.02 to 77.16. The gap is especially pronounced for the Qwen2.5 family, where random components obtain an average score of around 42, whereas semantic components reach nearly 79. Similar improvements are also observed for the LLaMA3.1 and Phi models. These results further confirm that the selected components capture task-relevant semantic information, rather than merely benefiting from random feature sparsification. D.2 Semantic Components Selection Figure 11: Task-level semantic similarity performance of different internal representations on remaining models. Figure 11 provides the complementary component-selection results for the remaining six models. The overall trend is consistent with the main analysis: the cumulative attention outputs ( A_{n}^{L} ) are usually the strongest representation for text semantic similarity. The advantage of A_{n}^{L} is especially clear for LLaMA3.1-8B, LLaMA3.1-8B-it, Phi3-mini-it, and Phi3.5-mini-it, where it outperforms the alternatives on every evaluated STS task. The only substantial exceptions come from the Qwen2.5 family, where h_{n}^{L} is competitive and occasionally better on tasks such as STS14, STS15, STS16, and STS-B. Even in these cases, F_{n}^{L} remains consistently weaker. This reinforces the conclusion that A_{n}^{L} is the most reliable representation for exposing semantic similarity information. Figure 12: Language-wise spearman correlation of cumulative attention on remaining models. D.3 Language Selection Strategies The appendix provides the full set of language-selection results omitted from the main text. Figure 12 extends the language-wise ranking analysis to the remaining models. The overall pattern is consistent with Figure 5 : English remains the strongest individual language in all cases, and French and Spanish are usually placed near the top. At the same time, the middle-ranked languages differ noticeably across models. For example, Qwen2.5-7B ranks Chinese and German relatively high, LLaMA3.1-8B assigns a high rank to Japanese, while the Phi models favor Portuguese and Italian among the top candidates. This confirms that the ranking is not universal, and that the language pool should be selected separately for each model. Figure 13: Analysis of language selection strategies on English prompt with mean vector (left) and source vector (right). Comparison across different top- m language selections. Figure 13 reports the two complementary configurations for the main models. With the English prompt and mean vector, performance remains sensitive to the number of selected languages: LLaMA2 models reach their best scores with small pools, while Qwen models generally benefit from larger pools and often peak around m=11 or m=12 . In contrast, the language-specific prompt with source vector produces much flatter curves. This suggests that source-vector aggregation is more robust to the inclusion of additional languages, whereas mean-vector aggregation can either amplify useful multilingual signals or introduce noise depending on the model. Figure 14: Analysis of language selection strategies on language-specific prompt with mean vector (left) and source vector (right) on remaining models. Comparison across different top- m language selections. Figure 15: Analysis of language selection strategies on English prompt with mean vector (left) and source vector (right) on remaining models. Comparison across different top- m language selections. Figures 14 and 15 show the same comparisons on the remaining models. The language-specific prompt with mean vector again exhibits the strongest dependence on m : Phi3-mini-it peaks early at m=4 , LLaMA3.1-8B peaks around m=6 , while LLaMA3.1-8B-it benefits from a larger pool and peaks around m=10 . The English prompt with source vector and the language-specific prompt with source vector are comparatively stable, with only small changes as m increases. These additional results reinforce the main conclusion that careful language selection is most important when using mean-vector aggregation, while source-vector settings are less sensitive but still show model-dependent optima. D.4 Impacts of Prompts and Semantic Vector Figure 16: Comparison of English and language-specific prompts under source and mean vectors settings on remaining models. Figure 17: Comparison of English and language-specific prompts under source and mean vectors settings across STS tasks. Figure 18: Average performance across tasks on LLaMA2-7B with remaining setting. Comparison between layer-specific attention and cumulative attention. Figure 19: Average performance across tasks on Qwen3-8B-it with remaining settings. Comparison between layer-specific attention and cumulative attention. Figure 20: Task-wise performance on STSBenchmark and SICK-R for LLaMA2-7B with four settings. Comparison between layer-specific attention and cumulative attention. Figure 21: Task-wise performance on STSBenchmark and SICK-R for Qwen3-8B-it with four settings. Comparison between layer-specific attention and cumulative attention. Figure 16 reports the remaining four models. The same pattern is largely preserved: the language-specific prompt with the mean vector obtains the best result on three of the four models, including LLaMA3.1-8B, LLaMA3.1-8B-it, and Phi3-mini-it. Averaged over these remaining models, this setting reaches 79.05, outperforming the English-prompt mean-vector setting by 1.77 points and the language-specific source-vector setting by 2.40 points. The only exception is Phi3.5-mini-it, where the English prompt with the mean vector is slightly better by 0.47 points, suggesting that the advantage of localized prompts is not uniform across all model families. Figure 17 further breaks down the comparison across STS tasks. The language-specific prompt with the mean vector achieves the highest average score on six of the seven evaluated tasks, while the language-specific source vector setting is best only on STS16. Across tasks, language-specific prompts improve the mean vector by 1.24 points on average, with consistent gains on STS12, STS13, STS14, STS15, STSBenchmark, and SICK-R. In contrast, under the source vector setting, the effect of prompt language remains marginal, with task-level differences staying within 0.30 points. These results reinforce the main finding that prompt localization is most beneficial when combined with mean-vector construction, where multilingual representations are explicitly aggregated before scoring. D.5 Attention Aggregation Strategies Figures 18 and 19 provide supplementary comparisons across the remaining prompt and vector configurations. The trends observed in the main text remain consistent: cumulative attention systematically achieves a higher peak average performance compared to layer-specific attention across all evaluated settings. Specifically, LLaMA2-7B shows an improvement of 4.97 points when using the English prompt combined with source vectors, 2.31 points with the English prompt and mean vectors, and 5.17 points under the language-specific prompt combined with source vectors. Correspondingly, Qwen3-8B-it exhibits gains of 4.50, 3.29, and 4.21 points under the same respective configurations. These results demonstrate that the advantages of cumulative aggregation are robust and independent of specific prompt choices or value-vector constructions. Figures 20 and 21 further detail the performance of both strategies on the STSBenchmark and SICK-R tasks. Cumulative attention consistently yields superior task-specific peaks across nearly all settings. For instance, when applying the English prompt with source vectors to LLaMA2-7B, cumulative attention boosts performance on STSBenchmark from 75.89 to 80.99, and on SICK-R from 73.22 to 77.12. Similarly, employing the language-specific prompt with mean vectors on Qwen3-8B-it elevates STSBenchmark from 79.06 to 82.82, and SICK-R from 75.19 to 78.68. Ultimately, these supplementary findings reinforce the conclusion that cumulative attention more effectively preserves valuable cross-layer semantic signals, generating more stable representations than those derived from any single layer. Figure 22: Analysis of semantic dimension sizes on Language-specific prompt (left) and English prompt (right) with source vector. Comparison across different top- k semantic dimension selections. Figure 23: Analysis of semantic dimension sizes on Language-specific prompt (left) and English prompt (right) with mean vector on remaining models. Comparison across different top- k semantic dimension selections. Figure 24: Analysis of semantic dimension sizes on Language-specific prompt (left) and English prompt (right) with source vector on remaining models. Comparison across different top- k semantic dimension selections. D.6 Impacts Semantic Dimension Sizes We provide additional results for the remaining prompt and vector configurations in Figure 22 . The same overall conclusion holds: the retained dimension budget is primarily controlled by the prompt language. For the English prompt combined with a mean vector, performance increases steadily from k=256 to k=1024 , with only marginal change afterwards. This indicates that English prompts still benefit from a relatively larger semantic subspace even when the vector is averaged across languages. In contrast, the configuration using a language-specific prompt combined with a source vector reaches near-optimal performance at k=512 or k=768 and then remains almost unchanged. This further supports that language-aligned prompts allow semantic information to be concentrated in a compact set of dimensions. Figures 24 and 24 show the same analysis on the remaining models. Although the absolute scores vary across model families, the trend is consistent. Configurations using language-specific prompts saturate quickly, usually after k=512 or k=768 , while configurations relying on English prompts show more gradual improvements as k increases and often perform best at k=1024 or k=1280 . These results confirm that the observed dimension-size behavior is not specific to the main set of models, but generalizes across additional model families. Appendix E Effectiveness Across Different Prompts Methods #Dim. STS12 STS13 STS14 STS15 STS16 STS-B SICK-R Avg. LLaMA2-7B Pretended CoT 35 4096 61.00 79.62 69.42 74.78 77.20 72.11 70.56 72.10 Pretended CoT + AlignedWVA 37 4096 69.81 86.37 77.83 83.63 82.80 82.07 76.10 79.80 Pretended CoT + (English Prompt, Ours) \phantom{{}^{*}}1294^{*} 71.11 86.67 79.05 84.21 82.70 82.56 76.51 80.40 Pretended CoT + (Language-specific Prompt, Ours) \phantom{{}^{*}}999^{*} 71.86 86.55 78.66 84.15 82.38 81.92 76.29 80.26 Knowledge Enhancement 35 4096 61.94 80.37 71.40 78.43 77.24 76.57 75.77 74.53 Knowledge Enhancement + AlignedWVA 37 4096 68.12 86.13 77.29 83.02 81.84 83.11 78.39 79.70 Knowledge Enhancement + (English Prompt, Ours) \phantom{{}^{*}}1117^{*} 70.69 86.45 78.98 84.14 81.80 83.91 78.79 80.68 Knowledge Enhancement + (Language-specific Prompt, Ours) \phantom{{}^{*}}908^{*} 70.90 86.57 78.50 83.72 81.80 83.46 78.70 80.52 LLaMA2-7B-it Pretended CoT 35 4096 61.39 79.31 69.36 76.45 72.62 73.47 70.62 71.89 Pretended CoT + AlignedWVA 37 4096 62.37 80.45 71.17 81.02 76.26 77.86 76.05 75.02 Pretended CoT + (English Prompt, Ours) \phantom{{}^{*}}1132^{*} 64.51 80.17 72.85 81.98 76.11 78.74 76.59 75.85 Pretended CoT + (Language-specific Prompt, Ours) \phantom{{}^{*}}837^{*} 72.22 81.73 76.03 83.14 75.17 79.95 76.72 77.85 Knowledge Enhancement 35 4096 57.55 79.32 68.91 74.36 74.06 73.18 72.63 71.43 Knowledge Enhancement + AlignedWVA 37 4096 62.09 82.77 71.96 79.34 77.62 77.51 75.63 75.27 Knowledge Enhancement + (English Prompt, Ours) \phantom{{}^{*}}1034^{*} 65.92 82.68 74.25 81.27 77.49 78.71 76.15 76.64 Knowledge Enhancement + (Language-specific Prompt, Ours) \phantom{{}^{*}}946^{*} 64.85 83.15 73.51 80.49 77.39 78.31 76.22 76.27 Qwen3-8B Pretended CoT 35 4096 56.78 73.17 58.71 67.99 73.21 68.71 61.99 65.79 Pretended CoT + AlignedWVA 37 4096 59.12 79.37 68.50 73.34 78.85 73.30 70.53 71.86 Pretended CoT + (English Prompt, Ours) \phantom{{}^{*}}1007^{*} 73.02 83.26 75.77 82.05 79.02 78.57 77.97 78.52 Pretended CoT + (Language-specific Prompt, Ours) \phantom{{}^{*}}752^{*} 76.40 84.42 76.56 83.68 81.64 80.63 78.43 80.25 Knowledge Enhancement 35 4096 58.28 79.15 67.73 75.00 77.14 72.36 72.37 71.72 Knowledge Enhancement + AlignedWVA 37 4096 64.89 82.16 73.87 80.11 79.33 72.61 73.51 75.21 Knowledge Enhancement + (English Prompt, Ours) \phantom{{}^{*}}914^{*} 73.22 82.97 75.45 81.43 78.82 76.93 77.75 78.08 Knowledge Enhancement + (Language-specific Prompt, Ours) \phantom{{}^{*}}696^{*} 67.96 83.35 75.47 81.12 79.13 74.58 74.90 76.65 Qwen3-8B-it Pretended CoT 35 4096 52.49 64.14 54.19 70.53 74.32 71.10 62.90 64.24 Pretended CoT + AlignedWVA 37 4096 64.64 77.96 68.67 79.52 80.01 78.01 72.99 74.54 Pretended CoT + (English Prompt, Ours) \phantom{{}^{*}}1034^{*} 75.64 83.50 76.86 84.16 81.03 81.87 77.70 80.11 Pretended CoT + (Language-specific Prompt, Ours) \phantom{{}^{*}}1240^{*} 75.43 84.67 75.49 83.97 81.95 81.64 77.95 80.16 Knowledge Enhancement 35 4096 59.61 73.26 63.36 74.70 75.37 73.33 71.16 70.11 Knowledge Enhancement + AlignedWVA 37 4096 66.31 80.97 72.61 79.44 79.23 76.86 73.71 75.59 Knowledge Enhancement + (English Prompt, Ours) \phantom{{}^{*}}905^{*} 74.10 83.12 76.22 82.67 79.45 79.91 77.04 78.93 Knowledge Enhancement + (Language-specific Prompt, Ours) \phantom{{}^{*}}683^{*} 74.40 83.56 76.19 82.84 79.20 80.98 77.25 79.20 Table 5: Results of Pretended CoT and Knowledge Enhancement prompts. To further examine whether the identified semantic components are robust to different prompting strategies, we evaluate our method under two other commonly used prompts, namely Pretended CoT and Knowledge Enhancement 35 . The results are reported in Table 5 . Overall, our method consistently achieves the best or second-best average performance across different models and prompts, showing that the semantic information uncovered by DySem is not tied to a specific prompt format. Under the Pretended CoT prompt, DySem brings consistent improvements over both the original prompt-based representations and AlignedWVA. On LLaMA2-7B, our method achieves average scores of 80.40 and 80.26 with English and language-specific prompts, respectively, outperforming AlignedWVA by 0.60 and 0.46 points. The gains are more pronounced on Qwen3-8B, where the language-specific prompt version reaches an average score of 80.25, improving over AlignedWVA by 8.39 points. Similar improvements are also observed on instruction-tuned models. For example, on Qwen3-8B-it, our method obtains average scores of 80.11 and 80.16, surpassing AlignedWVA by more than 5.5 points. Under the Knowledge Enhancement prompt, our method also maintains strong performance. On LLaMA2-7B, DySem achieves the best average score of 80.68 with the English prompt and 80.52 with the language-specific prompt, both outperforming AlignedWVA. On Qwen3-8B, our English-prompt variant obtains an average score of 78.08, exceeding AlignedWVA by 2.87 points. For instruction-tuned models, the improvements remain stable: on LLaMA2-7B-it, our method reaches 76.64 and 76.27 under the two prompt variants, while on Qwen3-8B-it it achieves 78.93 and 79.20, clearly outperforming the corresponding AlignedWVA results. These results demonstrate that DySem is effective across different prompt designs. Although the absolute performance may vary between English and language-specific prompts, our method consistently improves STS performance over prompt-only representations and AlignedWVA. This suggests that the semantic subspaces discovered by DySem capture prompt-agnostic semantic knowledge inside LLMs, enabling more reliable semantic computation under diverse prompting conditions.