hetanshwaghela's picture
Add live demo link
33f2f88 verified
|
Raw
History Blame Contribute Delete
5.64 kB
metadata
base_model: Qwen/Qwen3.5-0.8B
license: apache-2.0
language:
  - en
library_name: peft
pipeline_tag: text-generation
datasets:
  - hetanshwaghela/autoscientist-healthcare-reasoning
tags:
  - healthcare
  - medical
  - clinical-reasoning
  - chain-of-thought
  - grounded-generation
  - hallucination-mitigation
  - safety
  - adaptive-data
  - autoscientist
  - lora
  - qwen
  - fine-tuned

πŸ§ͺ AutoScientist β€” Healthcare Clinical-Reasoning (LoRA) + Experiment Log

Built with Adaptive Data by Adaption. A Qwen/Qwen3.5-0.8B LoRA adapter trained on the adapted clinical-reasoning dataset β€” released together with the honest, reproducible experiment that produced it.

TL;DR β€” read this first (integrity over hype)

This is a research artifact, not a leaderboard-beating model. On a held-out LLM-judged win-rate (Gemini 3.1 pro, 200 samples) the base model wins, 58/42. We report that plainly. The contribution of this project is the dataset (+30% quality, Grade B→A — see the dataset card) and the rigorous finding documented below.

πŸ““ The AutoScientist's notebook

Hypothesis. Adapting a high-quality medical chain-of-thought dataset (+30% platform quality) and SFT-ing a small model on it should beat the base model on held-out medical reasoning.

Experiment 1 β€” 20k rows, LoRA r=64, 3 epochs. β†’ Base 58 / adapted 42. Medical category: base 55 / adapted 46. β†’ Diagnostic: eval-loss plateaued after ~epoch 1 (1.559β†’1.525) while train-loss kept falling (2.27β†’1.19) β€” overfitting.

Experiment 2 β€” controlled follow-up: 60k rows, +40% general-purpose data (to counter catastrophic forgetting, per platform guidance), tuned recipe, more steps. β†’ Base 62 / adapted 38. It got worse β€” higher peak LR + more steps moved the model further from a strong base.

Conclusion (reproducible across two runs).

Supervised fine-tuning an already-instruction-tuned 0.8B model on long (~780-word) chain-of-thought makes it more verbose, and the judge prefers the base's crisper answers. Dataset quality and small-model win-rate are different axes. No hyperparameter or data-mix change flipped it β€” the effect is structural, not a bug.

This is the result the challenge is designed to surface: a clean, honest, reproducible negative β€” the dataset is the win; the model is the documented experiment.

Model description

  • Base model: Qwen/Qwen3.5-0.8B β€” the exact model AutoScientist trained from (served via togethercomputer/Qwen3.5-0.8B). All numbers are relative to this base, identical prompts and settings.
  • Method: AutoScientist, LoRA SFT, train_on_inputs=false.
  • Released recipe (Experiment 1, the stronger of the two): r=64, Ξ±=128, dropout 0.05, target q,k,v,o_proj, 3 epochs, LR ~1.1e-4 (cosine, warmup 0.05), weight-decay 0.01, grad-clip 2. Final train-loss β‰ˆ 1.19, eval-loss β‰ˆ 1.53 (168 steps).
  • Weight format: LoRA adapter (adapter_model.safetensors + adapter_config.json), base repointed to Qwen/Qwen3.5-0.8B for portable PEFT loading.
  • Language: English. Size: ~0.8B base params.

πŸ“Š Evaluation (base vs. adapted) β€” honest

Judge = Gemini 3.1 pro, 200 held-out samples, identical prompts/settings.

Win-rate (head-to-head) Base Qwen3.5-0.8B Adapted (this model)
On the dataset task 58 42
Medical category (all tasks) 55 46

Dataset quality (Adaptive Data, platform-measured): +30% overall, Grade B→A, completion quality +37.9%, message quality +17.6%, percentile 15.3→33.0.

🩺 What it's designed to do (safety blueprint)

Trained to reason then answer, stay grounded in evidence, hedge, recommend clinician confirmation, escalate red-flag/emergency symptoms, refuse when uncertain, and preserve numeric values exactly. (Design goals of the dataset; not a claim of clinical accuracy.)

How to use

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "Qwen/Qwen3.5-0.8B"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base)
model = PeftModel.from_pretrained(model, "hetanshwaghela/autoscientist-healthcare-reasoning")

⚠️ Limitations & safety

  • Underperforms its base on the held-out judge β€” do not treat as an improvement over Qwen/Qwen3.5-0.8B. Tends to be verbose.
  • Educational decision-support, not a medical device. Not for individual diagnosis, treatment, or dosing without a qualified clinician. Escalate emergencies; preserve numeric values exactly.
  • Inherits base-model and machine-generated-data limitations; English, exam-style skew.

πŸ” Reproducibility

Credit

Built with Adaptive Data by Adaption. Base: Qwen/Qwen3.5-0.8B. Foundation data: FreedomIntelligence/medical-o1-reasoning-SFT (Apache-2.0). Public-health blend: CDC public-domain text (Source: Centers for Disease Control and Prevention; no CDC endorsement is implied).