{"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/enhancing-monotonic-multihead-attention-for","title":"Enhancing Monotonic Multihead Attention for Streaming ASR","arxiv_id":"2005.09394","date":"2020-05-19","proceeding":null,"authors":["Hirofumi Inaguma","Masato Mimura","Tatsuya Kawahara"],"abstract":"We investigate a monotonic multihead attention (MMA) by extending hard monotonic attention to Transformer-based automatic speech recognition (ASR) for online streaming applications. For streaming inference, all monotonic attention (MA) heads should learn proper alignments because the next token is not generated until all heads detect the corresponding token boundaries. However, we found not all MA heads learn alignments with a na\\\"ive implementation. To encourage every head to learn alignments properly, we propose HeadDrop regularization by masking out a part of heads stochastically during training. Furthermore, we propose to prune redundant heads to improve consensus among heads for boundary detection and prevent delayed token generation caused by such heads. Chunkwise attention on each MA head is extended to the multihead counterpart. Finally, we propose head-synchronous beam search decoding to guarantee stable streaming inference.","url_abs":"https://arxiv.org/abs/2005.09394v3","url_pdf":"https://arxiv.org/pdf/2005.09394v3.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":"enhancing-monotonic-multihead-attention-for","repo_url":"https://github.com/hirofumi0810/neural_sp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"all","task_name":"All"},{"task_slug":"automatic-speech-recognition-2","task_name":"Automatic Speech Recognition"},{"task_slug":"automatic-speech-recognition","task_name":"Automatic Speech Recognition (ASR)"},{"task_slug":"boundary-detection","task_name":"Boundary Detection"},{"task_slug":"speech-recognition","task_name":"Speech Recognition"},{"task_slug":"speech-recognition-1","task_name":"speech-recognition"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2005.09394","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2005.09394"}},"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/hirofumi0810/neural_sp","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":15},"by_repo_kind":{"official":{"samples":15,"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":0,"samples":[{"code_sha256_prefix":"12d5dc4bc4f1e1aa","entry":"add_args_common","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/args_common.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/args_common.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":"12d5dc4bc4f1e1aa"}},{"code_sha256_prefix":"6ff5a3b80d5b430d","entry":"average_checkpoints","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/eval_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/eval_utils.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":"6ff5a3b80d5b430d"}},{"code_sha256_prefix":"cb16b773271ab2ed","entry":"compute_subsampling_factor","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/train_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/train_utils.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":"cb16b773271ab2ed"}},{"code_sha256_prefix":"87cb64194a1c4f6a","entry":"cross_entropy_lsm","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/models/criterion.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/models/criterion.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":"87cb64194a1c4f6a"}},{"code_sha256_prefix":"8cef8c0370530397","entry":"distillation","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/models/criterion.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/models/criterion.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":"8cef8c0370530397"}},{"code_sha256_prefix":"6ec9cbee8edfc3f8","entry":"kldiv_lsm_ctc","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/models/criterion.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/models/criterion.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":"6ec9cbee8edfc3f8"}},{"code_sha256_prefix":"dffc9087259a2b58","entry":"load_config","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/train_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/train_utils.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":"dffc9087259a2b58"}},{"code_sha256_prefix":"a6dbc2c0648c0def","entry":"measure_time","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/train_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/train_utils.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":"a6dbc2c0648c0def"}},{"code_sha256_prefix":"361835bafa5d4e60","entry":"mkdir_join","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/utils.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":"361835bafa5d4e60"}},{"code_sha256_prefix":"7250a2e5273dd28a","entry":"register_args_encoder","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/args_asr.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/args_asr.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":"7250a2e5273dd28a"}},{"code_sha256_prefix":"a26e873e715d966a","entry":"register_args_lm","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/args_lm.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/args_lm.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":"a26e873e715d966a"}},{"code_sha256_prefix":"e5b2027edba3cd80","entry":"repeat","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/models/torch_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/models/torch_utils.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":"e5b2027edba3cd80"}},{"code_sha256_prefix":"d62973315f74653e","entry":"set_lm_name","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/bin/model_name.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/bin/model_name.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":"d62973315f74653e"}},{"code_sha256_prefix":"3c1e475e592b7956","entry":"tensor2np","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/models/torch_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/models/torch_utils.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":"3c1e475e592b7956"}},{"code_sha256_prefix":"9a280777fa891d25","entry":"tensor2scalar","repo":"hirofumi0810/neural_sp","repo_kind":"official","path":"neural_sp/models/torch_utils.py","file_url":"https://github.com/hirofumi0810/neural_sp/blob/HEAD/neural_sp/models/torch_utils.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":"9a280777fa891d25"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}