{"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/provable-in-context-learning-of-linear","title":"In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learning","arxiv_id":"2409.12293","date":"2024-09-18","proceeding":null,"authors":["Frank Cole","Yulong Lu","Wuzhe Xu","Tianhao Zhang"],"abstract":"We study theoretical guarantees for solving linear systems in-context using a linear transformer architecture. For in-domain generalization, we provide neural scaling laws that bound the generalization error in terms of the number of tasks and sizes of samples used in training and inference. For out-of-domain generalization, we find that the behavior of trained transformers under task distribution shifts depends crucially on the distribution of the tasks seen during training. We introduce a novel notion of task diversity and show that it defines a necessary and sufficient condition for pre-trained transformers generalize under task distribution shifts. We also explore applications of learning linear systems in-context, such as to in-context operator learning for PDEs. Finally, we provide some numerical experiments to validate the established theory.","url_abs":"https://arxiv.org/abs/2409.12293v3","url_pdf":"https://arxiv.org/pdf/2409.12293v3.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":"provable-in-context-learning-of-linear","repo_url":"https://github.com/lugroupumn/icl-ellipticpdes","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"provable-in-context-learning-of-linear","repo_url":"https://github.com/lugroupumn/icl_linear_systems","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"operator-learning","task_name":"Operator learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.12293","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.12293"}},"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/lugroupumn/icl-ellipticpdes","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lugroupumn/icl_linear_systems","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_honours":1,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":11,"ran":8,"repositories":2}},"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":11,"samples":[{"code_sha256_prefix":"c1f77900cfa22dd5","entry":"coeff_2_vec","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/data_utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/data_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":"c1f77900cfa22dd5"}},{"code_sha256_prefix":"3fdb9ce5bbd8dfac","entry":"dphi","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/data_utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/data_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":"3fdb9ce5bbd8dfac"}},{"code_sha256_prefix":"e2484442967ebc51","entry":"forward","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"Net/Net.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/Net/Net.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":"e2484442967ebc51"}},{"code_sha256_prefix":"a902739f08f51d49","entry":"my_loss","repo":"lugroupumn/icl-ellipticpdes","repo_kind":"official","path":"src/models.py","file_url":"https://github.com/lugroupumn/icl-ellipticpdes/blob/HEAD/src/models.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a902739f08f51d49"}},{"code_sha256_prefix":"46ce5f0c7e8976e4","entry":"num2str_decimal","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/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":"46ce5f0c7e8976e4"}},{"code_sha256_prefix":"bbc3ea5030c78329","entry":"phi","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/data_utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/data_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":"bbc3ea5030c78329"}},{"code_sha256_prefix":"ba4884ea529a30e5","entry":"predict","repo":"lugroupumn/icl-ellipticpdes","repo_kind":"official","path":"src/models.py","file_url":"https://github.com/lugroupumn/icl-ellipticpdes/blob/HEAD/src/models.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ba4884ea529a30e5"}},{"code_sha256_prefix":"76d3515fedd1e806","entry":"train_system","repo":"lugroupumn/icl-ellipticpdes","repo_kind":"official","path":"src/models.py","file_url":"https://github.com/lugroupumn/icl-ellipticpdes/blob/HEAD/src/models.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"76d3515fedd1e806"}},{"code_sha256_prefix":"18100d3fa5e9ad95","entry":"eval_mdl","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/train_utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"18100d3fa5e9ad95"}},{"code_sha256_prefix":"654f2d6c1864f06e","entry":"my_h1_loss","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/train_utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"654f2d6c1864f06e"}},{"code_sha256_prefix":"33105001b29352c1","entry":"train_mdl","repo":"lugroupumn/icl_linear_systems","repo_kind":"official","path":"utils/train_utils.py","file_url":"https://github.com/lugroupumn/icl_linear_systems/blob/HEAD/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"33105001b29352c1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}