Training used a custom EvalAndStopCallback that evaluates drug quality every 100 steps on 3 benchmark targets and stops automatically when a pharmaceutical quality gate passes:
Validity gate: ≥ 67% of generated SMILES must be chemically valid (RDKit)
QED gate: Average QED (Quantitative Estimate of Drug-likeness) ≥ 0.55
Evaluation Results
Evaluated on 3 benchmark drug targets using RDKit SMILES validation and QED scoring:
Quality gate passed at step 100 of run 2 (41 minutes of training).
How to Load
Requirements
pip install unsloth
Inference
python
1from unsloth import FastModel
23model, processor = FastModel.from_pretrained(4 model_name="dlyog/gemma-cure",# downloads base + adapter automatically5 load_in_4bit=True,6 max_seq_length=2048,7)8FastModel.for_inference(model)910SYSTEM =(11"You are Deep2Lead's drug discovery AI v2. When given a protein target or biological "12"context, first reason about the binding pocket geometry, key residues, and desired "13"physicochemical profile (2-3 sentences), then output novel drug-like SMILES molecules. "14"Always label your reasoning as 'Rationale:' and your molecules as 'SMILES:'. Explain "15"choices in plain English suitable for high school students and early researchers. "16"Prioritize selectivity, low toxicity, and synthetic accessibility."17)1819messages =[20{"role":"system","content":[{"type":"text","text": SYSTEM}]},21{"role":"user","content":[{"type":"text","text":(22"Target: EGFR Kinase\n"23"Protein sequence (first 150 AA): MRPSGTAGAALLALLAALCPASRALEEKKVCQGTSNKLTQLGTFEDHFLSLQ"24"RMFNNCEVVLGNLEITYVQRNYDLSFLKTIQEVAGYVLIALNTVERIPLENLQIIRGNMYYENSYALAVLSNYDANKTGLKELPMRNLQEILHGAVR\n"25"Measured binding affinity: IC50 = 2.0 nM\n"26"Design a small molecule drug candidate with high binding affinity to this target. "27"First explain your structural reasoning, then provide the SMILES.\n"28"Requirements: MW 200-500 Da, QED > 0.50, SAS <= 5.0, Lipinski Ro5 compliant."29)}]},30]3132inputs = processor.apply_chat_template(33 messages, tokenize=True, return_dict=True,34 return_tensors="pt", add_generation_prompt=True,35).to("cuda")3637with__import__("torch").no_grad():38 outputs = model.generate(39**inputs,40 max_new_tokens=350,41 temperature=0.9,42 top_p=0.92,43 top_k=50,44 repetition_penalty=1.3,45 do_sample=True,46)4748response = processor.decode(49 outputs[0][inputs["input_ids"].shape[1]:],50 skip_special_tokens=True51)52print(response)
Expected Output Format
Rationale: The EGFR kinase active site contains a conserved ATP-binding hinge region
with Cys797 as a key covalent anchor point. A pyrimidine-aniline scaffold provides
optimal hinge binding geometry while maintaining MW within the 200-500 Da window
and favorable LogP for cell penetration.
SMILES: CN(C)c1ccc(-c2nc(Nc3ccccc3F)c(C#N)cn2)cc1
Prompt Format
The model expects this exact format (use processor.apply_chat_template):
System: You are Deep2Lead's drug discovery AI v2...
User:
Target: <target name>
Protein sequence (first 150 AA): <sequence>
Measured binding affinity: <Ki/IC50/Kd value>
Design a small molecule drug candidate...
Requirements: MW 200-500 Da, QED > 0.50, SAS ≤ 5.0, Lipinski Ro5 compliant.
Dataset
Training data: 225,000 drug–target binding pairs curated from:
Each record: {target_name, protein_sequence_150AA, binding_affinity, smiles, rationale}
Technical Notes
Why RS-LoRA: Uses α/√r scaling (vs standard α/r), stabilising gradients across different rank sizes. With r=32 and α=64, the effective scale is α/√r ≈ 11.3 vs standard α/r = 2.0 — higher signal without the instability of large α.
Why Unsloth: 2× faster training, 80% less VRAM via custom CUDA kernels and gradient checkpointing optimisations. Enables 4-bit training on the full 5.2B model with only 62M trainable LoRA params.
repetition_penalty=1.3: Critical for SMILES generation — without it the model loops on fragments like c1c1c1c1.... Matches deployment params.
TRANSFORMERS_OFFLINE=1: Set during training to use local HF cache and prevent mid-training download attempts.
Citation
bibtex
1@misc{gemma-cure-2026,
2 title = {Gemma-Cure: Drug Discovery LoRA Adapter for Gemma 4 E2B},
3 author = {Tarun Kumar Chawdhury},
4 year = {2026},
5 howpublished = {HuggingFace Model Hub},
6 url = {https://huggingface.co/dlyog/gemma-cure},
7 note = {Fine-tuned on 225K drug-target pairs. Kaggle Gemma 4 Good Hackathon 2026.}
8}
License
This adapter is released under the Gemma Terms of Use. The base model weights remain subject to the original Gemma license.