{"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/tod-bert-pre-trained-natural-language","title":"TOD-BERT: Pre-trained Natural Language Understanding for Task-Oriented Dialogue","arxiv_id":"2004.06871","date":"2020-04-15","proceeding":"EMNLP 2020 11","authors":["Chien-Sheng Wu","Steven Hoi","Richard Socher","Caiming Xiong"],"abstract":"The underlying difference of linguistic patterns between general text and task-oriented dialogue makes existing pre-trained language models less useful in practice. In this work, we unify nine human-human and multi-turn task-oriented dialogue datasets for language modeling. To better model dialogue behavior during pre-training, we incorporate user and system tokens into the masked language modeling. We propose a contrastive objective function to simulate the response selection task. Our pre-trained task-oriented dialogue BERT (TOD-BERT) outperforms strong baselines like BERT on four downstream task-oriented dialogue applications, including intention recognition, dialogue state tracking, dialogue act prediction, and response selection. We also show that TOD-BERT has a stronger few-shot ability that can mitigate the data scarcity problem for task-oriented dialogue.","url_abs":"https://arxiv.org/abs/2004.06871v3","url_pdf":"https://arxiv.org/pdf/2004.06871v3.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":"tod-bert-pre-trained-natural-language","repo_url":"https://github.com/jasonwu0731/ToD-BERT","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-2-Clause"}}],"tasks":[{"task_slug":"dialogue-state-tracking","task_name":"Dialogue State Tracking"},{"task_slug":"intent-detection","task_name":"Intent Detection"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"masked-language-modeling","task_name":"Masked Language Modeling"},{"task_slug":"natural-language-understanding","task_name":"Natural Language Understanding"}],"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":null,"atlas_url":"https://app.syntology.ai/?focus=2004.06871","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.06871"}},"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":"deterministic:regex_extraction","url":"https://github.com/jasonwu0731/ToD-BERT","reach":{"status":"ok","spdx":"BSD-2-Clause"}}],"summary":{"unverified":13},"by_repo_kind":{"official":{"samples":13,"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":13,"samples":[{"code_sha256_prefix":"1786a072383b7312","entry":"collate_fn_dm_turn","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_dm.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_dm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"1786a072383b7312"}},{"code_sha256_prefix":"50ab5aef491ff1c6","entry":"collate_fn_dst_dial","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_dst.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_dst.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"50ab5aef491ff1c6"}},{"code_sha256_prefix":"7f7ea4638dd98813","entry":"collate_fn_dst_turn","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_dst.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_dst.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"7f7ea4638dd98813"}},{"code_sha256_prefix":"35f90fdbc7b048f4","entry":"collate_fn_nlg_turn","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_nlg.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_nlg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"35f90fdbc7b048f4"}},{"code_sha256_prefix":"d8cb3aa9cb2984d6","entry":"collate_fn_nlu_turn","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_nlu.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_nlu.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"d8cb3aa9cb2984d6"}},{"code_sha256_prefix":"793d288b1c25b8f7","entry":"collate_fn_usdl_dial","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_usdl.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_usdl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"793d288b1c25b8f7"}},{"code_sha256_prefix":"31070cc18d3734aa","entry":"collate_fn_usdl_dial_flat","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_usdl.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_usdl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"31070cc18d3734aa"}},{"code_sha256_prefix":"174270cc38b29c53","entry":"collate_fn_usdl_turn","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/dataloader_usdl.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/dataloader_usdl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"174270cc38b29c53"}},{"code_sha256_prefix":"e155e413c186170f","entry":"cross_entropy","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/loss_function/masked_cross_entropy.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/loss_function/masked_cross_entropy.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"e155e413c186170f"}},{"code_sha256_prefix":"d7133e89862027f1","entry":"get_candidate_embeddings","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"my_tod_pretraining.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/my_tod_pretraining.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"d7133e89862027f1"}},{"code_sha256_prefix":"62a820cce0f4f54a","entry":"mask_for_response_selection","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"my_tod_pretraining.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/my_tod_pretraining.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"62a820cce0f4f54a"}},{"code_sha256_prefix":"c43122df579b6d8b","entry":"masked_cross_entropy","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/loss_function/masked_cross_entropy.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/loss_function/masked_cross_entropy.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"c43122df579b6d8b"}},{"code_sha256_prefix":"45176015bba52028","entry":"sequence_mask","repo":"jasonwu0731/ToD-BERT","repo_kind":"official","path":"utils/loss_function/masked_cross_entropy.py","file_url":"https://github.com/jasonwu0731/ToD-BERT/blob/HEAD/utils/loss_function/masked_cross_entropy.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"45176015bba52028"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}