Statistical Depth for Ranking and Characterizing Transformer-Based Text Embeddings
Authors: Parker Seegmiller
Sarah Masud Preum
Venue: EMNLP 2023 Main (2023)
Keywords: text embeddings
transformers
statistical inference
corpus analysis
statistical depth
in-context learning
synthetic data augmentation
TL;DR: We adopt a statistical depth to measure distributions of transformer-based text embeddings and introduce the practical use of this depth for both modeling and distributional inference in NLP pipelines.

Abstract: The popularity of transformer-based text embeddings calls for better statistical tools for measuring distributions of such embeddings. One such tool would be a method for ranking texts within a corpus by centrality, i.e. assigning each text a number signifying how representative that text is of the corpus as a whole. However, an intrinsic center-outward ordering of high-dimensional text representations is not trivial. A $\textit{statistical depth}$ is a function for ranking $k$-dimensional objects by measuring centrality with respect to some observed $k$-dimensional distribution. We adopt a statistical depth to measure distributions of transformer-based text embeddings, $\textit{transformer-based text embedding (TTE) depth}$, and introduce the practical use of this depth for both modeling and distributional inference in NLP pipelines. We first define TTE depth and an associated rank sum test for determining whether two corpora differ significantly in embedding space. We then use TTE depth for the task of in-context learning prompt selection, showing that this approach reliably improves performance over statistical baseline approaches across six text classification tasks. Finally, we use TTE depth and the associated rank sum test to characterize the distributions of synthesized and human-generated corpora, showing that five recent synthetic data augmentation processes cause a measurable distributional shift away from associated human-generated text.

