Instructions to use nagur-shareef-shaik/MERIT-Coder-4B-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nagur-shareef-shaik/MERIT-Coder-4B-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nagur-shareef-shaik/MERIT-Coder-4B-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nagur-shareef-shaik/MERIT-Coder-4B-GRPO") model = AutoModelForCausalLM.from_pretrained("nagur-shareef-shaik/MERIT-Coder-4B-GRPO", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nagur-shareef-shaik/MERIT-Coder-4B-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nagur-shareef-shaik/MERIT-Coder-4B-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nagur-shareef-shaik/MERIT-Coder-4B-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nagur-shareef-shaik/MERIT-Coder-4B-GRPO
- SGLang
How to use nagur-shareef-shaik/MERIT-Coder-4B-GRPO with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nagur-shareef-shaik/MERIT-Coder-4B-GRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nagur-shareef-shaik/MERIT-Coder-4B-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nagur-shareef-shaik/MERIT-Coder-4B-GRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nagur-shareef-shaik/MERIT-Coder-4B-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nagur-shareef-shaik/MERIT-Coder-4B-GRPO with Docker Model Runner:
docker model run hf.co/nagur-shareef-shaik/MERIT-Coder-4B-GRPO
Access to MERIT requires PhysioNet credentialed access to MIMIC-IV
MERIT was trained on MIMIC-IV. Requests are reviewed manually and granted only to credentialed PhysioNet users who have signed the MIMIC-IV data use agreement.
Log in or Sign Up to review the conditions and access this model content.
MERIT-Coder-4B-GRPO
The evidence-citing coder of MERIT: Qwen3.5-4B fine-tuned with LoRA on 40,000 MIMIC-IV discharge summaries (merged weights), then post-trained with group-relative policy optimisation (sample-F1 reward, 300 steps). It lists ICD-10-CM/PCS codes one per line and quotes verbatim evidence for every diagnosis that maps to a CMS-HCC V28 payment HCC. This is MERIT's default coder: the strongest standalone coder in the report.
Author: Nagur Shareef Shaik, Georgia State University.
Research report: MERIT: Research Report Draft (public).
For the best results use the full MERIT system (candidate shortlist, PLM-ICD fusion, per-HCC decoding, conformal routing), which reaches 60.2 micro-F1 and 79.3 HCC-F1. The coder alone (test split, 19,799 notes):
| Micro-F1 | Macro-F1 | Precision | Recall | HCC-F1 | RAF MAE | Missed HCC | Unsupported HCC | Verbatim quotes |
|---|---|---|---|---|---|---|---|---|
| 53.0 | 16.1 | 63.2 | 45.6 | 76.2 | 0.382 | 29.7% | 16.8% | 99.3% |
Prompt format
Chat template with thinking disabled (enable_thinking=False), greedy decoding, at most 1,024 new tokens; stop
reading at the first repeated code.
- system:
You are a certified inpatient medical coder. Read the discharge summary and list every ICD-10-CM diagnosis and ICD-10-PCS procedure code supported by the documentation, one per line. A diagnosis that maps to a CMS-HCC V28 payment HCC is written as\nCODE | "verbatim evidence from the note"\nwith the evidence copied word for word (at most 15 words); every other code is written alone. Prefer codes from the candidate list, but add any other code the note supports. Do not code conditions that are ruled out, historical only, or not documented. - user:
Discharge summary:\n<note>\n\nCandidate codes:\n<CODE: description, one per line>\n\nCodes:
The coder was trained with a candidate list from the MERIT shortlist head; without one, accuracy drops.
vllm serve nagur-shareef-shaik/MERIT-Coder-4B-GRPO --max-model-len 12288 # OpenAI-compatible API, needs HF_TOKEN with access
Intended use
- Research on automated ICD-10 coding and CMS-HCC risk adjustment, by credentialed MIMIC-IV users.
- Decision support only: every code, HCC and RAF value must be reviewed by a qualified coder.
Out of scope: autonomous coding, billing, payment or audit decisions; use on notes without a lawful basis for processing; any attempt to recover training data. MERIT was trained on inpatient discharge summaries from one US academic centre (MIMIC-IV) and has not been validated elsewhere.
Memorisation audit
Greedy continuation of the first 256 tokens of 200 training and 200 test notes, without instructions. A continuation counts as memorised when it shares more than 50 characters with the true text. Training notes: 0.5% over the threshold (1 of 200); test notes: 0%. Mean longest overlap 13.0 vs 12.1 characters, the level of shared note templates.
Citation
@techreport{shaik2026merit,
title = {MERIT: Risk-Aware ICD-10 Coding with Evidence-Citing Language Models and Code-Level Credit Assignment},
author = {Shaik, Nagur Shareef},
institution = {Georgia State University},
type = {Research Report Draft},
number = {Risk Adjustment Research Series, Report 1},
year = {2026}
}
- Downloads last month
- 2