{"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/barcodemamba-state-space-models-for","title":"BarcodeMamba: State Space Models for Biodiversity Analysis","arxiv_id":"2412.11084","date":"2024-12-15","proceeding":null,"authors":["Tiancheng Gao","Graham W. Taylor"],"abstract":"DNA barcodes are crucial in biodiversity analysis for building automatic identification systems that recognize known species and discover unseen species. Unlike human genome modeling, barcode-based invertebrate identification poses challenges in the vast diversity of species and taxonomic complexity. Among Transformer-based foundation models, BarcodeBERT excelled in species-level identification of invertebrates, highlighting the effectiveness of self-supervised pretraining on barcode-specific datasets. Recently, structured state space models (SSMs) have emerged, with a time complexity that scales sub-quadratically with the context length. SSMs provide an efficient parameterization of sequence modeling relative to attention-based architectures. Given the success of Mamba and Mamba-2 in natural language, we designed BarcodeMamba, a performant and efficient foundation model for DNA barcodes in biodiversity analysis. We conducted a comprehensive ablation study on the impacts of self-supervised training and tokenization methods, and compared both versions of Mamba layers in terms of expressiveness and their capacity to identify \"unseen\" species held back from training. Our study shows that BarcodeMamba has better performance than BarcodeBERT even when using only 8.3% as many parameters, and improves accuracy to 99.2% on species-level accuracy in linear probing without fine-tuning for \"seen\" species. In our scaling study, BarcodeMamba with 63.6% of BarcodeBERT's parameters achieved 70.2% genus-level accuracy in 1-nearest neighbor (1-NN) probing for unseen species. The code repository to reproduce our experiments is available at https://github.com/bioscan-ml/BarcodeMamba.","url_abs":"https://arxiv.org/abs/2412.11084v1","url_pdf":"https://arxiv.org/pdf/2412.11084v1.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":"barcodemamba-state-space-models-for","repo_url":"https://github.com/bioscan-ml/barcodemamba","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"mamba","task_name":"Mamba"},{"task_slug":"state-space-models","task_name":"State Space Models"}],"methods":[{"method_slug":"mamba","method_name":"Mamba"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2412.11084","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.11084"}},"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/bioscan-ml/BarcodeMamba","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/bioscan-ml/barcodemamba","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":5},"by_repo_kind":{"official":{"samples":6,"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":0,"samples":[{"code_sha256_prefix":"996f4345e56fcd6b","entry":"GPT2Embeddings","repo":"bioscan-ml/barcodemamba","repo_kind":"official","path":"utils/barcode_mamba.py","file_url":"https://github.com/bioscan-ml/barcodemamba/blob/HEAD/utils/barcode_mamba.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"996f4345e56fcd6b"}},{"code_sha256_prefix":"bd9265c78f62e7e9","entry":"BarcodeMamba","repo":"bioscan-ml/barcodemamba","repo_kind":"official","path":"utils/barcode_mamba.py","file_url":"https://github.com/bioscan-ml/barcodemamba/blob/HEAD/utils/barcode_mamba.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":"bd9265c78f62e7e9"}},{"code_sha256_prefix":"affa43bc1a64391e","entry":"Block","repo":"bioscan-ml/barcodemamba","repo_kind":"official","path":"utils/barcode_mamba.py","file_url":"https://github.com/bioscan-ml/barcodemamba/blob/HEAD/utils/barcode_mamba.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":"affa43bc1a64391e"}},{"code_sha256_prefix":"e859959e6ac2ce20","entry":"LMBackbone","repo":"bioscan-ml/barcodemamba","repo_kind":"official","path":"utils/barcode_mamba.py","file_url":"https://github.com/bioscan-ml/barcodemamba/blob/HEAD/utils/barcode_mamba.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":"e859959e6ac2ce20"}},{"code_sha256_prefix":"155da2e78c3d246e","entry":"create_block","repo":"bioscan-ml/barcodemamba","repo_kind":"official","path":"utils/barcode_mamba.py","file_url":"https://github.com/bioscan-ml/barcodemamba/blob/HEAD/utils/barcode_mamba.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":"155da2e78c3d246e"}},{"code_sha256_prefix":"6c7c5da68a736211","entry":"create_mixer_cls","repo":"bioscan-ml/barcodemamba","repo_kind":"official","path":"utils/barcode_mamba.py","file_url":"https://github.com/bioscan-ml/barcodemamba/blob/HEAD/utils/barcode_mamba.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":"6c7c5da68a736211"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}