{"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/entroformer-a-transformer-based-entropy-model-1","title":"Entroformer: A Transformer-based Entropy Model for Learned Image Compression","arxiv_id":"2202.05492","date":"2022-02-11","proceeding":"ICLR 2022 4","authors":["Yichen Qian","Ming Lin","Xiuyu Sun","Zhiyu Tan","Rong Jin"],"abstract":"One critical component in lossy deep image compression is the entropy model, which predicts the probability distribution of the quantized latent representation in the encoding and decoding modules. Previous works build entropy models upon convolutional neural networks which are inefficient in capturing global dependencies. In this work, we propose a novel transformer-based entropy model, termed Entroformer, to capture long-range dependencies in probability distribution estimation effectively and efficiently. Different from vision transformers in image classification, the Entroformer is highly optimized for image compression, including a top-k self-attention and a diamond relative position encoding. Meanwhile, we further expand this architecture with a parallel bidirectional context model to speed up the decoding process. The experiments show that the Entroformer achieves state-of-the-art performance on image compression while being time-efficient.","url_abs":"https://arxiv.org/abs/2202.05492v2","url_pdf":"https://arxiv.org/pdf/2202.05492v2.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":"entroformer-a-transformer-based-entropy-model-1","repo_url":"https://github.com/damo-cv/entroformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"entroformer-a-transformer-based-entropy-model-1","repo_url":"https://github.com/mx54039q/entroformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-compression","task_name":"Image Compression"},{"task_slug":null,"task_name":"Position"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2202.05492","atlas_url":"https://app.syntology.ai/?focus=2202.05492","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2202.05492"}},"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":"deterministic:regex_extraction","url":"https://github.com/damo-cv/entroformer","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mx54039q/entroformer","reach":null}],"summary":{"ran":3,"unverified":3},"by_repo_kind":{"official":{"samples":6,"ran":3,"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":6,"samples":[{"code_sha256_prefix":"b56b436f1b6c3bda","entry":"Attention","repo":"mx54039q/entroformer","repo_kind":"official","path":"module/entroformer.py","file_url":"https://github.com/mx54039q/entroformer/blob/HEAD/module/entroformer.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":"b56b436f1b6c3bda"}},{"code_sha256_prefix":"b1bf49886d5ceb5f","entry":"Config","repo":"mx54039q/entroformer","repo_kind":"official","path":"module/entroformer.py","file_url":"https://github.com/mx54039q/entroformer/blob/HEAD/module/entroformer.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":"b1bf49886d5ceb5f"}},{"code_sha256_prefix":"ee0e284acdd3119d","entry":"FeedForward","repo":"mx54039q/entroformer","repo_kind":"official","path":"module/entroformer.py","file_url":"https://github.com/mx54039q/entroformer/blob/HEAD/module/entroformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ee0e284acdd3119d"}},{"code_sha256_prefix":"7844198ee1544058","entry":"AttentionBlock","repo":"mx54039q/entroformer","repo_kind":"official","path":"module/entroformer.py","file_url":"https://github.com/mx54039q/entroformer/blob/HEAD/module/entroformer.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":"7844198ee1544058"}},{"code_sha256_prefix":"1e748260f44313d9","entry":"Block","repo":"mx54039q/entroformer","repo_kind":"official","path":"module/entroformer.py","file_url":"https://github.com/mx54039q/entroformer/blob/HEAD/module/entroformer.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":"1e748260f44313d9"}},{"code_sha256_prefix":"371f1a90d7b2d3e3","entry":"TransDecoder","repo":"mx54039q/entroformer","repo_kind":"official","path":"module/entroformer.py","file_url":"https://github.com/mx54039q/entroformer/blob/HEAD/module/entroformer.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":"371f1a90d7b2d3e3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}