Venue: NAACL 2025

# Learning vs Retrieval: The Role of In-Context Examples in Regression with

Large Language Models

Aliakbar Nafar\({}^{1}\), Kristen Brent Venable\({}^{2,3}\), Parisa Kordjamshidi\({}^{1}\)

\({}^{1}\)Michigan State University

\({}^{2}\)Florida Institute for Human and Machine Cognition

\({}^{3}\)University of West Florida

{nafarali, kordjams}@msu.edu, bvenable@ihmc.org

###### Abstract

Generative Large Language Models (LLMs) are capable of being in-context learners. However, the underlying mechanism of in-context learning (ICL) is still a major research question, and experimental research results about how models exploit ICL are not always consistent. In this work, we propose a framework for evaluating in-context learning mechanisms, which we claim are a combination of retrieving internal knowledge and learning from in-context examples by focusing on regression tasks. First, we show that LLMs can solve real-world regression problems and then design experiments to measure the extent to which the LLM retrieves its internal knowledge versus learning from in-context examples. We argue that this process lies on a spectrum between these two extremes. We provide an in-depth analysis of the degrees to which these mechanisms are triggered depending on various factors, such as prior knowledge about the tasks and the type and richness of the information provided by the in-context examples. We employ three LLMs and utilize multiple datasets to corroborate the robustness of our findings. Our results shed light on how to engineer prompts to leverage meta-learning from in-context examples and foster knowledge retrieval depending on the problem being addressed.

## 1 Introduction

The emergence of transformers Vaswani et al. (2017) has revolutionized natural language processing, leading to the development of LLMs such as GPTs Brown et al. (2020). In addition to their impressive zero-shot performance, these models demonstrated the capability of in-context learning (ICL), by which they learn a task from examples provided in the context of the prompt Brown et al. (2020). In tasks where both zero-shot and ICL settings are applicable, ICL consistently outperforms the zero-shot setting Brown et al. (2020); Liu et al. (2022). However, the inner mechanism of ICL in LLMs remains an open area of research.

Broadly speaking, current research identifies two main approaches to explain the ICL mechanism Dong et al. (2024); Li et al. (2024): 1) Meta-learning, 2) Knowledge retrieval. With meta-learning Schmidhuber (1987), the LLM **learns** a new **unseen** pattern from the in-context examples, allowing it to generalize to new inputs that follow the same pattern. In contrast, with knowledge retrieval, the LLM uses the in-context examples as cues to access and apply information already stored within its pre-trained parameters without inferring new patterns from the provided examples. For instance, given examples of input/output number pairs in the context, meta-learning allows the model to learn their relationship and apply it to new inputs. However, if the prompt informs the model that the pairs are the earth's population given a year, the LLM utilizes its knowledge retrieval and infers that the function is exponential and plateaus at around 8-10 billion after the year 2000.

Contrary to current research, we propose a different approach, arguing that ICL is not merely learning or retrieving knowledge, but rather, its behavior lies on a _spectrum_ between the two, which can be adjusted depending on various factors. Before exploring our proposed approach, we elaborate on the hypotheses mentioned above. 1

Footnote 1: See Appendix A for a detailed discussion on related work.

The first hypothesis suggests that transformers are effective meta-learners, and LLMs can generate accurate predictions based solely on the given input-output pairs. Bai et al. (2023) theoretically proves and practically tests the capability of an encoder-based transformer to implement generalized linear models in-context. Garg et al. (2022) uses a decoder-based model, a GPT-2 architecture modified for regression, that uses the input features inside the embeddings (instead of using to

kens) and outputs a number. Their model's performance surpasses a 2-layer Multi-Layer Perceptron (MLP) and a decision tree by meta-learning. Further, Vacareanu et al. (2024) directly uses LLMs to test regression capabilities using a limited number of features (less than 3) and concludes that LLMs are capable regressors based on in-context examples. However, according to our findings, their claim of avoiding data contamination is not well-supported. We note that none of these research works use realistic datasets or consider the combination of meta-learning with knowledge retrieval.

The second approach emphasizes knowledge retrieval while downplaying the learning aspect. For example, Min et al. (2022) examines 12 LLMs across various classification tasks, concluding that altering output labels, which are needed for learning, has no impact on performance. They argue that the crucial elements of ICL are limited to defining the label space, input distribution, and overall task format. Meanwhile, Kossen et al. (2024) argues that LLMs utilize the labels but in an arbitrary manner when experimenting with the same classification tasks. Li et al. (2024) further dismisses the significance of output labels and instead proposes two knowledge retrieval approaches. These include the retrieval of pre-existing solutions from training data Min et al. (2022); Wang et al. (2023); Wies et al. (2023), and a novel _solution composition_ approach, inspired by Hahn and Goyal (2023), which proposes that learned solutions can be combined. While this work offers valuable insights into ICL mechanisms, its findings are limited to a narrow selection of datasets and models. Here, the exclusive use of LLaMA 2 Touvron et al. (2023), which is known to struggle with long token contexts Machlab and Battle (2024); Zuhashaik et al. (2023) results in some different findings compared to our work. For instance, they report that remapping the inputs of in-context input-output pairs to alternative text reduces the accuracy to that of a random model (even with up to 40 in-context examples). On the other hand, under similar conditions, our experiments indicate that in newer models, learning occurs with optimal performance. We refrain from making specific claims about task selection or composition in our work. Instead, we categorize these processes under the broader umbrella of _knowledge retrieval_2. Similarly, to investigate ICL, Pan et al. (2023) uses simple classification tasks and older models (e.g., GPT-3 Ada), and as a result, its findings are partially different from ours.

Footnote 2: See Appendix B for a more detailed analysis of the discrepancies between our findings and those of Li et al. (2024).

We propose a different hypothesis that resolves the contradictions in the research community and support our claims with extensive empirical testing. We argue that ICL is not merely learning or retrieving knowledge but uses a combination of the two, which lies on a spectrum determined by factors we can manipulate. In this regard, we propose an evaluation framework and conduct a comparative study of different LLMs and datasets, focusing specifically on regression problems as our testing ground. In our evaluation framework, we query the LLM to estimate an output number based on a set of (feature, value) pairs given a set of ICL examp

Figure 1: The three main prompt configurations: In configuration a) the actual names of the features and the output are known, and the LLM is asked to guess the “price of a used Toyota or Maserati in 2019”. Configuration b) is similar to a) except that the feature names are anonymized. Here, the LLM is asked to estimate the “Output”. In Configuration c), we replace the real prices of in-context examples with randomly (Gaussian) generated numbers.

 

We opted for regression tasks for the following reasons: This choice aligns our work with the majority of related ICL meta-learning research, thus facilitating direct comparisons and building upon existing findings. These include works that alter the output module of LLMs, such as Garg et al. (2022) and those that use the token generation output of LLMs as is, such as Vacareanu et al. (2024). Moreover, Bhattacharya et al. (2024) demonstrates that the ICL capability of LLMs is independent of their input/output modules and is present in the intermediary layers of the LLMs. Finally, while LLMs are capable of regression (even when inputs are given to them in a textual format Vaccareanu et al. (2024)), this task still has a complex output space (e.g., continuous or unbounded), which is challenging for LLMs Fang et al. (2024).

We show that LLMs can perform regression on realistic datasets and measure the extent to which the LLM retrieves its internal knowledge versus learning from in-context examples. We provide an in-depth analysis of the degrees to which these mechanisms are triggered depending on the factors we use in our framework: the number of (feature, value) pairs, the number of in-context examples, and the prompting strategies.

In summary, our contributions are as follows: **1)** We demonstrate that LLMs can effectively learn from regression examples of **realistic** datasets interact, extending previous work on synthetic data to more practical scenarios. **2)** We propose a new hypothesis about the ICL mechanism that combines both learning and knowledge retrieval during the LLM inference, reconciling the research community's findings. **3)** We introduce an evaluation framework that allows for systematic comparison of ICL mechanisms across different LLMs, datasets, and prompt configurations3. **4)** We provide a comprehensive analysis of how LLMs balance internal knowledge retrieval and learning from in-context examples and propose prompt engineering techniques to control them.

