Tracing Pharmacological Knowledge In Large Language Models
Basil Hasan Khwaja, Dylan Chen, Guntas Toor, Anastasiya Kuznetsova

TL;DR
This paper investigates how pharmacological knowledge, specifically drug-group semantics, is represented within Llama-based biomedical language models, revealing that such knowledge is distributed across tokens and layers rather than localized.
Contribution
It provides the first systematic mechanistic analysis of pharmacological knowledge encoding in large language models using interpretability methods.
Findings
Early layers encode drug-group knowledge.
Distributed representations of pharmacological semantics are present in embeddings.
Intermediate tokens have a stronger causal effect on encoding drug-group information.
Abstract
Large language models (LLMs) have shown strong empirical performance across pharmacology and drug discovery tasks, yet the internal mechanisms by which they encode pharmacological knowledge remain poorly understood. In this work, we investigate how drug-group semantics are represented and retrieved within Llama-based biomedical language models using causal and probing-based interpretability methods. We apply activation patching to localize where drug-group information is stored across model layers and token positions, and complement this analysis with linear probes trained on token-level and sum-pooled activations. Our results demonstrate that early layers play a key role in encoding drug-group knowledge, with the strongest causal effects arising from intermediate tokens within the drug-group span rather than the final drug-group token. Linear probing further reveals that…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning in Healthcare · Topic Modeling · Artificial Intelligence in Healthcare and Education
