BioLaya — biomedical decision encoders

BioLaya is a set of six non-generative encoder checkpoints released together in a single Hugging Face repository. It contains one Laya-style structured decision model and five task-specific ModernBERT-large classification models. This repository is a multi-checkpoint collection, not a chat model or a single Transformers checkpoint at the repository root.

Authors / project: Gabriel Henrique Alencar Medeiros; BioLaya research at LITIS / Université de Rouen Normandie.

Checkpoints in this repository

Path Architecture / role Initialization
systemone/ Laya / ModernBERT decision model (~421M parameters) convaiinnovations/laya
standard/bionli/ Biomedical NLI, binary classification answerdotai/ModernBERT-large
standard/nli4ct/ Clinical trial NLI, binary classification ModernBERT-large
standard/chemprot/ Chemical–protein relation classification ModernBERT-large
standard/ddi2013/ Drug–drug interaction relation classification ModernBERT-large
standard/biored/ Biomedical relation classification ModernBERT-large

Training caveat: the supplied run configurations show that the five Standard models were fine-tuned directly from ModernBERT-large. The supplied SystemOne run uses Laya as its initial checkpoint. The archive contains DAPT configurations, but not proof that biomedical DAPT was applied to any of these six released checkpoints. Do not describe them as 100-million-token DAPT models.

Evaluation — five biomedical classifiers

These are the supplied per-task evaluation summaries (one run per checkpoint, seed 42). Accuracy, macro-F1 and ECE come from metrics/standard/<task>/summary.csv; measured median latency is per evaluated example under the original PyTorch evaluation runtime.

Task Evaluated examples Accuracy Macro-F1 ECE (top-1) Median latency
bionli 3,599 94.11% 93.55% 0.0394 14.8 ms
nli4ct 200 50.00% 38.00% 0.0242 47.7 ms
chemprot 5,744 39.22% 17.95% 0.1039 19.7 ms
ddi2013 979 56.28% 45.08% 0.1202 12.1 ms
biored 20,912 76.50% 64.77% 0.1707 20.8 ms
  • BioNLI: 3,599 test examples recovered through the original BioJev evaluation-ID membership, with some training examples excluded on input-overlap grounds. This is a modified training-split protocol; refer to protocol/five_benchmarks_audit.json.
  • NLI4CT: 200 development examples serve as the evaluation split. Do not describe these as an official test set.
  • ChemProt, DDI2013 and BioRED: their original test sets were used for evaluation. Inputs encode context, subject, and object where available. Some distinct annotated relations remain indistinguishable given the text supplied to the model, and conflicting labels were retained, not silently discarded. See the input-ambiguity counts in the audit.
  • Evaluation token limits for the Standard heads were 512 for four tasks and 1,024 for NLI4CT, although the underlying ModernBERT architecture supports longer sequences.

These numbers are descriptive checkpoints' scores, not evidence of clinical safety or a controlled superiority claim against different model families. Dataset, split, seed, length policy and supervision regime must be matched before comparing results.

Evaluation — SystemOne

The Laya decision encoder was evaluated on 6,768 development instances from 11 decision-task sources. Its micro-aggregated accuracy is 89.44%, with top-1 ECE 0.0466 and median latency 11.1 ms in the original Laya evaluation environment.

Source Evaluated examples Accuracy Source macro-F1
ag_news 250 94.40% 94.35%
banking77 400 96.00% 96.19%
bionli 2,000 94.25% 93.76%
boolq 400 91.75% 91.75%
mnli 550 86.91% 86.95%
nli4ct 200 62.00% 61.97%
policy 150 97.33% 97.33%
policy_v2 1,200 85.92% 85.90%
research_taxonomy_v21 768 99.61% 99.66%
routing_v2 600 84.33% 82.38%
sst5 250 52.40% 51.35%

The combined ALL macro-F1 reported in metrics/systemone/summary.csv is not a directly comparable pooled multiclass F1 across these heterogeneous sources. Use per-source F1 and aggregate accuracy for reporting. The evaluation set is a development/held-out-from-training split; training and model selection also involved these development tasks. An independent external test is still needed for a stronger generalization claim. The underlying BioJev source protocol had known overlap issues; BioLaya removed overlapping training content, and comparisons against original BioJev numbers are not strictly matched training protocols.