Footnote 3: The code and analytical tools are available at \({\boldsymbol{\mathsf{O}}}\).

## 2 Problem Setting

Our study focuses on a regression task where we use LLMs to predict numerical outputs based on the given inputs. We assume a regression dataset, \(D=\{(x_{1},y_{1}),(x_{2},y_{2}),\ldots,(x_{n},y_{n})\}\), comprising input-output pairs, is given. Each \(x_{i}\) comprises a set of pairs \((f_{ij},v_{ij})\) where \(f_{ij}\) represents the feature name and \(v_{ij}\) is the numerical value of \(f_{ij}\). The target variable \(y_{i}\) is the numerical value of the output. For example, if we consider a dataset providing the price of used cars given their fuel economy and mileage, we could have an input with (feature, value) pairs, (Fuel Economy,\(16\)) and (Mileage, \(0\)), and an output, \(95595\), indicating the price.

To resemble a regression problem setting, we present the LLM with a subset of \(m\) input-output examples \(\{(x_{1},y_{1}),(x_{2},y_{2}),\ldots,(x_{m},y_{m})\}\) taken from the in-context split of \(D\) for learning. Then, we query the LLM with the feature pairs of \(x\) taken from the test split of \(D\) to obtain the answer \(y\) as the output.4 Figure 1(a) depicts our problem setting in the context of a regression task that involves predicting the "price of a used Toyota or Maserati in 2019", which is the target variable name, given three (feature, value) pairs with a set of provided in-context examples. When \(m\) equals 0, we obtain the zero-shot setting without prior examples.

Footnote 4: We note that since we do not change the architecture of the LLMs, all numbers must be represented to and read by the LLM in textual form.

### Prompt Configurations

We employ three main prompt configurations for prompting the models, as shown in Figure 1. These configurations vary in different ways, such as hiding the real name of features (Figure 1(b)) or the actual ground truth (Figure 1(c)). We also prompt the LLM with simple numerical generation as a baseline in our experiments. This results in a total of four prompt configurations. We also consider other prompt configurations which either served as ablations or didn't provide any significant insights. In each prompt configuration, the context of the prompt comprises a task instruction, in-context examples (sample regression task input-outputs), and a query. The task instruction asks the LLM to estimate the objective of the dataset (such as the price of a used car) based on the given features by **just providing a number and no explanation as the output**. Each of these parts can be changed or removed according to the prompt configuration.

**Named Features** (Configuration a): This is our most straightforward prompt configuration. It reveals the actual names of the features and the required target variable (depending on the dataset) in the prompt. For instance, in the case of a dataset about the price of used cars, the LLM is instructed to estimate a "Used Car Price" based on "City Fuel Economy", "Mileage" and "Passenger Car Classifi 

cation". Following this instruction, sample input-output examples are given to the model, and then the query is asked as shown in Figure 1(a).

**Anonymized Features** (Configuration b): In this setup, which is shown in Figure 1(b), we present the LLM with input-output pairs where the actual name of the features and the target variable are changed to "Feature #" and "Output", respectively. The instruction asks the LLM to estimate the "Output" based on the given "Features". Here, the LLM can not use its domain knowledge, and **can only** use the provided number of the features.

**Randomized Ground Truth** (Configuration c): In our final main prompt configuration shown in Figure 1(c), we maintain the named features but replace the ground truth values with randomly generated numbers (independent of the feature values). These random numbers are generated using a Gaussian distribution based on the dataset statistics. This setup mainly serves as a control configuration to test to what degree the LLMs are truly learning from the provided ground truth in the examples.

**Direct Question Answering** (Direct QA): To establish an LLM baseline, we ask LLMs to estimate the target variable based on the given named features without any in-context examples (\(m=0\)). We also define the scope of the output by providing the mean and the standard deviation of the questioned dataset in the instruction to the LLM. An example of this added information is: "Estimate the insurance cost of this person given the information. An issuance cost is typically around \(13270.42\) with a standard deviation of \(12110.01\)".

### Models and Metrics

We evaluate several LLMs, including LLMaA 3 70B [1], GPT3.5 [6], and GPT4 [8]. We initially considered smaller LLMs such as Mistral 7B [9], but found their performance for regression tasks to be insufficient and consequently excluded them. To provide a comprehensive comparison, we also employed classical machine learning techniques alongside these LLMs. Specifically, we utilized a straightforward Ridge regression [10] and the more advanced RandomForest model [1]. Further details about these models, such as their hyper-parameters, are included in Appendix D.

In our analysis, for each dataset, we test the LLMs with a mix of **factors** (we call these factors to distinguish them from the features \(f_{ij}\) defined in our problem setting). The first factor is the _prompt configurations_, which can be Named Feature, Anonymized Features, Randomized Ground Truth, or Direct QA. The second and third factors are the _number of in-context examples_ and the _number of (feature, value) pairs_, which we will refer to as the number of features. The number of in-context examples is 0, 10, 30, and 100, and the number of features is 1, 2, and 3 in our experiments. These feature numbers indicate using the first feature (F1), the first two features (F2), and all three features (F3) (features are ordered and sorted in decreasing order of importance). Not all these factors can be used together as the 0 in-context examples factor can only be used with the Direct QA prompt configuration, and other prompt configurations can not be used with the 0 in-context examples factor. To assess the performance of the LLMs and the machine learning models on regression tasks, we use Mean Squared Error (MSE) as our main evaluation metric. We also calculate and report the coefficient of determination \(R^{2}\) and Mean Absolute Error (MAE) in Appendix E.

## 3 Experiments

This section presents our experimental findings, highlighting the interplay between various factors that influence the performance of LLMs across regression tasks and datasets.

### Datasets

To assess the LLMs' performance across diverse domains and complexity levels, we select three regression datasets and three of their most important features, where feature importance was calculated with RandomForest [12]: 1) Admission Chance: the _likelihood of admission to graduate programs for Indian students_[1] with three highly correlated features. Since this dataset is about Indian students, there is a lower chance of being observed in the LLM's training data, reflecting the general imbalance that skews towards USA-centric data [15]. 2) Insurance Cost: focuses on predicting a similar distribution of the _annual individual medical costs billed by health insurance companies in the USA_, drawing from demographic statistics compiled by the U.S. Census Bureau [10]. For this dataset, the first feature is the most important one by far. 3) Used Car Prices: the estimation of the _price of a used Toyota or Maserati car in 2019_.

 

Here, the first two features are the most impactful ones. 5 These datasets are pre-processed to select their most important features. We divide each dataset into two splits: an in-context subset comprising 100 instances and a test subset with 300 instances. See Appendix C for details.

Footnote 5: All datasets used in this study are publicly available. For references and details of our pre-processing code, visit \(\mathbf{\mathsf{O}}\).

### Knowledge Retrieval Assessment

To establish a baseline for our subsequent analyses, we first evaluate the LLMs' performance using only their knowledge retrieval, without any in-context examples. This assessment is required to understand how the in-context examples in other prompt configurations modulate the LLMs' performance and ICL mechanisms. The performance of LLMs with _Direct QA_ prompt configuration is shown in Figure 2. The red dashed line shows the performance of Mean model, which outputs the mean of the dataset independent of the input features.As can be observed, the **additional features generally improve the performance** across tasks (with inconsistencies when using LLaMA 3). However, the LLMs' utilization of features does not directly correlate with feature importance, as explained in Section 3.1. As for the impact of datasets, the Admission Chance dataset consistently shows the poorest results, with most outcomes at or above the Mean model's MSE. As mentioned earlier, this dataset is the least exposed to LLMs, which likely explains these findings.

