SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-emnlp.619 · EMNLP Findings · 2024

MEDCARE: Advancing Medical LLMs through Decoupling Clinical Alignment and Knowledge Aggregation

Yu Wang, Yanfeng Wang, Shuyang Jiang, Yusheng Liao

Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2024.findings-emnlp.619.json · badge: /api/ran/2024.findings-emnlp.619.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
BlueZeros/MedCare canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
check_target_module_exists Ran
ran on a synthesized input
BlueZeros/MedCare/medcare/model/utils.py
code served (permissive licence) · get_code("ce4b943c1f4622e6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal LoRA config object
# The function only checks target_modules attribute
class LoraConfig:
    def __init__(self, target_modules):
        self.target_modules = target_modules

# Set up arguments for check_target_module_exists
lora_config = LoraConfig(target_modules=["linear", "conv", "attention"])
key = "model.layer1.linear"
target_modules = ["linear", "conv", "attention"]

ARGS = {
    "lora_config": lora_config,
    "key": key,
    "target_modules": target_modules
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_chunk Ran
ran; our contract draft was wrong, not the code
BlueZeros/MedCare/medcare/eval/model_diverse_gen_batch.py
code served (permissive licence) · get_code("42a46570620cd9fa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def split_list(lst, n):
    """Split a list into n (roughly) equal-sized chunks"""
    chunk_size = math.ceil(len(lst) / n)
    return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]

def get_chunk(lst, n, k):
    chunks = split_list(lst, n)
    return chunks[k]

# Setup code
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3
k = 1

ARGS = {
    "lst": lst,
    "n": n,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_model_name_from_path Ran
ran; our contract draft was wrong, not the code
BlueZeros/MedCare/medcare/utils.py
code served (permissive licence) · get_code("fa6d2859d3461c9e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def get_model_name_from_path(model_path):
    model_path = model_path.strip('/')
    model_paths = model_path.split('/')
    if model_paths[-1].startswith('checkpoint-'):
        return model_paths[-2] + '_' + model_paths[-1]
    else:
        return model_paths[-1]

ARGS = {
    'model_path': 'path/to/model_v1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize Ran
ran, honoured the contract we drafted
BlueZeros/MedCare/medcare/eval/eval_em.py
code served (permissive licence) · get_code("0133c7875f5508e2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
from sympy import sympify

def normalize_frac(x):
    pattern = '\\\\frac\\{([^\\}]+)\\}\\{([^\\}]+)\\}'
    match = re.search(pattern, x)
    if match:
        a = match.group(1)
        b = match.group(2)
        return (a, b)
    else:
        return None

def normalize_dfrac(x):
    pattern = '\\\\dfrac\\{([^\\}]+)\\}\\{([^\\}]+)\\}'
    match = re.search(pattern, x)
    if match:
        a = match.group(1)
        b = match.group(2)
        return (a, b)
    else:
        return None

def normalize(x):
    if '\\frac' in x and normalize_frac(x):
        a, b = normalize_frac(x)
        try:
            a = float(a)
            b = float(b)
            return a / b
        except:
            return x
    elif '\\dfrac' in x and normalize_dfrac(x):
        a, b = normalize_dfrac(x)
        try:
            a = float(a)
            b = float(b)
            return a / b
        except:
            return x
    else:
        try:
            x = sympify(x).evalf()
            return float(x)
        except:
            return x

# Test case 1: LaTeX fraction with numeric numerator and denominator
test_input_1 = r'\frac{3}{4}'

# Test case 2: LaTeX dfrac with numeric numerator and denominator
test_input_2 = r'\dfrac{5}{2}'

# Test case 3: Simple numeric string
test_input_3 = '2.5'

# Test case 4: Expression that sympify can handle
test_input_4 = 'pi'

ARGS = {
    'x': test_input_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sympy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_dfrac Ran
ran; our contract draft was wrong, not the code
BlueZeros/MedCare/medcare/eval/eval_em.py
code served (permissive licence) · get_code("ceb9b19eaecb1183")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def normalize_dfrac(x):
    pattern = '\\\\dfrac\\{([^\\}]+)\\}\\{([^\\}]+)\\}'
    match = re.search(pattern, x)
    if match:
        a = match.group(1)
        b = match.group(2)
        return (a, b)
    else:
        return None

# Test case 1: valid dfrac pattern
x1 = '\\dfrac{numerator}{denominator}'

# Test case 2: string without dfrac
x2 = 'just some text'

# Test case 3: dfrac with complex expressions
x3 = '\\dfrac{x + y}{a - b}'

ARGS = {
    'x': x1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_frac Ran
ran; our contract draft was wrong, not the code
BlueZeros/MedCare/medcare/eval/eval_em.py
code served (permissive licence) · get_code("75cb6a84ff49f59b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def normalize_frac(x):
    pattern = '\\\\frac\\{([^\\}]+)\\}\\{([^\\}]+)\\}'
    match = re.search(pattern, x)
    if match:
        a = match.group(1)
        b = match.group(2)
        return (a, b)
    else:
        return None

ARGS = {
    'x': '\\frac{numerator}{denominator}'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_list Ran
ran; our contract draft was wrong, not the code
BlueZeros/MedCare/medcare/eval/model_diverse_gen_batch.py
code served (permissive licence) · get_code("076c252c52cbb161")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def split_list(lst, n):
    """Split a list into n (roughly) equal-sized chunks"""
    chunk_size = math.ceil(len(lst) / n)
    return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]

# Setup code
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3

ARGS = {
    "lst": lst,
    "n": n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
transpose Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
BlueZeros/MedCare/medcare/model/utils.py
code served (permissive licence) · get_code("8f1a49e9d8b29d83")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes:
# 1. weight: a tensor that has a .T attribute (transpose)
# 2. fan_in_fan_out: a boolean flag

weight = torch.randn(4, 3)  # Small tensor with distinct dimensions
fan_in_fan_out = True  # Boolean flag

ARGS = {
    "weight": weight,
    "fan_in_fan_out": fan_in_fan_out,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (3, 4) — shape (3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_mixoflora_module Not yet run
unverified (harvested, no recorded run)
BlueZeros/MedCare/medcare/model/utils.py
code served (permissive licence) · get_code("0c7b59bddb3aa491")
How it ran

no invocation recorded.

get_default_conv_template Not yet run
unverified (harvested, no recorded run)
BlueZeros/MedCare/medcare/conversations.py
code served (permissive licence) · get_code("69457b3734b62ce2")
How it ran

no invocation recorded.

load_pretrained_model Not yet run
unverified (harvested, no recorded run)
BlueZeros/MedCare/medcare/model/builder.py
code served (permissive licence) · get_code("15fafe7d2e76bf02")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 8 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
split_list 197 other papers
22 dated earlier, 46 later, 128 same year, order not determinable, 1 undated
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 194 more not named here
get_chunk 189 other papers
21 dated earlier, 44 later, 124 same year, order not determinable
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 186 more not named here
transpose 13 other papers
3 dated earlier, 7 later, 3 same year, order not determinable · 9 only as an assembly brick
2106.09685 (2021-06)
LoRA: Low-Rank Adaptation of Large Language Models
2304.08177 (2023-04)
Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
2312.03414 (2023-12)
Compressed Context Memory For Online Language Model Interaction
and 10 more not named here
get_model_name_from_path 5 other papers
3 later, 2 same year, order not determinable
2402.16050 (2024-02)
Efficient Temporal Extrapolation of Multimodal Large Language Models with Temporal Grounding Bridge
2404.09027 (2024-04)
MING-MOE: Enhancing Medical Multi-Task Learning in Large Language Models with Sparse Mixture of Low-Rank Adapter Experts
2510.23925 (2025-10)
Latent Chain-of-Thought for Visual Reasoning
and 2 more not named here
check_target_module_exists 1 other paper
1 same year, order not determinable
2404.09027 (2024-04)
MING-MOE: Enhancing Medical Multi-Task Learning in Large Language Models with Sparse Mixture of Low-Rank Adapter Experts
normalize 1 other paper
1 same year, order not determinable
2404.09027 (2024-04)
MING-MOE: Enhancing Medical Multi-Task Learning in Large Language Models with Sparse Mixture of Low-Rank Adapter Experts
normalize_dfrac 1 other paper
1 same year, order not determinable
2404.09027 (2024-04)
MING-MOE: Enhancing Medical Multi-Task Learning in Large Language Models with Sparse Mixture of Low-Rank Adapter Experts
normalize_frac 1 other paper
1 same year, order not determinable
2404.09027 (2024-04)
MING-MOE: Enhancing Medical Multi-Task Learning in Large Language Models with Sparse Mixture of Low-Rank Adapter Experts

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) have shown substantial progress in natural language understanding and generation, proving valuable especially in the medical field. Despite advancements, challenges persist due to the complexity and diversity inherent in medical tasks, which can be categorized as knowledge-intensive tasks and alignment-required tasks. Previous approaches either ignore the latter task or focus on a minority of tasks and hence lose generalization. To address these drawbacks, we propose a progressive fine-tuning pipeline. This pipeline employs a KNOWLEDGE AGGREGA-TOR and a NOISE AGGREGATOR to encode diverse knowledge in the first stage and filter out detrimental information. In the second stage, we drop the NOISE AGGREGATOR to avoid the interference of suboptimal representation and leverage an additional alignment module optimized towards an orthogonal direction to the knowledge space to mitigate knowledge forgetting. Based on this twostage paradigm, we proposed a Medical LLM through decoupling Clinical Alignment and Knowledge Aggregation (MEDCARE), which is designed to achieve promising performance on over 20 medical tasks, as well as results on specific medical alignment tasks. Various model sizes of MEDCARE (1.8B, 7B, 14B) all demonstrate significant improvements over existing models with similar model sizes. Our code and datasets are available at https:// github.com/BlueZeros/MedCare.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2024.findings-emnlp.619")
get_code_for_paper("2024.findings-emnlp.619")
have("2024.findings-emnlp.619")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2024.findings-emnlp.619.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-emnlp.619.svg)](https://syntology.ai/paper/2024.findings-emnlp.619)

Connect an agent — have() is free.