Statistical Depth for Ranking and Characterizing Transformer-Based Text Embeddings
Parker Seegmiller and Sarah Masud Preum
Department of Computer Science
Dartmouth College Hanover, NH, USA
(pkseeg.gr, gr, Sarah. Marah.Masud. Pr Preum
tmouth edu
Abstract
MRPC
Transformer Embeddings of
TTE Depth of F
Corpus (F)
The popularity of transformer-based text beddings calls for better statistical tools for measuring distributions of such embeddings. One such tool would be method for ranking texts within a corpus by centrality, i.c. assign- ing each text a number signifying how repre- sentative that text is of the corpus a whole. However, an intrinsic center-outward ordering of high-dimensiooal text representations trivial. A stafistical depth is function for ranking k-dimensional objects by measuring centrality with respect some observed k- dimensional distribution. We adopt statistical depth to measure distributions transformer- based text embeddings, transformer-batt based text embedding (TTE) depth, and introduce the prac- tical use of this depth both modeling and dis- tributional inference in NLP pipelines. We first define TTE depth and an associated rank sum test for determining whether two corpora differ significantly in embedding space. We then use TTE depth for the task of in-context learning prompt selection, showing that this approach reliably improves performance over statistical baseline approaches across six text classifica- tion tasks. Finally, we use TTE depth and the associated rank sum test to characterize the dis- tributions of synthesized and numan-generatl corpora, showing that five recent synthetic data augmentation processes cause a measurable dis- tributional shift away from associated human- generated text.
conslace the glainiffs have
Fy-102, 48 0.5)
Do(F.) 1.19
shown, albeh barely..
scope and decals invetipyrinn...
Umbelding
Maki
F2-10.1 1001,000, AA.......
TTE Depth
Dy(Py) - 1.26
"The hearing come ont day F8 [-0.1,
Dy(F.) 1.25
alter the hestagon...
upriated
F4 [-0.8, -0., .0....0........
Dg(Fa) 0.07
sperating sustemt...
"We will keep lighting withi the Jane..
(0.1,.0.,....
Dy(Ps) 1.31
Preeuescy
05
11
13
Depih
Figure 1: TTE depth gives center-outward ordering of texts within a corpus using their representations in embedding space. This statistical tool can be used in modeling tasks and inference tasks. Examples from the Microsoft Research Paraphrase Corpus (Dolan and Brockett, 2005) demonstrate that representative samples from the corpus receive high depth scores and outliers receive low depth scores.
goal of these models is to provide a semantically- meaningful, extrinsically-capahe vector represen- tation for a given text document of any length. However, these representations do not immedi- ately provide a natural ordering or notion of cen- ter with respect to corpus distribution, which would aid in tasks like outlier detection (see Fig- 1). Many transformer-based NLP pipelines would benefit from such a center-outward ordering of texts within a corpus and related statistical infer- ence, for example prompt selection for in-context learning (Gao et al., 2020) or characterizing distri- butional differences between embeddings of texts from two corpora (Pillutla et al., 2021). An intrin- sic notion of centrality (i.e. representation with respect to the corpus distribution) and outlyingness in k-dimensional embedding space is not trivial. A statistical depth is a function for ordering multidimensional objects with respect to some ob- served distribution. Depths have been defined for
1 Introduction
The transformer architecture (Vaswani et al., 2017) has revolutionized the field of natural language pro-
cessing (NLP). Generalized transformer-based text embedding models such S-BERT (Reimers and Gurevych, 2019) and GenSE+ (Chen et al., 2022) have yielded state of the art performance results on a variety of tasks such as natural language in- ference (NLI) (Williams et al., 2018) and semantic textual similarity (STS) (Cer et al., 2017). The

---

functional data (López-Pintado and Romo, 2009), directional data (Pandolfo et al.. 2018), and statisti- cal representations of text data (Bolívar et al., 2023). In addition to offering an ordering for single col- lection of multidimensional objects, a statistical depth also enables testing for significant differences between two distributions of such objects. We in- troduce a statistical depth for Transformer-based Text Embeddings, TTE depth, which provides center-outward ordering of texts within corpus based on the distributional properties of the texts in embedding space. diagram of this tool is given in Figure 1. While there exist upproaches for char- acterizing corpus distributions such as perplexity (Holtzman et al., 2019) and more recent approaches like MAUVE (Pillutla et al., 2021), TTE depth is orthogonal statistical tool that gives an intuitive centrality ranking for use in both modeling and dis- tributional inference in NLP pipelines. We investi- gate the use of depth in both modeling, via the task of prompt selection for in-context learning, and distributional characterization, via measuring the distributional differences between synthetic data and human-wrinn written data in synthetic data augmen- tation pipelines. The specific contributions of this work as follows.
sification tasks. Prompt selection is the task of selecting representative examples from a labeled training dataset to prompt large lan- guage model (LLM) for labeling an unseen test sample (Gao et al., 2020). We show that ranking via TTE depth improves Fl perfor- mance over statistical baselines in 5 out of 6 text classification tasks.
As TTE depth is also a statistical inference tool for characterizing corpus distributions, we use it to measure the differences between the embedding distributions of 5 human- written datasets and related synthetically aug- mented datasets. Measuring the distance be- tween human-written and synthetic corpora is a critical problem in the era of LLMs (Pil- lutla et al., 2021). We show that TTE depth can reliably determine when huiteewritten and synthetic corpora differ significantly, and thoroughly investigate case study using the synthetic natural language inference corpus. SyNLI (Chen et al., 2022).
2
Related Works
2.1
Distributional Characterization of Text Embeddings
We introduce the use of statistical depth for transformer-based text embeddings by defin- ing an angular distance- based depth for giv- ing center-outward ordering of transformer- based embeddings of texts within a given cor- pus. We call this depth munsformer-busel text embeddings (TTE) depth. Alongside TTE depth introduce the use of a Wilcoxon rank sum test for determining whether two sets of transformer- based embeddings can reasonably be assumed to come from significantly differ- ent distributions. This test allows researchers to both characterize distributional shifts be- tween corpora and determine whether such a shift is significant. As the goal of this work is to introduce TTE depth useful new tool in both modeling and distributional inference, we release a simple python package' to facili- tate the use of TTE depth in NLP pipelines.
A common task in NLP pipelines is to characterize text documents using text metrics, either for error analysis or other research purposes (Hansen et al., 2023). Many statistical linguistics-based metrics exist, such perplexity (Holtzman et al., 2019) or the Flesch reading ease metric (Hansen et al., 2023), which measures the reading comprehension level of a given document. While most existing metrics are focused on text-level statistics, a few tools exist for comparing transformer- embeddings and other deep learning embeddings. Recent work has defined out-of-distributio sam- ples for image classification (Kaur al., 2023). Ad- ditionally, distributional shifts of machine learning training data have been studied using classifier two- sample tests (Jang et al., 2022). While our work similarly measures distributions of deep learning model inputs, we focus on a statistical approach for transformer-basee text embeddings.
text
To demonstrate the potential of TTE depth in NLP modeling tasks, we use TTE depth as a ranking for the task of prompt selection for in-context learning across various text clas-
A recent tool similar to TTE depth is MAUVE (Pillutla et al., 2021), an approach measuring distributions of L.MM-generaed texts using diver- gence frontiers. While similar in goal, MAUVE and TTE depth differ in that TTE depth is a tool
"htnss//gsthubccmm/ksssggtttttt depth

---

for ordering text embeddings rather than measuring token distributions of text itself.
desired property of such embeddings (Reimers and Gurevych, 2019). As such, we utilize an angular distance-based depth for our investigation. class of angular distance-based depths for directional data was first introduced by (Pandolfo et al., 201 8), and later used by (Pandolfo and D' Ambrosio, 2021) for classification of directional data. Leaning on two depth definitions as introduced there we de- fine a depth for transformer-based text embeddings, TTE depth.
Coincidentally, MAUVE is built using Kullback- Leibler (KL) divergence (Joyce, 2011), statistical method for pairwise comparison of distributions, suitable for text embeddings. While several pair- wise comparison tools such as KL divergence exist for comparing text embeddings, as far as we are aware TTE depth the first tool of its kind for providing corpus-level measures of centrality and spread in transformer-bawee text embedding space.
TTE depth: Consider a set of embedded texts F derived from the thcoretical set of all possible such documents S, each embedded by some text embedding model M : S + R which embeds texts into vectors of length k. Given bounded distance 8(.,)) I& x R* -> IR the TTE depth of an embedded text FF with respect to F is defined
2.2 Depths for Multidimensional Data Objects
Statistical depth is a tool for characterizing sets of multidimensional objects. Depth measures assign each object in a set measure of centrality with respect to the observed distribution of the set, thus interpretable center-outward ordering. Depth has been applied to measure a variety of multi- dimensional data (Dai et al., 2022). As angular measures of text embeddings are often used to de- scribe how texts are related, depths for directional data are particularly relevant to our work. Recently depths have been defined for and applied in direc- tional data (Pandolfo al., 2018; Pandolfo and D' Ambrosio, 2021). While depth has shown to be an effective, interpretable method of endow- ing multidimensional distributions with notions of centrality and outlyingness, we are the first to use statistical depth for transformer- embeddings of text data.
(I) where II ~ F is random variable with uni- form distribution over F. Note that while M could be any text embedding model, in this work we specifically investigate transformer- bbssed embed- ding methods. TTE depth can be used in conjunc- tion with two bounded distance functions.
Fo(r,F)== =2 Ex(ō(2, H))
The cosine distance (- between two em- bedded text documents x, y É F is well explored as a tool for examining pairwise relationships be- tween transformer-baet text embeddings (Sunilku- mar and Shaji, 2019). It is defined as
Perhaps most similar our goal is recent work which defines compositional depth, depth for text corpora in which an inverse Fourier transform is applied to the if-idf embeddings of texts within a corpora and a statistical depth for functional data
x y
(x. v) =
(2)
| loll
For any two embedded texts x, y E F, the chord distance det((--) between the two is defined
is used for ranking (Bolívar et al., 2023). The au- thors use this depth for classification of health texts, showing comparable performance to other statisti- cal text classification methods. While our work is similar in that we applying notion of depth to aware)
(a, = 22(1-x'))
(3)
While primarily investigate TTE depth using cosine distance, either cosine distance chord distance can be used for calculating TTE depth. Using either distance function, we define the median of F, denoted ro, to be the text embed- ding in F with maximum depth. In other words, max Ds(x, F) = Ds(zo, F). TTE depth produces zEF this well-defined median at the center of the set of text embeddings F. Ordering the text embeddings in F by TTE depth gives a center-outward ranking of all text embeddings within a corpus.
text embeddings, (as far as the first to apply statistical depth to transformer- based text embeddings and to highlight use cases of such a depth measure in modern NLP pipelines.
3 Transformer-based Text Embedding Depth
Angular distance properties of text embeddings, such as high cosine similarity between embed- dings of two similar texts, are often sought as a
Wilcoxon Rank Sum Test: As TTE depth gives an ordering to a corpus of text embeddings, we

---

can use an existing rank sum test for determining whether the embeddings of two corpora differ sig- nificantly. Existing applications of depth utilize the Wilcoxon rank sum test generalized to multivariate data through the order induced by a depth function (López-Pinnl Prrez--intadooaooo and Romo, 2009; Liu and Singh, 1993); we follow these works in our definitions. Suppose we have two corpora, and the sets of the embeddings in I of texts within these corpora given by F and G. We wish to determine whether is unlikely that G' comes from the same distribution as F. For a given text embedding y E G. we first define R(y, F) as the fraction of the F population which is "less central" to F than the embedding That is, let X ~ F be random variable with uniform distribution over F and define
1 n Σ R(yh, Fm), where R(ys, Fm)) is the propor- tion of ry's having Do(Ty Fm) S Ds(Hi Fm). other words, Q Gn) is the average of the ranks of y 's in the combined sample X U Y. If this sam- ple estimate is low, we consider the likelihood that the samples X and Y come from the same distri- bution of text embeddings to be low, and say that it is instead likely that F and G differ significantly. As empirically shown in (Liu and Singh, 1993), the null distribution of W = +Q _==) and a Z test can
Gn) Q G)]
is approximated by N(0, 12 be used from there. We give detailed example of how to interpret the Q parameter and the Wilcoxon rank sum test in Section 5.2.
4 Methods
Rly, F) Pr( Ds(y, F)]
(4)
To investigate the usefulness of TTE depth as both modeling and distributional inference tool, we perform several experiments. We first develop an intuition to how many texts should be sampled ensure quality TTE depth results, and use this intuition throughout our evalu- ation. Next, we explore the use of TTE depth as a ranking technique for in-context learning prompt selection across six classification tasks. Finally, we use TTE depth and the associated rank sum test to examine the distributional differences between five Hlmman-written dataset, synthesized dataset) pairs.
This roughly measures how central given text embedding y E G is with respect text embed- dings in F. For example, if R(y: F) is low, then a large portion of the text embeddings in X are more central to F than y, indicating that y is an outlier with respect to F. Next we use R(y. F) to define the Q parameter to gauge the overall "outly- ingness" of the G text embeddings with respect to F. Let X ~ F and Y G be independent random variables with uniform distributions over F and G, and define
from a population
4.1 Sample Size Recommendations
We wish develop intuitive understanding of how many samples are required for consistent TTE depth measures, estimates of the Q parameter, and Wilcoxon rank sum test results. While is thcoret- ically possible to obtain these metrics with access to full corpora, we choose to investigate sampling techniques for two reasons. First, as TTE depth re- quires a pairwise distance comparison across cor- pus, it becomes computationally intractable to rank each text within a large corpus. Second, there ex- ist situations in which obtaining exorbitantly large samples of two corpora for comparison is expensive or time-com tome-consuming, for example, engineers who wish to measure a distributional shift in responses of a deployed LLM. Hence, we are interested in how many samples are required from two corpora F and G in order to get good estimate Q(Fn, Gn) for (F, C), thus good TTE depth measurement.
Q(F,G)- - -BGG)-PrDDAA Pr(D) DD(())
(5)
Since R(y. F) is the fraction of the F corpus which is "less central" to F than the value QFF, G') is the average of such fractions over all y's from the G corpus. This means that Q allows us characterize and quantify how two corpora differ in embedding space. When Q < 3. means on average more than 50% of the F corpus deeper than text embeddings Y from G, indicating Y is more outlying than X with respect to F, hence an inconsistency between F and G.
We use the Q parameter to test whether two sets of embedded texts F and G are likely to come from the same distribution. (Liu and Singh, 1993) pro- pose Wilcoxon rank sum test for the hypothe- ses Ho : F G versus H. : Q (a1, 22, ] and Y = {y1, V2, ..., Vn be samples of text embeddings from F and G, respec- tively. A sample estimate of Q is (F,, G.)) =
1/2 Let
We run a simulation study on the Wilcoxon rank sum test for corpora on the order induced by TTE

---

