{"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/learning-to-compute-grobner-bases","title":"Learning to Compute Gröbner Bases","arxiv_id":"2311.12904","date":"2023-11-21","proceeding":null,"authors":["Hiroshi Kera","Yuki Ishihara","Yuta Kambe","Tristan Vaccon","Kazuhiro Yokoyama"],"abstract":"Solving a polynomial system, or computing an associated Gr\\\"obner basis, has been a fundamental task in computational algebra. However, it is also known for its notorious doubly exponential time complexity in the number of variables in the worst case. This paper is the first to address the learning of Gr\\\"obner basis computation with Transformers. The training requires many pairs of a polynomial system and the associated Gr\\\"obner basis, raising two novel algebraic problems: random generation of Gr\\\"obner bases and transforming them into non-Gr\\\"obner ones, termed as backward Gr\\\"obner problem. We resolve these problems with 0-dimensional radical ideals, the ideals appearing in various applications. Further, we propose a hybrid input embedding to handle coefficient tokens with continuity bias and avoid the growth of the vocabulary set. The experiments show that our dataset generation method is a few orders of magnitude faster than a naive approach, overcoming a crucial challenge in learning to compute Gr\\\"obner bases, and Gr\\\"obner computation is learnable in a particular class.","url_abs":"https://arxiv.org/abs/2311.12904v3","url_pdf":"https://arxiv.org/pdf/2311.12904v3.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":"learning-to-compute-grobner-bases","repo_url":"https://github.com/hiroshikera/transformer-groebner","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"learning-to-compute-grobner-bases","repo_url":"https://github.com/HiroshiKERA/calt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"dataset-generation","task_name":"Dataset Generation"}],"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":"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/2311.12904","atlas_url":"https://app.syntology.ai/?focus=2311.12904","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.12904"}},"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":"deterministic:regex_extraction","url":"https://github.com/HiroshiKERA/transformer-groebner","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hiroshikera/transformer-groebner","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/HiroshiKERA/calt","reach":null}],"summary":{"ran":12,"unverified":6},"by_repo_kind":{"official":{"samples":17,"ran":12,"repositories":1},"listed":{"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":17,"samples":[{"code_sha256_prefix":"a0d24f0f17337d49","entry":"ContinuousEmbedding","repo":"hiroshikera/transformer-groebner","repo_kind":"official","path":"src/loader/models/encoding.py","file_url":"https://github.com/hiroshikera/transformer-groebner/blob/HEAD/src/loader/models/encoding.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a0d24f0f17337d49"}},{"code_sha256_prefix":"653a3879fe5fb006","entry":"coeffs_eq","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/evaluation/generation.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/evaluation/generation.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":"653a3879fe5fb006"}},{"code_sha256_prefix":"87a927cf120f3e7b","entry":"generate_yaml","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/misc/generate_config.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/misc/generate_config.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":"87a927cf120f3e7b"}},{"code_sha256_prefix":"f469b8d56291d428","entry":"generation","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/evaluation/generation.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/evaluation/generation.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":"f469b8d56291d428"}},{"code_sha256_prefix":"02e9a1b6a46e3abc","entry":"get_checkpoint_id","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/checkpoint.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/checkpoint.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":"02e9a1b6a46e3abc"}},{"code_sha256_prefix":"ec5278f3a6789c1a","entry":"load_config","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/checkpoint.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/checkpoint.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":"ec5278f3a6789c1a"}},{"code_sha256_prefix":"6f185d3c02bfd65e","entry":"load_model","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/model.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/model.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":"6f185d3c02bfd65e"}},{"code_sha256_prefix":"46d6bad400ce74ff","entry":"set_tokenizer","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/dataset/tokernizer.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/dataset/tokernizer.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":"46d6bad400ce74ff"}},{"code_sha256_prefix":"28a75bc84651a621","entry":"set_vocab","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/dataset/tokernizer.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/dataset/tokernizer.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":"28a75bc84651a621"}},{"code_sha256_prefix":"8055a9403fdd2b0a","entry":"str_to_float","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/data.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/data.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":"8055a9403fdd2b0a"}},{"code_sha256_prefix":"d4cd57d1fa5a2683","entry":"summarize_all_results","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/experiments/timing.sage.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/experiments/timing.sage.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":"d4cd57d1fa5a2683"}},{"code_sha256_prefix":"c3f85c891219a257","entry":"support_eq","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/evaluation/generation.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/evaluation/generation.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":"c3f85c891219a257"}},{"code_sha256_prefix":"a8dba307b67d1d22","entry":"HybridEmbedding","repo":"hiroshikera/transformer-groebner","repo_kind":"official","path":"src/loader/models/encoding.py","file_url":"https://github.com/hiroshikera/transformer-groebner/blob/HEAD/src/loader/models/encoding.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":"a8dba307b67d1d22"}},{"code_sha256_prefix":"10788cb1bffd7651","entry":"get_datacollator","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/data.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/data.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":"10788cb1bffd7651"}},{"code_sha256_prefix":"837c794d0cdda4ff","entry":"get_input_embedding","repo":"HiroshiKERA/calt","repo_kind":"listed","path":"src/calt/models/input_embeddings/base.py","file_url":"https://github.com/HiroshiKERA/calt/blob/HEAD/src/calt/models/input_embeddings/base.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":"837c794d0cdda4ff"}},{"code_sha256_prefix":"30e7a6e24f878bce","entry":"get_raw_dataset","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/experiments/showcase.sage.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/experiments/showcase.sage.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":"30e7a6e24f878bce"}},{"code_sha256_prefix":"642b1733fc94bd92","entry":"load_data","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/data.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/data.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":"642b1733fc94bd92"}},{"code_sha256_prefix":"6ad2f1e65d935216","entry":"load_pretrained_model","repo":"HiroshiKERA/transformer-groebner","repo_kind":"official","path":"src/loader/checkpoint.py","file_url":"https://github.com/HiroshiKERA/transformer-groebner/blob/HEAD/src/loader/checkpoint.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":"6ad2f1e65d935216"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}