{"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/token-turing-machines-are-efficient-vision","title":"Token Turing Machines are Efficient Vision Models","arxiv_id":"2409.07613","date":"2024-09-11","proceeding":null,"authors":["Purvish Jajal","Nick John Eliopoulos","Benjamin Shiue-Hal Chou","George K. Thiruvathukal","James C. Davis","Yung-Hsiang Lu"],"abstract":"We propose Vision Token Turing Machines (ViTTM), an efficient, low-latency, memory-augmented Vision Transformer (ViT). Our approach builds on Neural Turing Machines and Token Turing Machines, which were applied to NLP and sequential visual understanding tasks. ViTTMs are designed for non-sequential computer vision tasks such as image classification and segmentation. Our model creates two sets of tokens: process tokens and memory tokens; process tokens pass through encoder blocks and read-write from memory tokens at each encoder block in the network, allowing them to store and retrieve information from memory. By ensuring that there are fewer process tokens than memory tokens, we are able to reduce the inference time of the network while maintaining its accuracy. On ImageNet-1K, the state-of-the-art ViT-B has median latency of 529.5ms and 81.0% accuracy, while our ViTTM-B is 56% faster (234.1ms), with 2.4 times fewer FLOPs, with an accuracy of 82.9%. On ADE20K semantic segmentation, ViT-B achieves 45.65mIoU at 13.8 frame-per-second (FPS) whereas our ViTTM-B model acheives a 45.17 mIoU with 26.8 FPS (+94%).","url_abs":"https://arxiv.org/abs/2409.07613v3","url_pdf":"https://arxiv.org/pdf/2409.07613v3.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":"token-turing-machines-are-efficient-vision","repo_url":"https://github.com/pjjajal/efficientttms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2409.07613","atlas_url":"https://app.syntology.ai/?focus=2409.07613","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.07613"}},"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/pjjajal/efficientttms","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":10,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":14,"ran":11,"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":"864d874e1a38fae9","entry":"apply_flexi_patch_embed","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/flexivit/apply.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/flexivit/apply.py","link_basis":"first_harvest_node","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":"864d874e1a38fae9"}},{"code_sha256_prefix":"88000e625cf8cf24","entry":"benchmark_compvit_milliseconds","repo":"pjjajal/efficientttms","repo_kind":"official","path":"benchmark.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/benchmark.py","link_basis":"first_harvest_node","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":"88000e625cf8cf24"}},{"code_sha256_prefix":"024778ed3c596e91","entry":"create_directory","repo":"pjjajal/efficientttms","repo_kind":"official","path":"train_lt.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/train_lt.py","link_basis":"first_harvest_node","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":"024778ed3c596e91"}},{"code_sha256_prefix":"c61aa5f384e32ab3","entry":"deit3_small_patch16_224","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/deit/deit.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/deit/deit.py","link_basis":"first_harvest_node","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":"c61aa5f384e32ab3"}},{"code_sha256_prefix":"fa4c5a0e665092f9","entry":"deit_tiny_patch16_224","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/deit/deit.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/deit/deit.py","link_basis":"first_harvest_node","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":"fa4c5a0e665092f9"}},{"code_sha256_prefix":"a18e03e2956626a5","entry":"deit_wrapped_class","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/deit/deit.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/deit/deit.py","link_basis":"first_harvest_node","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":"a18e03e2956626a5"}},{"code_sha256_prefix":"0845f7660a1bdac8","entry":"device_info","repo":"pjjajal/efficientttms","repo_kind":"official","path":"benchmark.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/benchmark.py","link_basis":"first_harvest_node","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":"0845f7660a1bdac8"}},{"code_sha256_prefix":"ebdf26e4a36a2e07","entry":"interpolate_resize_patch_embed","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/flexivit/patch_embed.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/flexivit/patch_embed.py","link_basis":"first_harvest_node","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":"ebdf26e4a36a2e07"}},{"code_sha256_prefix":"12acaf3b4607fdc2","entry":"make_normalize_transform","repo":"pjjajal/efficientttms","repo_kind":"official","path":"datasets/imagenet21k/augment.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/datasets/imagenet21k/augment.py","link_basis":"first_harvest_node","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":"12acaf3b4607fdc2"}},{"code_sha256_prefix":"d0460ecffe0b6043","entry":"pi_resize_patch_embed","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/flexivit/patch_embed.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/flexivit/patch_embed.py","link_basis":"first_harvest_node","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":"d0460ecffe0b6043"}},{"code_sha256_prefix":"b1ae1923a93132d9","entry":"to_2tuple","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/flexivit/utils.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/flexivit/utils.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b1ae1923a93132d9"}},{"code_sha256_prefix":"b29923d8aac4281f","entry":"deit_factory","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/deit/factory.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/deit/factory.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b29923d8aac4281f"}},{"code_sha256_prefix":"abc0a4dfdaf48399","entry":"lookupvit_factory","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/lookup/factory.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/lookup/factory.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"abc0a4dfdaf48399"}},{"code_sha256_prefix":"2db8a00b5d8b2436","entry":"resize_abs_pos_embed","repo":"pjjajal/efficientttms","repo_kind":"official","path":"models/flexivit/utils.py","file_url":"https://github.com/pjjajal/efficientttms/blob/HEAD/models/flexivit/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2db8a00b5d8b2436"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}