depth. We use the natural language inference (NLI) corpus (Bowman et al., 2015) and an associated synthetic NLI (SyNLI) corpus (Chen et al., 2022) for this study. We sample 5,000 texts from each of the NLJ and SyNLI corpora pair and treat them as the population corpora F and G. respectively. We then embed each text in each population cor- pus using S-BERT, a popular general-purpose text embedding model (Reimers and Gurevych, 2019)?. We then use the order induced by TTE depth to compute the "true" Q parameter of these popula- tions, Q(F, G). To empirically determine a good sample size n to draw from F' and G for estimating Q(F, G) with Q(Fn= Fr: Gn), we iterate over sample sizes n E {5. 25, 50, 100, 500}, randomly draw samples of size from F and G, and compute QF,,, G.)) 20 times. We are interested in whether the distribution of (F,,, Ga) accurately represents the true value of Q(F, G) consistently with differ- ent sample sizes.
sample size increases. We note that the distribution of ((000 G500) estimates has a standard devia- tion of just 0.009, indicating low variance around the true value of Q(F,G) = 0.4118 while run- ning in a reasonable amount of time. We propose that = 500 is good enough sample size to test for significantly different distributions of two suffi- ciently large embedded corpora using the Wilcoxon rank sum test on the order induced by TTE depth, and we sample n 500 texts from each corpus for the evaluations this work.
4.2 In-Context Learning Prompt Selection
In-context learning (ICL) is a recent paradigm used for few-shot NLP tasks. In text classification it involves prompting a pre-trained LLM to assign label to an unseen input after being given sev- eral examples (Gao et al., 2020). Recent work has investigated prompt selection, i.e. the task of select- ing representative examples from a labeled training dataset to prompt LLM for labeling an unseen test sample (Gao et al., 2020). We propose the use of TTE depth for the task of prompt selection in model-agnostic setting. Exploration into ICL has shown that an important component of ICL prompting the inclusion of in-distribution texts in the ICL prompt (Min et al., 2022). We hypoth- esize that texts which better represent the corpus distribution, i.e. texts with higher TTE depth, will improve downstream ICI. performance. Since TTE depth is statistical ranking procedure, we do not compare extrinsic results against existing models for prompt selection. Instead, we extrinsically eval- uate test two TTE depth-based rankings against two naive statistical baseline rankings across six text classification tasks.
Estimating Q(F,G) using Q(F,, Gz)
((F.G) 0.41
n=5
10-
n-
n= 100
550
Frequency
0.2
0.1 0.5
0.7
Q.F.. G.))
Figure 2: Comparison of Q(F,,, G.) estimates for dif- ferent values of n. As expected, we see the center of each sample distribution centered around the true Q(F,C G). Additionally, we see the spread of the dis- tribution of QF,,, G.)) estimates decreases as sample sizes increases. As the distribution of Q(",,, Gr)) with n = 500 has low variance, we henceforth use n = 500 for estimating (F G) in the Wilcoxon rank sum test.
Random (RAND) ranking simply randomly shuf- fles the training dataset, after which the first N texts are used as ICL examples for prompt selection.
Label Distribution Match (LDM) ensures that the label distribution of the training dataset is matched by the selected ICL examples. For each label oc- cupying 1% of the training data label space, after applying a random shuffle the first N 1% texts with that label are selected as ICL examples. This ranking attempts to ensure that the LLM is able to accurately infer the label distribution of the training data through the ICL examples.
The true value of Q(F, G) was found to be 0.4118. We can see the sample distributions of Q(E,, Gn,) for different values of n in Figure 2. As expected, each of the distributions of (Fn,, G.)) estimates is centered around Q(F, G), and the spread of the sample distribution decreases as the
"While TTE depth can be used in conjunction with any text embedding model and either bounded distance, we use only S-BERT and cosine distance in our evaluations for simplicity. A comparison of different embedding models and bounded distances is provided in Appendix A.I.
Depth (DEEP) ranking ranks all embedded texts by their TTE depth. The N deepest texts are then selected as ICL examples.

---