We further explored the Direct QA approach by asking the LLM to explain its reasoning based on the given features before providing the final estimate. This variation yielded predictions comparable to the Direct QA results without offering additional insights and consequently was excluded from our main prompt configurations. See Appendix F for example answers and related diagrams.

### Learning/Knowledge Retrieval Interplay

We have defined four main prompt configurations to vary the degree to which the model uses its knowledge retrieval or learning from the in-context examples. By comparing the performance of these prompt configurations, we can understand how LLMs utilize knowledge retrieval and learning from the outputs. Figure 3 compares these prompt configurations' effects on LLMs. The _Randomized Ground Truth_ prompt configuration, shown with the lime color, consistently yields the worst results. Note that the names of the features are revealed here. As a result, this prompt configuration creates a scenario where patterns in the data may contradict the model's internal knowledge. For instance, in the Insurance dataset, some in-context examples show that people who smoke less, require lower insurance costs, while others indicate higher costs for the same group. The negative impact of this prompt configuration on performance becomes more significant as the number of in-context examples with random outputs increases. This is particularly evident when using 100 in-context examples. These results suggest that the LLMs are using the output variables to learn from the examples, and increasing the number of **in-context examples shifts the spectrum from knowledge retrieval to learning.** Our findings, which indicate that LLMs can be pushed to prioritize learning from the in-context examples over knowledge retrieval, challenge the uselessness of the outputs claimed by Min et al. (2022); Li et al. (2024).

Comparing the _Named Features_ and _Anonymized Features_ prompt configurations shows the power of combining the two paradigms of learning from in-context examples and knowledge retrieval. Anonymized Features prompt configuration, shown with the green color in Figure 3, allows only usage of the numeric part of the features for learning. This prompt yields better results than the Direct QA and the Mean model. Named Features prompt configuration, which adds the actual name of the features to the examples, is shown in purple. By encouraging the use of knowledge resulting from the added names of the features, it consistently outperforms Anonymized Features prompt configuration across variations of the factors, that is the number

Figure 2: Baseline results (Direct QA configuration) across datasets and number of features. The dashed red line shows the performance of the Mean model.

 

of in-context examples and the number of features. These results show that LLMs can exploit **both in-context examples' outputs for learning and clues like feature names for knowledge retrieval**. Note that when we replaced the feature names with random, unrelated names with the same ranges as the original features (e.g., replacing Smoker Status with Married since both are binary), the results remained the same as those of the Anonymized Features prompt configuration.

### Knowledge Retrieval Compensates for In-context Examples

As previously noted, the _Named Feature_ prompt configuration, which combines knowledge and learning, generally outperforms the _Anonymized Feature_ prompt configuration, which relies only on learning. Regarding these prompt configurations, analyzing our defined factors, such as the number of in-context examples, reveals more insights about ICL. Conventionally, in the realm of LLMs, more in-context examples tend to improve the task outcome. However, as demonstrated in Figure 3, performance deteriorates with more in-context examples when outputs are random, even if the model possesses knowledge about the subject. Figure 4, which compares the performance of different numbers of in-context examples, reveals that the Named Feature prompt configuration performs better when fewer in-context examples are used (solid vs dashed lines). A significant performance gap between the two prompt configurations is observed at 10 in-context examples, shown with the solid and dashed purple lines. However, at 100 in-context examples, shown with the solid and dashed line lines, the performance levels converge. This underscores the potential for **reducing the number of required in-context examples** by providing task-specific information, thereby shifting the spectrum from learning to knowledge retrieval.

Moreover, Figure 5 shows the advantage of the Named Features prompt configuration over both the Anonymized Features prompt configuration and also the traditional machine learning models by comparing them across various numbers of in-context examples. With fewer in-context examples (30 and especially 10), Named Features prompt configuration models generally outperform all other models. Their results indicate that the type of information in the LLMs' prompt can encourage exploiting their internal knowledge. Moreover, the LLMs' capability to **retrieve knowledge makes them more data-efficient, i.e., few-shot learners, than even classical machine learning models**, RandomForest and Ridge. However, this advantage applies primarily in a low-data regime and does not account for issues such as the higher training and execution costs of LLMs, which we discuss further in Section 4. All the models eventually converge at 100 examples when sufficient data for regression is provided.

Figure 3: Comprehensive comparison of prompt configurations’ effects on our models across various factors, shown in a hierarchy. The top level for each dataset distinguishes between GPT-3, LLaMA 3, and GPT-4 results using black, grey, and white arcs, respectively. The notation indicates the number of in-context examples, while F1, F2, and F3 represent the use of the first feature, the first two features, and all three features, respectively. The MSE scale of each dataset is shown at top left corner.

 



### More Features Help Knowledge Retrieval

Unlike the number of in-context examples, the number of features stands out as a unique factor that can improve **both learning and knowledge retrieval** in LLMs. As additional features are incorporated into the context, LLMs can better learn the relationships between features and outputs and also retrieve more relevant knowledge. This clearly helps in the case of Named Features prompt configuration.

However, the less obvious insights in this section emerge from the _Anonymized Features_ prompt configuration, which relies only on learning and consistently improves with the addition of features. As shown in Figure 6 for 100 in-context examples (the dotted lines), each additional feature either improves the results or maintains near-optimal performance. A similar, but less robust, trend is seen in the 30 in-context examples' diagram in Appendix F. While adding more features improves results, this improvement is more significant in language models compared to machine learning models such as Ridge and RandomForest in Figure 6. Given that in this prompt configuration 1) feature names are anonymous, 2) only raw numerical data is available for output estimation, and 3) the improvement in the **performance of LLMs does not correlate with the importance** of the features, we conjecture that the results could be influenced by **data contamination from the observed numbers.** This assertion is supported by the fact that this phenomenon is absent in the Admission Chance dataset, the least likely seen dataset by LLMs.

In the Named Feature prompt configuration for 100 in-context examples depicted in Figure 6, the results show an overall improvement, yet the trend is not as consistently downward or smooth as observed in the Anonymized Features prompt configuration when features are added. This fluctuation suggests that the knowledge retrieval aspect becomes more prominent and occasionally supersedes the learning component as the number of features increases. Based on these observations that happen at a high number of 100 in-context examples, we hypothesize that adding features **primarily enhances the knowledge retrieval aspect rather than contributing to the learning**.

### Quantitative Analysis

Following Yoo et al. (2022), we introduce a quantitative metric to assess the impact of knowledge on model performance. We denote the rate of improvement of a prediction after the addition of knowledge (named features) as _Knowledge Effect Ratio_ (KER), which can be calculated as such:

Figure 4: Comparison of the number of in-context examples using Named Features (straight lines) and Anonymized Features (dashed lines) prompt configurations. F1, F2 and F3 indicate using 1st (F1), then 1st and 2nd (F2), and all three features (F3).The MSE scale of each dataset is shown at the top left corner.

Figure 5: Performance of Named Features and Anonymized Features prompt configurations, Ridge, and RandomForest for 3 features based on the number of in-context examples.



\[{\sf KER}=\frac{|Y_{AF}-Y_{GT}|-|Y_{NF}-Y_{GT}|}{|Y_{AF}-Y_{GT}|} \times 100 \tag{1}\]

where \(Y_{AF}\) shows a prediction from the Anonymized Features Configuration, \(Y_{NF}\) shows a prediction from the Named Features Configuration and \(Y_{GT}\) is the ground truth value. This formula measures the rate of change in error (Mean Absolute Error) due to added knowledge in learning. We compute the KER for each dataset and combination of factors and then select its median improvement rate to mitigate the influence of outliers. As expected, this rate remains near zero across almost all factor combinations for the Admission Chance dataset, given that it does not benefit from knowledge in our tests. For the other two datasets, Figure 7 shows the average improvements across feature factors for each dataset and the number of in-context examples. Notably, the most significant gains emerge when the number of in-context examples is small, aligning with our earlier observations.

## 4 Discussion

