{"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/directed-graph-grammars-for-sequence-based","title":"Directed Graph Grammars for Sequence-based Learning","arxiv_id":"2505.22949","date":"2025-05-29","proceeding":null,"authors":["Michael Sun","Orion Foo","Gang Liu","Wojciech Matusik","Jie Chen"],"abstract":"Directed acyclic graphs (DAGs) are a class of graphs commonly used in practice, with examples that include electronic circuits, Bayesian networks, and neural architectures. While many effective encoders exist for DAGs, it remains challenging to decode them in a principled manner, because the nodes of a DAG can have many different topological orders. In this work, we propose a grammar-based approach to constructing a principled, compact and equivalent sequential representation of a DAG. Specifically, we view a graph as derivations over an unambiguous grammar, where the DAG corresponds to a unique sequence of production rules. Equivalently, the procedure to construct such a description can be viewed as a lossless compression of the data. Such a representation has many uses, including building a generative model for graph generation, learning a latent space for property prediction, and leveraging the sequence representational continuity for Bayesian Optimization over structured data. Code is available at https://github.com/shiningsunnyday/induction.","url_abs":"https://arxiv.org/abs/2505.22949v1","url_pdf":"https://arxiv.org/pdf/2505.22949v1.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":"directed-graph-grammars-for-sequence-based","repo_url":"https://github.com/shiningsunnyday/induction","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"bayesian-optimization","task_name":"Bayesian Optimization"},{"task_slug":"graph-generation","task_name":"Graph Generation"},{"task_slug":"property-prediction","task_name":"Property Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2505.22949","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2505.22949"}},"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/shiningsunnyday/induction","reach":null}],"summary":{"ran":3,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"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":5,"samples":[{"code_sha256_prefix":"24ed82428cf1d1ef","entry":"HG","repo":"shiningsunnyday/induction","repo_kind":"official","path":"src/grammar/hrg.py","file_url":"https://github.com/shiningsunnyday/induction/blob/HEAD/src/grammar/hrg.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":"24ed82428cf1d1ef"}},{"code_sha256_prefix":"1f161e0dd83098e7","entry":"Hyperedge","repo":"shiningsunnyday/induction","repo_kind":"official","path":"src/grammar/hrg.py","file_url":"https://github.com/shiningsunnyday/induction/blob/HEAD/src/grammar/hrg.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":"1f161e0dd83098e7"}},{"code_sha256_prefix":"1475f1203ba277d8","entry":"Node","repo":"shiningsunnyday/induction","repo_kind":"official","path":"src/grammar/hrg.py","file_url":"https://github.com/shiningsunnyday/induction/blob/HEAD/src/grammar/hrg.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":"1475f1203ba277d8"}},{"code_sha256_prefix":"ad369c27ea8413d4","entry":"HRG","repo":"shiningsunnyday/induction","repo_kind":"official","path":"src/grammar/hrg.py","file_url":"https://github.com/shiningsunnyday/induction/blob/HEAD/src/grammar/hrg.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":"ad369c27ea8413d4"}},{"code_sha256_prefix":"660febca0e0b9039","entry":"HRG_rule","repo":"shiningsunnyday/induction","repo_kind":"official","path":"src/grammar/hrg.py","file_url":"https://github.com/shiningsunnyday/induction/blob/HEAD/src/grammar/hrg.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":"660febca0e0b9039"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}