Depth with Label Distribution Match (DLDM) ranking is a combination of both the DEEP and LDM techniques. This ranking first ranks all em- bedded texts by their TTE depth. Then, the same selection strategy as the label distribution match ranking is used. Hence, the N 1% deepest texts for each label are selected as ICL examples.
2021). Specifically, we're interested in whether synthesized training texts across various NLP tasks are significantly different from their human-written training text counterparts in embedding space. We use TTE depth to investigate the following synthe- sis strategies.
Inversion, Passivization, and Combination are NLI sample synthesis techniques involving swap- ping the subjects and objects of sentences in the origin dataset, taking active verbs in sentences and converting them passive verbs, and both simul- taneously (Min et al., 2020). These synthesized samples are obtained by inverting samples from the Multi NLI (MNLI) corpus from the GLUE bench- mark (Williams et al., 2018), hence we use TTE depth to measure the distributional shift of the in- verted corpus against MNLI in embedding space. To embed sentence pair samples in the NLI task, join them and embed them afterwards.
We compare ranking methods across six text classification tasks. The Corpus of Lingustic Acceptability (COLA) (Warstadt et al., 2018), Microsoft Research Paraphrase Corpus (MRPC) (Dolan and Brockett, 2005), Stanford Sentiment Treebank (SST2) (Socher al., 2013), and Recog- nizing Textual Entailment (RTE) (Bentivogli et al., 2017) tasks are selected from the GLUE bench- mark (Wang et al.. 2019). The final tasks, the tweet hate speech detection (THATE) (Basile et al., 2019) and tweet offensive language identification (TOFF) (Zampieri et al., 2019) tasks are both tweet classification tasks.
SyNLI is dataset of synthetic NLI samples generated using a generator/diisrimnnator model trained on the NLI corpus (MNLI + Stanford NLI corpus (Bowman et al., 2015)) to synthesize sen- tence pairs (Chen et al., 2022). SyNLI sentence pairs are generated using T5, popular open- source LLM (Raffel et al., 2020), and are com- pared against samples from NLI in our TTE depth analyses.
For each task, we randomly sample 500 texts from the training corpus to represent the labeled training dataset for prompt selection. We embed each of these texts (for pairwise tasks we embed a joined version of the two texts) using S-BERT, Next, rank each embedded text according to each of the baseline and TTE depth-based based ranking strategies described. The N' ICL examples given by each ranking strategy are then used to create the ICL prompt. We use this prompt to query ChatGPT, a popular LLM which has been shown to offer good performance across several ICI. text classification tasks (Ray, 2023), to label each evaluation text in the evaluation corpus of each task. After post- processing ChatGPT output, results are recorded for each ranking strategy and are averaged over three values of N for each task.
SRQA-AUTO is dataset of stories involving spatial relationships between objects and spatial reasoning questions corresponding to the stories (Mirzace et al., 2021). In SRQA-AUTO the stories are generated from image captions using context- free grammars (CFGs) and a rule base is used to generate the corresponding spatial reasoning ques- tions. In our evaluation, SRQA-AUTO is com- pared against the SRQA HUQA-HUMAN dataset contain- ing human-written ( (story. question) ) pairs. Samples in SRQA-AUTO and SRQA-
4.3 Distributional Characterization of Synthesized Training Datasets
are embed- ded by joining story and question pairs and embed- ding the resulting text, and these embeddings are used in our TTE depth analysis.
The theory of data synthesis for training or fine- tuning language models is straight- forward: more data is good for learning, and synthesized data is cheaper and more accessible than Human-gennrated and human-labeled data (He et al., 2022). How- ever, most data synthesis techniques report only extrinsic evaluations of the synthesized data, i.e. an increase in Fl on hidden evaluation data. Intrin- sic evaluations, such as the distributional effects of synthesizing training samples for augmenting NLP datasets, require further exploration (Pillutla et al.,
For each training data synthesis technique, we use TTE depth to rank a sample of 500 synthesized texts and 500 texts from the corresponding human- written corpus. We compare the depth-induced distributions intuitively, reporting the TTE depth of the median of the Human-writted text (Med Human) and the synthesized text (Med Synth) with respect to the wriiten embedding distribution. We then use the Wilcoxon rank sum test on the order

---

induced by TTE depth to compare the distributions statistically,, testing whether the human- wwitten and synthesized corpora differ significantly in embed- ding space and giving Q estimates, W statistics, and p values. We further detail one analysis, ex- amining the Q measure of outlyingness obtained through TTE depth and discussing what it means for the synthesis technique to produce more outly- ing texts than the human-written corpus.
associated p-value. According to the Wilcoxon rank sum test on the order induced by TTE depth, all of the training sample synthesis techniques we evaluate produce a significantly different distribu- tion of texts in embedding space. This indicates that some aspect of each synthesis process causes the synthesized training samples to be either gener- ally more central more outlying than the origin training samples. Within the NLI task, the SyNLI synthetic dataset results in the lowest Q estimate, indicating that it is the furthest in embedding space from its origin dataset. This result is intuitive- other three NLI synthesis strategies simply result in transposed versions of the original text, whereas the SyNLI text samples are entirely new samples generated by an LLM. We briefly focus on this test as thorough example of using TTE depth as corpus analysis tool.
5 Results and Discussion
5.1 TTE Depth for In-Context Learning Prompt Selection
Prompt selection for ChatGPT is task with a black box evaluation setting due to opaque training pro- cesses, hence ICL results can be somewhat random (Ji et al., 2023). However, we hypothesize that since TTE depth will lead to prompts which are more representative of the labeled training dataset, on average these prompts should lead to better in- context tuning for LLMs such as ChatGPT.
Embedded Depth Distributions of NLI Training Samples
Ni Samplees
Results of the prompt selection evaluation de- scribed in Section 4.2 are displayed in Table 1. We report average Fl scores across N {5. 8, 11) samples selected using each ranking strategy. We use McNemar's test to determine whether depth- based strategies significantly outperform baselines (McNemar, 1947). For each of the depth-based strategies, we report whether the results were sta- tistically significantly better than each of the base- line strategies (p < 0.05) using the notation (Y/N) for whether the results were significantly better than the RAND and LDM baselines, respectively. Across the six text classification tasks, TTE depth- based ranking strategies outperform the naive base- lines in five tasks and the DLDM ranking outper- forms all other ranking strategies on average. Addi- tionally, the DLDM ranking strategy outperforms both baselines average. In 9 of the 24 pairwise comparisons (including all 8 across the 2 social me- dia tasks) the performance of depth- based ranking strategies is statistically significantly better than baseline approaches.
SyNU Samples
Relative Frequency
0.15
0.10
0.05
0.00
0.90
1.00
1.02
1.04
1.06
1.08
1.10
Embedded Depth
(S-BERT, Cosine)
Figure 3: Comparison of TTE depth distributions of samples from the NLI and SyNLI datasets, with re- spect to the NLI embedding distributions. The NLI and SyNLI corpora are differ significantly according to the Wilcoxon rank sum test, hence the synthesis process used to generate samples in the SyNLI dataset signifi- cantly shifts the distribution away from the NLI corpus.
Examining row 4 of Table 2 we find that the TTE depth ranking of SyNLI texts with respect to the distribution of NLI texts results in a Q estimate of 0.4064. A direct interpretation of this parameter means that, average, texts from the SyNLI cor- pus are more central (i.e. closer to the TTE depth median of the NLI corpus) than only 40.64% of the the texts in the NLI corpus. As described in Section 3, a Q parameter this low indicates that the texts in the SyNLI corpus mark a clear distributional shift
5.2 Distributional Characterization of Synthesized NLP Training Datasets
Results of our analysis are found in Table 2. As described in Section 4.3, we give the median and syn- thetic corpus, along with Q parameter estimates, the Wilcoxon rank sum test statistic W, and the
depth values of each human-generate

---

Depth-First
Task
Random
Label Distribution Match
Depth-First
Label Distribution Match
COLA
0.8164
0.8094
0.8166 (N/N)
0.8220 (N/Y)
MRPC
0.7166
0.7250
0.7334 (N/N)
0.6841 (N/N)
SST2
0.9486
0,9514
0.9518 (N/N)
0.9414 (N/N)
RTE 0.6366
0.7352
0,4413 (N/N)
0.7258 (N/N)
THATE 0,6039
0.6629
0.7072 (Y/Y)
0.7009 (Y/Y)
TOFF 0.7361
0.7189
0.7461 (Y/Y)
0.7411 (Y/Y)
AVG 0.7431
0.7671
0.7332
0.7692
Table 1: Results of the TTE depth-based naive ranking strategies across the six text classification tasks. The TTE depth-based ranking strategies outperform the naive baselines in of the 6 tasks, and the DLDM ranking outperforms all other ranking strategies on average.
Human Corpus
Synth Corpus Inversion 1.0431
Med Human
Med Synth
Q
W
MNLI
1.0397
0.4751
2.67
0.0077
MNLI
Passivization
1.0431
1 1,0408
0.4771
2.45
0.0142
MNLI
Combination
1.0431
1,0397
0.4785
2.30
0.0214
MNLI + SNLI
SyNLI 1.0339
1.0175
0.4064
10.19
0.0001
SRQA-HUMAN
SRQA-AUTO
1.8459
1.7756
0.3131
20.36
< 0.0001
Table 2: Embedded depth and Wilcoxon rank sum test results comparing human-written and synthesized data across five data synthesis techniques. For each test, a sample of 500 was taken from each of the origin and synthesized training datasets. Each text was embedded using S-BERT, and a Wilcoxon rank sum test the order induced by embedded depth was performed. For each test, the (aa0o. 500) estimate given, along with the corresponding W statistic and associated p-value. low p-value indicates that is unlikely the origin and synthesized datasets drawn from the same distribution in embedding space.
away from the NLI corpus.
Limitations and Future Work
We can this distribution shift graphically in Figure 3, where the distributions of TTE depths for the randomly sampled SyNLI texts and NLI texts, with respect to the NLI texts, are separated. This indicates that the synthesis technique used to create the SyNLI corpus produces texts which are distant from the texts in the human-written NLI corpus, measured by cosine similarity between S-BERT embeddings. This distributional shift can be seen in the Q parameter as well as the centers of the TTE depth distributions: the median depth of the NLI texts (1.0339) is higher than the median depth the SyNLI texts (1.0155). This shift could cause unintended consequences if the SyNLI corpus were to be treated equally with the Human--ritten NLI corpus in downstream applications.
As defined in Section 3, TTE depth depends on text embedding models which produce embeddings with desired spatial relationships. This assumption holds for most popular text embedding models, in- cluding those used in this work. However, text vectorizations which do not claim this property, such as if-idf, are not suitable for use TTE depth. Additionally, TTE depth at its core a dimension- ality reduction method that produces a single in- terpretable dimension along which texts can be measured. We note that no matter how the dimen- sionality of text embeddings is reduced, there will always be some amount of information loss. While the single dimension and intuitive center-outward ordering given by TTE depth is useful for many tasks, may not appropriate as a one-size-fits-all approach to distributional inference and is meant to be used in conjunction with other statistical tools for a full picture of embedding space properties.
TTE depth and the associated Wilcoxon rank sum test have the potential to be useful in both modeling and distributional inference tasks. TTE depth allows NLP researchers and practitioners to measure distributional properties corpora such as center and spread, as well as compare distributions corpora in embedding space.
Future work may use TTE depth for variety of NLP modeling and inference tasks. Modeling tasks may include the use of TTE depth to select repre- sentative documents to facilitate hierarchical multi-

---

document summarization (Fabbri al., 2019). In- ference tasks could include the use of TTE depth to investigate outlying documents in domain- domain-specific corpora, such as research in anomaly detection in social media posts (Guha and Samanta, 2021).
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. 2015. A large annotated corpus for learning natural language inference. arXiv preprint arXiv: 100xv::50000555 558.053666
Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez- Gazpio, and Lucia Specia. 2017. Semeval-2017 task I: Semantic textual similarit- and cross-lingual focused evaluation. arXiv preprint urXiv:1708.0005:
7 Conclusion
In this work we have introduced TTE depth, a novel approach to measure distributions of transformer- based text embeddings which endows corpora with intuitive notions of center and spread. TTE depth gives a center-outward ordering of texts within a corpus based on the texts in embedding space. We have defined TTE depth and an associated Wilcoxon rank sum test for discovering significant differences between pairs of corpora. To demon- strate the use of TTE depth in modeling, we have used TTE depth as a ranking for the task of prompt selection, showing good performance across a va- riety of text classification tasks. Additionally, we have shown the usefulness of TTE depth for char- acterizing distributional properties of corpora by investigating the embedding distributions of source and synthetic datasets in several synthetic data aug- mentation pipelines. TTE depth is a useful, novel tool for both modeling and distributional inference in modern transformer-be based NLP pipelines.
Yiming Chen, Yan Zhang, Bin Wang, Zuozhu Liu, and Haizhou Li. 2022. Generate, discriminate and contrast: A semi-supervised sentence rep- resentation learning framework. arXiv preprint 1XXi::2210.16795
Xiongtao Dai, Sara Lopez-Pintado, and Alzheimer's Disease Neuroimaging Initiative. 2022. Tukey's 's depth for object data. Journal of the American Statis- rical Association, pages 1-13.
Bill Dolan and Chris Brockett. 2005. Automati- cally constructing a corpus In Third International Workshop on Paraphrasing (IWP2005).
corpus of sentential paraphrases.
Alexander Richard Fabbri, Irene Li, Tianwei She, Suyi Li, and Dragomir Radev. 2019. Multi-news: A large- scale multi-documeet summarization dataset and ab- stractive hierarchical model. In Proceedings of the 57th Annual Meeting of the Association for Compu- tational Linguistics, pages 1074-1084.
Tianyu Gao, Adam Fisch, and Danqi Chen. 2020.
Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.1577 15723.
Acknowledgements
Tianyu Gao, Xingeheng Yao, and Danqi Chen. 2021.
This work was supported by the National Science Foundation Research Traineeship, Transformative Research and Graduate Education in Sensor Sci- ence, Technology and Innovation (DGE- 2125733).
Simese: Simple contrastive learning of sentence em- beddings. arXiv preprint arXiv:2104.0880
Abhijit Guha and Debabrata Samanta. 2021. Hybrid approach to document anomaly detection: an applica- tion to facilitate rpa in title insurance. International Journal of Automation and Computing, 18(1):55-72.
References
Lasse Hansen, Ludvig Renbo Olsen, and Kenneth Enevoldsen. 2023. Textdescriptives: python pack- age for calculating a large variety of metrics from text. Journal of Open Source Software, 8(84):5153,
Valerio Basile, Cristina Bosco, Elisabetta Fersini, Debora Nozza, Viviana Patti. Francisco Manuel Rangel Pardo, Paolo Rosso, and Manuela Sanguinetti. 2019, SemEval-2019 task 5: Multilingual detection of hate speech against immigrants and women in Twitter. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 54-63, Min- neapolis, Minnesota, USA. Association for Compu- tational Linguistics.
Xuanli He, Islam Nassar, Jamie Kiros, Gholamreza Haf- fari, and Mohammad Norouzi. 2022. Generate, notate, and learn: Nlp with synthetic text. Transac- rions of the Association for Computational Linguis- tics, 10:826 842.
Luisa Bentivogli, Ido Dagan, and Bernardo Magnini. 2017. The recognizing textual entailment challenges: Datasets and methodologies. Handbook of linguistic annotation, pages 1119-1147.
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2019. The curious case of neural text degeneration. arXiv preprint
Sooyong Jang, Sangdon Park, Insup Lee, and Osbert Bastani. 2022. Sequential covariate shift detection using classifier two-sample tests. In International Conference on Machine Learning, pages 9845 9880. PMLR
Sergio Bolívar, Alicia Nieto-Reyes, and Heather L., Rogers. 2023. Statistical depth for text data: An application to the classification of healthcare data. Mathematics, II()).

