{"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/teaching-temporal-logics-to-neural-networks","title":"Teaching Temporal Logics to Neural Networks","arxiv_id":"2003.04218","date":"2020-03-06","proceeding":"ICLR 2021 1","authors":["Christopher Hahn","Frederik Schmitt","Jens U. Kreber","Markus N. Rabe","Bernd Finkbeiner"],"abstract":"We study two fundamental questions in neuro-symbolic computing: can deep learning tackle challenging problems in logics end-to-end, and can neural networks learn the semantics of logics. In this work we focus on linear-time temporal logic (LTL), as it is widely used in verification. We train a Transformer on the problem to directly predict a solution, i.e. a trace, to a given LTL formula. The training data is generated with classical solvers, which, however, only provide one of many possible solutions to each formula. We demonstrate that it is sufficient to train on those particular solutions to formulas, and that Transformers can predict solutions even to formulas from benchmarks from the literature on which the classical solver timed out. Transformers also generalize to the semantics of the logics: while they often deviate from the solutions found by the classical solvers, they still predict correct solutions to most formulas.","url_abs":"https://arxiv.org/abs/2003.04218v3","url_pdf":"https://arxiv.org/pdf/2003.04218v3.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":"teaching-temporal-logics-to-neural-networks","repo_url":"https://github.com/reactive-systems/deepltl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"teaching-temporal-logics-to-neural-networks","repo_url":"https://github.com/necrashter/deepltl-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2003.04218","atlas_url":"https://app.syntology.ai/?focus=2003.04218","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2003.04218"}},"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/reactive-systems/deepltl","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/necrashter/deepltl-pytorch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":2,"ran":9,"ran_draft_wrong":3,"unverified":10},"by_repo_kind":{"official":{"samples":13,"ran":5,"repositories":1},"listed":{"samples":11,"ran":9,"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":"1bfc281ca0cb23d6","entry":"create_look_ahead_mask","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/models/transformer.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/models/transformer.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1bfc281ca0cb23d6"}},{"code_sha256_prefix":"4bc2b746faf71e08","entry":"create_look_ahead_mask","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/models/transformer.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/models/transformer.py","link_basis":"harvester_set","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":"4bc2b746faf71e08"}},{"code_sha256_prefix":"09cfa39c1a945b25","entry":"create_padding_mask","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/models/transformer.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/models/transformer.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"09cfa39c1a945b25"}},{"code_sha256_prefix":"f1c292f469811841","entry":"create_padding_mask","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/models/transformer.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/models/transformer.py","link_basis":"harvester_set","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":"f1c292f469811841"}},{"code_sha256_prefix":"4d12c68827c9e049","entry":"expand_to_same_rank","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/models/beam_search.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/models/beam_search.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4d12c68827c9e049"}},{"code_sha256_prefix":"b35303fb7949670e","entry":"flatten_beam_dim","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/models/beam_search.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/models/beam_search.py","link_basis":"harvester_set","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":"b35303fb7949670e"}},{"code_sha256_prefix":"6959fcf2fd01f0db","entry":"get_activation","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/models/transformer.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/models/transformer.py","link_basis":"harvester_set","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":"6959fcf2fd01f0db"}},{"code_sha256_prefix":"c2928e09d7c3cd10","entry":"get_ass","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/train/common.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/train/common.py","link_basis":"harvester_set","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":"c2928e09d7c3cd10"}},{"code_sha256_prefix":"d6df88fd6fc1d452","entry":"get_run_path","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/train/common.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/train/common.py","link_basis":"harvester_set","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":"d6df88fd6fc1d452"}},{"code_sha256_prefix":"e8a54793bb205026","entry":"get_shape_keep_last_dim","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/models/beam_search.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/models/beam_search.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e8a54793bb205026"}},{"code_sha256_prefix":"fba9be9ba7c1e0e0","entry":"map_structure","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/models/beam_search.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/models/beam_search.py","link_basis":"harvester_set","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":"fba9be9ba7c1e0e0"}},{"code_sha256_prefix":"f3d335e856a3e9e4","entry":"positional_encoding","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/layers/positional_encoding.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/layers/positional_encoding.py","link_basis":"harvester_set","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":"f3d335e856a3e9e4"}},{"code_sha256_prefix":"73b90c22738f0032","entry":"scaled_dot_product_attention","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/layers/attention.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/layers/attention.py","link_basis":"harvester_set","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":"73b90c22738f0032"}},{"code_sha256_prefix":"e092e8e3a00bcec6","entry":"shape_list","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/models/beam_search.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/models/beam_search.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e092e8e3a00bcec6"}},{"code_sha256_prefix":"16bdc764a81d1f5a","entry":"abbrev_count","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/utils/utils.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/utils/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":"16bdc764a81d1f5a"}},{"code_sha256_prefix":"bd594cfa2fd652e7","entry":"checkpoint_path","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/train/common.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/train/common.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":"bd594cfa2fd652e7"}},{"code_sha256_prefix":"3e033cf884fa1ed7","entry":"dataset_name","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/utils/utils.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/utils/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":"3e033cf884fa1ed7"}},{"code_sha256_prefix":"370c1f3fe2690649","entry":"get_angles","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/layers/positional_encoding.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/layers/positional_encoding.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":"370c1f3fe2690649"}},{"code_sha256_prefix":"981652cdff73c2e9","entry":"get_latest_checkpoint","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/train/common.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/train/common.py","link_basis":"harvester_set","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":"981652cdff73c2e9"}},{"code_sha256_prefix":"0fb71688c64be6e5","entry":"get_shape_keep_last_dim","repo":"necrashter/deepltl-pytorch","repo_kind":"listed","path":"deepltl/models/beam_search.py","file_url":"https://github.com/necrashter/deepltl-pytorch/blob/HEAD/deepltl/models/beam_search.py","link_basis":"harvester_set","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":"0fb71688c64be6e5"}},{"code_sha256_prefix":"ab5aea947fca2ea9","entry":"positional_encoding","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/layers/positional_encoding.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/layers/positional_encoding.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":"ab5aea947fca2ea9"}},{"code_sha256_prefix":"2f3557097c940388","entry":"prepare_dataset_no_tf","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/train/common.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/train/common.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":"2f3557097c940388"}},{"code_sha256_prefix":"817e786e14f0e285","entry":"run_with_timeout","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/utils/utils.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/utils/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":"817e786e14f0e285"}},{"code_sha256_prefix":"6ac8c2e8189b5ab7","entry":"scaled_dot_product_attention","repo":"reactive-systems/deepltl","repo_kind":"official","path":"deepltl/layers/attention.py","file_url":"https://github.com/reactive-systems/deepltl/blob/HEAD/deepltl/layers/attention.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":"6ac8c2e8189b5ab7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}