Our evaluation framework and extensive experiments provide insights into the ICL mechanisms of LLMs. In this section, we discuss the implications of our findings, address limitations, and suggest directions for future research.

### Controlling ICL Mechanisms

Understanding and manipulating ICL mechanisms in LLMs proves invaluable for practical applications and effective prompt engineering. Our experiments show that the LLMs use both learning from the in-context input-output examples and prior information with varying extents. We found that increasing the number of in-context examples encourages learning while adding more features **mainly boosts knowledge retrieval**. However, these benefits only materialize when there is room for improvement in the respective mechanism. For example, using more than 100 in-context examples did not help LLMs, and in the Admission Chance dataset, where the features were highly correlated, the addition of features did not help the performance either. This insight explains why Min et al. (2022)'s tasks appeared not to utilize output labels for learning; In their tasks, the dominant knowledge retrieval aspect likely eclipsed any learning benefits. Our findings also challenge the view of LLMs as merely meta-learners. While previous research demonstrates decoder models' capacity for meta-learning, the complex interplay of different training objectives (unknown in some proprietary models) and other factors introduce a significant knowledge retrieval component. Consequently, earlier findings can only be directly extrapolated to LLMs when considering all these dynamics.

### Practical Applications

Our findings emphasize the importance of striking an optimal balance between the number of meaningful features and the number of in-context examples to optimize LLMs performance. By strategically reducing the quantity of in-context examples while increasing the number of named features, it is possible to achieve resource efficiency and other potential benefits, such as mitigating data biases, without compromising performance. Conversely, when tackling tasks unfamiliar to the model, prun

Figure 6: Performance of Anonymized Features prompt configuration, Ridge, and RandomForest for 100 incorrect examples based on the number of features.

Figure 7: KRER improvement across different models and datasets with varying numbers of in-context examples. The improvements become more notable as the number of in-context examples decreases.

 

ing less important features can free up space in the LLM's token context, allowing it to accommodate more in-context examples. This shifts the ICL mechanism towards the learning side of the spectrum and improves the model's performance.

### Traditional ML Models vs LLMs

Our findings show that LLMs can be more data-efficient in low-data regimes, leveraging their pre-trained knowledge to achieve strong performance with only a few in-context examples. This advantage holds against traditional ML models even with the addition of more than 3 features, given that in classical ML models, with sparse data, more features lead to overfitting- a problem we encountered on our datasets as well. In addition, in our experiments, LLMs excelled at identifying the most important features of the datasets, performing on par with the classical feature selection method we used. On the negative side, LLMs require substantial computational resources to train and deploy. Meanwhile, traditional models such as Ridge regression or RandomForest can be trained rapidly on standard hardware and may eventually surpass LLMs if enough data is provided.

### Data Contamination

In our experiments, we showed that LLMs can perform regression on realistic datasets, even when feature names are anonymized. However, as detailed in the experiments section and illustrated in Figure 6, the improvement does not correlate with the actual importance of input features in the dataset. This discrepancy strongly suggests that data contamination occurs even at the level of numerical values. These findings challenge the claims made by Vacareanu et al. (2024), which uses a prompt configuration similar to Anonymized Features to avoid data contamination. Their study utilizes either well-known Friedman formulas or formulas that can be closely approximated (using two decimal places) by common mathematical expressions6.

Footnote 6: E.g. \(y=10x+\sin(5\pi x)+\cos(6\pi x)\approx 10x\).

### Order of Features & In-Context Examples

In our experiments, we explored two factors: rearrangang the order of features in the Direct QA prompt configuration and sorting the in-context examples in the Anonymized Features prompt configuration. When permuting the order of our three features (resulting in six possible permutations), we found only a slight change in performance. After sorting the in-context examples by their label values (with three features), we tested the impact on performance using sets of 10 and 100 in-context examples. While both scenarios resulted in a drop in performance, the drop was notably steeper when using 100 examples. Among the models we evaluated, GPT-4 was the least affected, maintaining robust performance with 10 sorted examples but showing a marked decrease with 100 examples.

We hypothesize that sorting examples by label values may cause LLMs to prioritize the sorted label pattern rather than the relationships between features and labels--an effect possibly affected by LLMs' inherent ability to detect and continue sorting patterns Besta et al. (2024). We noticed that when the examples were sorted in ascending order, the mean predicted value went up, and when sorted in descending order, it went down. This suggests that the sorting pattern guides the model's predictions, and it is best to keep the order of in-context examples randomized.

## 5 Conclusion

In this study, we have explored the ICL capabilities of LLMs through an empirical study on regression tasks. Our results demonstrate that LLMs utilize a blend of retrieved internal knowledge and learned information from in-context examples. Our findings extend the evaluations of prior hypotheses on ICL. For example, we evaluate the usage of outputs in in-context learning examples and show how to manipulate their effectiveness. This work not only advances our understanding of LLMs' in-context learning phenomenon but also offers practical insights for optimizing their application through careful prompt engineering.

This project is partially supported by the Office of Naval Research (ONR) grant N00014-23-1-2417. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of Office of Naval Research. We thank the anonymous reviewers for their valuable feedback and suggestions, which have helped improve this work.

 



## Limitations

### Scope of Study

Our framework focuses on regression tasks in line with most previous meta-learning research. We also utilize three diverse regression datasets. More regression (or classification) datasets with different characteristics, such as different relationships between their features, can be used for future investigation, which could elaborate more on the findings of our work with the previous work that dismissed the importance of outputs for learning.

### Interpretability

We interact with LLMs as a black box and the underlying neural mechanisms remain opaque in our experiments. Integrating this approach with interpretability techniques could yield a deeper understanding of ICL.

### Experimental Constraints

The token limit of some LLMs prevented us from testing beyond 100 in-context examples and three features in certain combinations. Although we found that results with 200 in-context examples closely mirrored those with 100, including a 4th feature could have further reinforced our findings. When tested, the results of the 4th feature aligned with our conclusions. However, we ultimately restricted our analysis to three features to maintain a comprehensive combination across all models.

### Data Contamination Challenge

Addressing the challenge of data contamination remains a complex issue [35, 6]. As mentioned earlier, it is hard to distinguish the degree of Data Contamination from approximate Knowledge Retrieval. Based on our findings, data contamination can happen even with the sequence of numerical values without any linguistic clues. To mitigate this issue, we suggest using distributions that are neither widely recognized nor easily approximated by common mathematical expressions. Furthermore, for datasets, it is advisable to utilize information sourced from regions beyond the United States or outside the primary training domain of the language model. This approach helps to minimize the potential influence of knowledge retrieval in generating the results.

## References