---

Ziwei Ji. Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang. Andrea Madotto, and Pascale Fung. 2023. Survey of halluci- nation in natural language generation. ACM Comput- ing Surveys, 55(12):1-38.
Partha Pratim Ray. 2023. Chatgpt: comprehensive review on background, applications, key challenges. bias, ethics, limitations and future scope. Internet of Things and Cyber-Physical Systems.
Nils Reimers and Iryna Gurevych. 2019. Sentence-bert Sentence embeddings using siamese nettss. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Associa- tion for Computational Linguistics.
James M Joyce. 101 Kullback-leibler divergence. In International encyclopedia of statistical science, pages 720-722. Springer.
Ramnect Kaur, Xiayan Ji, Souradeep Dutta, Michele Caprio, Yahan Yang. Elena Bernardis, Oleg Sokolsky, and Insup Lee. 2023. Using semantic information for defining and detecting ood inputs. arXiv preprint arXiv:2302.1 11019.
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher Manning, Andrew Y Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over sentiment treebank. In Proceedings of the 2013 conference on empiri- cal methods in natural language processing, pages 1631-1642.
Regina Y Liu and Kesar Singh. 1993. A quality index based on data depth and multivariate rank tests. Journal of the American Statistical Association, 88(421):252-260.
Sara López-Pintado and Juan Romo. 2009. On the concept of depth for functional data. Journal of the American statistical Association, 104(486)718--34)
Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and Tie- Yan Liu, 2020. Mpnet: Masked and permuted pre- training for language understanding. Advances in Neural Information Processing Systems, 33:16857- 16867.
Quinn McNemar. 1947. Note the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2):153-155
P Sunilkumar and Athira P Shaji. 2019. A survey on semantic similarity. In 2019 International Confer- ence on Advances in Compuring. Communication and Control (ICAC3), pages 1-8, IEEE.
Junghyun Min, R Thomas McCoy, Dipanjan Das, Emily Pitler. and Tal Linzen. 2020. Syntactic data augmen- tation increases robustness inference heuristics. arXiv preprint 2004::2004. 11999.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need, Advances neural information processing systems, 30.
Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis. Hannanch Hajishirzi, and Luke Zettle- moyer. 2022. Rethinking the role of demonstrations: What makes in-context learning work? Proceed- ings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 11048-11 11064.
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. Glue: multi-task benchmark and analysis platform for natural language understanding. In the Proceed- ings of ICLR.
Roshanak Mirzaee, Hossein Rajaby Faghihi, Qiang Ning, and Parisa Kordjmashidi. 2021. Spartqa:: textual question answering benchmark for spatial rea- soning. arXiv preprint
Giuseppe Pandolfo and Antonio D' Ambrosio. 2021. Septh-based classification of directional data. Ex- pert Systems with Applications, 169:114433.
Alex Warstadt, Amanpreet Singh, and Samuel R Bow- man. 2018. Neural network acceptability judgments. arXiv preprint 1at.::880..12777
Giuseppe Pandolfo, Davy Paindaveine, and Giovanni C Porzio. 2018. Distance-based depths for directional data. Canadian Journal of Statistics, 46(4):593- 609.
Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. broad-coverd challenge corpus for sen- tence understanding through inference. In Proceed- ings of the 2018 Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies, Volume (Long Papers), pages 1112-1122. Association for Computational Linguistics.
Krishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun, Sean Welleck, Yejin Choi, and Zaid Harchaoui. 2021. Mauve: Measuring the gap be- tween neural text and human text using divergence frontiers. Advances in Neural Information Process- ing Systems, 14-4886-4828.
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee. Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with unified text-to-text trans- former. The Journal of Machine Learning Research, 21 (1():5488-555)
Marcos Zampieri, Shervin Malmasi, Preslav Nakov, Sara Rosenthal, Noura Farra, and Ritesh Kumar, 2019. Semeval-2019 task 6: Identifying and catego- rizing offensive language in social media (offenseval). In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 75-86.

---

