{"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/magma-multimodal-augmentation-of-generative","title":"MAGMA -- Multimodal Augmentation of Generative Models through Adapter-based Finetuning","arxiv_id":"2112.05253","date":"2021-12-09","proceeding":null,"authors":["Constantin Eichenberg","Sidney Black","Samuel Weinbach","Letitia Parcalabescu","Anette Frank"],"abstract":"Large-scale pretraining is fast becoming the norm in Vision-Language (VL) modeling. However, prevailing VL approaches are limited by the requirement for labeled data and the use of complex multi-step pretraining objectives. We present MAGMA - a simple method for augmenting generative language models with additional modalities using adapter-based finetuning. Building on Frozen, we train a series of VL models that autoregressively generate text from arbitrary combinations of visual and textual input. The pretraining is entirely end-to-end using a single language modeling objective, simplifying optimization compared to previous approaches. Importantly, the language model weights remain unchanged during training, allowing for transfer of encyclopedic knowledge and in-context learning abilities from language pretraining. MAGMA outperforms Frozen on open-ended generative tasks, achieving state of the art results on the OKVQA benchmark and competitive results on a range of other popular VL benchmarks, while pretraining on 0.2% of the number of samples used to train SimVLM.","url_abs":"https://arxiv.org/abs/2112.05253v2","url_pdf":"https://arxiv.org/pdf/2112.05253v2.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":"magma-multimodal-augmentation-of-generative","repo_url":"https://github.com/Aleph-Alpha/magma","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"simvlm","method_name":"SimVLM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2112.05253","atlas_url":"https://app.syntology.ai/?focus=2112.05253","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.05253"}},"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/Aleph-Alpha/magma","reach":null}],"summary":{"ran":7,"ran_draft_wrong":1,"ran_violates":1,"ran_fixture":1,"unverified":5},"by_repo_kind":{"official":{"samples":15,"ran":10,"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":"5efa2a11277a7471","entry":"eval_step","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/train_loop.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/train_loop.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":"5efa2a11277a7471"}},{"code_sha256_prefix":"b28f8eba1c7bc3ab","entry":"get_transforms","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/transforms.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/transforms.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":"b28f8eba1c7bc3ab"}},{"code_sha256_prefix":"ace12fad87592626","entry":"load_config","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/config.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/config.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":"ace12fad87592626"}},{"code_sha256_prefix":"cda91d1c99cf9e9c","entry":"load_model","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/utils.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/utils.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":"cda91d1c99cf9e9c"}},{"code_sha256_prefix":"628f0fcc54199efc","entry":"nfresnet50","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/image_encoders.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/image_encoders.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":"628f0fcc54199efc"}},{"code_sha256_prefix":"e82e4764f914492f","entry":"pad_to_size","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/transforms.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/transforms.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e82e4764f914492f"}},{"code_sha256_prefix":"d3af6b05f019b479","entry":"pad_to_size_tensor","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/transforms.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/transforms.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d3af6b05f019b479"}},{"code_sha256_prefix":"4f70ab2c3e38d976","entry":"reduce_losses","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/utils.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4f70ab2c3e38d976"}},{"code_sha256_prefix":"ba246ce8c9917aba","entry":"remove_tokens_after_eos","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/sampling.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/sampling.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":"ba246ce8c9917aba"}},{"code_sha256_prefix":"aa8cc3e8f125148a","entry":"top_k_filter","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/sampling.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/sampling.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa8cc3e8f125148a"}},{"code_sha256_prefix":"d4435db67cbbf30d","entry":"get_gptj","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/language_model.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/language_model.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":"d4435db67cbbf30d"}},{"code_sha256_prefix":"f057466b39aff113","entry":"get_tokenizer","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/utils.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/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":"f057466b39aff113"}},{"code_sha256_prefix":"b92f1cee291214f5","entry":"save_to_jsons","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/datasets/convert_datasets.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/datasets/convert_datasets.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":"b92f1cee291214f5"}},{"code_sha256_prefix":"5c7e7dc9d5bdc305","entry":"train_step","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/train_loop.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/train_loop.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":"5c7e7dc9d5bdc305"}},{"code_sha256_prefix":"a2d4cd1429030731","entry":"train_step_classification","repo":"Aleph-Alpha/magma","repo_kind":"official","path":"magma/train_loop.py","file_url":"https://github.com/Aleph-Alpha/magma/blob/HEAD/magma/train_loop.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":"a2d4cd1429030731"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}