* Acharya et al. (2019) Mohan S Acharya, Asfia Armaan, and Aneeta S Antony. 2019. A comparison of regression models for prediction of graduate admissions. In _2019 International Conference on Computational Intelligence in Data Science (ICCIDS)_, pages 1-5.
* AI@Meta (2024) Al@Meta. 2024. Llama 3 model card. [https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md](https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md). Accessed: 2024-07-01.
* Anthropic (2024) Anthropic. 2024. Claude 3. [https://www.anthropic.com](https://www.anthropic.com). Large language model, accessed June 2024.
* Bai et al. (2023) Yu Bai, Fan Chen, Huan Wang, Caiming Xiong, and Song Mei. 2023. Transformers as statisticians: Provable in-context learning with in-context algorithm selection. In _Thirty-seventh Conference on Neural Information Processing Systems_.
* Balloccu et al. (2024) Simone Balloccu, Patricia Schmidtova, Mateusz Lango, and Ondrej Dusek. 2024. Leak, cheat, repeat: Data contamination and evaluation malpractices in closed-source LLMs. In _Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 67-93, St. Julian's, Malta. Association for Computational Linguistics.
* Besta et al. (2024) Maciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger, Michal Podstawski, Lukas Gianinazzi, Joanna Gajda, Tomasz Lehmann, Hubert Niewiadomski, Piotr Nyczyk, and Torsten Hoefler. 2024. Graph of thoughts: solving elaborate problems with large language models. In _Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence and Thirty-Sixth Conference on Innovative Applications of Artificial Intelligence and Fourteenth Symposium on Educational Advances in Artificial Intelligence_, AAAI'24/IAAI'24/EAAI'24. AAAI Press.
* Bhattacharya et al. (2024) Satwik Bhattachinsha, Arkil Patel, Phil Blunsom, and Varun Kanade. 2024. Understanding in-context learning in transformers and LLMs by learning to learn discrete functions. In _The Twelfth International Conference on Learning Representations_.
* Breiman (2001) Leo Breiman. 2001. Random forests. _Machine Learning_, 45(1):5-32.
* Brown et al. (2020) Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In _Advances in Neural Information Processing Systems_, volume 33, pages 1877-1901. Curran Associates, Inc

Xiang Cheng, Yuxin Chen, and Suvrit Sra. 2024. Transformers implement functional gradient descent to learn non-linear functions in context. In _Proceedings of the 41st International Conference on Machine Learning_, volume 235 of _Proceedings of Machine Learning Research_, pages 8002-8037. PMLR.
* Coda-Forno et al. (2023) Julian Coda-Forno, Marcel Binz, Zeynep Akata, Matt Botvinick, Jane Wang, and Eric Schulz. 2023. Meta-in-context learning in large language models. In _Advances in Neural Information Processing Systems_, volume 36, pages 65189-65201. Curran Associates, Inc.
* Deutch et al. (2024) Gilad Deutch, Nadav Magar, Tomer Natan, and Guy Dar. 2024. In-context learning and gradient descent revisited. In _Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)_, pages 1017-1028, Mexico City, Mexico. Association for Computational Linguistics.
* Dong et al. (2024) Qingxiu Dong, Lei Li, Damai Dai, Ce Zheng, Jingyuan Ma, Rui Li, Heming Xia, Jingjing Xu, Zhiyong Wu, Baobao Chang, Xu Sun, Lei Li, and Zhifang Sui. 2024. A survey on in-context learning. In _Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing_, pages 1107-1128, Miami, Florida, USA. Association for Computational Linguistics.
* a survey. _Transactions on Machine Learning Research_.
* Garg et al. (2022) Shivam Garg, Dimitris Tsipras, Percy S Liang, and Gregory Valiant. 2022. What can transformers learn incontrack? a case study of simple function classes. In _Advances in Neural Information Processing Systems_, volume 35, pages 30583-30598. Curran Associates, Inc.
* Hahn and Goyal (2023) Michael Hahn and Navin Goyal. 2023. A theory of emergent in-context learning as implicit structure induction. _Preprint_, arXiv:2303.07971.
* Hoerl and Kennnard (1970) Arthur E Hoerl and Robert W Kennnard. 1970. Ridge regression: Biased estimation for nonorthogonal problems. _Technometrics_, 12(1):55-67.
* Jiang et al. (2023) Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, Lello Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothee Lacroix, and William El Sayed. 2023. Mistral 7b. _Preprint_, arXiv:2310.06825.
* Kossen et al. (2024) Jannik Kossen, Yarin Gal, and Tom Rainforth. 2024. In-context learning learns label relationships but is not conventional learning. In _The Twelfth International Conference on Learning Representations_.
* Lantz (2013) Brett Lantz. 2013. _Machine Learning with R_. Packt Publishing Ltd.
* Li et al. (2024) Jiaoda Li, Yifan Hou, Minmaya Sachan, and Ryan Cotterell. 2024. What do language models learn in context? the structured task hypothesis. In _Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 12365-12379, Bangkok, Thailand. Association for Computational Linguistics.
* Li et al. (2023) Yingcong Li, Kartik Sreenivasan, Angeliki Giannonu, Dimitris Papailiopoulos, and Samet Oymak. 2023. Dissecting chain-of-thoughtt: Compositionality through in-context filtering and learning. In _Thirty-seventh Conference on Neural Information Processing Systems_.
* Liu et al. (2022) Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2022. What makes good in-context examples for GPT-3? In _Proceedings of Deep Learning Inside Out (DeeLIO 2022): The 3rd Workshop on Knowledge Extraction and Integration for Deep Learning Architectures_, pages 100-114, Dublin, Ireland and Online. Association for Computational Linguistics.
* Louppe et al. (2013) Gilles Louppe, Louis Wehenkel, Antonio Sutera, and Pierre Geurts. 2013. Understanding variable importances in forests of randomized trees. _Advances in neural information processing systems_, 26.
* Machlab and Battle (2024) Daniel Machlab and Rick Battle. 2024. Llm in-context recall is prompt dependent. _Preprint_, arXiv:2404.08865.
* Min et al. (2022) Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannanen Hajishirzi, and Luke Zettlemoyer. 2022. Rethinking the role of demonstrations: What makes in-context learning work? In _Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing_, pages 11048-11064, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
* Mital (2023) Ananya Mital. 2023. US Used Cars Dataset.
* OpenAI (2023) OpenAI. 2023. Gpt-4 technical report. _Preprint_, arXiv:2303.08774.
* Pan et al. (2023) Jane Pan, Tianyu Gao, Howard Chen, and Danqi Chen. 2023. What in-context learning "learns" in-context: Disentangling task recognition and task learning. In _Findings of the Association for Computational Linguistics: ACL 2023_, pages 8298-8319, Toronto, Canada. Association for Computational Linguistics.
* Pearson (1895) Karl Pearson. 1895. Vii. note on regression and inheritance in the case of two parents. _proceedings of the royal society of London_, 58(347-352):240-242 

F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnav (2011)Scikit-learn: machine learning in Python. Journal of Machine Learning Research12, pp. 2825-2830. Cited by: SS4.
* Y. Razeghi, R. L. Logan IV, M. Gardner, and S. Singh (2022)Impact of pretraining term frequencies on few-shot numerical reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2022, Abu Dhabi, United Arab Emirates, External Links: Link Cited by: SS4.
* O. Sainz, J. Campos, I. Garcia-Ferrero, J. Etxaniz, O. Lopez de Lacalle, and E. Agirre (2023)NLP evaluation in trouble: on the need to measure LLM data contamination for each benchmark. In Findings of the Association for Computational Linguistics: EMNLP 2023, San Diego, CA, USA, pp. 10776-10787. External Links: ISBN 978-3-3 

Related Work

As mentioned in the introduction, the research in this field can be categorized into meta-learning Schmidhuber (1987) and knowledge retrieval. So far, most works are theoretical, and most can be categorized into one of these two groups. However, both of these aspects are changing as this field rapidly expands; New empirical research is coming along, and new ideas are emerging, such as ours, that can not easily fit into one of these groups. For example, Li et al. (2023) proposes a structure that improves a basic transformer's in-context learning capabilities by breaking the input into multiple steps. The transformer still uses the outputs but also the knowledge that is given to it **in its input**. Another example would be Kossen et al. (2024), which empirically tests LLMs and claims that they can learn from the output labels but in an arbitrary manner, a challenge our paper aims to address. Another interesting example that we cannot simply put into a group is Coda-Forno et al. (2023), which performs meta-in-context learning by showing similar entire tasks and their solutions in the context of the model. Despite these emerging works, it's worth noting that most papers can still be classified into our established groups. When evaluating the literature, it's crucial to distinguish between theoretical claims and those based on empirical or synthetic data. Some theoretical papers suggest or imply that their findings might extend to LLMs, but such extrapolations should be approached with caution, as highlighted by Deutch et al. (2024); Shen et al. (2024).