A Appendix
As discussed in Section a lower Q indicates that the embeddings in corpus G are more outly- ing on average than embeddings in corpus F, with respect to the center of F. Intuitively, the embed- ding models with the best reported performance on STS benchmarks (MPNET and GenSE+) have the lowest average Q estimates, indicating that they are better able to discriminate between NLI and SyNLI in embedding space. Additionally, within the embedding models the Q estimates are very similar across the two distance functions. On av- erage, Q estimates using chord distance are only slightly lower than estimates using cosine distance with an average difference of 0.0041. While MP- NET and GenSE+ produce more desirable Q esti- mates on average, each transformer- based embed- ding model produces roughly the same Q estimate with 100, indicating that any combination is suitable for TTE depth analysis.
A.1 Comparison of Embedding Models and Bounded Distances
While in our evaluations, investigate TTE depth using only S-BERT, we also provide investiga- tion of TTE depth under different embedding mod- els here. We also further investigate TTE depth using chord distance, addition to cosine distance. To test whether Q estimates vary across embed- ding models and distance functions, we use the SyNLI and NLI corpora pair as in 4.1. For each embedding model and distance function, sam- ple 100 texts from each of the SyNLI and NLI cor- pora, compute embeddings using the embedding model, and compute TTE depth using the distance function 20 times. As in our sample size analy- sis, we are interested whether the distribution of ((Fo0, G10o) estimates varies depending on the embedding method and distance function used. In addition to the 2 bounded distances (cosine and chord distance), compare 4 popular embedding models.
Sentence BERT (S-BERT) is a popular general- purpose text embedding model which is trained using a triplet network structure (Reimers and Gurevych, 2019). To get a sense of whether the size of the embedding model matters for TTE depth re- sults, we use both S-BERT base and S-BERT large. SimCSE is text embedding model trained on labeled NLI datasets with contrastive learning objective learn general text embedding model (Gao al., 2021). At the time of publication, Sim- CSE achieved SOTA results on semantic textual similarity (STS) benchmarks. We utilize both the BERT-based and RoBERTa-based SimCSE models in our analysis.
GenSE+ is text embedding method trained in part using the SyNLI dataset we for TTE depth analysis (Chen et al., 2022). Upon release, GenSE+ achieved SOTA performance on STS benchmarks, making a good embedding model for use in TTE depth analysis.
MPNET uses novel masked and permuted pre- training method for developing a text embedding model (Song et al., 2020). MPNET reports SOTA performance varicty of downstream tasks. Table 3 shows the mean and standard devia- tion of 20 Q(Fi00. G100) estimates on the order induced by TTE depth across different bounded distance functions and embedding models, where is the NLI corpus and G the SyNLI corpus.

---

Distance Function
Embedding Model
Embedding Dimension
Mean Q
Standard Deviation Q
Cosine
S-BERT Base
384
0.4158
0.0233
Chord
S-BERT Base
384
0.4118
0.0233
Cosine
S-BERT Large
384
0.4219
0.0283
Chord
S-BERT Large
384
0.4176
0.0278
Cosine
MPNET
768
0,3905
0.0242
Chord
MPNET
768
0.3878
0.0236
Cosine
SimCSE BERT
768
0.4309
0.0233
Chord
SimCSE BERT
768
0.4270
0.0232
Cosine
SimCSE RoBERTa
768
0.4180
0.0186
Chord
SimCSE RoBERTa
768
0.4136
0.0185
Cosine
GenSE+
768
0.4094
0.0381
Chord
GenSE+
768
0.4042
0.0370
Table 3: Comparison of the mean and standard deviation of 20 11io0, G100) estimates across different bounded distance functions and embedding models, where the NLI corpus and is the SyNLI corpus.


