{"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/automatically-learning-hybrid-digital-twins","title":"Automatically Learning Hybrid Digital Twins of Dynamical Systems","arxiv_id":"2410.23691","date":"2024-10-31","proceeding":null,"authors":["Samuel Holt","Tennison Liu","Mihaela van der Schaar"],"abstract":"Digital Twins (DTs) are computational models that simulate the states and temporal dynamics of real-world systems, playing a crucial role in prediction, understanding, and decision-making across diverse domains. However, existing approaches to DTs often struggle to generalize to unseen conditions in data-scarce settings, a crucial requirement for such models. To address these limitations, our work begins by establishing the essential desiderata for effective DTs. Hybrid Digital Twins ($\\textbf{HDTwins}$) represent a promising approach to address these requirements, modeling systems using a composition of both mechanistic and neural components. This hybrid architecture simultaneously leverages (partial) domain knowledge and neural network expressiveness to enhance generalization, with its modular design facilitating improved evolvability. While existing hybrid models rely on expert-specified architectures with only parameters optimized on data, $\\textit{automatically}$ specifying and optimizing HDTwins remains intractable due to the complex search space and the need for flexible integration of domain priors. To overcome this complexity, we propose an evolutionary algorithm ($\\textbf{HDTwinGen}$) that employs Large Language Models (LLMs) to autonomously propose, evaluate, and optimize HDTwins. Specifically, LLMs iteratively generate novel model specifications, while offline tools are employed to optimize emitted parameters. Correspondingly, proposed models are evaluated and evolved based on targeted feedback, enabling the discovery of increasingly effective hybrid models. Our empirical results reveal that HDTwinGen produces generalizable, sample-efficient, and evolvable models, significantly advancing DTs' efficacy in real-world applications.","url_abs":"https://arxiv.org/abs/2410.23691v1","url_pdf":"https://arxiv.org/pdf/2410.23691v1.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":"automatically-learning-hybrid-digital-twins","repo_url":"https://github.com/samholt/HDTwinGen","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.23691","atlas_url":"https://app.syntology.ai/?focus=2410.23691","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.23691"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/samholt/HDTwinGen","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":13},"by_repo_kind":{"official":{"samples":13,"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":"9dff9ca6cae1cd18","entry":"cache_or_compute","repo":"samholt/HDTwinGen","repo_kind":"official","path":"summarizer_and_modifier.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/summarizer_and_modifier.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":"9dff9ca6cae1cd18"}},{"code_sha256_prefix":"2bf09f668a861e18","entry":"count_total_characters","repo":"samholt/HDTwinGen","repo_kind":"official","path":"summarizer_and_modifier.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/summarizer_and_modifier.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":"2bf09f668a861e18"}},{"code_sha256_prefix":"43b96b1bda587e4e","entry":"extract_exception","repo":"samholt/HDTwinGen","repo_kind":"official","path":"executor.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/executor.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":"43b96b1bda587e4e"}},{"code_sha256_prefix":"6b82026785a72f30","entry":"extract_failed_tests","repo":"samholt/HDTwinGen","repo_kind":"official","path":"agents.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/agents.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":"6b82026785a72f30"}},{"code_sha256_prefix":"0f907827b93b54c8","entry":"get_code_from_message","repo":"samholt/HDTwinGen","repo_kind":"official","path":"agents.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/agents.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":"0f907827b93b54c8"}},{"code_sha256_prefix":"aa2815e67d1228fc","entry":"get_llm_config","repo":"samholt/HDTwinGen","repo_kind":"official","path":"llm_utils.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/llm_utils.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":"aa2815e67d1228fc"}},{"code_sha256_prefix":"44b26a365fe7a95b","entry":"get_model_max_tokens","repo":"samholt/HDTwinGen","repo_kind":"official","path":"llm_utils.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/llm_utils.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":"44b26a365fe7a95b"}},{"code_sha256_prefix":"fbdf887d06f6847f","entry":"load_code_files_into_dict","repo":"samholt/HDTwinGen","repo_kind":"official","path":"summarizer_and_modifier.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/summarizer_and_modifier.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":"fbdf887d06f6847f"}},{"code_sha256_prefix":"2ad9f27dc4062f06","entry":"protectedDiv","repo":"samholt/HDTwinGen","repo_kind":"official","path":"sr.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/sr.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":"2ad9f27dc4062f06"}},{"code_sha256_prefix":"b9c05edc52147478","entry":"protectedExp","repo":"samholt/HDTwinGen","repo_kind":"official","path":"sr.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/sr.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":"b9c05edc52147478"}},{"code_sha256_prefix":"9066f32f75a5e92d","entry":"protectedLog","repo":"samholt/HDTwinGen","repo_kind":"official","path":"sr.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/sr.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":"9066f32f75a5e92d"}},{"code_sha256_prefix":"7add23f40c3b1269","entry":"replace_zeros_with_ones","repo":"samholt/HDTwinGen","repo_kind":"official","path":"utils/models.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/utils/models.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":"7add23f40c3b1269"}},{"code_sha256_prefix":"2bf6f0758841816f","entry":"setup_chat_rate_limiter","repo":"samholt/HDTwinGen","repo_kind":"official","path":"llm_utils.py","file_url":"https://github.com/samholt/HDTwinGen/blob/HEAD/llm_utils.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":"2bf6f0758841816f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}