Probing the Decision Boundaries of In-context Learning in Large Language Models
Authors: Siyan Zhao
Tung Nguyen
Aditya Grover
Venue: NeurIPS 2024 poster (2024)
Keywords: in-context learning; Large language models; LLM decision boundary
Primary area: natural_language_processing

Abstract: In-context learning is an emergent paradigm in large language models (LLMs) that enables them to generalize to new tasks and domains by simply prompting these models with a few exemplars without explicit parameter updates. Many attempts have been made to understand in-context learning in LLMs as a function of model scale, pretraining data, and other factors. In this work, we propose a new mechanism to probe and understand in-context learning from the lens of decision boundaries for in-context binary classification. Decision boundaries are straightforward to visualize and provide important information about the qualitative behavior of the inductive biases of standard classifiers. To our surprise, we find that the decision boundaries learned by current LLMs in simple binary classification tasks are often irregularly non-smooth, regardless of task linearity. This paper investigates the factors influencing these decision boundaries and explores methods to enhance their generalizability. We assess various approaches, including training-free and fine-tuning methods for LLMs, the impact of model architecture, and the effectiveness of active prompting techniques for smoothing decision boundaries in a data-efficient manner. Our findings provide a deeper understanding of in-context learning dynamics and offer practical improvements for enhancing robustness and generalizability of in-context learning.

Probing the Decision Boundaries of In-context Learning in Large Language Models
Siyan Zhao, Tung Nguyen, Aditya Grover Department of Computer Science University of California Los Angeles {siyanz, tungnd, adityaghecs ucla.edu
Abstract
In-context learning is key paradigm in large language models (LLMs) that enables them to generalize to new tasks and domains by simply prompting these models with few exemplars without explicit parameter updates. Many attempts have been made to understand in-context learning in LLMS as a function of model scale, pretraining data, and other factors. In this work, we propose new mechanism to probe and understand in-context learning from the lens of decision boundaries for in-context binary classification. Decision boundaries are straightforward visualize and provide important information about the qualitative behavior of the inductive biases of standard classifiers. To surprise, find that the decision boundaries learned by current LLMs in simple binary classification tasks are often irregular and non-smooth, regardless of linear separability in the underlying task. This paper investigates the factors influencing these decision boundaries and explores methods enhance their generalizability. We assess various approaches, including training- training-free and fine-tuning methods for LLMs, the impact of model architecture, and the effectiveness of active prompting techniques for smoothing decision boundaries in a data-efficient manner. Our findings provide deeper understanding of in-context learning dynamics and offer practical improvements for enhancing robustness and generalizability of in-context learning
Introduction
Recent language models, such as GPT-3+ [Brown et 2020 Achiam et al. 2023 have demonstrated
the ability to scale performance with increased training dataset size and model capacity through the simple objective of next token prediction [Kaplan et 2020). A key emergent behavior of models is in-context learning, which allows the model to learn tasks by
these transformer-basee conditioning on a sequence of demonstrations without explicit training [Wei et al. 2022 This unique capability allows LLMs to adapt seamlessly to new tasks, often achieving superior performance in few-shot settings [Brown al., 22200) Despite significant successes, the underlying mechanisms of how in-context learning works remain partially understood.
Recent attempts understand in-context learning have focused various aspects. From theoretical standpoint, studies by Von Oswald et al. (023) and Dai et al. (2033) have linked the mechanisms of in-context learning to gradient descent, suggesting that transformers can emulate optimization processes. On the practical side, research has investigated the impact of different factors on in-context
learning. Works by Min al. (2022b] and et [2023] reveal that accurate demonstrations are essential for effective in-context learning. On the other hand, factors such as the prompt structure and model size (Wei et al. 2023 Webson and Pavlick 2022). or the order of in-context examples [Chen et al.
2024 greatly affect outcomes. More recently, with the development of LLMs supporting longer
OOur code is released
38th Conference on Neural Information Processing Systems (NcurIPS 2024).

---

Class 1 lin-Context/training Examples)
Class (Model Prediction)
Class 2 (in Contex///rringg Examples)
Class (Model Prediction)
Decision Tree
MLP
K-NN
SVM (RBF Kernel)
LLama-3-88
GPT-4o
Feature
Foollur
Festure
Feature
Festure2
Featuree
93
27
60
40
Feature
Feature 1
Facture
Feature
Feeture
Festure
Figure Decision boundaries of LLMs and traditional machine learning models on linearly separable binary classification task. The background colors represent the model's 's predictions. while the points represent the in-context or training examples. LLMs exhibit non-smooth decision boundaries compared to the classical models. See Appendix E for model hyperparameters.
context lengths up to 10M [Reid et al. 2024 studies have shown that in-context learning performance improves with significant number of demonstrations [Agarwal et al. [024 Bertsch et al.) [2024), where the performance can be comparable to fine-tuning on the same amount of demonstrations. Additionally, works by Garr et al. [2022]. Nguyen and Grover [2022] have demonstrated that small transformers trained from scratch can learn unseen function classes in-context from examples.
In contrast to existing approaches, our study introduces a fresh perspective by viewing in-context learning in large language models (LLMs) as a unique machine learning algorithm. This conceptual framework enables us to leverage a classical tool from machine learning analyzing decision boundaries in binary classification tasks. By visualizing these decision boundaries, both in linear and non-linear contexts, we gain invaluable insights into the performance and behavior of in-context learning. This method allows us to probe the inductive biases and generalization capabilities of LLMs and offers unique assessment of the robustness of their in-context learning performance. Consequently, this approach provides comprehensive means to qualitatively analyze the underlying mechanisms that govern in-context learning and suggest ways to improve its performance in LLMs.
To our surprise, found that the recent L.MSs struggle provide smooth decision boundaries in all the classification tasks we considered, regardless of the model size, the number and ordering of in-context examples, and semantics of the label format. This issue persists even for simple binary linear classification tasks, where classical methods such as SVM can easily achieve smooth boundaries with fewer examples as shown in Figure [T] This observation raises questions about the factors that influence the decision boundaries of LLMss. To explore this, we experimented with series of apen-souree LLMs including Llama2-7b. Llama2- 13b, Llama3-8b [Touvron al.) [003). Mistral-7b 7b [Jiang et al. 2203],, pruned Llama2- 1.3b [Xia et al.] 2023). as well as state-of satte-of-the-rre the-art closed-source LLMS GPT-40 and GPT-3-Turbo [Brown et al. 2020]] We then explore methods to smooth the decision boundary, including fine-tuning and adaptive prompting strategies. Our work provides valuable practical insights for understanding and improving in-context learning in LLMSs through a new perspective. Our contributions can be summarized follows:
We introduce novel mechanism to probe and understand in-context learning in LLMs by visualizing and analyzing the decision boundaries on classification tasks.
We demonstrate that of-te-of-the-ar LLMs exhibit smothh, irregular decision boundaries even on simple linearly separable tasks, unlike classical ML models.
We study the influence of various factors impacting decision boundary smoothness, including model size, pretraining data and objectives, number of in-context examples, quantization levels,
label semantics, and order of examples.
We identify methods to improve the smoothness of L.LM decision boundaries, such as fine-tuning earlier layers, fine-tuning on synthetic tasks and eecertainty-wwar active learning.
Background
2.1 Training Large Language Models
Large Language Models (L..Ms) are trained on vast corpora of text using unsupervised learning. During training, these models learn to predict the next token in a sequence. Given sequence

---

of tokens (2.,, the model predicts the next token by maximizing the likelihood P(z P2 (, The training objective typically involves minimizing the cross-entropy loss:
N
T. log 22,
L L=
22 22... Fz-1)
where T; is the number tokens in the i-th sequence and N is the total number of sequences in the corpus. During training, teacher forcing is often employed, where the model receives the ground truth token I2 as input at each time step instead of its own prediction, enabling parallel training.
2.2 In-Context Learning in LLMs
After training, LLMs can generalize to new tasks through mechanism known as in-context learning. Let S = {(x1, ,, 3/ ), (X2, 3/2),..., (Xp; }o)} represent the set n input-output pairs provided as
examples in the prompt. where x; is imput and ys is the corresponding output. Given new input Xnow. the LLM is turned into a task-specific model that predicts the output Inew by conditioning on the given examples: P(hnew Xaew {(11 (1x119))....) 31), (x2, 32), ..... (Xn, }r))). In-context learning allows the LLM to perform tasks by leveraging the context provided by these examples, thereby inferring the task and generating appropriate responses for new inputs. This approach utilizes the model's ability
to recognize patterns and apply learned knowledge without additional training or fine-tuning.
3 Methodology
We aim better understand in-context learning in Large Language Models by investigating their decision boundaries on a series of binary classification tasks. To increase the generality of our framework, we evaluate several existing LLMs on different task distributions under different settings. We present the general framework here, and refer to Section 4 for specific experiment settings.
3.1 In-Context Classification
Consider K-class classification task with data distribution Pdata (x, y). where x is the input feature and y E {I....,
".....,K K) is the class label. To construct an in-context prompt, we sample n examples (xi, yi) Pdata for
.,...,9 n. Given new test point Xest. in-context learning constructs prompt P (X1,911 .1...... Xn, Nn Xws) by concatenating the n sampled examples and the test point. The prompt is then fed the LLM π, which predicts a class ğ for X
We prompt the LLM with P and obtain its prediction for Xest by choosing the most likely class in the next token distribution. Formally, let V denote the size of the LLM's vocabulary, and 1 IR. be the vector of logit values for each the tokens. To obtain a class prediction, we convert each class label into unique token id, say e(i) and choose the class with the maximum logit value the predicted label for Xquery, i.e., ÿ = arg max (1, KJ le(s)-
3.2 Decision Boundary Visualization
To visualize the decision boundary of a model π, we generate grid of points covering the feature space defined by the in-context examples set S. Let = {(x1, V1), (X2, U2)...., (X2, yk)} represent the set of in-context examples, and Xmin; Xmax E IRd denote the minimum and maximum values of the features in S along each dimension. We create uniform grid with G points along each dimension, resulting in a total of Gdd grid points. The grid points are denoted as Xgrid = {xquery Xquery E
[Xmin Xmax]* Xquery = Xmin + iAx E {0, 10.1...., G - 1}} where Ax G-I - Xmin) is the grid spacing along each dimension. Each point Xquery Xgrid is query input, and the model prompted with the sequence (x1, V..... XR, Uk. Xquery) ) to predict the corresponding class label ÿ. The decision boundary is then visualized by plotting the predicted labels á over the grid Xgria-
3

---

Experiments
In this section, we examine existing LLMs through the lens of decision boundaries by conducting a series of binary classification tasks under varying conditions. Our experiments aim address the following key questions:
How existing pretrained LLMs perform on binary classification tasks? 4.1
How do different factors influence the decision boundaries of these models?
How can improve the smoothness of decision boundaries?
Classification Tasks. We investigate the decision boundary of LLMs by prompting them with in-context examples of binary classification tasks, with an equal number of examples for each class. We generate classification datasets using scikit-lears [Pedregosa et al., 2011], creating three types of linear and non-linear classification tasks: linear, circle, and moon, each describing different shapes of ground-trurt truth decision boundaries. Detailed information on the dataset generation can be found in Appendix G addition the in-context examples, we calculate the in-context learning accuracy a held-out test set of size 100. We sample in-context examples and test points from classification task and convert them into prompt, with an example shown in Appendix F
Obtaining Decision Boundaries of Language Models. We study an extensive range of models, with sizes ranging from 1.3B to 13B parameters, including open-source models such as Llama2-7B. Llama3-8BB Llama2- 13B, fistral-7B-vO.1. and Saraardd-Llmaat state-of state-of-the-arr the-art closed-source LLMs, including GPT-4o and GPT-3.5-turb.. We generate the decision boundaries of the open-source models with 8-bit quantization due to computational constraints. We choose a grid size scale of 50 x 50, resulting 2500 queries for each decision boundary. For the open-source models, we use the approach described in 3.2 to get predictions. For the closed-source models, we use the next token generation as the prediction.
We also extend our analysis to
4.1 Non-Smooth Decision Boundaries of LLMs.
Figure compares the decision boundaries of 6 LLMs when provided with 128 in-context examples. Even on simple linearly separable classification problems, all of these models exhibit non-smooth decision boundaries. The decision boundaries vary significantly across models, indicating that these models have different reasoning abilities to interpret the same in-context data. All models show fragmented decision regions, which means small changes in the input features result in different classifications. This raises concerns about the reliability of LLMS and their practical deployment, as even when test accuracy for classification is high (shown in Figure 3 where accuracy increases with the number of context examples), the underlying decision boundary lacks generalization. We further demonstrate nonsmoothness in NLP text classification tasks by projecting text input into 2D space, as detailed in Appendix H In the following sections, we will explore factors that affect decision boundary smoothness and investigate methods to improve smoothness.
Class 1 ContCat Examples]
Cass (In-Context Examples)
Class 1 ILLM Prediction)
Class (LLM Prediction)
Sheared- Manarad-LLama-1.B
Mistral-78-vo.1
LLama-3-88
LLama-2-138
GPT-3.5-turba
GPT-40
Feature 2
Feakure 2
Feature
Frature
Feature
Fealure
Feature
Feature
Festure
Feature
Figure 2: Visualizations of decision boundaries for various LLMs, ranging in size from 1.3B to 13B, on linearly seperable binary classification task. The in-context data points are shown as scatter points and the colors indicate the label determined by each model. These decision boundaries are obtained using 128 in-context examples. The visualization highlights that the decision boundaries of these language models are not smooth.

