創薬向けの大規模言語モデル TxGemma を使ってみた
Google DeepMind が公開した創薬向けの大規模言語モデル TxGemma について、 Ollama + Open WebUI で構築したローカル LLM 環境で使ってみました。
TxGemma とは?
創薬では、標的分子との結合親和性評価や毒性予測などに多大なコストと時間を要します。その効率化を図る手段として、近年注目を集めているのが 創薬特化型の大規模言語モデル(LLM)。
TxGemma は、Google DeepMind 社が Gemma-2 をベースとして開発した創薬向けの LLM ファミリーです。
主な特徴
- 特定タスク専用モデルではなく、汎用的な創薬支援モデル
- 小分子、タンパク質、核酸など多様な入力に対応
- 毒性・薬理特性・臨床試験予測などの創薬タスクに対応
- 自然言語での対話・説明が可能(Chatモデル)
- 予測の根拠(例:分子構造による理由)も説明可
- モデルサイズ:2B / 9B / 27B
- オープンモデル(Hugging Face などで利用可)
技術詳細
- ベースモデル:Gemma-2(2B, 9B, 27B)
- 学習データ: Therapeutics Data Commons (TDC) 由来の約 700 万件の指示チューニングデータ + 一般 LLM チューニングデータ(Chat 版)
- 評価ベンチマーク: ChemBench , HLE, GPQA, MMLU など
応用例
- スクリーニング: 化合物の SMILES 表記を入力すると、毒性や臨床試験通過の可能性を予測
- 候補の比較: 二つの化合物のうち、どちらを次に進めるべきか判断
- メカニズムの説明: たとえば、「なぜこの分子は血液脳関門を通過できるのか?」という問いに対して、溶解性・分子量・電荷などの構造情報を用いて論理的に説明
TxGemma を使ってみる
Ollama は、ローカル環境で LLM を実行するためのエンジン、 Open WebUI は、ブラウザ上で LLM と対話するためのインターフェースを提供する Web アプリです。
Ollama + Open WebUI を導入 した後、Ollama で TxGemma (Chat 版) モデルを取得し、Open WebUI をインターフェースとして使ってみます。
モデルを取得する
Ollama で、Hugging Face Hub で公開されている GGUF 形式のモデル( Bartowski 版 )を取得します。TxGemma-9B-Chat モデルを試してみます。
ollama pull hf.co/bartowski/google_txgemma-9b-chat-GGUF
使ってみる
Open WebUI をインターフェスとして、TxGemma を試してみました。
プロンプトの例
TxGemma は instruction tuning(指示チューニング)をベースに学習されているため、以下のような形式で構造化したプロンプトが最適なようです。
Instruction: 何をしてほしいのか(例:毒性を予測せよ)
Context: 背景・前提条件(任意)
Question: 化合物の SMILES やアミノ酸配列配列などの入力データ
しばらく試してみた感じだと、背景情報(Context)を付与することで、LLM の文脈理解が向上し、より適切な回答が得られる可能性が高まるように思いました。
また TxGemma の学習データは、その大部分が英語を基盤としているため、原則として英語でプロンプトを作成する方が、より適切で安定した応答を得られると考えられます。
TxGemma の論文1に記載されていたプロンプトのうち、面白そうだなと思ったものを引用してみます。論文で用いられているのは 27B モデルですが、今回は 9B モデルで試しています。
血液脳関門(BBB)の透過性を予測する
Instructions: Answer the following question about drug properties.
Context: As a membrane separating circulating blood and brain extracellular fluid, the blood-brain barrier (BBB) is the protection layer that blocks most foreign drugs. Thus the ability of a drug to penetrate the barrier to deliver to the site of action forms a crucial challenge in development of drugs for central nervous system.
Question: Given a drug SMILES string, predict whether it
(A) does not cross the BBB (B) crosses the BBB
Drug SMILES: CN1C(=O)CN=C(C2=CCCCC2)c2cc(Cl)ccc21
Answer:
(B)
上記の問いに関して、27B モデルを用いた論文1における予測値は(B)
であり、同じ結果を示しています。
Chat モデルでは、上記のようなプロンプトに対する回答が得られた後、その予測の根拠を分子構造などの情報に基づいて説明させることができます。
Explain your reasoning based on the molecular structure.
The drug SMILES string “CN1C(=O)CN=C(C2=CCCCC2)c2cc(Cl)ccc21” represents a molecule with the following structural features:
- Aromatic rings: The presence of two benzene rings (C2=CCCCC2 and c2cc(Cl)ccc2) suggests potential for lipophilicity, which is a characteristic that often favors BBB crossing.
- Polar groups: The molecule also possesses polar groups like nitrile (-CN) and amide (-CON). These groups can contribute to hydrogen bonding interactions, potentially hindering BBB penetration.
- Chlorine atom: The chlorine atom (Cl) adds a small degree of lipophilicity but can also increase the molecule’s overall size and charge, potentially making it less permeable.
Reasoning for (B) classification:
While the aromatic rings suggest lipophilicity, the presence of polar groups and the chlorine atom could counteract this effect. It’s likely that the molecule has a balanced degree of lipophilicity and polarity. Many drugs that cross the BBB fall within this “balanced” category, where they possess enough lipophilic properties to dissolve in the lipid bilayer of the BBB, but also have sufficient polar groups to interact with aqueous environments on either side of the barrier.
Important Note: Predicting BBB permeability solely based on structural features is not always accurate. Other factors like molecular weight, charge, and specific transport mechanisms also play a role. Experimental validation is essential to confirm BBB crossing ability.
主要組織適合性複合体(MHC)分子との結合性を予測する
Instructions: Answer the following question about peptide-MHC binding.
Context: In the human body, T cells monitor the existing peptides and trigger an immune response if the peptide is foreign. To decide whether or not if the peptide is not foreign, the peptide must bind to a major histocompatibility complex (MHC) molecule. Therefore, predicting peptide-MHC binding affinity is pivotal for determining immunogenicity. In some experiments, the peptide binding is measured against cells that express multiple MHCs, so the peptide could be binding any one of the possible MHCs. Class 1 MHC molecules bind to peptides that are usually 8-14 amino acids long and activate CD8 T cells.
Question: Given the amino acid sequence of the peptide and possible pseudo amino acid sequences of MHC 1, predict whether the peptide
(A) does not bind to any of the MHCs (B) binds to any of the MHCs
Peptide amino acid sequence: QLADETLLKV
Possible MHC pseudosequences: YFAMYGEKVAHTHVDTLYVRYHYYTWAEWAYTWY
Answer:
(B)
上記の問いに関して、27B モデルを用いた論文1における予測値は(B)
であり、同じ結果を示しています。予測の根拠を尋ねてみます。
Explain your reasoning based on the molecular structure.
Let’s break down why the peptide QLADETLLKV binds to MHC class 1 molecules:
1. Peptide Structure:
- QLADETLLKV: This peptide is 9 amino acids long and has the following sequence: Glu (Q) - Ala (A) - Asp (D) - Glu (E) - Thr (T) - Leu (L) - Leu (L) - Lys (K) - Val (V).
2. MHC Class 1 Structure:
- MHC class 1 molecules are responsible for presenting intracellular peptides to CD8+ T cells. They have a groove formed by three alpha-helices (α1, α2, and α3) and a beta-sheet (β2). This groove is where the peptide binds.
- The peptide binding site within the MHC class 1 groove has specific amino acid residues that interact with the peptide.
3. Key Interactions:
- Glu (Q) at position 1: The glutamine (Q) residue at the N-terminus of the peptide can form hydrogen bonds with the positively charged residues in the α2 domain of the MHC class 1 molecule (e.g., Lys38 or Arg49).
- Hydrophobic Interactions: The string of leucine (L) and valine (V) residues in the middle of the peptide (LLKV) creates a hydrophobic core that interacts favorably with the hydrophobic pockets within the α2 and α3 domains of the MHC class 1 molecule.
- Other Interactions: Other residues in the peptide (A, D, E, T) likely contribute to less specific interactions with the MHC class 1 molecule through hydrogen bonding or van der Waals forces.
Conclusion:
The combination of these interactions between the peptide QLADETLLKV and the specific amino acid residues within the MHC class 1 groove favors peptide binding. This is why the answer is (A).
臨床試験の結果を予測する
Instructions: Answer the following question about clinical trials.
Context: Clinical trial is the most time and cost-consuming step in the drug discovery process. Phase 1 clinical trials test the safety and basic properties of a new drug or treatment in a small group of people for the first time. Optimizing and designing trials with machine learning could drastically lead to the speedup of delivery of life-saving therapeutics to patients. Clinical trial outcome prediction is a machine learning task that aims to forecast the outcome of clinical trials, such as the approval rate of a drug or treatment. It utilizes various clinical trial features, including the drug’s molecular structure and patient disease.
Question: Given a drug SMILES string and disease, predict if the phase 1 trial
(A) would not be approved (B) would be approved
Drug SMILES: COC1=NC(N)=NC2=C1N=CN2[C@@H]1O[C@H](CO)[C@@H](O)[C@@H]1O
Disease: Chronic myeloproliferative disease
Answer:
(A)
上記の問いに関して、27B モデルを用いた論文1における予測値は(A)
であり、同じ結果を示しています。
薬剤に対する感受性を予測する
Instructions: Answer the following question about drug responses.
Context: The same drug compound could have various levels of responses in different patients. To design drug for individual or a group with certain characteristics is the central goal of precision medicine. In experiments, IC50s of drugs were measured against cancer cell lines.
Question: Given a drug SMILES string and a cell line description, predict the normalized drug sensitivity from 000 to 1000, where 000 is minimum drug sensitivity and 1000 is maximum drug sensitivity.
Drug SMILES: CN1C=C(C2=CC=CC=C21)/C=C\3/C4=C(C=CC=N4)NC3=O
Cell line description: SNU-1, stomach cell sourced from cancer
Answer:
598
上記の問いに関して、27B モデルを用いた論文1における予測値は615
であり、近似した値を示しています。
まとめ
ある特定の分子について正確な物性値を求めるようとするときには、依然として RDKit のような物理ベースの記述子モデルを使った方が有効だと思います。
一方で TxGemma のような LLM は、明示的な記述子に依存することなく、多様な種類のデータを横断的に分析し、疾患との関連性を含めた総合的な判断を下せるという点で優位性があるように思いました。
また TxGemma は、Ollama + Open WebUI と組み合わせることで、対話型創薬支援 AI として手軽に活用できそうです。