{"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/medadapter-efficient-test-time-adaptation-of","title":"MedAdapter: Efficient Test-Time Adaptation of Large Language Models towards Medical Reasoning","arxiv_id":"2405.03000","date":"2024-05-05","proceeding":null,"authors":["Wenqi Shi","ran Xu","Yuchen Zhuang","Yue Yu","Haotian Sun","Hang Wu","Carl Yang","May D. Wang"],"abstract":"Despite their improved capabilities in generation and reasoning, adapting large language models (LLMs) to the biomedical domain remains challenging due to their immense size and corporate privacy. In this work, we propose MedAdapter, a unified post-hoc adapter for test-time adaptation of LLMs towards biomedical applications. Instead of fine-tuning the entire LLM, MedAdapter effectively adapts the original model by fine-tuning only a small BERT-sized adapter to rank candidate solutions generated by LLMs. Experiments demonstrate that MedAdapter effectively adapts both white-box and black-box LLMs in biomedical reasoning, achieving average performance improvements of 25.48% and 11.31%, respectively, without requiring extensive computational resources or sharing data with third parties. MedAdapter also yields superior performance when combined with train-time adaptation, highlighting a flexible and complementary solution to existing adaptation methods. Faced with the challenges of balancing model performance, computational resources, and data privacy, MedAdapter provides an efficient, privacy-preserving, cost-effective, and transparent solution for adapting LLMs to the biomedical domain.","url_abs":"https://arxiv.org/abs/2405.03000v2","url_pdf":"https://arxiv.org/pdf/2405.03000v2.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":"medadapter-efficient-test-time-adaptation-of","repo_url":"https://github.com/wshi83/medadapter","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"privacy-preserving","task_name":"Privacy Preserving"},{"task_slug":"test-time-adaptation","task_name":"Test-time Adaptation"}],"methods":[{"method_slug":"adapter","method_name":"Adapter"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2405.03000","atlas_url":"https://app.syntology.ai/?focus=2405.03000","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.03000"}},"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/wshi83/medadapter","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/wshi83/MedAdapter","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_draft_wrong":1,"unverified":10},"by_repo_kind":{"official":{"samples":16,"ran":6,"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":16,"samples":[{"code_sha256_prefix":"998b73ea2c529621","entry":"bioasq_judge","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/bioasq_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/bioasq_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"998b73ea2c529621"}},{"code_sha256_prefix":"fc2923ceeac1f499","entry":"medmcqa_judge","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/medmcqa_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/medmcqa_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fc2923ceeac1f499"}},{"code_sha256_prefix":"fd06b5e606986d89","entry":"medqa_judge","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/medqa_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/medqa_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fd06b5e606986d89"}},{"code_sha256_prefix":"e30a72d4f5561a07","entry":"mmlu_judge","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/mmlu_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/mmlu_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e30a72d4f5561a07"}},{"code_sha256_prefix":"a5c4afa103aa6d76","entry":"prepare_prompts","repo":"wshi83/MedAdapter","repo_kind":"official","path":"reward_model/orm/orm_guide.py","file_url":"https://github.com/wshi83/MedAdapter/blob/HEAD/reward_model/orm/orm_guide.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a5c4afa103aa6d76"}},{"code_sha256_prefix":"62f83829e4fb5a25","entry":"pubmedqa_judge","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/pubmedqa_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/pubmedqa_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"62f83829e4fb5a25"}},{"code_sha256_prefix":"80b367feb77c593c","entry":"bioasq_metrics","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/bioasq_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/bioasq_eval.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":"80b367feb77c593c"}},{"code_sha256_prefix":"7fe7aafc5afb6d9b","entry":"generate","repo":"wshi83/MedAdapter","repo_kind":"official","path":"reward_model/orm/orm_guide.py","file_url":"https://github.com/wshi83/MedAdapter/blob/HEAD/reward_model/orm/orm_guide.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":"7fe7aafc5afb6d9b"}},{"code_sha256_prefix":"ee2a47559197dba0","entry":"get_datasets","repo":"wshi83/MedAdapter","repo_kind":"official","path":"reward_model/orm/orm_guide.py","file_url":"https://github.com/wshi83/MedAdapter/blob/HEAD/reward_model/orm/orm_guide.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":"ee2a47559197dba0"}},{"code_sha256_prefix":"3ceed634ac6ca1d2","entry":"load_model","repo":"wshi83/medadapter","repo_kind":"official","path":"generator/vanilla_trainer.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/generator/vanilla_trainer.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":"3ceed634ac6ca1d2"}},{"code_sha256_prefix":"537590c07503fa34","entry":"load_prompts","repo":"wshi83/MedAdapter","repo_kind":"official","path":"reward_model/orm/orm_guide.py","file_url":"https://github.com/wshi83/MedAdapter/blob/HEAD/reward_model/orm/orm_guide.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":"537590c07503fa34"}},{"code_sha256_prefix":"44cf71f1d0538dbd","entry":"medmcqa_metrics","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/medmcqa_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/medmcqa_eval.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":"44cf71f1d0538dbd"}},{"code_sha256_prefix":"19fe01ffbad9b874","entry":"medqa_metrics","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/medqa_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/medqa_eval.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":"19fe01ffbad9b874"}},{"code_sha256_prefix":"a181c5f5aa10d4e4","entry":"mmlu_metrics","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/mmlu_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/mmlu_eval.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":"a181c5f5aa10d4e4"}},{"code_sha256_prefix":"5954c78296a000d6","entry":"orm_guided_generation","repo":"wshi83/MedAdapter","repo_kind":"official","path":"reward_model/orm/orm_guide.py","file_url":"https://github.com/wshi83/MedAdapter/blob/HEAD/reward_model/orm/orm_guide.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":"5954c78296a000d6"}},{"code_sha256_prefix":"f76f5726f4c301f8","entry":"pubmedqa_metrics","repo":"wshi83/medadapter","repo_kind":"official","path":"eval_fn/pubmedqa_eval.py","file_url":"https://github.com/wshi83/medadapter/blob/HEAD/eval_fn/pubmedqa_eval.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":"f76f5726f4c301f8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}