{"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/bert-has-a-mouth-and-it-must-speak-bert-as-a","title":"BERT has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model","arxiv_id":"1902.04094","date":"2019-02-11","proceeding":"WS 2019 6","authors":["Alex Wang","Kyunghyun Cho"],"abstract":"We show that BERT (Devlin et al., 2018) is a Markov random field language\nmodel. This formulation gives way to a natural procedure to sample sentences\nfrom BERT. We generate from BERT and find that it can produce high-quality,\nfluent generations. Compared to the generations of a traditional left-to-right\nlanguage model, BERT generates sentences that are more diverse but of slightly\nworse quality.","url_abs":"http://arxiv.org/abs/1902.04094v2","url_pdf":"http://arxiv.org/pdf/1902.04094v2.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":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/kyunghyuncho/bert-gen","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/nyu-dl/bert-gen","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/FrogTravel/PMLDL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/JuanJoseMV/neuraltextgen","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/gandharvsuri/Conditional-Generative-model-on-BERT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/opqrstuvcut/BertMouth","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/seanrjohnson/protein_gibbs_sampler","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/swastishreya/BERT_as_a_conditional_generative_model","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/vatsal199/Obedient_BERT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/woailaosang/repo_treasure","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/2023-MindSpore-1/ms-code-12/tree/main/Bert","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/MS-P3/code6","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"bert-has-a-mouth-and-it-must-speak-bert-as-a","repo_url":"https://github.com/MS-P3/code7/tree/main/visual_bert","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"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"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1902.04094","atlas_url":"https://app.syntology.ai/?focus=1902.04094","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1902.04094"}},"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/vatsal199/Obedient_BERT","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/seanrjohnson/protein_gibbs_sampler","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MS-P3/code6","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gandharvsuri/Conditional-Generative-model-on-BERT","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/FrogTravel/PMLDL","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nyu-dl/bert-gen","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kyunghyuncho/bert-gen","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/swastishreya/BERT_as_a_conditional_generative_model","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2023-MindSpore-1/ms-code-12/tree/main/Bert","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JuanJoseMV/neuraltextgen","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/woailaosang/repo_treasure","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MS-P3/code7/tree/main/visual_bert","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/opqrstuvcut/BertMouth","reach":null}],"summary":{"ran":6,"ran_draft_wrong":2,"ran_honours":2},"by_repo_kind":{"official":{"samples":2,"ran":2,"repositories":1},"listed":{"samples":8,"ran":8,"repositories":3}},"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":2,"samples":[{"code_sha256_prefix":"101fc3696d659817","entry":"apply_gap_threshold","repo":"seanrjohnson/protein_gibbs_sampler","repo_kind":"listed","path":"src/pgen/pgen_msa_revised.py","file_url":"https://github.com/seanrjohnson/protein_gibbs_sampler/blob/HEAD/src/pgen/pgen_msa_revised.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":"101fc3696d659817"}},{"code_sha256_prefix":"afbc573394ab876e","entry":"count_gaps_per_column","repo":"seanrjohnson/protein_gibbs_sampler","repo_kind":"listed","path":"src/pgen/pgen_msa_revised.py","file_url":"https://github.com/seanrjohnson/protein_gibbs_sampler/blob/HEAD/src/pgen/pgen_msa_revised.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":"afbc573394ab876e"}},{"code_sha256_prefix":"2fab4a1c479f4304","entry":"delete_msa_cols","repo":"seanrjohnson/protein_gibbs_sampler","repo_kind":"listed","path":"src/pgen/pgen_msa_revised.py","file_url":"https://github.com/seanrjohnson/protein_gibbs_sampler/blob/HEAD/src/pgen/pgen_msa_revised.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":"2fab4a1c479f4304"}},{"code_sha256_prefix":"992ab7ae4b4bf55c","entry":"detokenize","repo":"swastishreya/BERT_as_a_conditional_generative_model","repo_kind":"listed","path":"bert-babble.py","file_url":"https://github.com/swastishreya/BERT_as_a_conditional_generative_model/blob/HEAD/bert-babble.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"992ab7ae4b4bf55c"}},{"code_sha256_prefix":"596377a7c60ebe03","entry":"generate_step","repo":"seanrjohnson/protein_gibbs_sampler","repo_kind":"listed","path":"src/pgen/esm_sampler.py","file_url":"https://github.com/seanrjohnson/protein_gibbs_sampler/blob/HEAD/src/pgen/esm_sampler.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":"596377a7c60ebe03"}},{"code_sha256_prefix":"8c1bb7962bc49e93","entry":"get_seed_sent","repo":"nyu-dl/bert-gen","repo_kind":"official","path":"generate.py","file_url":"https://github.com/nyu-dl/bert-gen/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"8c1bb7962bc49e93"}},{"code_sha256_prefix":"013a68b0ac4716fe","entry":"initialization_text","repo":"opqrstuvcut/BertMouth","repo_kind":"listed","path":"bert_mouth.py","file_url":"https://github.com/opqrstuvcut/BertMouth/blob/HEAD/bert_mouth.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"013a68b0ac4716fe"}},{"code_sha256_prefix":"1ecf520984f04d3a","entry":"partition","repo":"seanrjohnson/protein_gibbs_sampler","repo_kind":"listed","path":"src/pgen/esm_msa_sampler.py","file_url":"https://github.com/seanrjohnson/protein_gibbs_sampler/blob/HEAD/src/pgen/esm_msa_sampler.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":"1ecf520984f04d3a"}},{"code_sha256_prefix":"2a890c3f8ff19f47","entry":"preprocess","repo":"nyu-dl/bert-gen","repo_kind":"official","path":"generate.py","file_url":"https://github.com/nyu-dl/bert-gen/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"2a890c3f8ff19f47"}},{"code_sha256_prefix":"4eee62223e0dfeb0","entry":"rawbatchlen","repo":"seanrjohnson/protein_gibbs_sampler","repo_kind":"listed","path":"src/pgen/models.py","file_url":"https://github.com/seanrjohnson/protein_gibbs_sampler/blob/HEAD/src/pgen/models.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":"4eee62223e0dfeb0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}