{"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/generative-pretrained-structured-transformers","title":"Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scale","arxiv_id":"2403.08293","date":"2024-03-13","proceeding":null,"authors":["Xiang Hu","Pengyu Ji","Qingyang Zhu","Wei Wu","Kewei Tu"],"abstract":"A syntactic language model (SLM) incrementally generates a sentence with its syntactic tree in a left-to-right manner. We present Generative Pretrained Structured Transformers (GPST), an unsupervised SLM at scale capable of being pre-trained from scratch on raw texts with high parallelism. GPST circumvents the limitations of previous SLMs such as relying on gold trees and sequential training. It consists of two components, a usual SLM supervised by a uni-directional language modeling loss, and an additional composition model, which induces syntactic parse trees and computes constituent representations, supervised by a bi-directional language modeling loss. We propose a representation surrogate to enable joint parallel training of the two models in a hard-EM fashion. We pre-train GPST on OpenWebText, a corpus with $9$ billion tokens, and demonstrate the superiority of GPST over GPT-2 with a comparable size in numerous tasks covering both language understanding and language generation. Meanwhile, GPST also significantly outperforms existing unsupervised SLMs on left-to-right grammar induction, while holding a substantial acceleration on training.","url_abs":"https://arxiv.org/abs/2403.08293v3","url_pdf":"https://arxiv.org/pdf/2403.08293v3.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":"generative-pretrained-structured-transformers","repo_url":"https://github.com/ant-research/structuredlm_rtdt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"generative-pretrained-structured-transformers","repo_url":"https://github.com/alipay/StructuredLM_RTDT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"constituency-grammar-induction","task_name":"Constituency Grammar Induction"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"natural-language-inference","task_name":"Natural Language Inference"},{"task_slug":"sentence","task_name":"Sentence"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-2","method_name":"GPT-2"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/constituency-grammar-induction-on-ptb","task":"Constituency Grammar Induction","dataset":"PTB Diagnostic ECG Database","model":"GPST(left to right parsing)","rank_in_archive_order":16,"of":24,"metrics":{"Mean F1 (WSJ)":"55.2"},"uses_additional_data":false},{"leaderboard":"/sota/natural-language-inference-on-multinli","task":"Natural Language Inference","dataset":"MultiNLI","model":"GPST(unsupervised generative syntactic LM)","rank_in_archive_order":43,"of":67,"metrics":{"Matched":"81.8","Mismatched":"82.0"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.08293","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.08293"}},"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/alipay/StructuredLM_RTDT","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ant-research/structuredlm_rtdt","reach":null}],"summary":{"ran":3,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":3,"ran":2,"repositories":1},"listed":{"samples":4,"ran":2,"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":"a784d2110f131468","entry":"GenerativeR2D2","repo":"ant-research/structuredlm_rtdt","repo_kind":"official","path":"model/generative_r2d2.py","file_url":"https://github.com/ant-research/structuredlm_rtdt/blob/HEAD/model/generative_r2d2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a784d2110f131468"}},{"code_sha256_prefix":"1e812e0a70ef2d48","entry":"R2D2GenOutput","repo":"ant-research/structuredlm_rtdt","repo_kind":"official","path":"model/generative_r2d2.py","file_url":"https://github.com/ant-research/structuredlm_rtdt/blob/HEAD/model/generative_r2d2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1e812e0a70ef2d48"}},{"code_sha256_prefix":"f170e96bed9e0da5","entry":"reshape_for_broadcast","repo":"alipay/StructuredLM_RTDT","repo_kind":"listed","path":"model/Llama_flash_attn.py","file_url":"https://github.com/alipay/StructuredLM_RTDT/blob/HEAD/model/Llama_flash_attn.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f170e96bed9e0da5"}},{"code_sha256_prefix":"e03d53ba9d4f9ae5","entry":"rotate_half","repo":"alipay/StructuredLM_RTDT","repo_kind":"listed","path":"model/Llama_flash_attn.py","file_url":"https://github.com/alipay/StructuredLM_RTDT/blob/HEAD/model/Llama_flash_attn.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e03d53ba9d4f9ae5"}},{"code_sha256_prefix":"a1ac0c11d14eec67","entry":"apply_rotary_emb","repo":"alipay/StructuredLM_RTDT","repo_kind":"listed","path":"model/Llama_flash_attn.py","file_url":"https://github.com/alipay/StructuredLM_RTDT/blob/HEAD/model/Llama_flash_attn.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a1ac0c11d14eec67"}},{"code_sha256_prefix":"68f9327845ca9499","entry":"load_model","repo":"ant-research/structuredlm_rtdt","repo_kind":"official","path":"model/generative_r2d2.py","file_url":"https://github.com/ant-research/structuredlm_rtdt/blob/HEAD/model/generative_r2d2.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"68f9327845ca9499"}},{"code_sha256_prefix":"3665fea6427d655d","entry":"load_tf_weights_in_gpt2","repo":"alipay/StructuredLM_RTDT","repo_kind":"listed","path":"model/gpt2_flash_attn.py","file_url":"https://github.com/alipay/StructuredLM_RTDT/blob/HEAD/model/gpt2_flash_attn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3665fea6427d655d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}