In the meta-learning research, Bai et al. (2023) theoretically prove that transformers can be trained to implement linear models within a specific error threshold. Then, they practically test the capability of an encoder-based transformer to implement generalized linear models in context and show that they are also robust against noisy data. In order to test the ICL capability of transformers, Garg et al. (2022) use a GPT-2 architecture which is closer to an LLM than a simple transformer. However, they modify this GPT-2 architecture for regression using the input features inside the embeddings instead of using tokens and output a number instead of generating tokens. Their model's performance surpasses linear models as well as KNN models, XGBoost, and a 2-layer neural network. Different from these, von Oswald et al. (2023) hypothesize that the strong performance of Transformers comes from an architectural bias towards mesa-optimization which they test on simple sequencing tasks, and Cheng et al. (2024) suggest Transformers can implement gradient descent in function space, enabling them to learn linear and non-linear models.

In the realm of empirical research, our focus is exclusively on studies examining ICL, distinct from related works involving numerical concepts such as numerical reasoning Razeghi et al. (2022). Vacareanu et al. (2024) uses a lot of different LLMs such as Gemini-pro Team et al. (2024), Claude 3 Anthropic (2024), GPT-4 OpenAI (2023) to test their ICL regression capabilities. They use various settings with up to three features, but not all features are relevant to the output as limited as a result. This work conducts rigorous testing with many models, and the only issue it has is regarding its claim of avoiding data contamination, which is not well-supported. They either use well-known Friedman formulas or formulas that can be closely approximated (using two decimal places) by common mathematical expressions such as \(y=10x+\sin(5\pi x)+\cos(6\pi x)\) simplified as \(y=10x\). Also, the data is based on formulas, which are not realistic regression datasets.

The first paper that argues output labels do not matter was Min et al. (2022). It tested various LLMs across multiple tasks and concluded that replacing the outputs with random labels does not affect the results, and the only important elements of ICL are limited to defining the label space, input distribution, and overall task format. Following this work, Pan et al. (2023) uses the same sentiment analysis, toxicity detection, natural language inference/paraphrase detection, and topic/stance classification tasks but argues that learning and retrieval occur under different circumstances. In contrast to our research, their approach employs less complex tasks (same tasks used in Min et al. (2022)), which they acknowledge could influence the observed patterns. Additionally, they utilize more basic models, including earlier and smaller iterations of GPT-3 such as ads. As a result, their findings yield distinct trends and visual representations compared to our work. Inspired by Hahn and Goyal (2023), Li et al. (2024) dismisses the significance of output labels and proposes that learned solutions can be combined for inference. The main limitation of this work is the exclusive use of LLaMA 2 Touvron et al. (2023). Our experimental results differ from Min et al. (2022); Pan et al. (2023); Li et al. ( 

2024), which requires a unified platform for direct comparison, which is practically infeasible. We argue this conflict is mainly due to the task and model selection. We will explain further on (Li et al., 2024) in Appendix B.

## Appendix B Learning from Outputs

In this section, we examine the paper (Li et al., 2024) and why its findings differ from ours. As mentioned earlier, the main problem with this work lies in its exclusive use of LLaMA 2 (Touvron et al., 2023), a model known to struggle with long token contexts Machlab and Battle (2024); Zuhashaik et al. (2023) which negatively impacts the ICL. While the choice of LLaMA 2 as a powerful open-source LLM at the time is understandable, LLaMA 3 (AI@Meta, 2024), which addressed many of LLaMA 2's issues and offered significantly improved capabilities, was already available at the time of publication. Some of their experiments require direct access to the LLM architecture, which necessitates an open-source LLM. However, many of their experiences can be done with the GPT family or other powerful models. Based on the LLM choice alone, this work is severely limited. Further limiting the study, the authors selected three simple review sentiment/news-type datasets that even basic machine learning models can excel at.

Regarding specific experiments, experiment 4.1 demonstrates that mapping each label to another fixed label yields results worse than a random baseline, even with 40 in-context examples. This finding contradicts our work and other related studies, which have shown that models can learn from outputs. We suspect this discrepancy may be attributed to LLaMA 2's well-documented issue of forgetting tasks as the number of tokens increases. Confusion ensues because the outputs likely appear nonsensical to LLaMA 2, and it has forgotten its instructions. It would have been beneficial for the authors to specify whether LLaMA 2 was outputting incorrect labels or entirely irrelevant answers.

Experiments 4.2 and 5.1 also raise questions, as they rely on token embeddings, which, without further evidence, appear unrelated to ICL. For example, Li et al. (2023) suggests that the level-by-level inference in transformers is necessary for ICL. The combination of embeddings and other factors, such as training the linear model for 80 epochs to match LLaMA 2's 80 layers, seems arbitrary and lacks clear justification in these experiments.

In conclusion, while the paper Li et al. (2024) offers interesting insights specifically regarding its categorization of the three hypotheses, its methodological choices and reliance on LLaMA 2 significantly limit its relevance to the broader discussions of in-context learning in language models.

## Appendix C Datasets

To assess the LLMs' performance across diverse domains and complexity levels, we select three regression datasets. These datasets are pre-processed to select their most important features. All numerical values in the datasets are rounded to two decimal points. We divide each dataset into two splits: an in-context subset comprising 100 instances and a test subset with 300 instances.

### Admission Chance

This dataset estimates the _likelihood of admission to graduate programs for Indian students_(Acharya et al., 2019). Since this dataset is about Indian students, it may be less seen in our model's training data, reflecting the general imbalance that skews towards USA-centric data Zhu et al. (2023). The dataset's selected features are CGPA (Cumulative Grade Point Average), GRE Score, and TOEFL Score. Among our three datasets, this is the only dataset with high inter-correlation among each feature pair (Pearson correlation Pearson (1895) greater than \(0.80\)). As a result, the feature importances, which are calculated with RandomForest Louppe et al. (2013) and shown in Figure 8, assign minimal importance to the second and third features. The target variable has a mean of \(0.72\) and a standard deviation of \(0.14\).

### Insurance Cost

This dataset focuses on predicting a similar distribution of the _annual individual medical costs billed_