Reviews:
[{"review_id": "y0UFDD6gj2", "reviewer": "Reviewer_bzCu", "summary": "", "questions": "1.Have you tried this measure on other tasks that could use that relies more heavily on corpus distribution other than classification? \n\n2.Prompt engineering is a significantly important task and a lot of papers have concluded that human curated prompts, highly tailored to each task are better than automated ones. Do you have plans to compare your automated prompts compared with human curated ones?", "limitations": "", "rating": 2, "confidence": 3, "soundness": 3, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# Summary\nWe thank the reviewer for their thoughtful comments. It was encouraging to see that the reviewer finds our ablation experiments thorough and interesting, in addition to recognizing the usefulness of TTE depth as a method for measuring distributional shift between corpora. We appreciate the reviewer’s feedback on our evaluation of TTE depth for the ICL prompt creation task. We answer specific questions and feedback from the reviewer below.\n\n# Questions\n> **Q1:** Their improvements in F1 on avg is not statistically significant enough to consider it better than just random.\n\n**A1:** We appreciate the reviewer’s feedback on the evaluation of the ICL prompt creation use case of TTE depth. To address this feedback, during the rebuttal period we have obtained new results using the full evaluation datasets, as opposed to samples of each evaluation dataset, for each of the 6 text classification tasks described in Section 4.2 of our paper. Additionally, we have statistically analyzed these new results using McNemar’s test [1]. As a reminder for the reviewer, we compare 2 TTE depth-based ranking strategies, depth-first (DEEP) and depth-first with label distribution matching (DLDM), against 2 baselines, random (RAND) and label distribution matching (LDM). We report average F1 scores on ICL classification using 5, 8, and 11 samples selected using each ranking strategy. For each of the depth-based strategies, we report whether the results were statistically significantly better than each of the baseline strategies (p < 0.05) using the signifier (Y/N) for whether the results were significantly better than the RAND and LDM baselines, respectively. Results are presented in the table below.\n\n|  Task |   RAND   |     LDM    |             DEEP            |             DLDM            |\n|:-----:|:--------:|:----------:|:---------------------------:|:---------------------------:|\n|       |    F1    |     F1     | F1 (Sig vs RAND/Sig vs LDM) | F1 (Sig vs RAND/Sig vs LDM) |\n| COLA  |  0.8164  |   0.8094   |         0.8166 (N/N)        |     **0.8220** (N/**Y**)    |\n| MRPC  |  0.7166  |   0.7250   |       **0.7334** (N/N)      |         0.6841 (N/N)        |\n| SST2  |  0.9486  |   0.9514   |       **0.9518** (N/N)      |         0.9414 (N/N)        |\n| RTE   |  0.6366  | **0.7352** |         0.4413 (N/N)        |         0.7258 (N/N)        |\n| THATE |  0.6039  |   0.6629   |   **0.7072** (**Y**/**Y**)  |     0.7009 (**Y**/**Y**)    |\n| TOFF  |  0.7361  |   0.7189   |   **0.7461** (**Y**/**Y**)  |     0.7411 (**Y**/**Y**)    |\n| _AVG_ | _0.7431_ |  _0.7671_  |           _0.7332_          |         **_0.7692_**        |\n\nWe highlight that TTE depth-based ranking strategies select better samples for downstream ICL classification performance on 5 of the 6 full evaluation datasets. Additionally, the DLDM ranking strategy outperforms both baselines on average. Finally, in 9 of the 24 pairwise comparisons (including all 8 across the 2 social media tasks) the performance of depth-based ranking strategies is statistically significantly better than baseline approaches. We hope that these newly-obtained results using full evaluation datasets, in addition to the statistical significance testing, demonstrate the usefulness of TTE depth in the ICL prompt creation task. We will add these new results to Section 5 of the paper. \n\nWe believe that this evaluation, in addition to the theoretical introduction to TTE depth and the evaluation of TTE depth as an inference method described in our paper, are sound contributions to corpus-level distributional inference and modeling in NLP.\n\n> **Q2:** Have you tried this measure on other tasks that could use that relies more heavily on corpus distribution other than classification?\n\n**A2:** Thank you for the great suggestion! The goal of this work is to introduce the use of TTE depth for modern NLP pipelines, hence we decided to thoroughly explore ICL prompt creation for text classification tasks as one use case, using multiple datasets from various domains. As an additional use case, we evaluate on the important inference task of measuring distributional shift between human and synthetic texts. However, in the future we plan to thoroughly explore other tasks. In particular, we agree with the reviewer and we hypothesize that tasks which are more corpus-dependent and use document-ordering strategies would be appropriate for future research, e.g., anomaly detection, or ICL prompt creation for information extraction. We hope that the release of the TTE depth python package, alongside this theoretical introductory work, will facilitate such interesting research in the future.\n\n> **Q3:** Prompt engineering is a significantly important task and a lot of papers have concluded that human curated prompts, highly tailored to each task are better than automated ones. Do you have plans to compare your automated prompts compared with human curated ones?\n\n**A3:** In short, yes. That’s a great idea and we will explore that in future explorations of TTE depth. We also want to share a bit more about the prompt creation process to address potential confusion. \n\nFollowing the terminology “prompt generation” introduced in prior work [2] we use the task definition of “prompt creation” as “the task of selecting representative examples from a data pool to prompt a LLM for labeling an unseen test example.” This is why we compare only against computational methods that automatically select representative texts from a larger training corpus, as in more recent works [3] and [4]. \n\nWhile we focus on the task of selecting representative examples from a data pool to include in an ICL prompt, as each ICL prompt includes a human-written instruction in addition to selected examples, there is still room in our approach to curate human input in the prompt instruction. As our approach does not automatically write this instruction, we are not claiming a fully automated prompt selection pipeline. We think it would be an interesting experiment to compare our approach with other human-curated approaches where humans select representative examples. \n\nWe also wish to emphasize that our goal in this work is not to achieve SOTA on the prompt creation task, but rather to theoretically introduce and thoroughly investigate the use of TTE depth as a tool for modern NLP modeling and inference tasks. \n\n# Conclusion/References\nThank you for your thoughtful review and comments. We hope this response satisfies your concerns and resolves any potential ambiguity, please let us know if you have any other questions!\n\n[1] McNemar, Q. 1947. Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2): 153–157.\n\n[2] Tianyu Gao, Adam Fisch, and Danqi Chen. 2020. Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.15723.\n\n[3] Zhou, Yuhang, Suraj Maharjan, and Beiye Liu. \"Scalable Prompt Generation for Semi-supervised Learning with Language Models.\" Findings of the Association for Computational Linguistics: EACL 2023. 2023.\n\n[4] Shrivastava, Disha, Hugo Larochelle, and Daniel Tarlow. \"Repository-level prompt generation for large language models of code.\" International Conference on Machine Learning. PMLR, 2023.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "They are thorough in performing an array of ablation experiments to determine the optimal number of samples needed to determine the effectiveness of the metric .\n\nThe metric is a good way to measure distributional shift between human and synthetic data.\n\n", "reasons_to_reject": "Their improvements in F1 on avg is not statistically significant enough to consider it better than just random.\n", "questions_to_authors": "1.Have you tried this measure on other tasks that could use that relies more heavily on corpus distribution other than classification? \n\n2.Prompt engineering is a significantly important task and a lot of papers have concluded that human curated prompts, highly tailored to each task are better than automated ones. Do you have plans to compare your automated prompts compared with human curated ones?", "paper_topic_and_main_contributions": "This paper introduces thee concept of transformer based text embedding depth also called TTE depth which is a way to rank embeddings based on angular distance within a corpus. They introduce a use case of few shot examples in prompt creation and use the metric to pick the samples. They show an improvement in F1 in 4 out of 6  classification they picked. They also use the metric to measure distance between synthetic and human generated data .", "excitement": 2, "reproducibility": 3, "ethical_concerns": "No", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "IkyPHvSOik", "reviewer": "Reviewer_vaeR", "summary": "", "questions": "", "limitations": "", "rating": 4, "confidence": 3, "soundness": 4, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# Summary\nWe thank the reviewer for their thoughtful review. We are encouraged that the reviewer sees the transformer-based text embedding (TTE) depth method and its associated python package as valuable contributions to the community, and finds that our evaluations yield positive results. We appreciate the reviewer’s feedback on the evaluation of TTE depth for the in-context learning (ICL) prompt creation task. We answer specific questions and feedback from the reviewer below.\n\n# Questions\n> **Q1:** The evaluation on the prompt creation task is limited. By using the ChatGPT API, a larger evaluation set should be obtained quickly without significant cost.\n\n**A1:** We appreciate the reviewer’s suggestion to obtain larger evaluation sets for the ICL prompt creation task. To address this concern, during the rebuttal period we have obtained new results using the full evaluation datasets, as opposed to samples of each evaluation dataset, for each of the 6 text classification tasks described in Section 4.2 of our paper. As a reminder for the reviewer, we compare 2 TTE depth-based ranking strategies, depth-first (DEEP) and depth-first with label distribution matching (DLDM), against 2 baselines, random (RAND) and label distribution matching (LDM). We report average F1 scores on ICL classification using 5, 8, and 11 samples selected using each ranking strategy. To address concerns about the statistical significance of our results in our evaluation of TTE depth in the ICL classification use case, during the rebuttal period we have also evaluated these results using McNemar’s test [1]. For each of the depth-based strategies, we report whether the results were statistically significantly better than each of the baseline strategies (p < 0.05) using the signifier (Y/N) for whether the results were significantly better than the RAND and LDM baselines, respectively. Results are presented in the table below.\n\n\n|  Task |   RAND   |     LDM    |             DEEP            |             DLDM            |\n|:-----:|:--------:|:----------:|:---------------------------:|:---------------------------:|\n|       |    F1    |     F1     | F1 (Sig vs RAND/Sig vs LDM) | F1 (Sig vs RAND/Sig vs LDM) |\n| COLA  |  0.8164  |   0.8094   |         0.8166 (N/N)        |     **0.8220** (N/**Y**)    |\n| MRPC  |  0.7166  |   0.7250   |       **0.7334** (N/N)      |         0.6841 (N/N)        |\n| SST2  |  0.9486  |   0.9514   |       **0.9518** (N/N)      |         0.9414 (N/N)        |\n| RTE   |  0.6366  | **0.7352** |         0.4413 (N/N)        |         0.7258 (N/N)        |\n| THATE |  0.6039  |   0.6629   |   **0.7072** (**Y**/**Y**)  |     0.7009 (**Y**/**Y**)    |\n| TOFF  |  0.7361  |   0.7189   |   **0.7461** (**Y**/**Y**)  |     0.7411 (**Y**/**Y**)    |\n| _AVG_ | _0.7431_ |  _0.7671_  |           _0.7332_          |         **_0.7692_**        |\n\nWe highlight that TTE depth-based ranking strategies select better samples for downstream ICL classification performance on 5 of the 6 full evaluation datasets. Additionally, the DLDM ranking strategy outperforms both baselines on average. Finally, in 9 of the 24 pairwise comparisons (including all 8 across the social media tasks) the performance of depth-based ranking strategies is statistically significantly better than baseline approaches. We hope that these newly-obtained results using full evaluation datasets demonstrate the usefulness of TTE depth in the ICL prompt creation task. We will add these new results to Section 5 of the paper.\n \nWe believe that this evaluation, in addition to the theoretical introduction to TTE depth and the evaluation of TTE depth as an inference method described in our paper, are sound contributions to corpus-level distributional inference and modeling in NLP.\n\n> **Q2:** Line 340, “computing” looks like an excessive word. Line 395 is missing a comma. Line 528, “the median” should be changed to “the median of.”\n\n**A2:** Thank you for your attention to detail. We will fix these typos in the next iteration of our paper. \n\n# References\n[1] McNemar, Q. 1947. Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2): 153–157.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "1. The paper is well-written and the research topic is interesting. The proposed method along with its associated python package can be a valuable contribution to the community.\n2. The experiments yield positive results on the two evaluation tasks.", "reasons_to_reject": "1. The evaluation on the prompt creation task is limited. By using the ChatGPT API, a larger evaluation set should be obtained quickly without significant cost.", "questions_to_authors": "", "paper_topic_and_main_contributions": "The authors propose transformer-based text embedding (TTE) depth, and illustrate the use of this statistical depth on NLP tasks including in-context learning prompt creation and difference measurement between human-written and machine-generated text. The performance of TTE depth shows small improvement over baselines.", "excitement": 4, "reproducibility": 4, "ethical_concerns": "No", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"Typos_Grammar_Style_and_Presentation_Improvements": "Line 340, “computing” looks like an excessive word. Line 395 is missing a comma. Line 528, “the median” should be changed to “the median of.”"}, "extra_text": {}}, {"review_id": "yqwchQcXkr", "reviewer": "Reviewer_cygC", "summary": "", "questions": "1. what Z means in the Eq (1)? is it normal distribution?\n2. How can the proposed approach prevent noisy data (junk data) being selected from the corpus?", "limitations": "", "rating": 3, "confidence": 3, "soundness": 3, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# Summary\nWe thank the reviewer for their thoughtful review and perspective. We are encouraged that the reviewer recognizes the importance of understanding corpus-level distributions in transformer-based embedding space. We appreciate the reviewer’s feedback on the applicability of TTE depth, our evaluation of TTE depth for the ICL prompt creation task, and our paper’s presentation. We answer specific questions and feedback below.\n\n# Questions\n> **Q1:** Additionally, I have concerns regarding the proposed approach's applicability, as it seems to be suitable mainly for well-constructed benchmark datasets with minimal noisy (junk) data. In real-world datasets, which typically contain a significant amount of noisy data, there is a high probability that the proposed approach may inadvertently select and prioritize such noisy instances.\n\n> How can the proposed approach prevent noisy data (junk data) being selected from the corpus?\n\n**A1:** We appreciate your perspective on this matter. However, we might have different interpretations. We want to share additional details that might shed light on our point of view.\n\nTTE depth is a method designed for the task of filtering noisy texts and finding representative samples from large corpora. By the definition of the angular distance-based TTE depth function described in our work, texts with the highest TTE depth values are the most representative of their corpus in embedding space and those which have the lowest TTE depth values are the least representative. Unless the majority of texts within a given corpus are “noisy,” in which case the corpus is likely unsuitable for many NLP tasks, TTE depth will not highly rank noisy texts within a corpus. On the contrary, TTE depth is designed to separate noisy texts from the majority text distribution. \n\nWe also argue that our evaluation of TTE depth as a ranking strategy for ICL prompt creation highlights the applicability of TTE depth in noisy corpora. Social media corpora, such as the offensive tweet detection (TOFF) and hate speech tweet detection (THATE) tasks we used for evaluation, contain more noisy texts as shown in [1]. TTE depth as a ranking strategy leads to statistically-significant, increased performance on downstream ICL classification tasks on both of these corpora. \n\nIn addition to the two social media datasets used in our ICL prompt creation evaluation, we argue that the COLA benchmark dataset is suitable for evaluating the applicability of the TTE depth ranking strategy on noisy data. The Corpus Of Linguistic Acceptability (COLA) dataset presents a binary classification task, to determine whether a given sentence is linguistically acceptable (1) or not (0). [2] 30% of sentences in this corpus are labeled as not linguistically acceptable, meaning the dataset contains a significant amount of noisy data. The TTE depth ranking strategy is able to produce representative texts from this corpus which, when used for ICL classification, produce better results than baselines. We believe that our modeling evaluation using this dataset, in addition to the social media datasets, highlights the applicability of TTE depth on noisy data.\n\nAdditionally, our results show that TTE depth, in conjunction with the Wilcoxon rank sum test, is able to effectively distinguish human-written texts from synthetic texts. While not a direct application of finding noisy texts in a corpus, we argue that it is highly correlated. In theory and in evaluation, our work shows that TTE depth is effective in the task of filtering noisy texts from large corpora. We leave evaluation of determining the _sensitivity_ of TTE depth to noisy data to future work given the page limit.\n\n> **Q2:** The claimed performance gain in Table 1 is relatively small over the baselines.\n\n**A2:** We appreciate the reviewer’s feedback on the evaluation of the ICL prompt creation use case of TTE depth. To address this feedback, during the rebuttal period we have obtained new results using the full evaluation datasets, as opposed to samples of each evaluation dataset, for each of the 6 text classification tasks described in Section 4.2 of our paper. Additionally, we have statistically analyzed these new results using McNemar’s test [3]. As a reminder for the reviewer, we compare two TTE depth-based ranking strategies, depth-first (DEEP) and depth-first with label distribution matching (DLDM) against two baselines, random (RAND) and label distribution matching (LDM). We report average F1 scores on ICL classification using 5, 8, and 11 samples selected using each ranking strategy. For each of the depth-based strategies, we report whether the results were statistically significantly better than each of the baseline strategies (p < 0.05) using the signifier (Y/N) for whether the results were significantly better than the RAND and LDM baselines, respectively. Results are presented in the table below.\n\n|  Task |   RAND   |     LDM    |             DEEP            |             DLDM            |\n|:-----:|:--------:|:----------:|:---------------------------:|:---------------------------:|\n|       |    F1    |     F1     | F1 (Sig vs RAND/Sig vs LDM) | F1 (Sig vs RAND/Sig vs LDM) |\n| COLA  |  0.8164  |   0.8094   |         0.8166 (N/N)        |     **0.8220** (N/**Y**)    |\n| MRPC  |  0.7166  |   0.7250   |       **0.7334** (N/N)      |         0.6841 (N/N)        |\n| SST2  |  0.9486  |   0.9514   |       **0.9518** (N/N)      |         0.9414 (N/N)        |\n| RTE   |  0.6366  | **0.7352** |         0.4413 (N/N)        |         0.7258 (N/N)        |\n| THATE |  0.6039  |   0.6629   |   **0.7072** (**Y**/**Y**)  |     0.7009 (**Y**/**Y**)    |\n| TOFF  |  0.7361  |   0.7189   |   **0.7461** (**Y**/**Y**)  |     0.7411 (**Y**/**Y**)    |\n| _AVG_ | _0.7431_ |  _0.7671_  |           _0.7332_          |         **_0.7692_**        |\n\nWe highlight that TTE depth-based ranking strategies select better samples for downstream ICL classification performance on 5 of the 6 full evaluation datasets. Additionally, the DLDM ranking strategy outperforms both baselines on average. Finally, in 9 of the 24 pairwise comparisons (including all 8 across the 2 noisy social media tasks) the performance of depth-based ranking strategies is statistically significantly better than baseline approaches. We hope that these newly-obtained results using full evaluation datasets, in addition to the statistical significance testing, demonstrate the usefulness of TTE depth in the ICL prompt creation task. We will add these new results to Section 5 of the paper. \n\nWe believe that this evaluation, in addition to the theoretical introduction to TTE depth and the evaluation of TTE depth as an inference method described in our paper, are sound contributions to corpus-level distributional inference and modeling in NLP.\n\n> **Q3:** The organization of the paper could be improved. Section 4, which is mainly about the experiments, could be merged into Section 5.\n\n**A3:** Thanks for the insightful comments! We will definitely reconsider the organization of the draft. \n\n> **Q4:** Furthermore, Section 3 needs refinement to provide a clearer understanding for readers. Some notations, such as \"Z\" in Eq (1), lack their definitions, which might cause confusion and hinder comprehension.\n\n> what Z means in the Eq (1)? is it normal distribution?\n\n**A4:** We agree that Z was probably not the best choice to represent a random variable in a statistics-related paper. As described after the definition of Eq (1), “EF is the expectation under the assumption that Z has distribution F,” meaning that Z simply represents the realized values of the distribution of F, i.e. the term EF[δ(x, Z)] represents the expected distance from the embedded text x to all other embedded texts in F. Should the paper be accepted, we will change the variable name and add a few points of clarification to Section 3 to provide a clearer understanding for the readers.\n\n# Conclusion/References\nThank you for your thoughtful review and comments. We hope this response satisfies your concerns, please let us know if you have any other questions!\n\n[1] Baldwin, Timothy, et al. \"How noisy social media text, how diffrnt social media sources?.\" Proceedings of the sixth international joint conference on natural language processing. 2013.\n\n[2] Warstadt, Alex, Amanpreet Singh, and Samuel R. Bowman. \"Neural network acceptability judgments.\" Transactions of the Association for Computational Linguistics 7 (2019): 625-641.\n\n[3] McNemar, Q. 1947. Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2): 153–157.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "- Motivation\n\nThis paper addresses the importance of understanding corpus level distributions and their correlations on the downstream tasks.", "reasons_to_reject": "- Evaluation\n\nThe claimed performance gain in Table 1 is relatively small over the baselines. Additionally, I have concerns regarding the proposed approach's applicability, as it seems to be suitable mainly for well-constructed benchmark datasets with minimal noisy (junk) data. In real-world datasets, which typically contain a significant amount of noisy data, there is a high probability that the proposed approach may inadvertently select and prioritize such noisy instances.\n\n\n- Presentation\n\nThe organization of the paper could be improved. Section 4, which is mainly about the experiments, could be merged into Section 5. Furthermore, Section 3 needs refinement to provide a clearer understanding for readers. Some notations, such as \"Z\" in Eq (1), lack their definitions, which might cause confusion and hinder comprehension.", "questions_to_authors": "1. what Z means in the Eq (1)? is it normal distribution?\n2. How can the proposed approach prevent noisy data (junk data) being selected from the corpus?", "paper_topic_and_main_contributions": "This paper introduces a novel method for computing distributions of a corpus using transformer embeddings. It extends the concept of statistical depth, which originally maps objects into a distributional space based on surface form information, into the embedding space. The authors employ distance functions, like cosine similarity, to implement their approach. Through their experiments, they demonstrate that sampling with their proposed method outperforms baseline samplings.\n\nThe main contributions of this paper is highlighting the importance of statistical depth and its expansion to the embedding space, and its implementation.", "excitement": 3, "reproducibility": 4, "ethical_concerns": "No", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: The authors propose transformer-based text embedding (TTE) depth, and illustrate the use of this statistical depth on NLP tasks including in-context learning prompt creation and difference measurement between human-written and machine-generated text. The performance of TTE depth shows small improvement over baselines.

While the reviewers were happy with the methdology, the impression from the evaluation results were mixed. The response was able to allviate only some of the concerns.
Decision: Accept-Main