---

Task: linear
Taskc circle
Task: moon
1127 Mambar h-contet Zeansles
312 Mamber Inicentant Exmmli
2321
Naroe Co
Test accuracy for LLMs and baselines across three classification tasks (linear, circle, and moon), with each subplot illustrating the test accuracy as the number of in-context examples increases. The baselines are the SVM with polynomial kernel and the MLP with two hidden layers. Shaded regions represent the standard eπror of the mean accuracy across 5 seeds.
Figure 3:
4.2 How Do Different Factors Influence the Decision Boundaries?
Impact of Model Size Decision Boundary and Accuracy From Figure model sizes increase from left to right, yet there is no clear correlation between model size and the smoothness of the decision boundary. Even the most powerful model, GPT-4o, demonstrates fragmented decision regions. This suggests that increasing model size alone is insufficient for improving decision boundary smoothness. However, shown in Figure 3 larger models tend to perform better in terms of test accuracy compared to smaller models, with Llama- 1.3B often performing the worst.
LLama-2-78
LLama-2-78
LLama-2-78
Llama-2-78 64 Examples
Llama-2-78
LLama-2-78 256 Examples
8 Examales
16 Examples
32 Examples
128 Examples
2osture2
Posture2
Featune
Fealure
Fealize
Feeture
Figure 4: Decision boundary of Llama2-7b with increasing in-context examples from 8 to 256.
OrderO
Order
Order
Order
Order
Poerure
Fature
Fsature
Figure 5: The sensitivity of the Llama3-8b model's decision boundary to the order of in-context examples. Each subplot (Order Order 4) shows the model's decision boundary with the same 32 examples shuffled differently.
Increasing In-Context Examples Does Not Guarantee Smoother Decision Boundaries While classification accuracies tend to improve with more in-context examples-and it's worth noting that Llama-3-8B and Mistral-7B's accuracy scales similarly the SVM and MLP Maselines-Figuee reveals that this does not translate to smoother decision boundaries. Despite the increase in accu- racy, the decision boundaries remain fragmented, indicating that merely providing more in-context examples is not sufficient for achieving smoother decision regions.
Figure illustrates the decision bound- aries of the LLaMA-2-7B model under different quantization levels Dettmers et al., 2022 When transitioning from 8-bit to 4-bit quantization, the red regions around the red in-context learning examples turn blue. This indicates that the reduced precision from 4-bit quantization significantly affects points near the decision boundary or areas where the model most uncertain. For further investigation, we plot the probability prediction for class (Figure 6b). The white regions, indicating a 50% probability for both classes, highlight the areas most impacted by quantization. Hence, varying quantization levels flip the LLM's decisions in the regions of highest uncertainty.
How Does Quantization Influence Decision Boundaries?
5

---

