We lifted 4 functions out of this paper's own repositories and ran 4 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.
| Repository | Role | Ran |
|---|---|---|
| uw-madison-lee-lab/dual_operating_modes_of_icl | canonical | 4 of 4 |
| Function | Status | Where it lives |
|---|---|---|
| decimal_to_numpy | Ran | uw-madison-lee-lab/dual_operating_modes_of_icl/TransformerExperiment/setting.py pointer only (licence: NONE) · get_code("e151f81560f7cdf1") |
| numpy_to_decimal | Ran | uw-madison-lee-lab/dual_operating_modes_of_icl/TransformerExperiment/setting.py pointer only (licence: NONE) · get_code("c1ff72ef583fa84d") |
| sorted_eigenvalues | Ran | uw-madison-lee-lab/dual_operating_modes_of_icl/TransformerExperiment/setting.py pointer only (licence: NONE) · get_code("38f20eea99d3afda") |
| train_model | Ran | uw-madison-lee-lab/dual_operating_modes_of_icl/TransformerExperiment/TS_D_d.py pointer only (licence: NONE) · get_code("7a0b41d5cd881c72") |
Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.
In-context learning (ICL) exhibits dual operating modes: task learning, i.e., acquiring a new skill from in-context samples, and task retrieval, i.e., locating and activating a relevant pretrained skill. Recent theoretical work investigates various mathematical models to analyze ICL, but existing models explain only one operating mode at a time. We introduce a probabilistic model, with which one can explain the dual operating modes of ICL simultaneously. Focusing on in-context learning of linear functions, we extend existing models for pretraining data by introducing multiple task groups and task-dependent input distributions. We then analyze the behavior of the optimally pretrained model under the squared loss, i.e., the MMSE estimator of the label given in-context examples. Regarding pretraining task distribution as prior and in-context examples as the observation, we derive the closed-form expression of the task posterior distribution. With the closed-form expression, we obtain a quantitative understanding of the two operating modes of ICL. Furthermore, we shed light on an unexplained phenomenon observed in practice: under certain settings, the ICL risk initially increases and then decreases with more in-context examples. Our model offers a plausible explanation for this "early ascent" phenomenon: a limited number of in-context samples may lead to the retrieval of an incorrect skill, thereby increasing the risk, which will eventually diminish as task learning takes effect with more in-context samples. We also theoretically analyze ICL with biased labels, e.g., zero-shot ICL, where in-context examples are assigned random labels. Lastly, we validate our findings and predictions via experiments involving Transformers and large language models.
The same record, over MCP at https://syntology.ai/mcp:
get_harvested_code_for_paper("2402.18819")
get_code_for_paper("2402.18819")
have("2402.18819")
Connect an agent — have() is free.