SlowGuess/NeurIPS_2023_OCR huggingface dataset:
For our setup, we create two equal clusters of data of 500 points each,  $C_1$  and  $C_2$ , in  $\mathbb{R}^2$ . We assign labels to the points in each cluster i.i.d. according to a probability  $p$ , where  $\operatorname*{Pr}(y = 1 | x \in C_1) = p$  and  $\operatorname*{Pr}(y = 1 | x \in C_2) = 1 - p$ . When  $p = 0.5$ , both the clusters have a uniform label distribution (non-smooth) while  $p = 1$  ensures each cluster has one class (smooth). We set  $k = 20$ ,  $\tau_{+} = P(\lambda_i = 1)$  and  $\tau_{-} = P(\lambda_i = -1)$ .
Improvement over weak supervision. We show that EMBROID offers improvement over methods that only use  $\lambda$ . We fix  $p = 0.8$  and  $\beta_{i} = \operatorname{Pr}(\lambda_{i} = y) = 0.6$  for each  $i \in [m]$ . We compare EMBROID against the standard weak supervision approach from [14], which requires  $m \geq 3$ , in Figure 4a.
Smoothness. EMBROID's performance depends on the smoothness of the embedding as defined in eq. (4). We consider one LM prediction  $m = 1$  and vary the smoothness  $p$  from 0.5 to 1.0 and generate predictions using  $\beta_{i} = 0.6$ . Figure 4b exhibits that EMBROID's accuracy is positively correlated with the embedding smoothness.
Base prediction accuracy. Finally, we show that EMBROID's performance depends on the base prediction accuracy,  $\beta_{i}$ . We consider  $m = 1$  and set  $p = 0$ ,  $\beta_{i} = 0.8$ . We use a parameter  $\rho$  to denote the probability that  $\lambda_{i}$  is incorrect on points in cluster  $C_1$ . As  $\rho$  varies from 0 to 1, the predictions of  $\lambda_{i}$  become biased towards 1 and effectively reduces  $\beta_{i}$  to 0.5. In Figure 4c, we observe that as the base prediction accuracy decreases, EMBROID's performance decreases and eventually goes below the base LM performance.
(b)
Figure 4: Synthetic experiments. (a) Comparison of EMBROID to weak supervision by varying number of LLM sources. Increasing sources consistently improves both EMBROID and WS and the gains remain constant. (b) EMBROID's performance as embedding smoothness (eq. (4)) varies. EMBROID's accuracy linearly improves as a function of embedding smoothness. (c) EMBROID's performance with varying probability of LLM being incorrect in  $C_1$ . As the LM becomes incorrect, the cluster becomes less homogeneous and this degrades EMBROID's performance.
G Ablation
We perform additional ablations of EMBROID. We focus on two aspects:
The role of  $\tau^{-} / \tau^{+}$
- The impact of weak supervision in combining  $\lambda_{\mathrm{sm},j}$ .
G.1 Ablation over  $\tau$
In our experiments, we set  $\tau_{i}^{+} = \tau_{i}^{-} = \mathbb{E}[\lambda_{i}]$ , or the average vote of source  $\lambda_{i}$ . This has the following effect on the neighborhood vote  $\lambda_{\mathrm{sm},j}[i]$  for source  $\lambda_{i}$  under  $E_{j}$ :
- When the average vote for a source  $\lambda_{i}$  in a neighborhood under  $E_{j}$  for  $x$  is more negative than the average overall vote for a source, then  $\lambda_{\mathrm{sm},j}[i](x) = -1$ .
Figure 5: We analyze how F1 changes for different settings of  $\tau_{i}^{+} / \tau_{i}^{-}$  for GPT-JT on a task. Observe that setting  $\tau_{i}^{+} = \tau_{i}^{-} = \mathbb{E}[\lambda_{i}]$  (denoted as the orange triangle) produces close-to-optimal performance.
LM	Base prompt	Majority vote aggregation	EMBROID
j1-jumbo	0.498	0.569	0.604
openai_text-davinci-003	0.806	0.844	0.855
bloom-7b1	54.7	61.2	64.7
opt-6.7b	48.2	56.1	59.8
GPT-JT-6B-v1	67.8	73.2	75.1
Table 8: We evaluate how EMBROID compares to a majority vote aggregation over neighborhood vote vectors. We report macro-F1 average across all tasks and prompts, mirroring results in Table 1.
- When the average vote for a source  $\lambda_{i}$  in a neighborhood under  $E_{j}$  for  $x$  is more positive than the average overall vote for a source, then  $\lambda_{\mathrm{sm},j}[i](x) = 1$ .
In general, we find that this setting provides good performance, while requiring no additional tuning or validation. For example, the Figure 5 below compares a setting of  $\tau_{i}^{+} / \tau_{i}^{-}$  against the F1 score for GPT-JT on ag_news-business.
G.2 Role of weak supervision aggregation
We quantify the extent to which performance gains are derived from (1) the computation of  $\lambda_{\mathrm{sm}}$  as opposed to (2) the use weak-supervision [14] to combine  $\lambda_{\mathrm{sm}}$  and  $\lambda$ . Specifically, we replace Equation 3 with a simple majority vote classifier which combines the original prediction with the computed neighborhood votes.
G.3 Choice of embeddings
We provide additional discussion on how practitioners may go about choosing embeddings for EMBROID. At the outset, we note that selecting/evaluating embeddings is particularly difficult in our regime, where practitioners do not have access to labeled data. Importantly, this motivates Embroid's "mixture of embeddings" approach. Previous methods (e.g., Liger [7]) operate on only a single embedding space. Thus, practitioners must be certain that the embedding space chosen is good for a task, and a poorly chosen embedding space will reduce performance. Because EMBROID ensembles different embedding spaces, practitioners can be less certain in the quality of any individual embedding space.
A natural strategy may be to start with an initial large set of candidate embeddings, and drop embeddings according to task-specific measurements (akin to feature selection). Several criteria may be used to determine which embeddings to maintain:
- Looking at the MLM loss of the embedding model (e.g. BERT) on the task data. Prior literature on domain specificity has suggested that this may be a promising heuristic [71].
- Looking to the performance of embedding models on other related tasks may also be helpful [38, 71].
- Looking at the extent to which a potential embedding space generates embeddings which are geometrically similar to embeddings already included in Embroid. If the embedding space is similar, then the additional value of incorporation is low.
The number of embeddings used presents a bias-variance tradeoff. Under Proposition 5.1, increasing the number of embedding spaces (1) increases the variance due to estimation error, but lowers (2) the conditional entropy of  $H(y|\lambda)$ . Precisely characterizing this tradeoff is challenging because the variance is an upper bound, and  $H(y|\lambda)$  can only be estimated. However, these bounds/estimates can be used to derive heuristic stopping rules: for instance, add embedding spaces until the marginal decrease in the conditional entropy is less than the upper bound on the marginal increase in variance.
H Experiments
H.1 Implementation details
Compute Inference for API-access models (e.g., GPT-3.5 and J1-Jumbo) were run using the HELM API [38]. Inference for open source models (OPT, GPT-JT, and Bloom) were run using the Manifest library [49] on 40GB A100 NVIDIA GPU machines.
Hyperparameters EMBROID was run with  $k = 10$ ,  $\tau_{i}^{+} = P(\lambda_{i} = 1)$ , and  $\tau_{i}^{-} = P(\lambda_{i} = -1)$ .
H.2 Space demand
We provide additional information on the space requirements for EMBROID. First, we clarify that EMBROID requires only one large model. This model can be on the order of GPT-3 (176B parameters), or a much smaller open-source equivalent like GPT-JT (7B parameters). Next, EMBROID requires embeddings from 2-3 additional models. However, as our results show, these models can be relatively small. For instance, we rely on BERT-base and SentenceBERT models—both of which are approximately 110 million parameters. Finally, the latent variable graphical model has 2 parameters for class prior and  $1 + N$  parameters per LLM prediction, where  $N$  is the number of embedding spaces. So, when EMBROID is run on a single LLM's predictions with two embedding spaces, the total number of parameters is  $2 + (1 + 2)^{*}1 = 5$ .
H.3 Runtime
In terms of time complexity, we observe that computing LLM predictions is the largest bottleneck. On a dataset of 1800 samples for instance:
- Computing predictions on GPT-3.5 takes 1440 seconds (24 minutes).
- Computing embeddings using BERT takes 5 seconds.
- Computing nearest-neighbors using the (unoptimized) scikit-learn library takes 3 seconds.
- Solving the Embroid graphical model takes less than a second.
API-model tasks Due to cost constraints, we study the API access models (GPT-3.5 and J1-Jumbo) on a subset of tasks. These are:
- ag_news_world
- ag_news_sports
dbpedia_educational institution
- dbpedia ATHletechemprot_regulator
- chemprot_upregulator
- rct_objective
- rct_methods
- CUAD_Audit Rights
- CUAD_Non-Compete
- learnedHands_HE
- learnedHands_HO
- few(rel_architect
- few.Rel_league
H.4 Robustness across models
We provide the results for each LM on each task as CSV files in the supplemental attachment. We visualize the improvements in Table 1 below, by plotting the original prompt performance on the x-axis, and the performance after EMBROID on the y-axis (Figure 6).
Prompt F1
Figure 6: We visualize the improvement from EMBROID over the base prompt for each model's tasks. All models except for gpt-neo-1.3B were run thrice per task, with each run using different in-context samples for the prompt. Each dot corresponds to a task. The x-axis measures the average macro F1 of the base prompt, and the y-axis measures the average macro F1 of EMBROID (across all runs). Because GPT-3.5 and J1-Jumbo are studied on a subset of 12 tasks, there are fewer dots in the plot.
H.5 Comparison to AMA
We visualize the improvements in Table 2 below, by plotting the performance of AMA on the x-axis, and the performance of EMBROID-3 on the y-axis (Figure 7).
H.6 Chain-of-thought experiments
We compare EMBROID to chain-of-thought (CoT) [64] on the following tasks:
- ag_news.business
- ag_news_sports
- CUAD_Affiliate License-Licensee
- CUAD_Audit Rights
- dbpedia_album
- dbpedia_building
- few(rel_architect
- few.Rel_country
- learnedHands_HO
- learnedHands_MO
Figure 7: We visualize the improvement from EMBROID over AMA [2] for each model's tasks. Each dot corresponds to a task. The x-axis measures the average macro F1 of AMA, and the y-axis measures the average macro F1 of EMBROID. Because GPT-3.5 and J1-Jumbo are studied on a subset of 12 tasks, there are fewer dots in the plot.
We manually write logical chains for each prompt. Because CoT primarily succeeds on "large" models [64], we focus our experiments on GPT-3.5.
H.7 Comparison to GPT-4
GPT-4 [48] was made publicly available after this work was completed. Nonetheless, we offer preliminary results evaluating EMBROID on predictions produced by GPT-4. We evaluated EMBROIDEmbroid+GPT-4 on a subset of 14 tasks. These are:
- ag_news_world
- ag_news_sports
dbpedia_educational institution
- dbpedia ATHletechemprot_regulator
- chemprot_upregulator
- rct_objective
- rct_methods
- CUAD_Audit Rights
- CUAD_Non-Compete
- learnedHands_HE
- learnedHands_HO
- few(rel_architect
- few.Rel_league
We note that overall, GPT-4 appears to saturate our evaluated tasks, scoring greater than  $95\%$  on 5 of them. Given that we evaluate on publicly accessible benchmarks, this could be explained by leakage into GPT-4's pre-training data. We find that EMBROID is strictly better than the base prompt on  $42\%$  of tasks, and effectively equivalent or better (i.e., no worse than 1 point F1) on  $73\%$  of tasks. On two tasks Embroid improves by  $4+$  points.
Though EMBROID's absolute gains over base prompts may diminish for stronger base LMs like GPT-4, our evaluation and findings focused on open-source models because of their practical feasibility. Such models are cheaper and better suited for sensitive domains, as they allow data to remain on-premises. This is a particularly salient concern for applications in medicine, law, or government. On these models, we found that EMBROID offered substantial gains, with a win-rate  $>88\%$  and an average improvement  $>7$  points F1.
H.8 Comparison to self-consistency
We evaluate EMBROID against self-consistency [63] over GPT-3.5, and find that (1) it can provide competitive performance to self-consistency, and (2) that it can improve predictions generated from self-consistency.
We study a subset of five tasks: ag_news.business, CUAD_Audit Rights, dbpedia_album, few_REL_architect, learned_hands_HO. For self-consistency, we generate 5 predictions per sample, using a temperature of 0.7. For each task, we consider a "base" prompt which does not use chain-of-thought, but otherwise uses the same task instructions and in-context demonstrations. For 4/5 tasks, EMBROID applied to the output of the base prompt outperforms self-consistency. On all tasks, EMBROID applied to the predictions generated from self-consistency improve performance, by a median of six points.
We additionally note one important distinction between self-consistency and EMBROID. While self-consistency requires multiple predictions from a LM for a single sample (thus accruing additional cost in hardware usage or API calls), Embroid requires only one prediction per-sample.
H.9 Multi-class experiments
We present initial results evaluating EMBROID in the multi-class setting. We create a multiclass version of the contract classification task by combining five different binary classification datasets: CUAD_Audit right, CUAD_Governing law, CUAD_Non-compete, CUAD_Volume restriction, and CUAD_Expiration date. The total size of this dataset is 1858, with the largest class (602 samples) occurring nearly  $3.5\mathrm{x}$  as much as the smallest class (165 samples).
We evaluate a one-vs-all version of EMBROID, where EMBROID is applied five times—each time predicting one of the classes. A final class prediction is generated by comparing each of the class-specific EMBROID classifier's predicted probability for the class, and choosing the class with the highest probability. Overall, we find that this variant of EMBROID improves the quality of the base prompt (by 4 points on balanced-accuracy and 1.6 points on macro-F1).