{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "JhG5H1MR3WtJ" }, "source": [ "# Interpreting Aging Biology Data with LFM2 Longevity Models\n", "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Liquid4All/cookbook/blob/main/guides/lfm2_longevity.ipynb)\n", "\n", "Over the last few decades, researchers have sought to characterize aging at the molecular level, generating diverse datasets that span DNA methylation, transcriptomics, plasma proteomics, genetics, and clinical biomarkers. Most existing tools like aging clocks and biological foundation models, however, are trained on one of these data modalities at a time.\n", "\n", "[LFM2-1.2B-Longevity](https://huggingface.co/LiquidAI/LFM2-1.2B-Longevity) and [LFM2-2.6B-Longevity](https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity) can instead take any of these data types as input by representing them as structured text. Trained on aging-related multi-omic data, these models were developed jointly by [Liquid AI](https://www.liquid.ai) and [Insilico Medicine](https://insilico.com). The accompanying paper, [An Open Benchmark and Language Models for AI in Aging Biology](https://www.cell.com/cell/fulltext/S0092-8674(26)00999-2), introduces the models and [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench). Our [release blog post](https://www.liquid.ai/blog/longevitybench) further covers the benchmark design and results.\n", "\n", "> Outputs are model predictions, not clinical advice, and should be validated experimentally." ] }, { "cell_type": "markdown", "metadata": { "id": "gVcORV8x3WtK" }, "source": [ "## What LongevityBench measures\n", "\n", "LongevityBench evaluates how well language models interpret biological data relevant to aging. It contains 17 tasks and 25,457 prompts across five data domains. Tasks include comparing the ages of two individuals, predicting survival outcomes, and estimating the effect of genetic perturbations on lifespan.\n", "\n", "The tasks use four answer formats: pairwise comparison, multiclass classification, numerical regression, and binary classification.\n", "\n", "| Domain | Source | Pairwise | Multiclass | Regression | Binary |\n", "|---|---|---|---|---|---|\n", "| Clinical | NHANES | age, mortality | age, mortality | age | mortality |\n", "| DNA methylation | GEO | age | age | age | — |\n", "| Transcriptomics | GTEx | age | age | — | — |\n", "| Proteomics | Olink | age | age | age | — |\n", "| Genetics | OpenGenes, SynergyAge | lifespan | — | lifespan | expression direction |\n", "\n", "Training and evaluation sets were carefully split according to the source dataset: NHANES clinical data by survey wave, DNA methylation profiles by GEO study, GTEx transcriptomic and Olink proteomic data by individual, OpenGenes records by protein family, and SynergyAge records by species. The examples below come from the evaluation set (i.e., [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench)), with some prompts shortened for readability." ] }, { "cell_type": "markdown", "metadata": { "id": "uARgBo_k3WtL" }, "source": [ "## Setup\n", "\n", "The Longevity models are supported natively in Transformers from version 5.1.0 onward, so no custom modeling code is required.\n", "\n", "This notebook uses `accelerate` (`v1.14.0`), `torch` (`v2.11.0`),`torchvision` (`v0.26.0`), `transformers` (`v5.16.1`)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "pC2HE0TB3WtL" }, "outputs": [], "source": [ "%pip install -q \"transformers>=5.1.0\" torch accelerate" ] }, { "cell_type": "markdown", "metadata": { "id": "OOLDDJ3f3WtL" }, "source": [ "## Load the model\n", "\n", "Both models run on a free Colab instance or a laptop, and share the same interface, so switching `model_id` is the only change needed to run the other." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "2dt1ZVke3WtL", "colab": { "base_uri": "https://localhost:8080/", "height": 305, "referenced_widgets": [ "2f8fe63b69474ca0a5ee6da1724f208a", "a493f79dc67a4df8ba2c95333d214c84", "22ee9e48180d442cb5411e5b160d7d0b", "6a47130cdcad4f8cb3b38d4ba51cb3c0", "11d801c88fcf4bbe955d7a68ffb3b8e0", "a9b543b07dca4cbe9ebdd6c640bbeacc", "c393e27a371f4bfe88cb5da07142ea38", "fcd3bd9314784750b4e8721930007a61", "9c904f2e02d140c0b8ab500ebfc48556", "cd94377a35e843a38f3a11372e0ccd80", "59f83fbd242f41b58129977ac2e33833", "54d2442608aa408da38d17523f95ba2f", "6247615c2f6d48f68ac55042f8417d5c", "d12d24b28fb54dc5b586b50fec8e77a5", "c7f4af53dda54350b121f0f5fe74d89e", "9bf40730bb814b73a16127396abc8f01", "fef45b11a6334ab7bf1dc8d117b66e14", "68a054df3da4453c9b0bf6ab841342fc", "82e77ee08e834a60863020611bac8f49", "d8fc012dd1b742419048de69b70460c1", "099d22d159d04f0483802a059c1af5c2", "1c21c139e3bc476ba37ab7389af346e3", "54e99b41e22945b8be81653aedfb12a5", "c86b0d189d854899aa11f06ae1c7a39f", "34b41a1a57cb45f99a5d1a29661869ce", "c444e940621c4eba93f5be3d892eca15", "827f22adbaa54d56aeed187d09a6cdc0", "476db1988b70483998fb683cae008007", "09cdf280812d487483c0d1317c30f4e9", "4c2f87abff9b43c3875cd7da4a453b9c", "b76321f2ad774158a442c633b42ef173", "272df16abece4a3db8e0bb15084072a1", "848db09030634d79be3cf452d1bd8810", "8b79c236626b47e88dec0e33bbb6fae8", "9c8391c5830b400ca8c86203ad4cfdc2", "f37c3f089fc24ae6950af16b4f38e390", "d2e2a1cb82794380882c6463686a3ff1", "c52c4beb05324757a56a6749764e4d09", "b650280c924c434a90fc271af990276f", "27e4b8a23e1e45a08ae6eea152378a07", "31d1c663f6a8414f9e247535e0c709a3", "99488783ea87473faada0eaf073d258d", "9edb7bf99ba540aea26b04efa3dc6c74", "5de8d69e2709440caae060b1ac23c7eb", "852a6a723d3447549a44c03c76534254", "9037c27d099d4765b2c844f4f9eb72d0", "68aee218f7964457aefdacdead4c12bc", "142258f0a62b46ddbf2371aeea24c456", "a35ac29728ea4b2b8018ea7e8cfea55a", "f32ead96cb3f431bbfe5facad3a11853", "415afd81a16c4fffa41f9a82ace49d9a", "431b68c9769548b18663bccdc50ae98f", "43de2c71772d46e8a760ef54f8c4d7ba", "451950e9d5934d68abe9d58bd1ffb64b", "db09d24cd12544ed93db3e84f3abd8d2", "f6e06313882c4f13bb0fbc6497da9cf6", "2e8f071398b043c4a52228cb69899bd8", "4a21ec3ea0f84f46aac66131fded3ac9", "06924956f923486283a2e3cc5a94bb5e", "3a5693bbaea144b981bd619b85e96177", "8f4d35658086421d978334c71bbf4de1", "e7509b6197a44a6a8c31a9475b9973a8", "0e1ca01aaa014c5096c66dbe36d6c7a8", "04ba2125705e4156bacbb334805d22fa", "ca5ebda4b0ed4ad38e1070621efdb0c2", "91de47f61c3b4690a3fea9f6c39ef732", "a5f9ee2edccc417a995b00a202036aee", "f09c25fc3f884c60b724e29ff874385c", "952380a4ef8645a4b35bc763f06a7d0d", "2a8f09e747124b7fbc2d0f4f8b52c6d9", "13784ac3bf8b4395ad95b45dd88d9ec8", "f5c05e52fe284a38ab1cafc303871bd0", "631daf4b4a9848df9888b3506e93d998", "9095e1a1da2742039717202f7f581996", "81388a1ff341473eb2b6b9db601636a4", "42c403966f5b4ede9cd65abeb0781d94", "d8f60821a6954772924fd2edb56551fd", "681dea80d6864ddb9111ea9c9e868e9b", "68234e9626414ffabe26965a7ab68a16", "e7a78ed3a6474efda5f5dee9ea26fa5a", "55fe346c071040e3b424f14879d11a12", "ff3184068abb48e2949b178535d3d0f3", "05d4d1698b654eaeafc185e7ee9273ed", "34a8dc4fdfd04f08ad3dc3bd7331bfb4", "f2dfe85ca4ab4a0da66e50561ca79f91", "8aeae6a9d9a34d54af100f29421ae5ff", "81c9cf55b7cc487bae79f9c3bbacae01", "c3576fda6907405684926d96bf86640d", "686806cbe078492bbaf55bca0fd3d525", "f3ff70a6f98146bf9874103c289f587f", "07fd792b5b3e40b49ab9aa306a4f4eb3", "32202fb262f449d599c7ebf498c5f0f9", "7bffe35eed7a4ca8be62d980f5155ad0", "e9ee61e630e14a12a9e7aaf4e1f99eb1", "49a2cb27d0c84771be9467b380f9654c", "63ff52e6c5fe48dcb8a503c42d13e3dd", "e5a0b8fe419843b99dfb366815bf252c", "5ce5dce89860432580e9f04b764f12d0", "027343bc4e3c48b383bcdcc95f7e766a" ] }, "outputId": "48924551-bc07-4360-bace-a225053c3a5e" }, "outputs": [], "source": [ "from transformers import AutoModelForCausalLM, AutoTokenizer\n", "\n", "lfm_models = [\n", " \"LiquidAI/LFM2-1.2B-Longevity\",\n", " \"LiquidAI/LFM2-2.6B-Longevity\",\n", "]\n", "\n", "model_id = \"LiquidAI/LFM2-1.2B-Longevity\"\n", "\n", "tokenizer = AutoTokenizer.from_pretrained(model_id)\n", "model = AutoModelForCausalLM.from_pretrained(\n", " model_id,\n", " device_map=\"auto\",\n", " dtype=\"bfloat16\",\n", ")" ] }, { "cell_type": "markdown", "metadata": { "id": "nUHU91vc3WtL" }, "source": [ "## Task examples\n", "\n", "Training prompts used a dynamic-thinking template, where the user turn ends in `/think` or `/no_think` to select the response mode. End the prompt with `/no_think` to request a direct answer, as in the published evaluation, or `/think` to enable a reasoning trace. The examples below use `/no_think`.\n", "\n", "Note: To try `/think`, increase `max_new_tokens` to allow room for both the reasoning trace and the final answer." ] }, { "cell_type": "markdown", "metadata": { "id": "bAC-_0SZ3WtL" }, "source": [ "### Clinical records (NHANES)\n", "\n", "This task (`LB-0034`) asks the model to identify the older of two NHANES participants from their clinical and laboratory profiles. Each profile includes demographics, BMI, and blood measurements such as glucose, cholesterol, and blood cell counts. Some measurements are often reported in different units between participants (e.g., glucose appears in mg/dL for Participant A and mmol/L for Participant B).\n", "\n", "The expected answer for the example below is **A**." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "hR5PH13x3WtL", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "1714b7ad-84a4-4144-fc58-80379af49ad1" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "A\n" ] } ], "source": [ "prompt = \"\"\"Which participant is older, based on their clinical blood test results? Answer with one letter.\n", "\n", "Options: A. Participant A B. Participant B\n", "\n", "Participant A:\n", "Demographics: Female.\n", "Body measurements: BMI 24.3 kg/m2.\n", "Blood panel: Albumin (g/L) 49.00; Alkaline phosphatase (U/L) 91.00; Blood urea nitrogen (mg/dL) 8.00; Creatinine (umol/L) 48.82; Serum glucose (mg/dL) 180.00; Total bilirubin (mg/dL) 0.50; Uric acid (mg/dL) 4.60; Total cholesterol (mg/dL) 295.00; HDL (mg/dL) 105.00; LDL (mg/dL) 172.00; Triglyceride (mg/dL) 90.00; C-reactive protein (mg/dL) 0.28; White blood cell count (1000 cells/uL) 7.50; Red blood cell count (million cells/uL) 4.06; Mean cell volume (fL) 98.20; Red cell distribution width (%) 11.40; Glycohemoglobin (%) 8.40; Vitamin A (umol/L) 2.78; Vitamin E (umol/L) 70.67; Vitamin B12 (pmol/L) 811.80; Bone alkaline phosphatase (ug/L) 10.05; Cadmium (nmol/L) 13.35.\n", "\n", "Participant B:\n", "Demographics: Female.\n", "Biometrics: BMI 27.1 kg/m2.\n", "Blood test results: Albumin (g/L) 46.00; Alkaline phosphatase (U/L) 64.00; Blood urea nitrogen (mg/dL) 9.00; Creatinine (mg/dL) 0.65; Serum glucose (mmol/L) 4.22; Total bilirubin (mg/dL) 0.40; Uric acid (mg/dL) 4.00; Total cholesterol (mg/dL) 213.00; HDL (mg/dL) 68.00; C-reactive protein (mg/dL) 0.17; White blood cell count (1000 cells/uL) 8.00; Red blood cell count (million cells/uL) 3.93; Mean cell volume (fL) 95.30; Red cell distribution width (%) 11.90; Segmented neutrophils percent (%) 48.60; Lymphocyte percent (%) 35.30; Monocyte percent (%) 12.30; Eosinophils percent (%) 2.20; Basophils percent (%) 1.60; Glycohemoglobin (%) 5.40; Vitamin A (umol/L) 2.55; Vitamin E (umol/L) 54.18; Vitamin B12 (pmol/L) 296.68; Bone alkaline phosphatase (ug/L) 15.24; Cadmium (nmol/L) 5.34. /no_think\"\"\"\n", "\n", "input_ids = tokenizer.apply_chat_template(\n", " [{\"role\": \"user\", \"content\": prompt}],\n", " add_generation_prompt=True,\n", " return_tensors=\"pt\",\n", " tokenize=True,\n", " return_dict=False,\n", ").to(model.device)\n", "\n", "output = model.generate(\n", " input_ids,\n", " do_sample=True,\n", " temperature=0.3,\n", " min_p=0.15,\n", " repetition_penalty=1.05,\n", " max_new_tokens=512,\n", ")\n", "\n", "print(tokenizer.decode(output[0, input_ids.shape[-1]:], skip_special_tokens=True))" ] }, { "cell_type": "markdown", "metadata": { "id": "SQslgujD3WtM" }, "source": [ "**Related tasks**\n", "\n", "* **Multiclass age (`LB-0030`)**: use a single participant’s clinical profile to predict their age group/decade.\n", "\n", " ```\n", " Which age group does this participant belong to? Answer with one letter.\n", "\n", " Options: A. 20-29 B. 30-39 C. 40-49 D. 50-59 E. 60-69 F. 70-79 G. 80+ /no_think\n", " ```\n", "\n", "* **Regression age (`LB-0038`)**: use a single participant’s clinical profile to estimate their age in years.\n", "\n", " ```\n", " How old is this participant? Answer with a number of years. /no_think\n", " ```\n", "\n", "* **Binary mortality (`LB-0042`)**: predict whether a participant was alive or deceased at follow-up from their clinical profile.\n", " ```\n", " Is this participant alive or deceased at follow-up? Answer with one letter.\n", "\n", " Options: A. Alive B. Deceased /no_think\n", " ```\n", "\n", "* **Pairwise mortality (`LB-0050`)**: compare two participants’ clinical profiles and predict which participant survived longer.\n", "* **Multiclass mortality (`LB-0046`)**: use a single participant’s clinical profile to predict their survival-time range." ] }, { "cell_type": "markdown", "metadata": { "id": "GXfuDEdM3WtM" }, "source": [ "### DNA methylation (GEO)\n", "\n", "This task (`LB-0006`) asks the model to identify the older of two blood donors from their DNA methylation profiles. The prompt provides methylation levels, expressed as beta values, for each donor at selected CpG sites. It also includes annotations that provide further biological information for each locus.\n", "\n", "The full prompt lists around 160 CpG sites at a median of 21,330 tokens; for brevity, the example below includes only eight CpG sites selected for their large differences between the donors.\n", "\n", "The expected answer for the example below is **B**." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "id": "w-IGfxJg3WtM", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "1007866f-97d4-456e-bb3d-491890bd1aef" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "B\n" ] } ], "source": [ "prompt = \"\"\"Based on the following DNA methylation profiles from blood samples, which individual is older?\n", "\n", "Options: A: A female, from Canada, white, BMI 38.3, non-smoker. ; B: A female, from Germany, diagnosed with osteoporosis.\n", "\n", "Methylation data:\n", "The following CpG sites show the largest methylation differences between the two individuals: cg15720535 (chr9:136688133, -, CpG Island). In AGPAT2 (1-acylglycerol-3-phosphate O-acyltransferase 2) promoter, 676bp upstream of TSS; ENSG00000301427 promoter, 85bp upstream of TSS. Process: positive regulation of cytokine-mediated signaling pathway, CDP-diacylglycerol biosynthetic process, response to xenobiotic stimulus, phospholipid metabolic process. Function: 1-acylglycerol-3-phosphate O-acyltransferase activity, acyltransferase activity, transferase activity. Component: endoplasmic reticulum membrane, specific granule membrane, plasma membrane, endoplasmic reticulum. A: 0.15, B: 0.68, B much higher. | cg02828104 (chr20:50154263, -, S_Shore 91bp). In PEDS1 (plasmanylethanolamine desaturase 1) promoter, 509bp upstream of TSS; PEDS1-UBE2V1 (PEDS1-UBE2V1 readthrough) promoter, 626bp upstream of TSS. Process: ether lipid biosynthetic process, fatty acid metabolic process, lipid metabolic process. Function: oxidoreductase activity, plasmanylethanolamine desaturase activity, protein binding. Component: endoplasmic reticulum, endoplasmic reticulum membrane. A: 0.15, B: 0.64, B much higher. | cg18680834 (chr19:30372442, +, N_Shelf 2335bp). In ZNF536 (zinc finger protein 536) body (exon_1), 148kbp downstream of TSS. Process: negative regulation of transcription by RNA polymerase II, regulation of DNA-templated transcription. Function: DNA-binding transcription repressor activity, RNA polymerase II-specific, RNA polymerase II cis-regulatory region sequence-specific DNA binding, metal ion binding, DNA-binding transcription factor activity, RNA polymerase II-specific. Component: nucleus. A: 0.27, B: 0.75, B much higher. | cg18059933 (chr8:94950235, +, S_Shore 91bp). In TP53INP1 (tumor protein p53 inducible nuclear protein 1) promoter, 840bp upstream of TSS; NDUFAF6 (NADH:ubiquinone oxidoreductase complex assembly factor 6) body, 55kbp downstream of TSS. Process: negative regulation of cell population proliferation, positive regulation of DNA-templated transcription, cellular oxidant detoxification, autophagosome assembly. Function: antioxidant activity, protein binding. Component: cytoplasmic vesicle, autophagosome, nucleoplasm, PML body. Process: mitochondrial respiratory chain complex I assembly. Function: protein binding. Component: cytoplasm, mitochondrial inner membrane, mitochondrion, nucleus. A: 0.23, B: 0.69, B much higher. | cg19403023 (chr16:2798796, -, CpG Island). In PRSS41 (serine protease 41) body (intron_2), 326bp downstream of TSS. Process: protein processing, proteolysis. Function: hydrolase activity, peptidase activity, serine-type endopeptidase activity, serine-type peptidase activity. Component: extracellular region, intracellular organelle, plasma membrane, side of membrane. A: 0.23, B: 0.69, B much higher. | cg10591174 (chr12:110920642, -, OpenSea). In MYL2 (myosin light chain 2) body, 132kbp downstream of TSS. Process: positive regulation of the force of heart contraction, ventricular cardiac muscle tissue morphogenesis, negative regulation of cell growth, muscle cell fate specification. Function: structural constituent of muscle, myosin heavy chain binding, actin monomer binding, calcium ion binding. Component: actin cytoskeleton, cardiac myofibril, myosin complex, cytoplasm. A: 0.17, B: 0.62, B much higher. | cg24949488 (chr10:96304605, -, OpenSea). In DNTT (DNA nucleotidylexotransferase) body (exon_1), 196bp downstream of TSS; ENSG00000229418 body (intron_1), 2kbp downstream of TSS. Process: double-strand break repair via nonhomologous end joining, DNA biosynthetic process, DNA modification, DNA repair. Function: DNA nucleotidylexotransferase activity, nucleotidyltransferase activity, transferase activity, metal ion binding. Component: cytosol, nucleoplasm, nucleus. A: 0.39, B: 0.81, B much higher. | cg25165880 (chr1:6394266, +, S_Shore 141bp). In ACOT7 (acyl-CoA thioesterase 7) promoter, 499bp upstream of TSS; ENSG00000271746 body (exon_1), 711bp downstream of TSS. Process: medium-chain fatty-acyl-CoA catabolic process, medium-chain fatty acid biosynthetic process, coenzyme A biosynthetic process, acyl-CoA metabolic process. Function: long-chain fatty acyl-CoA hydrolase activity, carboxylic ester hydrolase activity, protein homodimerization activity, fatty-acyl-CoA binding. Component: cytoplasm, cytosol, extracellular exosome, mitochondrion. A: 0.22, B: 0.64, B much higher. /no_think\"\"\"\n", "\n", "input_ids = tokenizer.apply_chat_template(\n", " [{\"role\": \"user\", \"content\": prompt}],\n", " add_generation_prompt=True,\n", " return_tensors=\"pt\",\n", " tokenize=True,\n", " return_dict=False,\n", ").to(model.device)\n", "\n", "output = model.generate(\n", " input_ids,\n", " do_sample=True,\n", " temperature=0.3,\n", " min_p=0.15,\n", " repetition_penalty=1.05,\n", " max_new_tokens=512,\n", ")\n", "\n", "print(tokenizer.decode(output[0, input_ids.shape[-1]:], skip_special_tokens=True))" ] }, { "cell_type": "markdown", "metadata": { "id": "Z70zs1Id3WtM" }, "source": [ "**Related tasks**\n", "\n", "* **Multiclass age (`LB-0002`)**: use a single individual’s DNA methylation profile to predict their age group.\n", "\n", " ```\n", " Which age group is this individual in? Answer with one letter.\n", "\n", " Options: A. 20-29 B. 30-39 C. 40-49 D. 50-59 E. 60-69 F. 70-79 G. 80+ /no_think\n", " ```\n", "\n", "* **Regression age (`LB-0010`)**: use a single individual’s DNA methylation profile to estimate their age in years.\n", "\n", " ```\n", " How old is this individual? Answer with a number of years. /no_think\n", " ```" ] }, { "cell_type": "markdown", "metadata": { "id": "xE255b0R3WtM" }, "source": [ "### Transcriptomics (GTEx)\n", "\n", "This task (`LB-0018`) asks the model to identify which of two adrenal gland samples comes from an older donor. Each sample includes a list of genes ranked by expression, along with pathway enrichment scores that summarize patterns across groups of genes. The ranked lists indicate which genes are more highly expressed within each sample, but do not provide their expression values.\n", "\n", "The expected answer for the example below is **A**." ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "id": "MU4cmiiy3WtM", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "9cdfdf7c-bab2-41ce-b53e-c56e2a6b7e3f" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "A\n" ] } ], "source": [ "prompt = \"\"\"Which of the following two Adrenal Gland samples comes from an older individual?\n", "\n", "Options: A. Sample A B. Sample B\n", "\n", "Sample a: Demographics: male\n", "Transcriptomic profile:\n", "Top-2774 expressed genes: COX1; ND4; CYP17A1; ATP6; CYTB; COX3; ND2; COX2; CYP11B1; STAR; ND1; DHCR24; MEG3; DLK1; HSD3B2; ATP8; SCARB1; CYP21A2; ND5; AKR1B1; ND4L; ND3; EEF1A1; HSP90AA1; PEBP1; HSPA8; NEAT1; CLU; EEF2; APOE; ASH2L; PSAP; TPT1; DDX5; CTSD; HSP90AB1; CYP11A1; GAPDH; EPHX1; ACTB; FTH1; FTL; ACADVL; SERPINA5; FADS2; PEG10; ND6; ACTG1; BEST1; SPARC; UBC; HSPD1; ALDOA; SRRM2; AOX1; GSTA1; PKM; NOV; RARRES2; SQSTM1; RPL3; MGST1; UBB; B2M; SCD; DDX17; RPS8; TBX3; ABCC3; ATP5B; FDPS; RPS6; CYB561A3; GNAS; C4B; MYL9; C3; TMBIM6; HSPB1; FDX1; H19; SDC3; RPL13A; HNRNPA2B1; RHOB; RPLP0; GSN; TMSB4X; RACK1; ATP5A1; FDXR; GJA1; CALM2; BORCS7; APP; P4HB; HSPA1A; RPL13; BSG; RPL8; TNXB; RPL13AP5; DCN; DDB1; LAMB2; SREBF1; KCNK3; HSPA1B; RPL4; ALAS1; RPLP1; CTSA; SLC25A6; FAM198B; RPL5; AP2M1; MALAT1; AS3MT; VAT1; HSPA9; RDX; TUBB4A; NR5A1; MGP; C5orf45; OAZ1; SEMA3B; GNS; EIF4G2; RPL19; RPL7A; LDLR; EIF4A2; PDK4; HLA-A; C4A; HSPG2; SLC25A3; RPS18; MYL6; VIM; RPL10; C2CD2; RPS11; TXNIP; IDH1; TKFC; RPS3; FDFT1; PCBP2; LONP1; C7; GSTA4; ATN1; CYB5B; TIMP1; PLBD2; LSS; NDRG2; HLA-C; SREBF2; HNRNPH1; NFE2L1; RPL15; ALDH2; SNRNP70; CERS2; LGALS3BP; CD46; MATR3; RPS4X; ASPH; ITM2B; LDHB; HMGCS1; FOSL2; RPL18; RPS9; SOAT1; HDLBP; GPI; PRDX2; ALDH3A2; RBBP7; EZR; RHOA; SERF2; CYP21A1P; RPL28; MSMO1; LENG8; ARHGEF40; POR; RPS24; PAPSS2; FLNA; PRDX3; EIF4G1; DDIT4; NACA; HNRNPU; SPTBN1; AES; RPL37A; TM7SF2; RPL23; PLXNB2; ENO1; LRRC75A-AS1; RTN4; VWA5B2; SYNPO; TSC22D3; RPS19; CAPN2; VCP; GRAMD1B; APOC1; ACTN4; RPL11; MYH9; RPL17; STAB1; LDHA; PABPC1; TIMP3; PCBP1; CYB5R3; SENP3; FAM166B; RPL29; CCND3; SARAF; TPI1; SLC40A1; FADS1; CTNNB1; RPS14; UBA1; FASN; CTSB; TLN1; RPS5; DDX39B; MBOAT7; EIF4A1; RPLP2; ADGRV1; RPS12; CTNNA1; RPL36; HNRNPK; TKT; EIF1; HSP90B1; ECE1; BGN; GOLGA8A; MLEC; PPIF; CLTC; SCD5; ATF4; AHSA2; ABCB1; WBP2; CTTN; MTCH1; NAP1L1; HIF1A; POLR2A; ECH1; SF3B1; SORBS2; SRSF5; CDKN1C; CD63; TNS1; ANXA5; NCL; HMGCR; DAB2; DDR2; NUMA1; RPS2; PIK3R2; TXNRD1; RPL27; HADHB; RPS20; CCNL2; MCFD2; SOD1; ZNF275; TPP1; PPP2R1A; KIAA1522; PEG3; TNS2; CSDE1; RBM39; RAB31; RPS17; MT2A; PGRMC1; ERGIC1; WDR6; COL18A1; STAT6; EEF1D; RPL32; ABLIM1; NDRG4; EPB41L1; MAGED1; RNF213; EIF4B; PGK1; COQ8A; MVP; SRSF6; IDI1; PINK1; SGK1; FSTL1; GABARAP; YWHAZ; CNN3; RPL31; COL3A1; LSP1; PLEC; MKNK2; MYL12B; HNRNPC; PTOV1; EBP; CIRBP; AP2A1; ZBED6CL; EEF1G; FLOT1; RPL30; DNAJA1; A2M; YWHAE; RGN; CANX; COL6A1; ALAD; STIP1; RAP1GAP; MRFAP1; HSPB6; DDX24; PRPF8; FAM129B; SLC16A9; RPL10A; CCT3; UBE2D3; RPL35A; DYNC1H1; CHCHD2; GHITM; AHNAK; EWSR1; RPS16; SERINC1; SCAP; BRE; VAPA; ARF1; BST2; MORF4L2; ELOVL5; TPD52L1; LAPTM4A; SEPT9; UBA52; SRCAP; HP1BP3; RPL27A; SON; USP22; PCBP1-AS1; PRDX5; CFL1; MIF; CNBP; RPS15A; NONO; RPS23; APLP2; MDH2; RPL37; GPX3; PBXIP1; MAT2A; CS\n", "\n", "Sample b: Demographics: female\n", "Transcriptomic profile:\n", "Top-2751 expressed genes: COX1; ND4; STAR; ATP6; CYP17A1; ND1; COX3; CYP11B1; ND2; COX2; CYTB; ND5; ATP8; ND6; SCARB1; CYP21A2; ACTB; GAPDH; ASH2L; HSD3B2; DHCR24; EEF1A1; ND4L; NEAT1; ND3; CYP11A1; HSP90AB1; AKR1B1; EEF2; ACTG1; CTSD; MEG3; PSAP; P4HB; TPT1; PEG10; UBC; HSPA8; PKM; HSPA9; HSPA5; SPARC; DLK1; H19; ENO1; RPL8; HSPD1; ALDOA; HSP90B1; CLU; FTH1; FLNA; SREBF1; FTL; APOE; CYP21A1P; ATP5B; UBB; CD63; KCNK3; MYL6; B2M; GNAS; SRRM2; PEBP1; C7; RPS6; TNXB; ACADVL; RTN4; DDX5; RPS8; RHOA; RPL3; RPS18; HSP90AA1; SQSTM1; RPLP0; RACK1; LDHA; ALAS1; TIMP1; GJA1; AP2M1; RPL4; FDX1; XIST; BEST1; APP; TUBB; RPL19; MGST1; RPL13AP5; CANX; GNS; TPI1; SLC25A6; RPL13; VCP; CALR; TMBIM6; SEMA3B; MYH9; RPL7A; CFL1; TUBB4A; HNRNPA2B1; TXNRD1; HIF1A; MT2A; CTSA; RPLP2; MYL9; MALAT1; BSG; RPS3; ABCB1; SPTBN1; TUBA1B; FADS2; EPHX1; EIF4A1; SENP3; SCD; BORCS7; OAZ1; ATP5A1; EIF4G1; PLBD2; RDX; RPLP1; RPL13A; ACTN4; CTSB; HDLBP; RPS11; AOX1; LONP1; RPL28; RPL37A; GPI; SLC25A3; DDX17; POR; AS3MT; CALM2; ABCC3; RPS4X; RPS5; NCL; RPS2; VIM; RHOB; EPB41L1; ANXA2; PSMD2; RPL10; CTNNA1; C3; EZR; HSPB1; HNRNPK; CLTC; GSN; HLA-C; RPS24; TSIX; RPS12; MRFAP1; PFN1; TMSB4X; SEC61A1; SYNPO; EIF4G2; DDR2; TLN1; RPS17; PRPF8; CIRBP; IGFBP4; ECE1; LSP1; RPN2; DCN; ALDH3A2; CAPN2; VAT1; C5orf45; C4B; SLC3A2; FAM129B; RPL5; TBX3; DDB1; RPL11; SERF2; PPP2R1A; HSPG2; GRAMD1B; ARF1; RPL32; MIF; RPL23; FDXR; DDX39B; AADAC; PGK1; RBBP7; NFE2L1; MVP; YWHAE; RPS19; RPL27; ATP1A1; HLA-A; FOSL2; EIF1; UBA1; RPL31; RPS9; EIF5A; ARHGDIA; ASPH; RPL36; PPIB; UBA52; ZNF275; EEF1D; DYNC1H1; RPS14; IGFBP5; MATR3; PRDX2; RRBP1; RPL17; CHCHD2; CYP11B2; CACNA1H; SPTAN1; RPL15; EEF1G; TXNIP; AARS; NACA; RAN; RPS16; MYL12B; BGN; LMNA; COL1A1; YWHAG; RPL18; COL3A1; PABPC1; MTCH1; XRCC6; RPL37; MCFD2; PAPSS2; HLA-B; RPL29; COL4A2; PCBP1; PLEC; RARRES2; CSDE1; EWSR1; FLOT1; FAM166B; SLC47A1; YWHAZ; ERGIC1; SDC3; IFITM3; PCBP2; RPL30; SON; SARAF; SCAP; PPIF; CNN3; ATN1; ATF4; NR5A1; PDIA6; ENG; RAB7A; ILF3; LDLR; PPIA; THBS1; HSPA1B; ELOVL5; TIMP3; CYB5B; LGALS1; RPL10A; ANXA5; GPX3; SND1; RPS20; PDIA3; RPL27A; NME1-NME2; HUWE1; YWHAQ; LDHB; HNRNPU; PTMA; LENG8; YBX1; GHITM; AP2A1; HSPA1A; RPS27A; VWA5B2; DNER; GANAB; CLPTM1; GALNT2; MGP; WDR1; MLEC; CYB5R3; DDX24; MDH2; HDAC7; PRDX1; IARS; SERPINA5; PEG3; HNRNPH1; SLC23A2; TAGLN2; COL1A2; LGALS3BP; RPL26; RPS23; RPL35; AHNAK; SURF4; SERINC1; COL4A1; NUMA1; TNS1; YWHAB; ABCA1; LRRC59; APLP2; SSR2; NOV; AES; NUDC; TKT; CERS2; DDOST; NFIC; FSTL3; CCT7; ATP6V0C; BCAP31; C4A; CS; SLC16A9; MORF4L2; SOD2; C1R; CD151; PLEKHB2; SOAT1; TPM3; PEA15; TCIRG1; PLTP; PGRMC1; TPP1; RPS25; C2CD2; DDX3X; RPL41; LRRC75A-AS1; H3F3B; FLII; PSMA7; EIF3A; RPL14; COPG1; MSN; POLR2A; SEPT9; GNB1; GRHPR; VAPA; KCNQ1; ITM2B; FAU; TMED10; HM13; EDF1; GABARAP\n", "\n", "Gene set enrichment analysis:\n", "Sample-A shows low activity in Phospholipase C Mediated Cascade Fgfr4 (NES: -0.07, genes: FGF4, FGF6, FGF16, FGF19, FGF23 and 10 other genes), while Sample-B shows low activity (NES: -0.13, genes: FGF16, FGF19, FGF4, FGF6, FGF8 and 10 other genes). Sample-A shows very high activity in Cholesterol Biosynthesis (NES: 0.46, genes: GGPS1, ARV1, LBR, PLPP6, IDI2 and 22 other genes), while Sample-B shows moderately high activity (NES: 0.40, genes: PLPP6, HSD17B7, ARV1, LBR, IDI2 and 22 other genes). Sample-A shows low activity in Defective C1Galt1C1 Causes Tnps (NES: -0.14, genes: MUC17, MUC16, MUC5B, MUC7, MUC15 and 12 other genes), while Sample-B shows low activity (NES: -0.00, genes: MUC15, MUCL1, MUC16, MUC17, MUC12 and 12 other genes). Sample-A shows very low activity in Defective Galnt3 Causes Hftc (NES: -0.18, genes: MUC17, MUC16, MUC5B, MUC7, MUC15 and 11 other genes), while Sample-B shows low activity (NES: -0.05, genes: MUC15, MUCL1, MUC16, MUC17, MUC12 and 11 other genes). /no_think\"\"\"\n", "\n", "input_ids = tokenizer.apply_chat_template(\n", " [{\"role\": \"user\", \"content\": prompt}],\n", " add_generation_prompt=True,\n", " return_tensors=\"pt\",\n", " tokenize=True,\n", " return_dict=False,\n", ").to(model.device)\n", "\n", "output = model.generate(\n", " input_ids,\n", " do_sample=True,\n", " temperature=0.3,\n", " min_p=0.15,\n", " repetition_penalty=1.05,\n", " max_new_tokens=512,\n", ")\n", "\n", "print(tokenizer.decode(output[0, input_ids.shape[-1]:], skip_special_tokens=True))" ] }, { "cell_type": "markdown", "metadata": { "id": "TReM4N8d3WtN" }, "source": [ "**Related tasks**\n", "\n", "* **Multiclass age (`LB-0014`)**: use a single sample’s gene-expression profile to predict the donor’s age group.\n", "\n", " ```\n", " Which age group is this Adrenal Gland sample from? Answer with one letter.\n", "\n", " Options: A. 20-29 B. 30-39 C. 40-49 D. 50-59 E. 60-69 F. 70-79 G. 80+ /no_think\n", " ```" ] }, { "cell_type": "markdown", "metadata": { "id": "ppAvp0E23WtN" }, "source": [ "### Proteomics (Olink)\n", "\n", "This task (`LB-0299`) asks the model to identify the older of two individuals from their plasma protein profiles. The prompt includes 100 proteins selected for differences in abundance between the individuals, with measurements reported as NPX (Normalized Protein eXpression), Olink’s relative measure on a log₂ scale. For each protein, the model receives both individuals’ values.\n", "\n", "The expected answer for the example below is **B**." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "id": "3TtEJEI-3WtN", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "d900c2f2-8e59-44e6-e03d-f64aa7bb3147" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "B\n" ] } ], "source": [ "prompt = \"\"\"Measurements were performed using Olink Explore 3072 proximity extension assay (PEA) plasma proteomics. Values are NPX (Normalized Protein eXpression, log2 scale). 2890 proteins measured across Cardiometabolic, Inflammation, Oncology, and Neurology panels.\n", "\n", "Based on their plasma proteome profiles, which individual is older?\n", "\n", "Proteomic data:\n", "Top-100 differentially abundant proteins out of 2890 measured (NPX): TMED1 (A: 10.44, B: -8.38, A much higher); PTN (A: -6.18, B: 4.14, B much higher); AGBL2 (A: -8.37, B: 1.93, B much higher); DDX4 (A: -9.62, B: -0.29, B much higher); KIAA1549 (A: -10.31, B: -1.06, B much higher); CNTF (A: -7.94, B: 1.24, B much higher); ZP3 (A: -5.94, B: 3.07, B much higher); RAD51 (A: -8.74, B: 0.25, B much higher); OSTN (A: -8.24, B: 0.07, B much higher); RRAS (A: -8.45, B: -0.31, B much higher); SERPINB5 (A: 1.43, B: -6.64, A much higher); SLC1A4 (A: -7.99, B: 0.00, B much higher); FMR1 (A: 0.70, B: -7.07, A much higher); IL3 (A: -5.98, B: 1.32, B much higher); PNMA2 (A: -8.67, B: -1.39, B much higher); TMCO5A (A: -7.34, B: -0.18, B much higher); MORF4L1 (A: -8.36, B: -1.26, B much higher); CSH1 (A: -1.69, B: -8.52, A much higher); BLOC1S2 (A: 0.78, B: -5.90, A much higher); EPN1 (A: -0.77, B: 5.45, B much higher); IL18RAP (A: -1.02, B: 5.14, B much higher); PARD3 (A: -0.98, B: -7.08, A much higher); KRT17 (A: -1.32, B: -7.40, A much higher); HDAC9 (A: -6.97, B: -0.98, B much higher); MCEE (A: -0.73, B: 5.05, B much higher); PYY (A: -1.59, B: 4.19, B much higher); CYP24A1 (A: -0.70, B: 5.02, B much higher); TDGF1 (A: 4.07, B: -1.55, A much higher); PPP1R12B (A: -5.86, B: -0.23, B much higher); LELP1 (A: -0.72, B: 4.87, B much higher); DAND5 (A: -1.18, B: 4.39, B much higher); RRP15 (A: 0.71, B: -4.73, A much higher); NPPB (A: -3.74, B: 1.31, B much higher); GCG (A: -1.61, B: 3.39, B much higher); ZPR1 (A: -1.35, B: 3.54, B much higher); IL1RN (A: -0.89, B: 3.99, B much higher); KIR2DS4 (A: 3.83, B: -1.01, A much higher); PHLDB2 (A: 3.92, B: -0.87, A much higher); CCND2 (A: -4.27, B: 0.33, B much higher); PM20D1 (A: 1.18, B: -3.34, A much higher); WASL (A: -0.33, B: 4.12, B much higher); TRIM40 (A: -2.79, B: -7.19, A much higher); KIF20B (A: 2.39, B: -1.93, A much higher); SERPINH1 (A: -3.64, B: -7.94, A much higher); METAP1D (A: 3.73, B: -0.55, A much higher); FGF9 (A: 2.80, B: -1.42, A much higher); PLB1 (A: 2.94, B: -1.20, A much higher); VCPKMT (A: -0.33, B: 3.77, B much higher); CENPJ (A: -4.13, B: -8.21, A much higher); HIF1A (A: -0.82, B: 3.25, B much higher); GSTT2B (A: -3.39, B: 0.66, B much higher); HADH (A: -0.44, B: 3.56, B much higher); APOL1 (A: 3.07, B: -0.87, A much higher); NGRN (A: 3.88, B: 0.02, A much higher); MUC16 (A: -3.87, B: -0.03, B much higher); CRYM (A: -0.55, B: 3.25, B much higher); TSPAN7 (A: -1.57, B: 2.18, B much higher); CHGA (A: -2.05, B: 1.63, B much higher); CKMT1A_CKMT1B (A: -2.18, B: 1.43, B much higher); SPRR1B (A: -1.03, B: -4.65, A much higher); ALPP (A: 0.64, B: -2.83, A much higher); CILP (A: -1.75, B: 1.71, B much higher); ESR1 (A: -1.86, B: 1.60, B much higher); PDCL2 (A: -2.42, B: 1.01, B much higher); IL36G (A: -0.24, B: 3.14, B much higher); GDF15 (A: -0.81, B: 2.55, B much higher); ACRV1 (A: -0.90, B: 2.44, B much higher); HEBP1 (A: 2.99, B: -0.33, A much higher); TFAP2A (A: -0.63, B: 2.68, B much higher); REG4 (A: -1.13, B: 2.16, B much higher); GADD45B (A: -2.06, B: 1.15, B much higher); PCARE (A: -0.97, B: 2.24, B much higher); TRDMT1 (A: -2.47, B: 0.69, B much higher); LY6D (A: -0.30, B: 2.85, B much higher); PFDN2 (A: 1.22, B: -1.93, A much higher); LECT2 (A: -2.38, B: 0.72, B much higher); RALB (A: -3.57, B: -0.48, B much higher); VSIG2 (A: -2.18, B: 0.87, B much higher); RNF4 (A: -1.77, B: 1.23, B much higher); FGF16 (A: -2.27, B: 0.72, B much higher); OMG (A: 0.68, B: -2.28, A much higher); FHIP2A (A: 1.44, B: -1.48, A much higher); MELTF (A: 2.13, B: -0.76, A much higher); SLC4A1 (A: -2.32, B: 0.56, B much higher); SSC4D (A: 4.29, B: 1.41, A much higher); DCTN2 (A: -3.08, B: -0.20, B much higher); NAA80 (A: -0.88, B: 1.98, B much higher); FIS1 (A: 0.88, B: -1.98, A much higher); PRL (A: -1.59, B: 1.27, B much higher); ITGB1BP1 (A: -2.53, B: 0.31, B much higher); NPY (A: -1.61, B: 1.21, B much higher); DUSP3 (A: -3.17, B: -0.39, B much higher); FGF21 (A: -0.49, B: 2.28, B much higher); MLN (A: -1.81, B: 0.96, B much higher); SHPK (A: -2.31, B: 0.42, B much higher); MAP1LC3A (A: -2.15, B: 0.54, B much higher); LATS1 (A: -3.00, B: -0.32, B much higher); NFX1 (A: -3.30, B: -0.62, B much higher); ADGRG1 (A: -0.77, B: 1.90, B much higher); PDP1 (A: 1.04, B: -1.61, A much higher)\n", "\n", "Options: A. Patient-A B. Patient-B /no_think\"\"\"\n", "\n", "input_ids = tokenizer.apply_chat_template(\n", " [{\"role\": \"user\", \"content\": prompt}],\n", " add_generation_prompt=True,\n", " return_tensors=\"pt\",\n", " tokenize=True,\n", " return_dict=False,\n", ").to(model.device)\n", "\n", "output = model.generate(\n", " input_ids,\n", " do_sample=True,\n", " temperature=0.3,\n", " min_p=0.15,\n", " repetition_penalty=1.05,\n", " max_new_tokens=512,\n", ")\n", "\n", "print(tokenizer.decode(output[0, input_ids.shape[-1]:], skip_special_tokens=True))" ] }, { "cell_type": "markdown", "metadata": { "id": "-sU8LECh3WtN" }, "source": [ "**Related tasks**\n", "\n", "These tasks use protein measurements from a single individual and ask the model to predict either an age group or an age in years.\n", "\n", "- **Age-group classification (`LB-0074`)**: predict the individual’s age decade.\n", "\n", " ```\n", " Which age group does this individual belong to? Answer with one letter.\n", "\n", " Options: A. 20-29 B. 30-39 C. 40-49 D. 50-59 E. 60-69 F. 70-79 G. 80+ /no_think\n", " ```\n", "\n", "- **Age regression (`LB-0082`)**: estimate the individual’s age in years.\n", "\n", " ```\n", " How old is this individual? Answer with a number of years. /no_think\n", " ```" ] }, { "cell_type": "markdown", "metadata": { "id": "ICiNPPZB3WtN" }, "source": [ "### Genetic evidence (OpenGenes)\n", "\n", "This task asks the model to predict whether a gene’s expression increases or decreases with age in human muscle. Rather than measurements from individual participants, the prompt provides evidence about one gene, including expression changes in animal studies, interaction partners, Gene Ontology annotations, and tissue expression.\n", "\n", "The gene in the example below is OPN3 but its name is masked throughout the prompt, allowing the model to reason directly from the provided evidence rather than recalling an answer.\n", "\n", "The expected answer for the example below is **A**, that expression decreases with age." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "id": "6JAqkzQ73WtN", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "44675df5-69ad-4d20-93f6-4ecc6780ad2c" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "A\n" ] } ], "source": [ "prompt = \"\"\"Animal model evidence:\n", "In the brain of C57BL/6 mice, a gene increased gene expression, as established by measuring protein levels. In the spinal cord of C57BL/6 mice, a gene decreased gene expression, as established by measuring protein levels. In the brain of rhesus monkeys between ages 5 and 31 years, a gene decreased gene expression by 43.0%, as established by measuring protein levels. In the brain of C57BL/6 × C3H mice between ages 5 and 30 months, a gene increased gene expression by 26.8%, as established by measuring protein levels. In the brain of C57BL/6 mice between ages 2 and 20 months, a gene decreased gene expression, as established by measuring mRNA levels.\n", "\n", "PPI network:\n", "This gene interacts with CHML and KMO in humans.\n", "\n", "GO term annotations:\n", "This gene has molecular functions including all-trans retinal binding, G protein-coupled photoreceptor activity, 11-cis retinal binding, G protein-coupled receptor activity, and photoreceptor activity; participates in negative regulation of apoptotic process, positive regulation of cellular respiration, cellular response to UV-A, response to blue light, and adenylate cyclase-inhibiting G protein-coupled receptor signaling pathway; is located in membrane, cytoplasm, cytosol, photoreceptor outer segment, and plasma membrane.\n", "\n", "Protein Atlas expression:\n", "This gene mRNA (Tau=0.81, tissue-enhanced) is most expressed in cerebral cortex and liver (nTPM 6-11). Low or not detected in all other tissues. Medium in Adrenal gland, Bronchus, Duodenum, Gallbladder, Heart muscle, Nasopharynx, Parathyroid gland, Prostate, Rectum, Salivary gland, Seminal vesicle, Skeletal muscle, Small intestine, Stomach, Thyroid gland, Urinary bladder, Appendix (mixed), Cervix (mixed), Colon (mixed), Endometrium (mixed), Kidney (mixed), Liver (mixed), Lung (mixed), Pancreas (mixed), and Skin (mixed). Low in Adipose tissue, Bone marrow, Epididymis, Esophagus, Fallopian tube, Hippocampus, Oral mucosa, Smooth muscle, Breast (mixed), Caudate (mixed), Cerebellum (mixed), Cerebral cortex (mixed), Placenta (mixed), Soft tissue (mixed), Spleen (mixed), Testis (mixed), and Tonsil (mixed). Not detected in Lymph node, Ovary, and Vagina.\n", "\n", "In muscle of humans between ages 18 and 65 years, Gene X mRNA expression measured by microarray:\n", "\n", "Options: A. decreases with age B. increases with age /no_think\"\"\"\n", "\n", "input_ids = tokenizer.apply_chat_template(\n", " [{\"role\": \"user\", \"content\": prompt}],\n", " add_generation_prompt=True,\n", " return_tensors=\"pt\",\n", " tokenize=True,\n", " return_dict=False,\n", ").to(model.device)\n", "\n", "output = model.generate(\n", " input_ids,\n", " do_sample=True,\n", " temperature=0.3,\n", " min_p=0.15,\n", " repetition_penalty=1.05,\n", " max_new_tokens=512,\n", ")\n", "\n", "print(tokenizer.decode(output[0, input_ids.shape[-1]:], skip_special_tokens=True))" ] }, { "cell_type": "markdown", "metadata": { "id": "qyTDIrWA3WtN" }, "source": [ "**Related tasks**\n", "\n", "These tasks use records from SynergyAge to predict how genetic perturbations affect lifespan.\n", "\n", "- **Pairwise lifespan comparison (`LB-0122`)**: compare two perturbations and predict which extends lifespan more.\n", "\n", " ```\n", " Which gene-pair perturbation extends lifespan more? Answer with one letter.\n", "\n", " Options: A. Perturbation A B. Perturbation B /no_think\n", " ```\n", "\n", "- **Lifespan regression (`LB-0126`)**: predict the percentage change in lifespan following a perturbation.\n", "\n", " ```\n", " By what percentage does this gene-pair perturbation change lifespan? Answer with a number. /no_think\n", " ```" ] }, { "cell_type": "markdown", "metadata": { "id": "1t1LqX8H3WtN" }, "source": [ "## References\n", "\n", "- Release blog post: [Setting the Frontier of Aging Biology with Liquid Foundation Models](https://www.liquid.ai/blog/longevitybench)\n", "- Paper: Zhavoronkov, A. et al. (2026). [An Open Benchmark and Language Models for AI in Aging Biology](https://www.cell.com/cell/fulltext/S0092-8674(26)00999-2). *Cell* 189, 5980-5994.\n", "- Models: [LFM2-1.2B-Longevity](https://huggingface.co/LiquidAI/LFM2-1.2B-Longevity) and [LFM2-2.6B-Longevity](https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity)\n", "- Benchmark: [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench)\n", "- Base models: [LFM2-1.2B](https://huggingface.co/LiquidAI/LFM2-1.2B) and [LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B)\n", "- [LFM2 Technical Report](https://arxiv.org/abs/2511.23404)\n", "- [Chat template documentation](https://docs.liquid.ai/lfm/key-concepts/chat-template) and [Transformers inference guide](https://docs.liquid.ai/lfm/inference/transformers)\n", "\n", "### Need help building with our models and tools?\n", "\n", "Join the Liquid AI Discord community and ask.\n", "\n", "\"Join" ] } ], "metadata": { "accelerator": "GPU", "colab": { "gpuType": "T4", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }