Downloads · 30 days
0
Hari5115/MoleculeIQ-SmolLM2-360M
MoleculeIQ-SmolLM2-360M is a text generation model from Hari5115. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
A 360M parameter language model fine-tuned for ingredient and molecular safety Q&A. Given a question about a chemical, food additive, cosmetic ingredient, or household product, the model explains whether it is safe, h…
Downloads · 30 days
0
Access
Public
Updated May 25, 2026
Parameters
362M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
A 360M parameter language model fine-tuned for ingredient and molecular safety Q&A. Given a question about a chemical, food additive, cosmetic ingredient, or household product, the model explains whether it is safe, how it works in the body, and what precautions to take — in plain English, always leading with the conclusion.
Built by fine-tuning SmolLM2-360M-Instruct on the MoleculeIQ dataset using LoRA. Runs on CPU, no GPU required.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "Hari5115/MoleculeIQ-SmolLM2-360M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32)
model.eval()
SYSTEM = (
"You are MoleculeIQ, an expert in molecular and ingredient safety. "
"Answer questions accurately, explain mechanisms clearly, "
"and always lead with the conclusion."
)
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Is aspartame safe to consume daily?"},
]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=300,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
)
answer = tokenizer.decode(
output[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True
)
print(answer)
Q: Is sodium benzoate safe in food?
At the concentrations permitted in food (up to 0.1% in most jurisdictions), sodium benzoate is generally considered safe for the general population. It works as a preservative by inhibiting the growth of bacteria, yeasts, and moulds in acidic environments. People with aspirin sensitivity or asthma may experience reactions. Avoid combining it with vitamin C (ascorbic acid) in drinks, as this can form benzene, a known carcinogen.
Q: Why is bleach dangerous to mix with ammonia?
Never mix bleach and ammonia — this creates toxic chloramine gases at room temperature with no warning signs. The reaction between sodium hypochlorite and ammonia produces chloramine vapours that cause severe respiratory irritation, chest pain, and shortness of breath even at low concentrations. If you accidentally mix them, leave the area immediately, ventilate the room, and seek fresh air.
Q: How does ibuprofen affect the kidneys?
Ibuprofen is generally safe for kidneys in healthy adults at recommended doses, but can cause damage with prolonged use or in vulnerable populations. It works by inhibiting prostaglandins — hormones that help regulate kidney blood flow. In people with existing kidney disease, heart failure, dehydration, or the elderly, this inhibition can reduce blood flow enough to cause acute kidney injury. Limit use to the shortest effective duration and stay well hydrated.
| Parameter | Value |
|---|---|
| Base model | SmolLM2-360M-Instruct |
| Fine-tuning method | LoRA via peft |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Trainable parameters | 3,276,800 (0.90% of total) |
| Learning rate | 2e-4 |
| LR scheduler | cosine |
| Effective batch size | 32 |
| Epochs | 3 |
| Max sequence length | 768 |
| Training examples | 3,082 |
| Training time | ~17 min on T4 GPU |
Evaluated on 200 held-out examples from the MoleculeIQ test split:
| Metric | Base SmolLM2-360M | MoleculeIQ Fine-tuned | Improvement |
|---|---|---|---|
| ROUGE-L | 0.1349 | 0.1697 | +25.8% |
| BERTScore F1 | 0.7835 | 0.8096 | +3.3% |
The fine-tuned model shows consistent improvement in answer structure and domain relevance. Qualitative review shows it reliably leads with conclusions and explains mechanisms — the base model does not follow this format.
Trained on Hari5115/MoleculeIQ:
MIT