{"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/electrocardiogram-instruction-tuning-for","title":"MEIT: Multi-Modal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation","arxiv_id":"2403.04945","date":"2024-03-07","proceeding":null,"authors":["Zhongwei Wan","Che Liu","Xin Wang","Chaofan Tao","Hui Shen","Zhenwu Peng","Jie Fu","Rossella Arcucci","Huaxiu Yao","Mi Zhang"],"abstract":"Electrocardiogram (ECG) is the primary non-invasive diagnostic tool for monitoring cardiac conditions and is crucial in assisting clinicians. Recent studies have concentrated on classifying cardiac conditions using ECG data but have overlooked ECG report generation, which is time-consuming and requires clinical expertise. To automate ECG report generation and ensure its versatility, we propose the Multimodal ECG Instruction Tuning (MEIT) framework, the first attempt to tackle ECG report generation with LLMs and multimodal instructions. To facilitate future research, we establish a benchmark to evaluate MEIT with various LLMs backbones across two large-scale ECG datasets. Our approach uniquely aligns the representations of the ECG signal and the report, and we conduct extensive experiments to benchmark MEIT with nine open-source LLMs using more than 800,000 ECG reports. MEIT's results underscore the superior performance of instruction-tuned LLMs, showcasing their proficiency in quality report generation, zero-shot capabilities, and resilience to signal perturbation. These findings emphasize the efficacy of our MEIT framework and its potential for real-world clinical application.","url_abs":"https://arxiv.org/abs/2403.04945v3","url_pdf":"https://arxiv.org/pdf/2403.04945v3.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":"electrocardiogram-instruction-tuning-for","repo_url":"https://github.com/aiot-mlsys-lab/meit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diagnostic","task_name":"Diagnostic"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.04945","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.04945"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aiot-mlsys-lab/meit","reach":{"status":"ok"}}],"summary":{"ran_fixture":2,"ran":9,"ran_draft_wrong":2,"unverified":4},"by_repo_kind":{"official":{"samples":17,"ran":13,"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":17,"samples":[{"code_sha256_prefix":"3c76e52815c5401d","entry":"repeat_kv","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/modeling_ecg_llama.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/modeling_ecg_llama.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":2,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3c76e52815c5401d"}},{"code_sha256_prefix":"0fe82a947dc39b42","entry":"apply_rotary_pos_emb","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/modeling_ecg_llama.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/modeling_ecg_llama.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0fe82a947dc39b42"}},{"code_sha256_prefix":"006ce061f56fa6b5","entry":"build_alibi_tensor","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/models/modeling_ecg_bloom.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/models/modeling_ecg_bloom.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":"006ce061f56fa6b5"}},{"code_sha256_prefix":"dd26c6cbc300bf99","entry":"create_sinusoidal_positions","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/models/modeling_ecg_gpt_j.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/models/modeling_ecg_gpt_j.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":"dd26c6cbc300bf99"}},{"code_sha256_prefix":"5eff112fe5b7811c","entry":"dropout_add","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/models/modeling_ecg_bloom.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/models/modeling_ecg_bloom.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":"5eff112fe5b7811c"}},{"code_sha256_prefix":"70e6efcabc56da63","entry":"encode_with_messages_format","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/ds_configs/finetune_ecgllm_with_lora_mimic.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/ds_configs/finetune_ecgllm_with_lora_mimic.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":"70e6efcabc56da63"}},{"code_sha256_prefix":"88b8bf1223d522a4","entry":"encode_with_prompt_completion_format","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/finetune_ecgllm_with_lora_mimic_without_IT.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/finetune_ecgllm_with_lora_mimic_without_IT.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"88b8bf1223d522a4"}},{"code_sha256_prefix":"2eb0fa9c56686ed4","entry":"format_func","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/draw_figures/plot_loss.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/draw_figures/plot_loss.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":"2eb0fa9c56686ed4"}},{"code_sha256_prefix":"9e9cdbf9e14e72cd","entry":"get_embed_positions","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/models/modeling_ecg_gpt_j.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/models/modeling_ecg_gpt_j.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":"9e9cdbf9e14e72cd"}},{"code_sha256_prefix":"c588bbb6dcb102c3","entry":"get_reference_reports_val_set","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/eval_metrics.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/eval_metrics.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":"c588bbb6dcb102c3"}},{"code_sha256_prefix":"df542a35e1c20625","entry":"get_state_dict","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/finetune_ecgllm_with_lora_mimic_without_IT.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/finetune_ecgllm_with_lora_mimic_without_IT.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":"df542a35e1c20625"}},{"code_sha256_prefix":"be7c0ed30787664f","entry":"rotate_every_two","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/models/modeling_ecg_gpt_j.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/models/modeling_ecg_gpt_j.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":"be7c0ed30787664f"}},{"code_sha256_prefix":"e03d53ba9d4f9ae5","entry":"rotate_half","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/modeling_ecg_llama.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/modeling_ecg_llama.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e03d53ba9d4f9ae5"}},{"code_sha256_prefix":"bb7fe7f66a1d9f08","entry":"bloom_gelu_forward","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/models/modeling_ecg_bloom.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/models/modeling_ecg_bloom.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":"bb7fe7f66a1d9f08"}},{"code_sha256_prefix":"0965c5d99ff0f81d","entry":"encode_with_messages_format","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/finetune_ecgllm_with_lora_mimic_without_IT.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/finetune_ecgllm_with_lora_mimic_without_IT.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":"0965c5d99ff0f81d"}},{"code_sha256_prefix":"10deefcbaed6584f","entry":"encode_with_messages_format","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/finetune_ecgllm_with_lora_ptbxl.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/finetune_ecgllm_with_lora_ptbxl.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":"10deefcbaed6584f"}},{"code_sha256_prefix":"1c2dfbdd38bfe7a1","entry":"get_meteor_score","repo":"aiot-mlsys-lab/meit","repo_kind":"official","path":"ECG_LLMs/eval_metrics.py","file_url":"https://github.com/aiot-mlsys-lab/meit/blob/HEAD/ECG_LLMs/eval_metrics.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":"1c2dfbdd38bfe7a1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}