{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/learning-vs-retrieval-the-role-of-in-context","title":"Learning vs Retrieval: The Role of In-Context Examples in Regression with LLMs","arxiv_id":"2409.04318","date":"2024-09-06","proceeding":null,"authors":["Aliakbar Nafar","Kristen Brent Venable","Parisa Kordjamshidi"],"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 perform regression on real-world datasets 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.","url_abs":"https://arxiv.org/abs/2409.04318v1","url_pdf":"https://arxiv.org/pdf/2409.04318v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"learning-vs-retrieval-the-role-of-in-context","repo_url":"https://github.com/HLR/LvsR-LLM","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"meta-learning","task_name":"Meta-Learning"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"regression-1","task_name":"regression"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2409.04318","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.04318"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/HLR/LvsR-LLM","reach":{"status":"ok"}}],"summary":{"ran":12},"by_repo_kind":{"official":{"samples":12,"ran":12,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":12,"samples":[{"code_sha256_prefix":"a7103037fea193cf","entry":"create_IO_example","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"utils.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a7103037fea193cf"}},{"code_sha256_prefix":"2d0a9726e7f08256","entry":"create_file_name","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"utils.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2d0a9726e7f08256"}},{"code_sha256_prefix":"ee73f674640a4661","entry":"evaluate_model","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"Datasets/model_training.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/Datasets/model_training.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ee73f674640a4661"}},{"code_sha256_prefix":"bd90d7e0a54821fe","entry":"generate_random_chance_of_admission","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"Datasets/utils.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/Datasets/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bd90d7e0a54821fe"}},{"code_sha256_prefix":"81ffacf0b35b7f76","entry":"generate_random_charges_usedcar","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"Datasets/utils.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/Datasets/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"81ffacf0b35b7f76"}},{"code_sha256_prefix":"887a84fd93372282","entry":"generate_random_output","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"utils.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"887a84fd93372282"}},{"code_sha256_prefix":"05223f06301a425a","entry":"generate_random_output","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"Datasets/utils.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/Datasets/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"05223f06301a425a"}},{"code_sha256_prefix":"f7a371212c0b807c","entry":"get_drop_list","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"Datasets/model_training.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/Datasets/model_training.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f7a371212c0b807c"}},{"code_sha256_prefix":"2b74fb1168aa2682","entry":"preprocess_usedcars","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"Datasets/data_preprocessing.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/Datasets/data_preprocessing.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2b74fb1168aa2682"}},{"code_sha256_prefix":"3494677b1e2970bc","entry":"process_admission_chance","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"reader.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/reader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3494677b1e2970bc"}},{"code_sha256_prefix":"a49115e866e69018","entry":"process_insurance_cost","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"reader.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/reader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a49115e866e69018"}},{"code_sha256_prefix":"03675993a6b6403b","entry":"read_dataset","repo":"HLR/LvsR-LLM","repo_kind":"official","path":"reader.py","file_url":"https://github.com/HLR/LvsR-LLM/blob/HEAD/reader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"03675993a6b6403b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}