OpenMed

OpenMed Inkling 2 Mini Biomedical Sections v1

OpenMed on Hugging Face OpenMed SDK on GitHub pip install openmed License Apache-2.0

OpenMed's fine-tune of Inkling 2 Mini for reading biomedical abstracts. Give it one sentence from an abstract and it names the sentence's role: background, objective, methods, results or conclusions. On 300 sentences from 181 articles not used in training, it scores 78.40 macro F1, better than the original Inkling 2 Mini on all five roles, and it finds 93.3% of methods sentences and 90.0% of results sentences. It ships as one standalone checkpoint of about 19.5 GB in the same mixed NVFP4 and MXFP8 format as the original, under Apache-2.0.

Developed by OpenMed
Base model Inkling 2 Mini by Thinking Machines Lab (Apache-2.0)
Task Name the role of one sentence in a biomedical abstract
Input One English sentence, up to 160 tokens
Output background, objective, methods, results or conclusions, the label with the highest score
Evaluated on 300 sentences (60 per role) from 181 articles, none of them in training; macro F1 78.40 (original Inkling 2 Mini 77.13)
Training 600 labeled sentences from 509 open-access trial abstracts; rank-8 LoRA on the query and value projections of the last four layers (278,528 trained parameters), 100 steps, then merged into this checkpoint
Language English
License Apache-2.0

About OpenMed

OpenMed builds open models and open-source tools for clinical and biomedical text that run on your own hardware.

Quick start

The checkpoint loads directly with Transformers on one CUDA GPU. The code below was checked against this repository with the tested Transformers revision.

pip install -U accelerate torch https://github.com/huggingface/transformers/archive/046bdb8cc2cee29d233964bb77fe6fd37cfe4aa3.zip
import torch
from transformers import AutoModelForMultimodalLM, AutoTokenizer

repo = "OpenMed/Inkling2-Mini-BiomedicalSections-v1"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForMultimodalLM.from_pretrained(
    repo, dtype=torch.bfloat16, device_map={"": "cuda"},
    attn_implementation="eager", experts_implementation="eager",
).eval()

labels = ["background", "objective", "methods", "results", "conclusions"]
codes = "ABCDE"[:len(labels)]
instruction = "Classify the role of this sentence in a biomedical abstract."
legend = "\n".join(f"{code} = {label}" for code, label in zip(codes, labels))

def encode(text):
    return tokenizer.encode(text, add_special_tokens=False)

text = "We randomly assigned volunteers to two groups."
ids = encode(instruction + "\n" + legend + "\nText: ") + encode(text)[:160] + encode("\nAnswer:")
inputs = torch.tensor([ids], device=model.device)
choices = [encode(" " + code)[0] for code in codes]
with torch.inference_mode():
    logits = model(input_ids=inputs, attention_mask=torch.ones_like(inputs),
                   use_cache=False, logits_to_keep=1).logits
    print(labels[logits[0, -1, choices].argmax().item()])

How it decides

  • One forward pass, no generation. The prompt lists the five roles as answer codes A to E, and the model's next-token scores for those codes pick the role. Nothing is sampled.
  • Use this exact prompt. The instruction, the role legend, the Text: and Answer: markers and the 160-token cap are the ones used in training and evaluation.
  • A whole abstract: split it into sentences and score each one with the same prompt.
  • Memory: the weights are decoded to BF16 on load; the reference run used one GPU with 96 GB of memory.

Evaluation

300 sentences from 181 biomedical articles, 60 for each role, from an independently sourced 2024 set of abstracts. None of these articles is in the training data. Each sentence's role comes from the heading its authors gave it in a structured abstract, and the headings were removed before scoring. The model trained for one fixed epoch, with no checkpoint chosen on these sentences, and every model below scored the same 300 sentences.

Model Macro F1 Accuracy
OpenMed Inkling 2 Mini Biomedical Sections v1 (this model) 78.40 78.67
Before OpenMed fine-tuning: thinkingmachines/Inkling-2-Mini 77.13 77.33
TF-IDF and logistic regression trained on the same 600 sentences 66.14 66.33

F1 by role:

Role This model Before OpenMed fine-tuning This model's precision / recall
Methods 88.19 85.94 83.58 / 93.33
Results 84.38 83.46 79.41 / 90.00
Conclusions 81.08 79.63 88.24 / 75.00
Background 69.84 68.75 66.67 / 73.33
Objective 68.52 67.89 77.08 / 61.67
  • OpenMed's fine-tuning added +1.27 macro F1 points over the original Inkling 2 Mini (95% interval +0.19 to +2.65, paired bootstrap over articles, 2,000 resamples) and raised F1 on every role. It is +12.26 points over the TF-IDF baseline (+7.02 to +17.40).
  • Methods, results and conclusions are the strongest roles. Background and objective sentences are the ones it most often confuses with each other.
  • This standalone checkpoint gives the same role as the trained adapter on all 300 sentences.

What it is for

It adds structure to abstracts that have none: tag each sentence, then pull the methods and results sentences for screening, evidence tables or search. It has been evaluated on English abstracts of biomedical studies.

For CPU-sized models on the same task, see OpenMed/ModernBERT-BiomedicalSections-Base-v1 and OpenMed/GLiNER2.5-BiomedicalSections-Small-v1.

Built on

OpenMed fine-tuned this model from Inkling 2 Mini by Thinking Machines Lab (Apache-2.0), using the fixed-loop release. Training used sentences from 509 CC BY abstracts of randomized controlled trials; every article, with its authors and DOI, is credited in NOTICE.txt. Thank you to Thinking Machines Lab for releasing Inkling 2 Mini openly, and to the authors who published their work open access.

This model is released under Apache-2.0. No abstract text or training data is included in this repository.

Citation

@misc{panahi2025openmedner,
  title={OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art Transformers for Biomedical NER Across 12 Public Datasets},
  author={Maziyar Panahi},
  year={2025},
  eprint={2508.01630},
  archivePrefix={arXiv}
}

OpenMed · Hugging Face · GitHub · PyPI · X

Downloads last month
-
Safetensors
Model size
26B params
Tensor type
F32
·
BF16
·
F8_E4M3
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OpenMed/Inkling2-Mini-BiomedicalSections-v1

Quantized
(236)
this model

Paper for OpenMed/Inkling2-Mini-BiomedicalSections-v1

Evaluation results

  • Macro F1 (five roles) on Sentences from structured biomedical abstracts (300 sentences, 181 articles, not in training)
    self-reported
    78.400
  • Accuracy on Sentences from structured biomedical abstracts (300 sentences, 181 articles, not in training)
    self-reported
    78.670
  • F1 methods on Sentences from structured biomedical abstracts (300 sentences, 181 articles, not in training)
    self-reported
    88.190
  • F1 results on Sentences from structured biomedical abstracts (300 sentences, 181 articles, not in training)
    self-reported
    84.380