{"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/comer-modeling-coverage-for-transformer-based","title":"CoMER: Modeling Coverage for Transformer-based Handwritten Mathematical Expression Recognition","arxiv_id":"2207.04410","date":"2022-07-10","proceeding":null,"authors":["Wenqi Zhao","Liangcai Gao"],"abstract":"The Transformer-based encoder-decoder architecture has recently made significant advances in recognizing handwritten mathematical expressions. However, the transformer model still suffers from the lack of coverage problem, making its expression recognition rate (ExpRate) inferior to its RNN counterpart. Coverage information, which records the alignment information of the past steps, has proven effective in the RNN models. In this paper, we propose CoMER, a model that adopts the coverage information in the transformer decoder. Specifically, we propose a novel Attention Refinement Module (ARM) to refine the attention weights with past alignment information without hurting its parallelism. Furthermore, we take coverage information to the extreme by proposing self-coverage and cross-coverage, which utilize the past alignment information from the current and previous layers. Experiments show that CoMER improves the ExpRate by 0.61%/2.09%/1.59% compared to the current state-of-the-art model, and reaches 59.33%/59.81%/62.97% on the CROHME 2014/2016/2019 test sets.","url_abs":"https://arxiv.org/abs/2207.04410v2","url_pdf":"https://arxiv.org/pdf/2207.04410v2.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":"comer-modeling-coverage-for-transformer-based","repo_url":"https://github.com/Green-Wood/CoMER","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"comer-modeling-coverage-for-transformer-based","repo_url":"https://github.com/qingzhenduyu/ical","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"handwritten-mathmatical-expression","task_name":"Handwritten Mathmatical Expression Recognition"}],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/handwritten-mathmatical-expression","task":"Handwritten Mathmatical Expression Recognition","dataset":"CROHME 2014","model":"CoMER","rank_in_archive_order":7,"of":17,"metrics":{"ExpRate":"58.38"},"uses_additional_data":false},{"leaderboard":"/sota/handwritten-mathmatical-expression-1","task":"Handwritten Mathmatical Expression Recognition","dataset":"CROHME 2016","model":"CoMER","rank_in_archive_order":6,"of":16,"metrics":{"ExpRate":"56.98"},"uses_additional_data":false},{"leaderboard":"/sota/handwritten-mathmatical-expression-2","task":"Handwritten Mathmatical Expression Recognition","dataset":"CROHME 2019","model":"CoMER","rank_in_archive_order":6,"of":14,"metrics":{"ExpRate":"59.12"},"uses_additional_data":false},{"leaderboard":"/sota/handwritten-mathmatical-expression-3","task":"Handwritten Mathmatical Expression Recognition","dataset":"HME100K","model":"CoMER","rank_in_archive_order":5,"of":12,"metrics":{"ExpRate":"68.12"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.04410","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.04410"}},"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/qingzhenduyu/ical","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Green-Wood/CoMER","reach":{"status":"ok"}}],"summary":{"ran":1,"unverified":1},"by_repo_kind":{"listed":{"samples":2,"ran":1,"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":2,"samples":[{"code_sha256_prefix":"1cf8a4220581a8ed","entry":"MaskBatchNorm2d","repo":"qingzhenduyu/ical","repo_kind":"listed","path":"ical/model/transformer/arm.py","file_url":"https://github.com/qingzhenduyu/ical/blob/HEAD/ical/model/transformer/arm.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":"1cf8a4220581a8ed"}},{"code_sha256_prefix":"2d03229bed56282c","entry":"AttentionRefinementModule","repo":"qingzhenduyu/ical","repo_kind":"listed","path":"ical/model/transformer/arm.py","file_url":"https://github.com/qingzhenduyu/ical/blob/HEAD/ical/model/transformer/arm.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":"2d03229bed56282c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}