systemone/train_report.json also includes an internal training-time evaluation; it is slightly different from the separate end-of-run evaluation summarized above. This README uses the latter for the headline benchmark.

Load and run

Standard task-specific checkpoint (Transformers)

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

repo = "Gabriel382/biolaya"
subfolder = "standard/bionli"  # or nli4ct, chemprot, ddi2013, biored

tokenizer = AutoTokenizer.from_pretrained(repo, subfolder=subfolder)
model = AutoModelForSequenceClassification.from_pretrained(repo, subfolder=subfolder)
model.eval()

# This is a basic demonstration, NOT the exact training prompt encoder.
inputs = tokenizer(
    "Premise: Aspirin reduces platelet aggregation. Hypothesis: Aspirin influences platelets.",
    return_tensors="pt", truncation=True, max_length=512,
)
with torch.inference_mode():
    prediction = model(**inputs).logits.argmax(dim=-1).item()
print(model.config.id2label[prediction])

Important: For scientifically comparable inference, reproduce the text-construction and pair-marking used by the BioLaya repository's data adapter (especially for relation extraction). The snippet above demonstrates weight loading but is not an exact replication of the reported evaluation preprocessing. Each checkpoint has a distinct label mapping in its own config.json.

SystemOne decision checkpoint (Laya SDK)

import laya

agent = laya.load("Gabriel382/biolaya", subfolder="systemone")
questions = {
    "fever_reported": {
        "type": "choice",
        "instructions": "Does the clinical text report fever?",
        "criteria": {"yes": "Fever is reported", "no": "Fever is not reported"},
    }
}
result = agent.system_one({"text": "The patient presented with fever and cough."}, questions)
print(result["answers"]["fever_reported"])

For the recorded BioLaya SystemOne training, see configs/systemone/biolaya.yaml, systemone/rl_agent_config.json, and systemone/train_report.json. This checkpoint was trained on choice questions. Other typed question modes (noul, score) were not evaluated for this BioLaya fine-tune; their accuracy and calibration should not be assumed.

Ollama

The Hugging Face systemone/model.safetensors checkpoint is not itself an Ollama GGUF. Running through Ollama requires a separately converted and validated Laya GGUF plus a compatible Ollama decision runtime. No GGUF is included in this Hugging Face repository, and native Ollama/PyTorch numerical parity is not claimed here.

Training and protocol

  • SystemOne: Laya fine-tune using soft-ce, requested 3 epochs, micro-batch 4, gradient accumulation 16, encoder LR 2.5e-5, head LR 1e-4, seed 42, max input length 1,024 and option-head limit 256. See run logs for effective optimizer updates and completed epoch count; stored Laya configuration also reports internal calibration on 400 items.
  • Standard: ModernBERT-large with sequence classification head, 3 epochs, LR 2e-5, seed 42, gradient accumulation 16 and per-task max length 512 / 1,024. Full per-task configuration is under configs/standard/five/.
  • Evaluation: no errors were reported among the evaluated examples in the supplied summaries. The reliability measures depend on the inference implementation and are not automatically portable to a different runtime.
  • Data and splits: input sources and split policies are documented in protocol/five_benchmarks_audit.json. Raw datasets and individual evaluation predictions are not bundled with this release.

Limitations and intended use

For research use only. Not approved as a medical device. Do not use for autonomous diagnosis, treatment, medical triage or other clinical decisions without independent validation, appropriate human oversight and regulatory review.

Notable limitations include biomedical relation labels that remain ambiguous given the exported input representation, possible loss of critical evidence through truncation, reliance on English data, use of a development set for SystemOne performance reports, lack of repeated seeds in this particular five-model release, and possible differences between PyTorch and GGUF inference.

License and attribution

This release is marked Apache-2.0, in line with the Apache-2.0 licenses of the upstream Laya and ModernBERT-large models. The releasing author should confirm this derivative licensing choice and any dataset redistribution terms before publication. The release includes only model weights, metadata and aggregate evaluation summaries; no raw benchmark texts are distributed by default.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Gabriel382/BioLaya

Finetuned
(422)
this model