--- base_model: google/txgemma-2b-predict library_name: peft pipeline_tag: text-generation license: other license_name: health-ai-developer-foundations license_link: https://developers.google.com/health-ai-developer-foundations/terms language: - en tags: - lora - peft - txgemma - pharmacogenomics - lung-cancer - reproducibility --- # TxGemma PGx LoRA Adapter — 210k Checkpoint This repository provides the manuscript-specific LoRA adapter used for the pharmacogenomic (PGx) representation component of the study **“Leveraging Pharmacogenomic Signals to Augment Genomic–Treatment Representations for Prognostic Prediction of 1-Year Mortality in Lung Cancer.”** The released adapter corresponds to the selected **210,000-step checkpoint** used for PGx representation extraction. This repository distributes the adapter only; it does **not** redistribute Google TxGemma base-model weights. ## Model artifact - **Base model:** `google/txgemma-2b-predict` - **Adapter framework:** LoRA / PEFT - **Selected checkpoint:** 210,000 steps - **LoRA rank (`r`):** 8 - **LoRA alpha:** 8 - **LoRA dropout:** 0.0 - **Bias:** none - **Target modules:** `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` - **Task type:** causal language modeling The repository root contains: - `adapter_config.json` - `adapter_model.safetensors` - `LICENSE` - `NOTICE` - `MODIFICATIONS.md` - `CHECKSUMS.sha256` - `examples/synthetic_clinical_examples.jsonl` - `examples/synthetic_pgx_contexts.jsonl` ## Base-model access and adapter loading The adapter requires separate access to `google/txgemma-2b-predict`. Access to the base model is governed by Google's Health AI Developer Foundations (HAI-DEF) Terms of Use and may require acceptance of those terms on Hugging Face. A minimal PEFT loading pattern is: ```python from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel base_model_id = "google/txgemma-2b-predict" adapter_path = "." # repository root after cloning/downloading tokenizer = AutoTokenizer.from_pretrained(base_model_id) base_model = AutoModelForCausalLM.from_pretrained( base_model_id, device_map="auto", torch_dtype="auto", ) model = PeftModel.from_pretrained(base_model, adapter_path) model.eval() ``` The code above demonstrates adapter loading only. It is not intended to reproduce the protected clinical cohort or the complete downstream survival-prediction analysis. ## Synthetic clinical examples The `examples/` directory contains a small set of **fully synthetic, fictional clinical examples** created solely to illustrate the expected structure of study inputs. - `examples/synthetic_clinical_examples.jsonl` contains **five** fictional patient-level examples. - `examples/synthetic_pgx_contexts.jsonl` contains **two** illustrative PGx inference-context examples derived from those fictional records. These examples: - were created from scratch; - do **not** contain real patient records; - are **not** perturbations or transformations of real patient records; - are **not** intended to reproduce the study cohort distribution; and - are **not** intended to reproduce the reported model-performance estimates. No outcome labels are included in the synthetic clinical examples. The study target was **1-year all-cause mortality from the predefined landmark**. ## PGx inference-context examples The illustrative PGx context records demonstrate, at a structural level, how a medication-specific molecular representation and altered-gene context can be represented together for encoder input. They are provided for transparency only and are **not asserted to reproduce an exact production prompt string or a real patient record**. These examples are distinct from the GDSC fine-tuning prompt format described in the Supplementary Methods. ## Representation lineage At a high level, the study pipeline can be summarized as: ```text Protected clinical / genomic source data ↓ Integrated patient-level clinical information ↓ ┌──────────────────┬──────────────────────┬────────────────────────┐ │ ENF representation│ PGx inference context│ CTE / E2E / GKC │ │ │ │ baseline representations│ └──────────────────┴──────────────────────┴────────────────────────┘ ↓ Model-ready representations ↓ EHR + PGx late fusion ↓ XGBoost ↓ 1-year mortality prediction ``` The patient-level PGx representation described in the manuscript is obtained by aggregating context-level encoder representations. Protected patient-level clinical data and patient-level PGx feature vectors are not included in this public repository. ## Scope and reproducibility boundary This repository is intended to support **model accessibility, methodological specification, and privacy-preserving transparency** for the study. Included: - the manuscript-specific LoRA adapter; - the exact PEFT adapter configuration distributed with that adapter; - synthetic patient-level input examples; and - illustrative PGx inference-context examples. Not included: - protected patient-level EHR or genomic data; - real patient identifiers or outcome labels; - pre-calculated real-patient PGx feature vectors; - downstream patient-level prediction files; or - downstream classifier weights fitted to the protected clinical cohort. Accordingly, the public materials support inspection and reuse of the PGx adapter and the input structure without releasing protected clinical data. They do not by themselves reproduce the manuscript's patient-level performance estimates. ## Modification notice This repository contains a manuscript-specific LoRA model derivative of `google/txgemma-2b-predict`. The adapter weights were produced by study-specific LoRA fine-tuning, and the selected released artifact corresponds to the 210,000-step checkpoint. No Google base-model weights are redistributed here. See `MODIFICATIONS.md` for a concise artifact-level notice. ## License and use restrictions This adapter is a model derivative of TxGemma and is distributed subject to the **Health AI Developer Foundations Terms of Use**: https://developers.google.com/health-ai-developer-foundations/terms The HAI-DEF Prohibited Use Policy incorporated by those terms is available at: https://developers.google.com/health-ai-developer-foundations/prohibited-use-policy A local copy of the HAI-DEF Terms of Use is included in `LICENSE`. Users are responsible for complying with those terms, including applicable use and redistribution restrictions. Access to and use of the separate TxGemma base model are also subject to the base model's applicable terms. The required HAI-DEF distribution notice is included in `NOTICE`. Google does not endorse this repository or the associated study. `TxGemma`, `Gemma`, and `Google` are referenced only to identify the upstream model and provider. ## Associated manuscript **Leveraging Pharmacogenomic Signals to Augment Genomic–Treatment Representations for Prognostic Prediction of 1-Year Mortality in Lung Cancer** PLOS Digital Health — major revision materials.