{"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/neural-context-flows-for-learning","title":"Neural Context Flows for Meta-Learning of Dynamical Systems","arxiv_id":"2405.02154","date":"2024-05-03","proceeding":null,"authors":["Roussel Desmond Nzoyem","David A. W. Barton","Tom Deakin"],"abstract":"Neural Ordinary Differential Equations (NODEs) often struggle to adapt to new dynamic behaviors caused by parameter changes in the underlying physical system, even when these dynamics are similar to previously observed behaviors. This problem becomes more challenging when the changing parameters are unobserved, meaning their value or influence cannot be directly measured when collecting data. To address this issue, we introduce Neural Context Flow (NCF), a robust and interpretable Meta-Learning framework that includes uncertainty estimation. NCF uses Taylor expansion to enable contextual self-modulation, allowing context vectors to influence dynamics from other domains while also modulating themselves. After establishing theoretical guarantees, we empirically test NCF and compare it to related adaptation methods. Our results show that NCF achieves state-of-the-art Out-of-Distribution performance on 5 out of 6 linear and non-linear benchmark problems. Through extensive experiments, we explore the flexible model architecture of NCF and the encoded representations within the learned context vectors. Our findings highlight the potential implications of NCF for foundational models in the physical sciences, offering a promising approach to improving the adaptability and generalization of NODEs in various scientific applications. Our code is openly available at https://github.com/ddrous/ncflow.","url_abs":"https://arxiv.org/abs/2405.02154v5","url_pdf":"https://arxiv.org/pdf/2405.02154v5.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":"neural-context-flows-for-learning","repo_url":"https://github.com/ddrous/ncflow","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"meta-learning","task_name":"Meta-Learning"}],"methods":[],"datasets_introduced":[{"slug":"gen-dynamics","name":"Gen-Dynamics","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.02154","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.02154"}},"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":"deterministic:regex_extraction","url":"https://github.com/ddrous/ncflow","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/ddrous/gen-dynamics","reach":{"status":"ok","spdx":"GPL-3.0"}}],"summary":{"ran":3,"unverified":4},"by_repo_kind":{"official":{"samples":6,"ran":3,"repositories":1},"community":{"samples":1,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"fc753da6def5cb3d","entry":"generate_new_keys","repo":"ddrous/ncflow","repo_kind":"official","path":"ncf/_utils.py","file_url":"https://github.com/ddrous/ncflow/blob/HEAD/ncf/_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fc753da6def5cb3d"}},{"code_sha256_prefix":"743b77e7d7d260f0","entry":"get_new_key","repo":"ddrous/ncflow","repo_kind":"official","path":"ncf/_utils.py","file_url":"https://github.com/ddrous/ncflow/blob/HEAD/ncf/_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"743b77e7d7d260f0"}},{"code_sha256_prefix":"14200d8435001ae5","entry":"seconds_to_hours","repo":"ddrous/ncflow","repo_kind":"official","path":"ncf/_utils.py","file_url":"https://github.com/ddrous/ncflow/blob/HEAD/ncf/_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"14200d8435001ae5"}},{"code_sha256_prefix":"2dcf01846249c5a5","entry":"Euler","repo":"ddrous/ncflow","repo_kind":"official","path":"ncf/learner.py","file_url":"https://github.com/ddrous/ncflow/blob/HEAD/ncf/learner.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2dcf01846249c5a5"}},{"code_sha256_prefix":"96adc21df998be33","entry":"RK4","repo":"ddrous/ncflow","repo_kind":"official","path":"ncf/learner.py","file_url":"https://github.com/ddrous/ncflow/blob/HEAD/ncf/learner.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"96adc21df998be33"}},{"code_sha256_prefix":"03eb2778e8be8055","entry":"get_val_images","repo":"carolinahiguera/NCF","repo_kind":"community","path":"ncf/train_seq2seq.py","file_url":"https://github.com/carolinahiguera/NCF/blob/HEAD/ncf/train_seq2seq.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"03eb2778e8be8055"}},{"code_sha256_prefix":"31b333bdcc0116c5","entry":"loss_fn","repo":"ddrous/ncflow","repo_kind":"official","path":"ncf/learner.py","file_url":"https://github.com/ddrous/ncflow/blob/HEAD/ncf/learner.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"31b333bdcc0116c5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}