Figure 8: The relative importance of features across our datasets calculated with RandomForest (also reflecting improvements in our Ridge as later shown in Figure 6.

 

by health insurance companies in the USA_, drawing from demographic statistics compiled by the U.S. Census Bureau (Lantz, 2013). The selected features are Smoker Status, BMI, and Age with their importances shown in Figure 8. Smoking Status emerges as the most critical feature, followed by BMI, and then Age. The average and standard deviations of costs are \(13,270.42\) and \(12,110.01\), respectively.

### Used Car Prices

We use selected subset of the used car prices dataset (Mital, 2023) that involves predicting the _price of a used Toyota or Maserati car in 2019_. The features include City Fuel Economy, Mileage with similar high importance, and Passenger Car Classification with minimal importance, as shown in Figure 8. The target variable has a mean of \(42,279.49\) and a standard deviation of \(50,014.51\).

## Appendix D Hyper-Parameters

As mentioned earlier, we evaluate several LLMs, which are LLaMA 3 70B (AI@Meta, 2024), GPT3.5 (Brown et al., 2020), and GPT4 (OpenaAI, 2023). We also used Ridge regression (Hoerl and Kennard, 1970) and RandomForest (Breiman, 2001). The GPT-3 and GPT-4 versions we use are "gpt-4-0125-preview", "gpt-3.5-turbo-0125". In these models, the temperature is set to \(0.1\), and make tokens is set to \(10\). Each time the models do not generate a number (i.e., generate a disclaimer that says "the data is insufficient"), the seed value, which is initialized to \(100\), is increased by one. This precaution was not necessary for GPT-4, but GPT-3.5 sometimes refused to answer the questions. For LLaMA 3, top p value is set to \(0.99\), max tokens to 6, and the temperature to \(0.1\). Similar to GPT models, we propmt LLaMA 3 again if it fails to generate a number. For Ridge, the default Python class of scikit[(Pedregosa et al., 2011)] has the alpha value ( the normalizing variable) of \(1\). For RandomForest, however, we wanted to make it more generalized. Consequently, we used \(10,000\) estimators and a max depth of 2 for it.

## Appendix E MAE and \(R^{2}\)

In this section, we depict the main diagrams in the paper with MAE and \(1-R^{2}\) metrics instead of MSE. MAE is less sensitive to outliers compared to MSE and is expressed in the same units as the original data. \(R^{2}\), also known as the coefficient of determination, ranges from 0 to 1 and represents the proportion of variance in the dependent variable that is predictable from the independent variable(s). An \(R^{2}\) value of 1 indicates that the model explains all the variability of the response data around its mean, while 0 means the model explains none of the variability. It can also be negative, indicating that the model fits the data worse than the Mean model. \(R^{2}\) differs from MSE and MAE because the higher, the better. As a result, to make \(R^{2}\) diagrams comparable, instead of \(R^{2}\), we show the results for \(1-R^{2}\) (1 is included to show the negative results. This also moves the baseline results of \(R^{2}\) to \(1\) for the Mean model.

For Figures 2,3,4,5 and 6 of the main paper, the MAE results are shown in Figures 9,11,13,15 and 17, respectively. For Figures 2,3,4,5, and 6 of the main paper, the \(1-R^{2}\) results are shown in Figures 10,12,14,16 and 18, respectively.

Figure 10: This figure shows Figure 2 of the main paper with 1-\(R^{2}\) instead of MSE. The figure shows the baseline results of LLMs’ (Direct QA configuration) across datasets and number of features. The dashed red line shows the performance of the Mean model.

Figure 9: This figure shows Figure 2 of the main paper with MAE instead of MSE. The figure shows the baseline results of LLMs’ (Direct QA configuration) across datasets and number of features. The dashed red line shows the performance of the Mean model.

 



## Appendix F Reasoning Configuration and Additional Diagrams

In this section, we include some diagrams that could have provided more insight and were removed from the main text for space. We also show examples of the reasoning configurations and diagrams related to that.

### Additional Diagrams of the Main Paper

Here, we included the variants of Figures 5 and 6 of the main paper that we omitted for space. Figure 5 with 1 and 2 features is shown in Figures 19 and 20. Figure 6, with 10 and 30 in-context examples, is shown in Figures 21 and 22.

### Reasoning Examples

In this section, we show examples of reasoning for estimating an output for each dataset and LLM with 3 features. We will show the results of this setting in the next section.

#### f.2.1 GPT-3 Reasoning over the Admission Chance Dataset:

Based on the given information, the applicant has a high Cumulative GPA of 8.48, a decent GRE score

Figure 11: This figure shows Figure 3 of the main paper with MAE instead of MSE. The figure shows the comprehensive comparison of prompt configurations’ effects on our models across various factors, shown in a hierarchy. The top level for each dataset distinguishes between GPT-3, LLaMA 3, and GPT-4 results using black, grey, and white arcs, respectively. The notation \(IC_{i}\) indicates the number of in-context examples, while F1, F2, and F3 represent the use of the first feature, the first two features, and all three features, respectively.

Figure 12: This figure shows Figure 3 of the main paper with 1-\(R^{2}\) instead of MSE. The figure shows the comprehensive comparison of prompt configurations’ effects on our models across various factors, shown in a hierarchy. The top level for each dataset distinguishes between GPT-3, LLaMA 3, and GPT-4 results using black, grey, and white arcs, respectively. The notation \(IC_{i}\) indicates the number of in-context examples, while F1, F2, and F3 represent the use of the first feature, the first two features, and all three features, respectively.



of 311.0, and a good TOEFL score of 104.0. These scores are above average and indicate a strong academic background.

Considering that the average Chance of Admission is 0.74 with a standard deviation of 0.14, and the applicant's strong academic profile, I would estimate that the Chance of Admission for this applicant is higher than the average.

Figure 16: This figure shows Figure 5 of the main paper with 1-\(R^{2}\) instead of MSE. The figure shows the performance of Named Features and Anonymized Features prompt configurations, Ridge, and RandomForest for 3 features based on the number of in-context examples.

Figure 14: Figure 4 of the main paper with 1-\(R^{2}\) instead of MSE. The figure shows the comparison of the number of in-context examples using Named Features (straight lines) and Anonymized Features (dashed lines) prompt configurations. F1, F2 and F3 represents using 1st (F1), then 1st and 2nd (F2), and all three feature (F3).

Figure 13: Figure 4 of the main paper with MAE instead of MSE. The figure shows the comparison of the number of in-context examples using Named Features (straight lines) and Anonymized Features (dashed lines) prompt configurations. F1, F2 and F3 represents using 1st (F1), then 1st and 2nd (F2), and all three feature (F3).

Figure 15: This figure shows Figure 5 of the main paper with MAE instead of MSE. The figure shows the performance of Named Features and Anonymized Features prompt configurations, Ridge, and RandomForest for 3 features based on the number of in-context examples.

 

My final estimation is 0.80.

#### f.2.2 LLaMA Reasoning over the Admission Chance Dataset:

Based on the provided information, I will estimate the Chance of Admission.

The given scores are all above average, indicating a strong applicant. The cumulative GPA of 8.48 is excellent, suggesting a high level of academic achievement. The GRE score of 311.0 is also above average, indicating strong verbal and quantitative skills. The TOEFL score of 104.0 is well above the average required for most graduate programs, demonstrating a high level of English proficiency.

Considering these strong scores, I would expect the Chance of Admission to be higher than the average of 0.74. Given the standard deviation of 0.14, I would estimate the Chance of Admission to be around one standard deviation above the mean. My final estimation is 0.88.

#### f.2.3 GPT-4 Reasoning over the Admission Chance Dataset:

To estimate the Chance of Admission based on the provided information, we need to consider how the given data points (Cumulative GPA, GRE Score, TOEFL Score) might relate to the average Chance of Admission and its standard deviation. However, without specific information on how these factors correlate with admission chances, we'll have to make some general assumptions based on typical

Figure 19: This figure shows Figure 5 of the main paper with 1 feature instead of 3. The figure shows the performance of Named Features and Anonymized Features prompt configurations, Ridge, and RandomForest based on the number of in-context examples.

Figure 17: This figure shows Figure 6 of the main paper with MAE instead of MSE. The figure shows the performance of Anonymized Features prompt configuration, Ridge, and RandomForest for 100 in-context examples based on the number of features.

Figure 20: This figure shows Figure 5 of the main paper with 2 features instead of 3. The figure shows the performance of Named Features and Anonymized Features prompt configurations, Ridge, and RandomForest based on the number of in-context examples.

 

admissions criteria.

1. **Cumulative GPA**: An 8.48 GPA, assuming it's on a 10-point scale, is quite high. This would generally be seen as a strong positive in the admissions process, suggesting a higher than average chance of admission.

2. **GRE Score**: A score of 311 is somewhat above average (the average GRE scores for many programs tend to hover around the low to mid-300s). While not outstanding, it's competitive enough not to detract significantly from an application, especially with a strong GPA.

3. **TOEFL Score**: A TOEFL score of 104 is good, indicating a strong proficiency in English. For most universities, this score is above the minimum requirement and should be sufficient to not negatively impact the chance of admission.

Given the average Chance of Admission is 0.74 with a standard deviation of 0.14, and considering the strong GPA, adequate GRE, and TOEFL scores, it's reasonable to estimate the Chance of Admission to be above average but not exceptionally so due to the GRE score not being far above average.

Taking into account the positive impact of a high GPA and good TOEFL score, balanced against the GRE score, a reasonable estimate might place the Chance of Admission slightly above the average but not by a large margin. Therefore, considering the given data and the average Chance of Admission, my final estimation is 0.78."

#### f.2.4 GPT-3 Reasoning over the Insurance Cost Dataset:

Based on the given information of being a smoker, having a BMI of 24.7, and being 43 years old, we can expect higher annual medical costs compared to non-smokers, individuals with lower BMIs, and younger individuals. Smokers tend to have higher medical costs due to the increased risk of various health conditions such as lung cancer, heart disease, and respiratory issues. Additionally, as individuals age, they are more likely to develop chronic health conditions that require ongoing medical care, which can also contribute to higher medical costs. A BMI of 24.7 is considered within the normal range, which may have a slightly lower impact on medical costs compared to individuals with higher BMIs.

Taking into account these factors, along with the average annual individual medical costs billed by health insurance in the USA of $13,270.42 and a standard deviation of $12,110.01, I estimate that the annual individual medical costs for a 43-year-old smoker with a BMI of 24.7 in the USA would be higher than the average due to the increased health risks associated with smoking and age. Therefore, my final estimation is $20,000." "Based on the provided information of being a non-smoker with a BMI of 25.8 and an age of 46, we can estimate that the individual is relatively healthy. Typically, younger individuals with a healthy BMI and who do not smoke tend to have lower medical costs compared to older individuals or those with unhealthy habits.

Considering the average annual individual medical costs billed by health insurance in the USA of $13,270.42 with a standard deviation of

Figure 21: This figure shows Figure 6 of the main paper with 10 in-context examples instead of 100. The figure shows the performance of Anonymized Features prompt configuration, Ridge, and RandomForest based on the number of features.

Figure 22: This figure shows Figure 6 of the main paper with 30 in-context examples instead of 100. The figure shows the performance of Anonymized Features prompt configuration, Ridge, and RandomForest based on the number of features.

 

S12,110.01, we can assume that this individual's medical costs might be lower than the average due to their healthy profile. However, since medical costs can vary significantly based on individual health conditions and unforeseen circumstances, it is challenging to provide an accurate estimate without more specific information.

Taking into account the individual's healthy profile and the average costs in the USA, my final estimation is $10,000."

#### f.2.5 LLaMA Reasoning over the Insurance Cost Dataset:

Based on the provided information, we can make an educated estimation of the annual individual medical costs billed by health insurance in the USA.

We are given the average annual individual medical costs billed by health insurance in the USA, which is $13,270.42, along with the standard deviation of $12,110.01. This suggests that the distribution of medical costs is likely to be skewed to the right, with a long tail of high-cost individuals.

The additional information provided about the individual, such as being a smoker (smoker: 1.0), having a BMI of 24.7, and being 43 years old, can also influence the estimation. Smokers tend to have higher medical costs due to the increased risk of smoking-related illnesses. A BMI of 24.7 is considered overweight, which can also lead to higher medical costs. The age of 43 is relatively middle-aged, which may not have a significant impact on medical costs compared to older or younger individuals.

Considering these factors, I would adjust the average annual individual medical costs upwards to account for the increased risk associated with smoking and being overweight. However, I would not adjust it too drastically, as the individual's age is not extremely high.

My final estimation is $16,500."

#### f.2.6 GPT-4 Reasoning over the Insurance Cost Dataset:

To estimate the annual individual medical costs billed by health insurance in the USA for a 43-year-old smoker with a BMI of 24.7, we need to consider how the given factors (smoking status, BMI, and age) typically influence medical costs, based on the provided average and standard deviation.

1. **Smoking Status****: Being a smoker generally increases medical costs significantly due to the higher risk of diseases associated with smoking (e.g., lung cancer, heart disease). 2. ***BMI**: A BMI of 24.7 is within the normal weight range (18.5-24.9), which might not significantly increase medical costs compared to those with higher BMI values. 3. **Age**: At 43 years old, an individual might start to experience more health issues than a younger person, but not as many as someone in a more advanced age group. This could mean slightly higher than average costs due to age but not the highest possible.

Given the average annual medical costs of $13,270.42 and considering the significant impact of smoking, the effect of age, and the relatively neutral effect of a normal BMI, the costs for this individual would likely be higher than the average but not excessively so due to the mitigating factor of a healthy BMI.

Considering the standard deviation of $12,110.01, which indicates a wide range of costs, and the fact that smoking is a major cost driver, it's reasonable to estimate that the costs for this individual would be above average but not at the extreme end of the spectrum.

Given these considerations, a reasonable estimate for the annual individual medical costs for this person, factoring in the significant increase due to smoking but moderated by age and a healthy BMI, would be somewhat above the average but not by the full extent of one standard deviation.

My final estimation is $20,000."

#### f.2.7 GPT-3 Reasoning over the Used Car Prices Dataset:

To estimate the price of a used car that can be either a Toyota or Maserati in 2019, we can consider the following factors:

1. City Fuel Economy: The given city fuel economy of 14.0 suggests that the car may not be very fuel-efficient, which could potentially lower its price.

2. Mileage: The mileage of 0.0 indicates that the car is essentially brand new or has very low mileage, which generally tends to increase the price of a used car.

3. Is Toyota: The fact that the car is not a Toyota implies that it could be a Maserati, which is a luxury brand known for higher price tags compared to Toyota vehicles.

Considering these factors, we can infer that the car is likely a Maserati due to its non-Toyota staus, which would generally have a higher price tag. Given that the average price of a used car that can 

be either a Toyota or Maserati in 2019 is SS50,014.51 with a standard deviation of $42,279.49, and considering the low mileage and potential luxury status of the car, my final estimation for the price of this used car would be higher than the average, so I estimate it to be $60,000."

#### f.2.8 LLaMA Reasoning over the Used Car Prices Dataset:

Based on the given information, we can see that the average price of a used car that can be either a Toyota or Maserati in 2019 is 50014.51 with a standard deviation of 42279.49. Since the mileage is 0.0, it's likely that the car is relatively new or has been well-maintained, which could increase its value. The city fuel economy is 14.0, which is a moderate value, but it's not a key factor in determining the price of a used car.

The most important factor is the brand, and since Is Toyota is 0.0, it means the car is a Maserati, which is a luxury brand known for its high-performance and premium vehicles. Maserati cars tend to hold their value well, and their prices are generally higher than those of Toyota cars.

Considering these factors, I would estimate the price of this used car to be higher than the average price. My final estimation is 65000."

#### f.2.9 GPT-4 Reasoning over the Used Car Prices Dataset:

Given the information, we have a car with a city fuel economy of 14.0, mileage of 0.0, and it is not a Toyota (implying it could be a Maserati since the options are either Toyota or Maserati). Maseratis are luxury vehicles and typically have a higher price point compared to Toyotas. The average price of a used car from the given data is $50,014.51 with a standard deviation of $42,279.49.

Considering the car in question is a Maserati (as indicated by ""Is Toyota: 0.0""), and it has 0.0 mileage, which suggests it's either new or nearly new, we can expect the price to be higher than the average of the mixed pool of Toyota and Maserati used cars. The low city fuel economy is characteristic of high-performance or luxury vehicles, which aligns with it being a Maserati.

Given these factors, and knowing that Maseratis are premium vehicles, the price would likely be above the average. However, without knowing the exact model or year (beyond it being a used car as of 2019), we can't pinpoint the exact price but can infer it would be higher due to the brand and the newness indicated by zero mileage.

Considering the standard deviation and the average, and the fact that this is a luxury vehicle likely on the higher end of the price spectrum, a reasonable estimation, taking into account the luxury brand premium and the new condition, would be one standard deviation above the mean. Thus, my final estimation is $92,294."

### Reasoning Configuration Diagrams

The diagrams that compare the Direct QA prompt configuration to the reasoning configuration are shown in Figures 23, 24 and 25 for metrics MSE, MAE and \(1-R^{2}\), respectively. As mentioned in the text of the main paper, there is no rhyme or reason for the behavior of the LLMs in this regard.

 

Figure 23: Comparison between Direct QA and Reasoning prompt configurations between dataset, LLMs and the number of features using MSE metric.

 

Figure 24: Comparison between Direct QA and Reasoning prompt configurations between dataset, LLMs and the number of features using MAE metric.

 

Figure 25: Comparison between Direct QA and Reasoning prompt configurations between dataset, LLMs and the number of features using metric.