Bit Quantization
No Quantization
Predicted Probability
Festures
Feature
Feature
Festure
Teature
Teature 1
(a) Decision boundaries of Llama-2-7b with different quanti- zation choices on linearly seperable tsak.
(b) Prediction of probability of class I with 8-bit quantization.
Figure 6: Impact of quantization on Llama2-7-8b's decision boundaries and probability predictions.
Are Decision Boundaries Sensitive to the Prompt Format? Yes, decision boundaries are sensitive the labels' names, shown in Figure 7 Using semantically unrelated labels, such "Foo" and
"Bar" as suggested in [Wei et al. 2023]. results in flipped predictions compared to using reversed class names like "Bar" and "Foo". This suggests that the LLM's prediction still depend on its semantic prior knowledge of the labels.
10,
"Foo, Bar
"Bar, Roo"
*A, 8
"Positive, Negative" LLamm-2-78
"lss No Laama-2-70
Llmm--2-7
117mar2-78
Laama-2-70
LLama-2-7
Fosture
Essture
Saluyy 2
Feature
Feature
Fealure
Figure 7: The decision boundaries L.aama2-7B and LLLama3-8B, across various class labels. Each row corresponds to model, and each column represents a different class label, shown in quotes.
Are Decision Boundaries Sensitive to the Order of In-Context Learning Examples? Recent works have shown that LLMs are sensitive to the order of in-context examples [Chen et al. 2024 which can significantly influence downstream performance. Similarly, illustrated in Figure we demonstrate that the model's 's decision boundaries vary with different shuffles of the in-context examples, highlighting the sensitivity of the decision boundaries to the order of the examples.
4.3
How to Improve the Decision Boundary Smoothness?
Can We Finetune LLMs on the In-Context Examples to Achieve Smoother Decision Boundaries? Our experiments indicate that finetuning LLMs on in-context examples does not result in smoother decision boundaries. Specifically, we finetuned Llama3-8B on 128 in-context learning examples and found that the resulting decision boundaries remained non-smooth. Examples of the decision boundaries after finetuning are provided in Appendix B
Can We Finetune LLMs on a Dataset of Classification Tasks to Achieve Smoother Decision Boundaries? Previous works have shown that finetuning a pretrained L.LM on large collection of tasks improves its in-context learning performance unseen tasks [Min al.) [022a]] In this section, we investigate the same paradigm helps improve the decision boundary smoothness of LLMs. To do this, finetune pretrained Llama model Touvron et al., 2023 on set of 1000 binary classification tasks generated from scikit-lest -earn [Pedregosa et al. 2011], where the ground-truth decision boundary is either linear, circle-shaped, moon-shaped, with equal probabilities. For each task, we sample randomly N = 256 data points x ~ Xgrid and their corresponding label y's. We then sample the number of context points m (18 128), and finetune the LLM to predict Viom given Tizm and the preceding examples:
N
((T) E
Σ ii=++1
logp(1: 24, V1--1)
(2)
where the expectation is with respect to task, data points ((,, y:) 1 and the number of context points m. After training, evaluate the same finetuned model various binary classification tasks

---

with varying numbers of context points. To ensure the test tasks are unseen during training, we use different parameters in creating the datasets, such as the separateness between two classes and the scale between the inner and outer circles in the circle task. See Appendix Goor more details.
We consider several finetuning settings for ablation studies. 1) In the first setting, finetune the pretrained LLM using LoRA [Hu et al. [021]] and finetune the attention layers. 2) We finetune only the token embedding layer of LLM. 3) We finetune only the linear head layer of LLM. Then we consider modifying the architecture of the LLM: In this setting, we keep the core transformer backbone of the LLM frozen, attach randomly initialized embedding layers and prediction head the model, and train the entire model using objective (2). This stems from the intuition that task- -ppccifcc nnttern-matching capabilities of the transformer backbone for the new task. We refer to this model as CustomLLM, and consider its three variants, which add 1) a new embedding layer for x, 2) a new prediction head for y, and 3) new embedding layers for y. and a new prediction head for y. The embedding layers and prediction head are ML.ss with one hidden layer. We embed the raw numerical values instead of the text representation of z whenever new embeddding layer for is used (same for y), and predict directly the binary class values instead of text labels whenever the new prediction head is used. Results of Finetuning LLM and CustomLLM in Figure 8 and Figure show that finetuning the intermediate and earlier embedding layers leads to smoother decision boundary compared to finetuning the top prediction head.
embedding and prediction layers allow the model maximally utlize the general
Finetune LLM
Finetune LLM Embedding Layer
Finetune Attention Layers
Linear Head
Feature 2
Feature
u.
Feature
Feature 1
Feature
Figure 8: Decision boundary of Llama3-88 8B post finetuning the linear head, embedding layer and the attention layers. Finetuning the latter two layers improves the smoothness.
CustomLLM Prediction Head
CustomLLM
CustomLLM Input & Output
Input embed only
Fealure
Tecturg
Feekuuee
Feature
Feature
Figure 9: CustomLLM finetuning ablations. Decision boundary after finetuning the prediction head, input embedding layer and both layers for the Cus
Can LLMs finetuned on one in-context learning task generalize more complex in-context learning tasks? In this section, we further explore whether a LLM fine-tuned only on a linear task can achiever smoother decision boundaries on unseen and more complex tasks. As shown in Figure [To we compare the decision boundaries of Llama3-8b before and after SFT on the linear task only. Unexpectedly, we found it generalizes to unseen non-linear tasks as well as 3-class and 4-class classification tasks, despite only being trained on a binary linear task. The smoother decision boundaries observed in these unseen tasks suggest that fine-tuning on a synthetic in-context learning task can have downstream benefits for other tasks, enabling the model to be more robust in in-context learning.
Can we train a transformer from scratch to learn smooth decision boundary in-context? One may wonder whether a small transformer trained from scratch can provide smooth decision boundaries. To answer this, we train TNPs (Nguyen and Grover 2022) a transformer-base model specifically designed for in-context learning. For each sequence of data points ((T,, y/s 2 from a task C, TNPs leam to predict the query labels Vism given the query inputs 24>m and the context pairs, assuming
7

---

Proture
Polute
(a) Decision boundaries before SFT on linear data of Llama3-8b across 4 tasks.
R
Textur
Ftalune
Peature
(b) Decision boundaries after SFT on linear data Llama3 -8b across unseon tasks.
Figure 10: Generalization ability of Llama-3-8B after supervised fine-tuning single binary linear classification task. The first two columns show the model's performance on non non-linear classification tasks before and after fine-tuning, while the last columns demonstrate its ability to generalize 3-class and 4-class classification tasks.
conditional independence among the queries given the context:
N
(())= =
log Wit Flims Vl.m)
where the expectation is with respect task C, data points {(x; 36 1 and the number of context points m. TNPs employ a specialized mask to ensure the conditional independence assumption. We showed in Appendix D that transformers trained from sctrach can learn to in-context learn smooth decision boundary. Details are in Appendix D
How to Use Uncertainty-aware Active Learning Learn Decision Boundaries We investigate whether the decision boundary can be smoothed by providing the LLM with labels of the most uncertain points on the grid as additional in-context examples. Uncertainty is measured as the entropy of the probability distribution of the two classes after softmax normalization of the logits. Our study focuses on an active learning scheme where new in-context examples are incrementally added based on the LLM's current uncertainty. Initially, we obtain the decision boundary conditioned on the existing in-context examples. refine this boundary, we query the LLM over a grid and select the top-k most uncertain points, ensuring they spatially distant from each other using greedy sampling approach. For labeling these uncertain points, we use a logistic regression model well-trained on larger dataset with perfect accuracy the ground truth decision boundary. As active sampling method results in a smoother decision
shown in Figure II this uncertainty-ave boundary over iterations compared random sampling. The iterative refinement enhances the model's generalization capabilities, leading to higher test set accuracies and greater sample efficiency, requiring fewer additional in-context examples achieve performance gains. These findings indicate that leveraging the LLM'' uncertainty measurements is valuable for selecting new in-context examples in resource-constrainne settings where labeled data is scarce. We show more examples in Appendix
5
Related Works
Understanding in-context learning in transformers and LLMs is an active area of research, with existing works approaching this problem from both theoretical and practical perspectives.
Theoretical understanding of in-context learning Recent works aim to establish a theoretical connection between in-context learning and gradient descent (GD). The pioneering work by Akyürek et al. proves transformers can implement learning algorithms for linear models based on GD and closed-form ridge regression by construction. Von Oswald al. (2023) proves the equivalence between linear self-attention and GD linear regression by construction. Similarly, Dai al.

---

Cleec Un-Cantect Fommlee)
Cass Jh-Coniist
[Mode Prediction
Caoo: (Modee Predicior)
32 stamples
66 szampies
26 acamples
120 asamples
360 examples
132 azampisa
224 acamplea
256 axamples
Featare
Feature
Poature
heaurr
(a) Decision boundaries with different numbers of context examples when using active sampling.
Examples)
Exampled)
Presiciont
22 nicmpples de dccurncy:
examplee
96 eccmppes Accurapp.oo 0.81
120 ncamplac Text Aecuracy 0.71
142 esamples Acceraoy:
22d ecamples
256 osamplex
Test coraacy 0.76
accuracy:
Accuracy
courncy: 0.75
feruee
Pealuee Uncertainty
Fodlurt
Fesurt Uncortainty
Netues Uncertaisty
Pesture
Fassre
Pesture
Uncartabrit
Uncertwasty
uncertairty
Uncertaitty
Uncertainty
Feetur
Teature
Feature
Tesure
Teature 1
Feature
Teature
Feature
Teature
(b) Decision boundaries with different numbers of context examples when using random sampling.
Figure 11: Comparison of active and random sampling methods. We plot the decision boundaries and uncertainty plot across different number of in-context examples from 32 to 256, where the in-context examples are gradually added to the prompt using active or random methods. Active sampling gives smoother decision boundary and the uncertain points lie on it. The test set accuracies is plotted in the titles.
2023 shows that attention in transformers has a dual form of GD and views transformers as meta- optimizers. Subsequent works extend these ideas characterize the global optimum of single-layer linear transformers. Ahn et al. [2024] observe that with the optimal parameters, the transformer implements single step of preconditioned gradient descent, while Zhang et al. [2023] shows that at the global optimum, the transformer achieves competitive prediction error with the best linear predictor on a new prediction task. In addition to theoretical connections GD, complementary direction aims to establish statistical complexity and generalization bounds of in-context learning
transformers [Bai al., 2024 Li et al., 2023b Wies al. 2024 Wu et al., 2023 The common limitation of these existing theoretical frameworks is the reliance on strong assumptions about the transformer architecture or the functional form of the in-context learning tasks which may not reflect real-world practices.
Practical understanding of in-context learning More relevant to paper is line of works focusing on understanding the practical aspects of in-context learning in LLMs. Many existing works investigate the roles of in-context examples and prompts. Min al. [2022b show surprising result that ground-truth demonstrations are not required for in-context learning, while other factors such as the label space, input text distribution, and overall sequence format play an important role. (Shi et al.) [2023] investigate the distractibility of LLMs and shows that their performance dramatically drops when irrelevant context included. Subsequently, /Wei et al. [2023) characterize these behaviors of LLMs with respect to model size, and show that larger language models perform in-context learning differently in the presence of flipped or semantically unrelated labels. [Webson and Pavlick 2022 argue against the current practice of prompt engineering, showing that intentionally irrelevant even pathologically misleading prompts achieve similar downstream performance to instructively good prompts. Orthogonally, Lampinen et al. (2022) find that including explanations in the in-context

---

examples significantly improves the few-shot performance of LLMs. Finally, given the expanded context windows of modern LLMs, recent works have explored in-context learning in the many-shot setting with hundreds or thousands of examples [Agarwal et al. 2024 Li et al. 2023a Bertsch et al. 2024].
Learning to learn in-context In contrast to the emergent in-context capabilities of LLMs, existing works have also studied methods that learn perform in-context learning explicitly. |Min et al. [2022a propose MetalCL, meta-training framework for finetuning pretrained LLMs to perform in-context learning on large and diverse collection of tasks. MetalCL outperforms several baselines including
emergent in-context learning and multi-task learning followed by zero-shot transfer. Beyond text,
TNP [guuyen and Grover, 2022 Nguyen al. 2023 Nguyen and Grover [024] and PFNs [Müller et al. 2021] propose to train transformer models ls to perform in-context prediction for family of
functions, which allows in-context generalization to unseen functions after training. Similarly, Garg et al. [2022] show that autoregressive transformers can be trained from scratch to learn function classes such as linear functions and 2-layer ReLU networks. Other work also shows that alignment can be done in-context [Zhao et al., 2023), where in-context learned reward model can be used for inference-time preference alignment. These works present an interesting set of baselines for our work to examine the in-context learning ability of LLMs.
6 Conclusion
We propose a novel approach to understanding in-context learning in LLMs by probing their decision boundaries in in-context learning in binary classification tasks. Despite achieving high test accuracy, we observe that the decision boundaries of LLMs are often irregularly non-smooth. Through extensive experiments, we identify factors that affect this decision boundary. We also explore fine-tuning and adaptive sampling methods, finding them effective in improving boundary smoothness. Our findings provide new insights into the mechanics of in-context learning and suggest pathways for further research and optimization.
Acknowledgments
This research is supported by NSF CAREER Award 2341040, Schmidt Sciences A12050 Fellowship, Samsung, and Cisco.
10

---

References
J. Achiam, S. Adler, S. Agarwal, L. Ahmad, I. Akkaya, F. L. Aleman, D. Almeida, J. Altenschmidt,
S. Altman, S. Anadkat, al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774 2023.
R. Agarwal, A. Singh, L. M. Zhang, B. Bohnet, S. Chan, A. Anand, Z. Abbas, A. Nova, D.
Co-Reyes, E. Chu, et al. Many-shot in-context learning. arXiv preprint arXiv:2404. 2024.
K. Ahn, X. Cheng, H. Daneshmand, and S. Sra. Transformers learn to implement preconditioned gradient descent for in-context learning. Advances in Neural Information Processing Systems, 36, 2024.
E. Akyürek, D. Schuurmans, J. Andreas, T. Ma, and D. Zhou. What learning algorithm is in-context learning? investigations with linear models. In The Eleventh International Conference on Learning Representations.
Y. Bai, F. Chen, H. Wang, C. Xiong, and S. Mei. Transformers as statisticians: Provable in-context learning with in-context algorithm selection. Advances in neural information processing systems, 36, 2024.
A. Bertsch, M. Ivgi, U. Alon, J. Berant, M. R. Gormley, and G. Neubig. In-context learning with long-context models: An in-depth exploration. arXiv preprint vrXiv:2405.00200, 2024.
T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, al. Language models are few-shot learners, Advances neural information processing systems, 33:1877-1901, 2020.
X. Chen, R. A. Chi, X. Wang, and D. Zhou. Premise order matters in reasoning with large language models. arXiv preprint arXiv:2402.08939 2024.
A. Conneau and D. Kiela. Senteval: An evaluation toolkit for universal sentence representations. arXiv preprint 1.X3.v8800.05444 2018
D. Dai, Y. Sun, L. Dong, Y. Hao, S. Ma, Z. Sui, and F. Wei. Why gpt learn in-context? language models secretly perform gradient descent as meta-optimizers. In Findings of the Association for Computational Linguistics: ACL 2023, pages 4005-4019, 2023.
Dettmers, M. Lewis, Y. Belkada, and L.. Zettlemoyer. Llm.int8(): 8-bit matrix multiplication for transformers at scale, 2022.
Garg, D. Tsipras, Liang, and G. Valiant. What can transformers learn in-context? a case study of simple function classes. Advances in Neural Information Processing Systems, 35:30583-30598, 2022.
E. J. Hu, P. Wallis, Z. Allen-Zhu, Li, S. Wang, L. Wang, W. Chen, et al. Lora: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2021.
A. Q. Jiang, A. Sablayrolles, A. Mensch, C. Bamford, D. S. Chaplot, D. d. I. Casas, F. Bressand, G. Lengyel, G. Lample, L. Saulnier, et al. Mistral 7b. arXiv preprint arXiv:2310.06825, 2023.
J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361 2020.
A. Lampinen. I. Dasgupta, S. Chan, K. Mathewson, M. Tessler, A. Creswell, J. McClelland, J. Wang. and F. Hill. Can language models learn from explanations in context? In Findings of the Association for Computational Linguistics: EMNLP 2022, pages 537-563, 2022.
M. Li, S. Gong, J. Feng, Y. Xu, J. Zhang, Z. Wu, and L. Kong. In-context learning with many demonstration examples. arXiv preprint arXiv:2302.04 04931, 2023a.
Y. Li, M. E. Ildiz, D. Papailiopoulos, and S. Oymak. Transformers as algorithms: Generalization and stability in in-context learning. International Conference on Machine Learning, pages 19565-19594. PMLR, 2023b.

---

P. Malo, A. Sinha, P. Korhonen, J. Wallenius, and P. Takala. Good debt or bad debt: Detecting semantic orientations in economic texts. Journal of the Association for Information Science and Technology, 65(4):782-796, 2014.
S. Min, M. Lewis, L. Zettlmooerr. and H. Hajishirzi. Metaicl: ings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2791-2809, 2022a.
Learning to learn in context. In Proceed-
S. Min, X. Lyu, A. Holtzman, M. Artetxe, M. Lewis, H. Hajishirzi, and L. Zettlemoyer. Rethinking the role of demonstrations: What makes in-context learning work? In Proceedings of the 2022 Conference Empirical Methods in Natural Language Processing, pages
2022b.
I. Mollas, Z. Chrysopoulou, S. Karlos, and G. Tsoumakas. Ethos: an online hate speech detection dataset. arXiv preprint 2Xix:20066083288, 2020.
S. Müller, N. Hollmann, S. P. Arango, J. Grabocka, and F. Hutter. Transformers can do bayesian inference. In International Conference on Learning Representations, 2021.
T. Nguyen and A. Grover. Transformer neural processes: Uncertainty-awar meta learning via sequence modeling. In International Conference on Machine Learning, pages 16569-16594. PMLR, 2022.
T. Nguyen and A. Grover. Lico: Large language models for in-context molecular optimization. arXiv preprint arXiv:2406. 2888111,00..8811, 2024.
T. Nguyen, S. Agrawal, and A. Grover. Expt: Synthetic pretraining for few-shot experimental design. Advances in Neural Information Processing Systems, 36:45856-45869, 2023.
F. Pedregosa. G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Pretten- hofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825 12:2825-2830, 2011.
M. Reid, N. Savinov, D. Teplyashin, D. Lepikhin, T. Lillicrap, J.-b. Alayrac, R. Soricut, A. Lazaridou, O. Firat, J. Schrittwieser, et al. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context. arXiv preprint arXiv:2403.0m 055300, 2024.
Shi, X. Chen, K. Misra, N. Scales, D. Dohan, Chi, N. Schärli, and Zhou. Large language models can be easily distracted by irrelevant context. In International Conference on Machine Learning, pages 31210-31227. PMLR, 2023.
R. Socher, A. Perelygin, J. Wu, J. Chuang, C. D. Manning, A. Y. Ng, and C. Potts. Recursive deep models for semantic compositionality over sentiment treebank. In Proceedings of the 2013 conference on empirical methods natural language processing, pages 1631-1642, 2013.
H. Touvron, L. Martin, K. Stone, P. Albert, A. Almahairi, Y. Babaei, N. Bashlykov, S. Batra, P. Bhargava, S. Bhosale. al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint ar arXiv:2307.092883 2023.
J. Von Oswald, E. Niklasson, E. Randazzo, J. Sacramento, A. Mordvintsev, A. Zhmoginov, and M. Vladymyrov. Transformers learn in-context by gradient descent. In International Conference on Machine Learning, pages 55151-35174. PMLR, 2023.
A. Wang, Y. Pruksachatkun, N. Nangia, A. Singh, J. Michael, F. Hill, O. Levy, and S. Bowman. Superglue: A stickier benchmark for general-purpos language understanding systems. Advances in neural information processing systems, 32, 2019.
A. Webson and E. Pavlick. Do pased models really understand the meaning of their prompts? In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2300-2344, 2022.
J. Wei, Y. Tay, R. Bommasani, C. Raffel, B. Zoph, S. Borgeaud, D. Yogatama, M. Bosma, D. Zhou, D. Metzler, et al. Emergent abilities of large language models. Transactions on Machine Learning Research, 2022.
12

---

J. Wei, J. Wei, Y. Tay, D. Tran, A. Webson, Y. Lu, X. Chen, H. Liu, D. Huang, D. Zhou, et al. Larger language models do in-context learning differently. arXiv preprint arXiv:2303.03846, 2023.
N. Wies, Y. Levine, and A. Shashua. The learnability of in-context learning. Advances in Neural Information Processing Systems, 36, 2024.
J. Wu, D. Zou, Z. Chen, V. Braverman, Q. Gu, and P. Bartlett. How many pretraining tasks needed for in-context learning linear regression? In The Tweifth International Conference on Learning Representations, 2023.
M. Xia, T. Gao, Zeng, and D. Chen. Sheared Ilama: Accelerating language model pre-training via structured pruning. arXiv preprint arXiv:2310.06694, 2023.
R. Zhang, S. Frei, and P. L. Bartlett. Trained transformers learn linear models in-context. arXiv preprint arXiv:2306. 200.20997.. 2023.
X. Zhang, Zhao, and LeCun. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28, 2015.
S. Zhao, J. Dang, and A. Grover. Group preference optimization: Few-shot alignment of large language models. arXiv preprint arXiv:2310. 1523, 2023.
13

---

A Pretrained LLMs decision boundary on linear and non-linear classification tasks
Sheared-LLama-Lnn
LLama-24 B-7m 5
Mistral-7B-vo.1.
L-m
LLama-2-132
Reaure
Feature
Feature
Feature
1
1
Sheared-LLama-1..
LLama-2-78
Mistral-7B-vo.1
LLama-3-88
LLama-2-132
Festure
Feature
resure
Feature
Feature
Feature
Feature
Feature
Sheared-LLama--1..
LLama-2-77
Mistral-7B-vO.J.
LLama-3-88
LLama-2-138
Festure
Festure 2
Festure
Festure 2
Jo.
x
Feature
Feature
Feature
Feature
Feature
Figure 12: Visualizations of decision boundaries for various LLMs, ranging in size from 1.3B to 13B, on three classification tasks. The tasks are, from top to bottom, circle, linear, and moon classifications. Note that the circle and moon tasks are not linearly separable. The in-context data points are shown as scatter points and the colors indicate label determined by each model. These decision boundaries are obtained using 128 in-context examples. The visualization highlights that the decision boundaries of these language models are not smooth.
B Finetune on in-context examples only
Finetuned on
Finetuned on in-context examples
in-context examples
Feature
Feature
Feature 1
Feature 1
Figure 13: Two examples of Llama2-7B finetuned on the in-context examples points, which are scattered points in the plot.
14

---

C SFT LLMs for in-context classification
We used LoRA (Hu et 2021] supervise fine-tune the Llama series models on both non-linear and linear classification tasks, including circle, linear, and moon datasets. The models fine-tuned are Sheared-Llanee 1.3B, Llama2-7B, Llama2-13B. and Llama3-8B, Visualization in Figure [4] demonstrates that these language models produce smoother decision boundaries after training on the classification datasets using SFT.
Supervised Fine-tuned LLMs
LLama-2-- 2-7B
LLama-2-78
LLama-2-78
LLama-2-78
80
Feature
Feature
Feature
Feature
80
2 8
60
Feature
Feature 1
Feature 1
Feature
LLama-3-8F
LLama-3-88
LLama-3-88
LLama-3-88
Feature 2
80
Feature 2
80
Feature 2
40
Feature
20
20
20
20
40
50
20
40
50
80
40
50
65
Feature
Feature 1
Feature 1
Feature
LLama-2-13B
LLama -2-3B
LLama-2-13B
-Lama-2-138
Feature 2
80
Feature
60
Feature
Feature
8
80
20
20
60
60
60
40
Feature
Feature 1
Feature 1
Feature
Sheared--LLma--1.3
Sheared-LLama-1.23
Sheared-LLama-LLe
Sheared- -Laaa---LLaaa-113333
Feature
8
Feature
8
Feature
Feature
60
20
Feature
Feature
Feature
Feature
Figure 14: Decision boundary of in-context learning on 128 examples across Llama series models
after supervised finetuning with LoRA.
15

---

D Training Transformers from Scratch: TNP models decision boundaries
We trained TNP models of four different sizes as shown in the Table | below. We plot how does the TNP models decision boudnary changes as more in-context examples are added in Figure [3] TNP models learn smooth deicision boundary for this moon-shaped con-linear task. And we did not observe a scaling law of transformer sizes versus the decision boundary smoothness. In contrast the smaller model generalize better than the larger model.
Table 1: TNP transformers model sizes and architectures.
Model
Parameters (M) Input embed dim
feedforward dim
num heads
num layers
Small
0.1
64
64
2
3
Medium
0.6
128
128
4
Large
1.6
256
X- X-Large
9.7
256
512
16
18
examples
16 examples
32 examples
examples
128 examples
256 examples
512 examples
Fanture
Febure
Tesure
Franure
Festare examples
Histure examples
eexamplss
examples
examales
examples
512 examples
Fonture
Parturs
Festure
Stow ManeBous
feature exaamples
Teature examples
Teature examples
Feature examples
Feetuue examples
reeture examples
sples
Paat am
Fulium
Tae Sen Mese
Frat ?
3
fcuturi examples
fusuric 1 examples
Feature 1 32 examples mal
Ficture 1 examples
Fiature
Fature 1 256 examples
Fazure examples
128 examples
Fettume
Patture
Festure
Sem Seaae
Pesture
Teature
Teature 1
Teature
Feature
Teat.ue
Trature
Peccue
Figure 15: Decision boundary of TNP models of different sizes trained from scratch.
E Traditional Classifiers Model Details
In our experiments, we used several classical machine learning models with the following hyperpa- rameters:
Decision Tree Classifier: We set the maximum depth of the tree to
Multi-Layer Perceptron: The neural network consists of two hidden layers, each with 256 neurons, and the maximum number of iterations is set to 1000.
K-Nearest Neighbors: The number of neighbors is set to 5.
Support Vector Machine (SVM): We used a radial basis function (RBF) kernel with gamma value of 0.2.
16

---

Prompt Format for binary classification
Given pairs of numbers and their labels, predict the label for a new input pair of numbers based the provided data. Answer with only one of the labels 'Foo' and 'Bar':
Input: 64 24
Label: Bar
Input: 34 41
Label: Bar
Input: 71 66
Label:
Input: 96
Label: Foo
Input:
Label: Foo
What is the label for this input?
Input: 2 3
Label:
Figure 16: Few-shot in-context prompt with n context questions.
G
Classification Datasets
We use three types of classification tasks from scikit-learn Pedreeosa et al. 2011 to probe the decision boundary of LLMs and transformers: linear, circle, and moon classification problems. For linear classification tasks, we utilize the make_ saabe__lasssficatti classification problems by creating clusters of points normally distributed around the vertices of hypercube with sides of length 2 x class_sep. Circle classification tasks are generated using the make_ circles function, creating binary classification problem with large circle containing smaller circle. The factor parameter controls the scale the inner circle relative to the outer circle. Moon classification tasks are generated using the make _moons function, creating binary classification problem with two interleaving half circles. The noise parameter controls the standard deviation of Gaussian noise added the data points.
function, which generates random
For training tasks, the class_ parameter is randomly sampled from the range [1.5, 2), and the factor parameter for cireular tasks is sampled from [0.1, 0.4]. For testing tasks, the class_soo parameter is sampled from [1, 1.4], and the factor parameter from [0.5, 0.9], ensuring that testing tasks differ from training tasks. The noise parameter for moon-shaped tasks is sampled from [0.05, 0.1] for training and [0.1, 0.2) for testing, introducing varying levels of complexity in the classification problems.
H Decision Boundary of LLMs on NLP tasks.
We extend our analysis to multi-class NLP classification tasks using nigh-dimensional real-world datasets. To address the challenge of visualizing high-dimensional text embeddings, we project them onto 2D space using t-SNE and send the 2D embeddings as input in the prompt to the LLM. While any dimensionality reduction technique inevitably introduces confounding factors, this approach allows us to extend our analysis to more complex, real-world scenarios. Our experiments encompass six widely-used NLP classification tasks, covering both binary and multi-class settings. These include Subjective/Obeeective sentence classification (SUBJ) [Conneau and Kiela 2018 financial sentiment analysis (FP) [Malo et al. 2014], textual entailment recognition (RTE) Wang et al.; 2201)), hate
speech detection (ETHOS) MMolas et al. 2020 sentiment analysis (SST-2) Sooher et al. 2013
17

---

and news topic classification (AG NEWS) (Zhang et al. 2015]. The results, presented in Figure I7 demonstrate that the non-smooth decision boundary characteristies observed in our synthetic datasets persist in these more complex NL.P tasks.
subj
fp
rte
ethos
sst2
8g. news
200
100
Tedtur
Festure
Fecture
Testure
Testure
Textume
Figure 17: Decision boundaries of Llama-3-8b on six NLP tasks, ranging from binary to multi-class classification. Since text embeddings are natively dighsiimessional, we projected embeddings onto 2D space using t-SNE. The irregular, non-smooth behaviors are also seen in these tasks.
I Uncertainty Aware Active Sampling For Smoother Decision Boundary and Better Test set Accuracy
(InCantect
(i-Contect Doamples)
Closs (Wodel Indirtiont
Class (Model Predictoo)
32 acamples
66 acamples
96 ecampies
128 axamples
1.0 ecamplas
192 examples
228 exangiss
256 asamples
Festare
Faseiss
fasture
Fosturs
2
Festure
Feoure
Feenure
Festlee
Teanire
Fesure
Festure
(a) Active sampling
Cass [In-Contast Examples)
Class Jn-Corkest Exampleo
clont
(Vode: Preditionn
Text Acc.rcccyyya.. 0.88
Tast Accurang 0.85
Tat Accarsoyc
Accumoyy: 0,00
Tesk Accumbiy B.54
That Accurncy: 9:84
Teat Acuuaagy 0.84
Ths' Accoracy: 9.88
Fasture1 Unvertaiity
Ratur Incerbainty
Natur Uncertaitty
Fastum Uncerbuitt
Fesuia Uncertality
Fesuur
Faszare Uncertuitty
Teatur
Uncertainty
Uncertabey
(b) Random sampling
Figure 18: Comparison of active and random sampling methods.
18

---

Cloec
Un-Cantect Fommlle)
Casc Jh-Coniist
(Mode Prediction
Caoos Preditior)
32 stamples
66 azamples
26 acamples
120 asamples
300 essmples
182 esampiss
224 acamples
250 axamples
Prinuee
(a) Active sampling
Examples)
Examples)
22 ncampple decurncy:
examplee Tast Accuracy:
ecamples
examples accuracy
examples
22d escemptes Accuncye
256 osamples couracye
Accuraoy
Accuracy 0.60
Accerayy
Feituee Uncartabrty
Pealure ]
Podtent
Feaure Uncortainty
Pature Uncertalsty
Pesture uncertairty
Forare Uncertiinty
Peatume
Teature
Feature 1
Fesure
Testure 1
Festure 1
Testure
Feature
Teature
(b) Random sampling
Figure 19: Comparison of active and random sampling methods.
19

---

NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification:
reflects our proposed method and experimental findings.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results
be expected to generalize other settings.
is fine to include aspirational goals as motivation as long is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification:
We provide limitation the appendix section.
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification. asymptotic approximations only holding locally). The authors should reflect how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low images are taken in low lighting. Or speech-to-text system might be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach address problems of privacy and faimess.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't 't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory Assumptions and Proofs
Question:
For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
Answer: [NA]
20

---

Justification:
The paper does not include theoretical studies.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but they appear in the supplemental material, the authors are encouraged to provide short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental Result Reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that affects the main claims and/or conclusions of the paper (regardless whether the code and data are provided or not)?
Answer: [Yes]
Justification:
We present complete method and experiment details in Section 3 annd
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g.. in the case of large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily a new algorithm, the paper should make clear how to reproduce that algorithm. (b) the contribution is primarily a new model architecture, the paper should describe the architccture clearly and fully.
(c) If the contribution is new model (e.g., a large language model), then there should either way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reprodueibility. the case of closed-source models, may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers have some path to reproducing or verifying the results.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions to faithfully reproduce the main experimental results, as described in supplemental material?
21

---

Answer:
[Yes]
Justification:
reproducible, they All code and checkpoints will be released publicly upon acceptance.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurIPS code and data submission guidelines (https://nips. cc/
public/guides htte///ooaaamiiiinooooooo.ooo
for more details.
While we encourage the release of code and data, we understand that this might not be possible, so "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https for more details.
/ //nips httpcc/cpplllgggiuueee
The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.
6. Experimental Setting/Details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification:
We present complete method and experiment details in Section 3 and
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, or as supplemental material.
7. Experiment Statistical Significance
Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Question:
Answer: [Yes]
Justification: Although we do not provide error bar for every plot, this is due to the nature of our work, since are visualizing the decision boundary for qualitative understanding. We justify this with additional plots in various settings in the appendix. Apart from the decision boundary plots, we do plot the accuracy plot with error bar. Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results accompanied by error bars, confi- dence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
22

---

The assumptions made should be given (e.g.. Normally distributed errors).
It should be clear whether the error bar is the standard deviation the standard error of the mean.
It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative emrr rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments Compute Resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time of execution) needed reproduce the experiments?
Question:
Answer: [Yes]
Justification:
We provide the compute in the appendix.
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs well estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make into the paper).
9. Code Of Ethics
Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics
Answer: [Yes]
Justification:
The paper conforms to the NeurlPS Code of Ethics.
Guidelines:
The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g.. if there is a special consid- eration due to laws or regulations their jurisdiction).
10. Broader Impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [NA]
Justification: Our work does not have societal impact.
Guidelines:
The answer NA means that there no societal impact of the work performed.
If the authors answer NA or No, they should explain why their work has no societal impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
23

---

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility of MI..
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification: NA
Guidelines:
The answer NA means that the paper poses such risks.
Released models that have high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Lieenses for existing assets
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper. properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes].
Justification: Yes, cited every dataset and models used.
Guidelines:
The answer NA means that the paper does not existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset is used and, if possible, include URL.
The name of the license (c.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (c.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswi thcode. com com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

---

If this information is not available online, the authors are encouraged to reach out to the asset's 's creators.
13. New Assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [NA]
Justification:
We don't release new dataset.
Guidelines:
The answer NA means that the paper does not release new assets,
Researchers should communicate the details of the dataset/code/moodl as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset is used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsourcing and Research with Human Subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification: we don't 't have any.
Guidelines:
The answer NA means that the paper does not involve crowdsoureing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included in the main paper.
According the NeurIPS Code of Ethies, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification:
We don't 't have this.
Guidelines:
The answer NA means that the paper does involve crowdsourcing research with human subjects.
Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurlPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
25


Reviews:
[{"review_id": "KBVMXrGx82", "reviewer": "Reviewer_PtXB", "summary": "This paper conducts a wide range of experiments exploring the smoothness of decision boundary generated by LLMs. Synthetic datasets from scikit-learn are used for the experiments, and experimental results are showing that various factors affect decision boundaries of LLMs.", "questions": "- It would be better to define the concept of smoothness of decision boundry more formally since expecting a perfect smoothness of LLMs' decision boundary is rather unrealistic.", "limitations": "Yes", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "- There are analyses from diverse perspectives, in terms of model size, in-context examples, quantization, prompt format, example order. Extensive experimental results help interpret the targeted phenomenon. Moreover, changes when fine-tuning LLMs with in-context examples are observed.", "weaknesses": "**[W1] Justification of task and dataset**: \n- There have been works trying to understand the mechanism of in-context learning by conducting experiments on NLP classification tasks. However, it seems unclear why the authors choose scikit-learn-generated dataset. Is this dataset proper to investigate the effectiveness of in-context learning? In addition, can experimental results using this dataset be generalized to NLP classification tasks?\n- Moreover, there are concerns on comparison groups. Traditional ML algorithms (e.g., Decition Tree, K-NN, etc.) map each datum into vector spaces, while  LLMs map the entire context into vectors. Can comparing these two mechanism be regarded as a fair process?\n\n**[W2] Analysis**: I have concerns that there are sets of experimental reporting without interpretations of probable reasons. There is a core question: How the smoothness of decision boundary helps understand in-context learning mechanism?\n\n**(Update) After the author's rebuttal, most of these concerns are clarified, thus raising the score 3 to 5.**", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Dear Reviewer PtXB,\n\nThank you for your feedback. We hope to address your questions and comments below.\n\n> Q1: There have been works trying to understand the mechanism of in-context learning by conducting experiments on NLP classification tasks. However, it seems unclear why the authors choose scikit-learn-generated dataset. Is this dataset proper to investigate the effectiveness of in-context learning? \n\n1. Our primary motivation for using synthetic 2D classification datasets is their amenability to decision boundary visualization, which is central to our paper's focus as decision boundaries are typically studied in 2D space, and our proposed mechanism offers novel insights into the generalization abilities of in-context learning. NLP classification tasks, with their discrete token nature and variable input lengths, pose significant challenges for visualization of decision boundaries along x and y axes.\n2. Our use of synthetic function datasets is firmly grounded in established practices for studying in-context learning. Several recent high-profile works have exclusively used synthetic data to investigate ICL/learning algos:\n\n    - NeurIPS 2022 paper (https://arxiv.org/pdf/2208.01066) focuses entirely on linear functions for ICL.\n    - ICLR 2023 paper  (https://arxiv.org/pdf/2211.15661) explores learning algorithms for ICL and primarily conducts experiments on synthetic linear functions.\n    - Google's research (https://arxiv.org/abs/2303.03846) employs synthetic linear function classes (see Section 6).\n    - NeurIPS 2019 paper (https://arxiv.org/pdf/1905.11604) utilizes similar scikit-learn datasets to study decision boundaries for SDE algorithms (see Figure 1).\nThese papers demonstrate that our approach is quite prevalent in the field. The use of scikit-learn is simply a means to generate widely accepted and reproducible benchmarks with clear characteristics such as linear/non-linear patterns.\n\n3. Following up your suggestions, we include additional experiments on 6 nlp classification datasets. Note, to handle the high dimensionality of text embeddings, we projected them onto 2D space using t-sne. (Any dimensionality reduction technique will introduce confounders to the analysis, but this price is inevitable to extend our analysis). We experiment with a total of 6 widely-used NLP classification tasks, with both binary and multi-class settings. These include sentiment analysis and Textual Entailment Recognition. As shown in **Figure 1 of the rebuttal PDF**, we demonstrate similar non-smooth decision boundary characteristics in NLP tasks as observed in our synthetic datasets. \n\n\n> Q2: there are concerns on comparison groups. Traditional ML algorithms (e.g., Decition Tree, K-NN) map each datum into vector spaces, while LLMs map the entire context into vectors. Can comparing these two mechanism be regarded as a fair process?\n\nWe view in-context learning in LLM as a learning algorithm and use decision boundary visualization as a tool to analyze the generalization ability. In this sense, ICL in LLM is comparable to the traditional classifiers and MLP. Related works have also studied ICL in LLM as learning algorithms. For example, Akyürek et al. proves transformers can implement learning algorithms for linear models based on GD and closed-form ridge regression.\n\n> Q3: \"There is a core question: How the smoothness of decision boundary helps understand in-context learning mechanism?\" & \"... can experimental results using this dataset be generalized to NLP classification tasks?\"\n\n- Our work offers novel insights into the ICL mechanism by analyzing decision boundary characteristics, an aspect previously unexplored. Unlike prior research focused on accuracy metrics, we examine the underlying decision-making process of LLMs during ICL. The smoothness of decision boundaries provides valuable information about the model's generalization capabilities, as every grid point (except the in-context examples) lies outside the “training set.”\n\n- To further link decision boundary smoothness with NLP task performance, we fine-tuned a Llama3 8B model on synthetic tasks and tested it on 7 NLP ICL datasets. As shown in **Table 1 of the rebuttal PDF**, the fine-tuned model shows higher performance on several tasks and improved average performance across all tasks. These results suggest that smoother decision boundaries can contribute to generalization in NLP tasks.\n\n> Q4: ... better to define the concept of smoothness of decision boundry more formally since expecting a perfect smoothness of LLMs' decision boundary is rather unrealistic.\n\n- Formally measuring smoothness is challenging due to grid discretization. Qualitatively, the difference in smoothness is evident when comparing traditional models (e.g., kNN, DT) to LLMs. To address this concern quantitatively, we explored several metrics, including curvature (average rate of change of the tangent vector along the decision boundary) and boundary length. However, measuring the continuity behavior of decision boundaries with discretized grids is non-trivial and these metrics are challenging to define and often do not show obvious trends.\n- Nevertheless, we define an empirical metric for decision boundary smoothness: Nearest Neighbor Entropy. This calculates the average entropy of predictions among the k-nearest neighbors for each grid point.\n- We show in **Table 2 of the rebuttal PDF** the NN entropy for the models shown in Figure 1 of our submitted paper, comparing the smoothness of traditional models and sota LLMs. LLMs exhibit higher entropy than models like Decision Trees and kNN. We also provide results for different LLMs with 64 and 128 in-context examples, showing that as the number of examples increases, the entropy generally decreases. This quantitative approach, combined with our qualitative observations, provides a more comprehensive analysis of decision boundary.\n\nWe hope this addresses your concerns. Please let us know if you have any questions.", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "Pg54gxvbkw", "reviewer": "Reviewer_WmaA", "summary": "The authors study the decision boundaries of LLMs in binary in-context learning tasks, finding that decision boundaries can be non-smooth despite high test accuracy and linear separability of the task itself. They examine numerous methods for smoothing the decision boundaries, including SFT and training a transformer that intentionally learns a smooth decision boundary.", "questions": "N/A.", "limitations": "N/A.", "rating": 10, "confidence": 4, "soundness": 4, "presentation": 4, "contribution": 4, "strengths": "Fascinating, insightful paper. Well-written, good visualizations.\nRobustly evaluated across model families, model sizes, number of examples. Even examines the effects of quantization on the decision boundary, which might be one of the most important points in the paper (4-bit quantization affects the boundary quite a bit).\nIncludes sections on fine-tuning to smooth decision boundary as well as training from scratch to do so.\nGreat RW section, up to date with the most recent work.\nNo-brainer accept.", "weaknesses": "None that I can see.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Dear reviewer WmaA, \n\nThank you for the positive and encouraging review! We are glad to find that you found our work to be insightful, well-written and robustly evaluated :)", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "Dla68M2fWN", "reviewer": "Reviewer_PktE", "summary": "This paper investigates the decision boundary of in-context learning of Transformers. The paper shows that for three toy tasks, the decision boundaries of in-context learning of various pretrained models are not smooth. The paper then explores the method for improving the smoothness of decision boundaries and finds that supervised finetuning can mitigate this non-smoothness. Furthermore, finetuning on one task can benefit the smoothness of decision boundaries on other tasks.", "questions": "See the weaknesses.", "limitations": "The main limitation is that the experiments are conducted only on toy datasets.", "rating": 3, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. The decision boundary of in-context learning is an interesting research topic, which seems not investigated by previous work.\n2. The paper provides multiple empirical results and finds a method for improving the smoothness of decision boundary of in-context learning.\n3. The writing of this paper is clear.", "weaknesses": "1. The empirical results are limited to toy datasets, which may reduce the impact of the proposed smoothness-improving method.\n2. The paper does not empirically show that smoother decision boundary smoothness leads to higher generalization accuracy. On the contrary, the paper finds that gpt-4o has high accuracy along with not smooth decision boundary, which makes improving smoothness less motivated. \n3. No quantitative evaluation of smoothness is present in the papers, making smoothness difficult to compare.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Dear Reviewer PktE,\n\nThank you for your feedback. We hope to address your questions and comments below.\n\n> \"The empirical results are limited to toy datasets, which may reduce the impact of the proposed smoothness-improving method.\"\n\n1. Our primary motivation for using synthetic 2D classification datasets is their amenability to decision boundary visualization, which is central to our paper's focus as decision boundaries are typically studied in 2D space, and our proposed mechanism offers novel insights into the generalization abilities of in-context learning. NLP classification tasks, with their discrete token nature and variable input lengths, pose significant challenges for visualization of decision boundaries along x and y axes.\n2. Our use of synthetic function datasets is firmly grounded in established practices for studying in-context learning. Several recent high-profile works have exclusively used synthetic data to investigate ICL/learning algos:\n\n    - NeurIPS 2022 paper (https://arxiv.org/pdf/2208.01066) focuses entirely on linear functions for ICL.\n    - ICLR 2023 paper  (https://arxiv.org/pdf/2211.15661) explores learning algorithms for ICL and primarily conducts experiments on synthetic linear functions.\n    - Google's research (https://arxiv.org/abs/2303.03846) employs synthetic linear function classes (see Section 6).\n    - NeurIPS 2019 paper (https://arxiv.org/pdf/1905.11604) utilizes similar scikit-learn datasets to study decision boundaries for SDE algorithms (see Figure 1).\nThese papers demonstrate that our approach is quite prevalent in the field. The use of scikit-learn is simply a means to generate widely accepted and reproducible benchmarks with clear characteristics such as linear/non-linear patterns.\n\n3. Following up on the reviewers’ suggestions, we include additional experiments on 6 high-dimensional real-world classification datasets. Note, to handle the high dimensionality of text embeddings, we projected them onto 2D space using t-sne. (Any dimensionality reduction technique will introduce confounders to the analysis, but this price is inevitable to extend our analysis). We experiment with a total of 6 widely-used NLP classification tasks, including both binary and multi-class settings. These include sentiment analysis and Textual Entailment Recognition, providing a broader perspective on the applicability of our approach. Our results, presented in **Figure 1 of the rebuttal PDF**, demonstrate similar non-smooth decision boundary characteristics in NLP tasks as observed in our synthetic datasets. \n\n> \"The paper does not empirically show that smoother decision boundary smoothness leads to higher generalization accuracy. On the contrary, the paper finds that gpt-4o has high accuracy along with not smooth decision boundary, which makes improving smoothness less motivated.\"\n\n- While we do not conclusively link boundary smoothness to NLP task performance, this was not our primary aim. Our research aims to provide an initial exploration of decision boundary characteristics in in-context learning, a crucial yet understudied area for understanding ICL behavior. \n- Following up on the reviewer’s suggestion, to investigate the benefits of smoother boundaries, we fine-tuned a Llama3 8B model on synthetic classification tasks and tested it on 7 diverse NLP datasets on ICL. As shown in the **Table 1 of the rebuttal pdf**, the results were promising: the fine-tuned model showed significantly higher performance on several tasks and improved average performance across seven tasks, suggesting smoother boundaries can contribute to better generalization in NLP tasks.\n- The fact that GPT-4o's has high accuracy and a less smooth decision boundary does not negate the importance of decision boundary smoothness. Decision boundary characteristics often imply generalization to unseen data. GPT-4's high accuracy on current benchmarks does not necessarily imply good generalization, as its training data is not fully known. Different models may achieve high performance through various mechanisms, and smoothness could be beneficial, particularly for specific tasks that require high reliability, robustness, and interpretability.\n\n> \"No quantitative evaluation of smoothness is present in the papers, making smoothness difficult to compare.\"\n\n- Formally measuring smoothness is challenging due to its dependence on grid discretization. Qualitatively, the difference in smoothness is evident when comparing traditional models (e.g., kNN, decision trees, logistic regression) to LLMs. To address this concern quantitatively, we explored several metrics, including curvature (average rate of change of the tangent vector along the decision boundary) and boundary length (total length of the decision boundary). However, measuring the continuity behavior of decision boundaries with discretized evaluations is non-trivial and these quantitative metrics are challenging to define and often do not show obvious trends.\n\n- Nevertheless, we define and present an empirical metric for decision boundary smoothness: Nearest Neighbor Entropy. This measure calculates the average entropy of predictions among the k-nearest neighbors for each point in the grid, reflecting the variability and smoothness of the boundary.\n\n- We show in **Table 2 of the rebuttal PDF** the NN entropy values for the models shown in Figure 1 of our submitted paper, comparing the smoothness of traditional models and state-of-the-art LLMs. LLMs exhibit higher NN entropy than models like Decision Trees and kNN. We also provide results for different LLMs with 64 and 128 in-context examples, demonstrating that as the number of examples increases, the entropy generally decreases. This quantitative approach, combined with our qualitative observations, provides a more comprehensive assessment of decision boundary smoothness.\n\nWe hope this addresses your concerns. Please let us know if you have any questions.", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "X8zI8fKx4y", "reviewer": "Reviewer_AvnH", "summary": "This study investigate in-context learning in LLMs by examining their decision boundaries in binary classification tasks. The authors investigate the performance of several mainstream models on these tasks. Despite achieving high test accuracy, the decision boundaries of these LLMs are often irregularly non-smooth. Factors such as model size and prompts' influence on decision boundaries are explored. Additionally, the author examines fine-tuning and adaptive sampling methods, finding them effective in improving boundary smoothness.", "questions": "- Line 69: “Large Language Models (LLMs) are trained on vast corpora of text using unsupervised learning.” Shouldn't this be self-supervised learning?\n\n- Line 132-134: “For the open-source models, we use the approach described in 3.2 to get predictions. For the closed-source models, we use the next token generation as the prediction…” This is confusing since section 3.2 only mentions visualization methods. What are the differences in prompt design or experiments between these two approaches?", "limitations": "Overall, this is a good paper. I would raise my score if the authors could address my main concerns, especially regarding the robustness of their results to variations in prompts.", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- This is the first study, to my knowledge, to explore the decision boundaries of in-context learning LLMs.\n- The experiments are thorough, and some findings, such as the use of uncertainty-aware active learning to help LLMs learn decision boundaries, are beneficial for future research.", "weaknesses": "- The tests are mainly conducted on binary classification tasks, making it unclear if the findings can be generalized to other tasks.\n- Although different model sizes are covered, these models are from different series. The reason for using these models should be clarified in the paper.\n- The decision boundaries appear to be heavily influenced by the prompts, such as the design of labels and the order of in-context learning examples. Coule the authors explore the robustness of their results to variations in prompts, like different formats or synonym replacements? If the robustness to prompts is poor, applying these results to other fields could be challenging.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:
To address the reviewer's concerns, we conducted additional experiments. Here is a summary:

- **NLP Multi-class Classification Tasks (Figure 1):**

We included additional experiments on six widely-used NLP classification datasets, addressing concerns about our use of toy datasets. Note, to handle the high dimensionality of text embeddings, we projected them onto 2D space using t-sne. (Any dimensionality reduction technique will introduce confounders to the analysis, but this price is inevitable to extend our analysis). We experiment with a total of 6 widely-used NLP classification tasks, with both binary and multi-class settings. These include sentiment analysis and Textual Entailment Recognition. As shown in Figure 1 of the rebuttal PDF, we demonstrate similar non-smooth decision boundary characteristics in NLP tasks as observed in our synthetic datasets.

- **Impact of Smoothness on NLP Performance (Table 1):**

Following up reviewer’s concerns in how decision boundary smoothness affect NLP task performance, we fine-tuned a Llama3 8B model on synthetic classification tasks and tested it on 7 diverse NLP datasets on ICL. As shown in the Table 1 of the rebuttal pdf, the results were promising: although only fine-tuned on synthetic classification dataset, the fine-tuned model showed significantly higher performance on several NLP ICL tasks and has an overall improved average performance across 7 tasks, suggesting smoother boundaries in synthetic tasks can contribute to better generalization in NLP tasks.

- **Quantifying Decision Boundary Smoothness (Table 2):**

Following up reviewer’s concerns on the lack of formal definition of smoothness of decision boundary in our setting. We define an empirical metric for decision boundary smoothness: Nearest Neighbor Entropy. This calculates the average entropy of predictions among the k-nearest neighbors for each grid point. Our analysis reveals that LLMs exhibit higher entropy than traditional models like Decision Trees and kNN. Furthermore, increasing the number of in-context examples generally decreases entropy, providing quantitative support for our qualitative observations. Apart from this metric, we also explored several other metrics, including curvature (average rate of change of the tangent vector along the decision boundary) and boundary length (total length of the decision boundary).  However, measuring the continuity behavior of decision boundaries with discretized evaluations is non-trivial and these quantitative metrics are challenging to define and often do not show obvious trends.

- **Influence of Prompt Format (Figure 2):**

We find that the LLM's decision boundary is also affected by the prompt format, which aligns with the importance of prompt engineering in ICL. However, the overall non-smoothness level of the decision boundaries remained consistent. We view prompt formats as another factor influencing the decision boundary rather than undermining our results, since our central observations regarding the non-smoothness of decision boundaries show similar patterns across different prompts. We will add this as another influencing factor in our paper.

Meta-review: This paper proposes a new way to interpret in-context learning for binary classification by analyzing the decision boundaries. The work shows that these boundaries frequently are not smooth, examines the reasons for this and proposes methods for improving the generalizability of in-context learning. Authors perform additional experiments on 6 NLP datasets/tasks based on reviewer suggestions. Rebuttals result in reviewers increasing their scores.
Decision: Accept (poster)