Manuscript Offprint
arXiv:2610.03029SoftGene: Protein Language Model-Enhanced Soft Prompting for Interpretable Gene Set Annotation
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Gene set analysis is a cornerstone of functional genomics, yet it remains labor-intensive and heavily dependent on manual curation and expert biological interpretation. While Large Language Models (LLMs) have emerged as powerful tools for genomic reasoning and annotation, most existing approaches rely on symbolic gene names and fail to capture domain-specific biological structure, particularly protein sequence information that governs molecular activity, interactions, and downstream gene function. In this work, we propose SoftGene, a novel framework for LLM-based gene set annotation that leverages the hierarchical structure of gene sets. First, we use a hierarchical attention-based encoder built on ESM, a protein language model, to represent each gene set using protein-level amino acid sequence information. Second, we construct a hybrid prompting scheme that combines soft prompts derived from gene set embeddings with hard prompts containing auxiliary context generated by an LLM, and feed the resulting prompt into a local LLM for annotation. We evaluate our framework on two benchmark datasets: Gene Ontology (GO) and the Molecular Signatures Database (MSigDB). Our results show that integrating protein-sequence representations with textual context improves gene set annotation overall, while per-domain analyses reveal that the contribution of protein embeddings varies across biological domains.
1 Introduction
Gene sets represent cohorts of functionally related genes that collectively drive specific biological pathways and cellular processes (Ashburner et al., 2000). Generating gene set annotations, which are concise descriptions that delineate shared functional behaviors and metabolic roles, is a fundamental task in modern genomics (Ji et al., 2026). As sequencing continues to reveal novel gene associations, the ability to rapidly and accurately annotate these sets is essential for translating raw data into biological insights (Salzberg, 2019).
Traditionally, gene set annotation has relied on expert curation or statistical enrichment methods, such as Over-Representation Analysis (ORA) (Beissbarth and Speed, 2004) and Gene Set Enrichment Analysis (GSEA) (Subramanian et al., 2005). However, manual annotation is a time-consuming process that cannot scale with the current pace of data generation (Baumgartner Jr et al., 2007). Furthermore, existing automated methods are inherently limited by their dependence on curated databases, which are often incomplete or biased toward well-studied genes and biological processes (Stoeger et al., 2018; Haynes et al., 2018).
The recent emergence of Large Language Models (LLMs) has introduced a promising paradigm for a wide range of biological and biomedical tasks (Luo et al., 2022; Jin et al., 2024; Ferruz et al., 2022) including automated gene annotation (Wang et al., 2024; Joachimiak et al., 2024). However, current LLM-based approaches often overlook the domain-specific biological structure of constituent proteins. Protein-sequence representations can provide evolutionary and structural signals such as subcellular localization (Thumuluri et al., 2022), interaction-relevant interfaces (Sun et al., 2025), and structural properties (Simon and Zou, 2025) that may complement symbolic gene information (Anfinsen, 1973). The utility of these sequence-derived signals, however, can vary across biological domains. Moreover, hard-prompting strategies typically treat genes as semantic tokens, and LLMs remain prone to hallucination (Kalai et al., 2025), which reduces their reliability for this task. Lastly, although many LLM approaches provide narrative explanations through generative reasoning (Hu et al., 2025), they still lack a concrete decision path showing how specific genes or protein domains contribute to the predicted annotation.
In this paper, we address these limitations by
Corresponding author.

Figure 1: High-level overview of the model architecture. The proposed approach combines a sequence-level pathway that encodes amino acid information into soft prompt tokens with a textual pathway that provides high-level functional context from a large language model, enabling the generation of descriptive gene set annotations optimized via supervision against ground-truth labels.
presenting a soft-prompting framework for interpretable gene set annotation. An overview of the framework is shown in Figure 1. Our main contributions are as follows:
• We incorporate the embeddings from a pretrained protein language model (PLM) and introduce a hierarchical attention encoder that learns to weigh the relative importance of biological features and aggregate them into a comprehensive representation of gene sets.
• We propose a conditioning scheme that bridges biological sequence data and natural language, enabling an LLM to generate annotations informed by both text-based context and protein-sequence-derived representations.
• We provide concrete interpretability by leveraging the hierarchical attention mechanism to quantify the relative importance of biological features contributing to each annotation. This yields explicit, feature-level explanations grounded in the input data, rather than relying solely on implicit reasoning within the language model.
• We evaluate our framework on two widely used benchmark datasets: Gene Ontology (GO) and MSigDB. Results demonstrate superior performance over existing baselines across metrics.
2.1 Problem Formulation
A gene set is a collection of genes that are grouped together based on shared biological function, participation in a common pathway, or co-regulation. Gene sets are widely used in genomics to represent higher-level biological processes and functional modules.
Let denote a collection of gene sets. Each gene set consists of a variable number of member genes where is the length of the set. The ordering of genes within a set is assumed to be irrelevant. Each gene encodes one or more proteins where represents the number of protein isoforms associated with ; may vary across genes, reflecting multiple isoforms or splice products. Each protein is represented as a sequence of amino acids
where denotes the length of the protein and each is an amino acid from the standard set of 20 residues, .
For each gene set G, we are given a free-text annotation describing the biological function, pathway membership, or functional role. These annotations are concise, domain-specific phrases or sentences designed to capture the essential functional properties of the gene set without extensive narrative context.
Task: Given a gene set , with each gene associated with proteins represented as amino acid sequences, the goal of the gene set annotation task is to predict the corresponding annotation sequence
where are tokens drawn from the vocabulary of the pretrained language model. Formally, the task can be framed as conditional sequence generation; we seek a model such that
where is the predicted annotation sequence. In other words, the model must learn a mapping from the hierarchical representation of the gene set, incorporating amino acid sequences for all constituent proteins, to a concise, technical description of the gene set's biological function.
2.2 Model Overview
The model consists of two main components:
• A Hierarchical Attention-Based Gene Set Encoder, which learns context-aware gene set representations by encoding proteins with a frozen pretrained protein language model (PLM) and hierarchically aggregating them into gene- and gene set-level embeddings using attention pooling.
• The Hybrid Gene Set Soft Prompting module, wherein the resulting gene set embedding is projected by a trainable multilayer perceptron (MLP) into soft prompt tokens that condition a frozen language model for free-text annotation generation. These soft prompts are combined with task instructions and auxiliary contextual information from a large pretrained language model and fed to a local LLM to produce the final predicted annotation.
2.3 Hierarchical Attention-Based Gene Set Encoder
The hierarchical attention-based gene set encoder is responsible for generating gene set-level representations using trainable attention pooling mechanisms. As shown in Figure 2, we begin by taking as input a gene set comprising genes where . Each gene encodes proteins , where , and each protein is expressed as a sequence of amino acids

Figure 2: Overview of the hierarchical gene set encoder. Frozen pretrained protein representations are hierarchically aggregated using trainable attention-based pooling to produce a gene set embedding.
, where . Each protein is first encoded using a pretrained protein language model (ESM-2), which produces a contextual embedding for each amino acid in the sequence:
where , and is the hidden dimension of the protein language model. To obtain a fixed-size embedding for each protein, we apply mean pooling over its amino acid embeddings. Specifically, for protein , we compute:
For higher-level aggregation, we use attention pooling. Given a set of input embeddings , attention pooling is defined as follows. Each embedding is first scored using a trainable multilayer perceptron (see Appendix C.1 for details):
The weights are obtained via a softmax:
System Prompt
You are a computational biologist writing Gene Ontology-style functional summaries.
Use established biological terminology and avoid speculation.
Prefer concise, high-level functional descriptions over gene-specific details.
Do not list individual genes unless functionally necessary.
User Prompt
Summarize the shared biological function of the following genes in 2–3 concise sentences.
Focus on biological processes, molecular functions, or cellular components that are well-established in the literature.
Use precise biological terminology suitable for Gene Ontology annotation.
Figure 3: To obtain the gene set context, we utilize a system prompt to define a persona and stylistic guidelines alongside a user prompt for task instructions, which are fed to a commercial model.
and the pooled representation is computed as a weighted sum:
We denote this operator as AttentionPooling( ), which is reused for multiple aggregation steps across different levels of the hierarchy.
Given the set of protein embeddings associated with a gene , corresponding to its annotated splice isoforms, we aggregate them into a single gene-level representation using the AttentionPooling( ) operator defined above. Specifically, we apply attention pooling to with a gene-level pooling MLP to obtain the gene embedding :
This allows the model to differentially weight splice isoforms according to their relevance, downweighting noisy or irrelevant isoforms and producing a gene representation that reflects isoform-specific contributions to be used as input to the subsequent gene set-level aggregation.
Given a gene set with gene embeddings , we apply the AttentionPooling( ) operator with independently learned parameters to produce a fixed-size gene set representation :
This final representation captures the relative contributions of genes within the set and serves as input to downstream components.

Figure 4: Overview of the hybrid gene set soft prompting module. A gene set embedding is converted into soft prompt tokens that, together with instruction and context prompts, condition a frozen language model to generate free-text gene set annotations.
2.4 Hybrid Gene Set Soft Prompting
As shown in Figure 4, this module generates free-text annotations from the gene set embedding produced by the hierarchical encoder.
To condition the local LLM (e.g., Llama) on the gene set embedding, we map it to the LLM input space using a multi-layer perceptron (MLP):
where is a sequence of tunable soft tokens in the embedding space of the LLM. These tokens serve as a learnable continuous prompt that encodes the structured biological information from the gene set.
In addition to the soft prompt, we append two hard prompts to guide the LLM during generation. The first prompt, , contains the instruction for the model, specifying that it should generate a candidate annotation for the input gene set. The second prompt, , is generated by a commercial large pretrained language model (in our case, GPT 4.1 Nano) and provides context and analysis of the genes in the set through semantic-level reasoning as follows:
The prompts passed to are shown in Figure 3. This context supplies knowledge that the smaller local LLM may not encode in its pretrained weights.
This component can be replaced with any sufficiently capable locally-hosted language model for fully offline deployment.
The final input to the LLM (a local Llama 3 model (Grattafiori et al., 2024)) is the concatenation of the instruction, context, and soft prompts, which is then used to generate the candidate gene set annotation:
2.5 Training Procedure
Given the ground-truth annotation sequence , the language model defines a conditional distribution over output tokens:
Training is performed using teacher forcing, where at each time step the model conditions on the ground-truth prefix . The training objective is the standard token-level cross-entropy loss:
During optimization, the parameters of the PLM and language model are kept frozen. Gradients are propagated only through the soft prompt projector and the hierarchical attention encoder, allowing the model to learn an effective conditioning of the language model on gene set representations while fully leveraging pretrained knowledge.
3 Experiments
3.1 Datasets
We evaluate our framework on two widely used gene set databases. Statistics for each dataset after filtering are presented in Table 1. The datasets are elaborated as follows:
-
Gene Ontology (GO): The Gene Ontology (GO) dataset (Ashburner et al., 2000) provides a structured, controlled vocabulary for describing gene functions across three domains: Biological Process (BP), Molecular Function (MF), and Cellular Component (CC).
-
MSigDB: The Molecular Signatures Database (MSigDB) (Liberzon et al., 2015) is a comprehensive collection of annotated gene sets. We use gene sets from the C2 collection, specifically from KEGG (Kanehisa and Goto, 2000), Reactome (Fabregat et al., 2018), PID (Schaefer et al., 2009), and BioCarta (Nishimura, 2001).
Table 1: Dataset statistics (annotation length measured in characters).
| Measure | GO | MSigDB |
|---|---|---|
| Number of Gene Sets | 18,889 | 2,461 |
| Avg. Genes Per Set | 21.18 | 50.07 |
| Min. Number of Genes | 1 | 5 |
| Max. Number of Genes | 13,616 | 1,491 |
| Unique Genes Covered | 42,597 | 12,021 |
| Avg. Annotation Length | 38.51 | 36.25 |
| Min. Annotation Length | 4 | 6 |
| Max. Annotation Length | 187 | 155 |
3.2 Experimental Settings
We publicly release our source code for reproducibility. We randomly split the data into 70% training and 30% testing sets and report the mean and 95% confidence interval over three runs. Hyperparameter settings for both modules are presented in Appendix C.1.
3.3 Evaluation Metrics
Following previous works (Wang et al., 2024, 2025), we employ lexical and semantic similarity measures to evaluate our method. We use the following metrics for our evaluation:
-
METEOR (Lavie and Agarwal, 2007) measures the alignment between the candidate annotation and the reference by considering unigram matches while accounting for synonyms, stemming, and word order. We report METEOR to capture lexical alignment while accounting for synonyms, stemming, and word order.
-
ROUGE (Lin, 2004) identifies the longest common subsequence between the generated and reference texts. This ensures that essential biological keywords and descriptions from the ground truth are captured in the model's output.
-
BERTScore (Zhang et al., 2019) addresses the limitations of exact-match metrics by using contextual embeddings to calculate similarity. By comparing tokens based on their vector representations, BERTScore rewards candidate annotations that are synonymous with the ground truth, even when exact phrasing differs.
3.4 Results
3.4.1 Baseline Comparison
We compare our approach against the following categories of baselines, as summarized in Table 2.
- Prompt Engineering Methods: We evaluate standard zero-shot and few-shot prompting
Code: https://github.com/KU-AI4H/softgene.
Table 2: Performance of SoftGene and baselines on the Gene Ontology (GO) and MSigDB datasets. First, second, and third-best results are indicated by boldface, double underline, and single underline, respectively.
| Configuration | Gene Ontology (GO) | MSigDB | ||||
|---|---|---|---|---|---|---|
| METEOR | ROUGE-L | BERTScore-F1 | METEOR | ROUGE-L | BERTScore-F1 | |
| Prompt Engineering Methods | ||||||
| Zero-shot | 0.024 ± 0.001 | 0.133 ± 0.001 | 0.773 ± 0.00 | 0.087 ± 0.014 | 0.127 ± 0.009 | 0.762 ± 0.002 |
| Few-shot | 0.018 ± 0.001 | 0.164 ± 0.003 | 0.740 ± 0.001 | 0.100 ± 0.025 | 0.136 ± 0.017 | 0.771 ± 0.008 |
| One-shot CoT | 0.065 ± 0.001 | 0.096 ± 0.002 | 0.761 ± 0.001 | 0.086 ± 0.010 | 0.112 ± 0.003 | 0.762 ± 0.001 |
| Prompt-tuning Methods | ||||||
| Gene Symbol Soft Prompting | 0.113 ± 0.002 | 0.158 ± 0.004 | 0.778 ± 0.001 | 0.105 ± 0.022 | 0.138 ± 0.021 | 0.771 ± 0.008 |
| P-Tuning | 0.148 ± 0.130 | 0.196 ± 0.130 | 0.783 ± 0.042 | 0.113 ± 0.058 | 0.161 ± 0.061 | 0.716 ± 0.026 |
| Prefix Tuning | 0.142 ± 0.082 | 0.173 ± 0.094 | 0.766 ± 0.048 | 0.080 ± 0.006 | 0.113 ± 0.021 | 0.756 ± 0.007 |
| Agentic Systems | ||||||
| Discovera | 0.107 ± 0.003 | 0.144 ± 0.005 | 0.769 ± 0.001 | 0.092 ± 0.003 | 0.108 ± 0.003 | 0.768 ± 0.007 |
| TALISMAN | 0.108 ± 0.006 | 0.146 ± 0.002 | 0.766 ± 0.001 | 0.086 ± 0.005 | 0.107 ± 0.001 | 0.760 ± 0.001 |
| GeneAgent | 0.071 ± 0.003 | 0.116 ± 0.002 | 0.768 ± 0.001 | 0.030 ± 0.006 | 0.117 ± 0.003 | 0.764 ± 0.002 |
| SoftGene | ||||||
| SoftGene (Mistral 3 8B) | 0.203 ± 0.015 | 0.257 ± 0.015 | 0.802 ± 0.001 | 0.148 ± 0.017 | 0.206 ± 0.018 | 0.795 ± 0.005 |
| SoftGene (Qwen 3 8B) | 0.210 ± 0.007 | 0.260 ± 0.003 | 0.803 ± 0.001 | 0.135 ± 0.023 | 0.194 ± 0.021 | 0.790 ± 0.007 |
| SoftGene (Llama 3.2 3B) | 0.197 ± 0.013 | 0.247 ± 0.003 | 0.800 ± 0.001 | 0.145 ± 0.004 | 0.206 ± 0.011 | 0.793 ± 0.004 |
| SoftGene (Llama 2 13B) | 0.191 ± 0.008 | 0.239 ± 0.011 | 0.797 ± 0.004 | 0.121 ± 0.024 | 0.184 ± 0.024 | 0.787 ± 0.009 |
| SoftGene (Llama 3.1 8B) | 0.220 ± 0.033 | 0.267 ± 0.029 | 0.806 ± 0.006 | 0.157 ± 0.005 | 0.215 ± 0.001 | 0.795 ± 0.003 |
(Brown et al., 2020), as well as a one-shot chain-of-thought (CoT) prompting strategy following prior work (Hu et al., 2025). These baselines rely entirely on the language model's knowledge acquired during pretraining. Our method consistently outperforms them across all metrics, indicating the limitations of prompting alone for this task.
-
Prompt-tuning Methods: We compare against two standard prompt-tuning techniques, P-Tuning (Liu et al., 2022) and Prefix Tuning (Li and Liang, 2021), as well as a baseline that uses token embeddings averaged across all gene symbols in the set as a soft prompt. These methods allow the model to adapt to the task with limited additional parameters. These prompt-tuning baselines underperform SoftGene under our evaluation setting, resulting in lower performance than our approach.
-
Agentic Systems: We evaluate agentic baselines that incorporate external knowledge sources. Discovera (Pinto Veizaga et al., 2025) and TALISMAN (Joachimiak et al., 2024) augment generation with database queries, while GeneAgent (Wang et al., 2024) combines retrieval-augmented generation (RAG) with self-reflection mechanisms to produce grounded outputs. Despite access to external biological databases, these methods underperform our model, showing that these agentic baselines do not match SoftGene under our evaluation setting.
3.4.2 Ablation Study
We conduct an ablation study in Table 3 to evaluate the contribution of each component in SoftGene. Removing the soft prompt and relying solely on hard prompts (“w/o Soft Prompt (S)”) leads to a substantial performance drop across all metrics and both datasets, highlighting the importance of directly conditioning the LLM on structured gene set representations. Excluding LLM-generated contextual information (“w/o Context ( )”) results in a consistent degradation in performance while still outperforming baselines, indicating that high-level semantic context improves generation quality. When replacing pretrained PLM embeddings with randomly initialized embeddings (“w/o Protein Embeddings”), overall performance decreases, indicating that sequence-derived representations provide complementary information beyond the downstream architecture. As shown by the per-domain analysis, however, the magnitude of this contribution varies substantially across biological domains. Notably, without pretrained protein embeddings, SoftGene still outperforms all baselines, demonstrating that gains are not simply attributable to PLM embeddings. These results confirm that SoftGene’s gains arise from the combined effect of structured gene set embeddings, attention-based pooling, and soft prompt conditioning, with each contributing meaningfully to final performance.
Table 3: Ablation study.
| Configuration | Gene Ontology (GO) | MSigDB | ||||
|---|---|---|---|---|---|---|
| METEOR | ROUGE-L | BERTScore | METEOR | ROUGE-L | BERTScore | |
| w/o Soft Prompt (S) | 0.020 ± 0.000 | 0.065 ± 0.001 | 0.707 ± 0.001 | 0.006 ± 0.004 | 0.045 ± 0.002 | 0.704 ± 0.001 |
| w/o Context () | 0.182 ± 0.024 | 0.232 ± 0.028 | 0.795 ± 0.005 | 0.145 ± 0.007 | 0.202 ± 0.020 | 0.790 ± 0.003 |
| w/o Protein Embeddings | 0.199 ± 0.015 | 0.252 ± 0.017 | 0.803 ± 0.002 | 0.097 ± 0.017 | 0.135 ± 0.025 | 0.774 ± 0.012 |
| SoftGene | 0.220 ± 0.033 | 0.267 ± 0.029 | 0.806 ± 0.006 | 0.157 ± 0.005 | 0.215 ± 0.001 | 0.795 ± 0.003 |

Figure 5: Performance comparison of the SoftGene model across different soft prompt lengths using the GO dataset.

Figure 6: Performance comparison of the SoftGene model across different soft prompt lengths using the MSigDB dataset.
3.4.3 Soft Prompt Length
We analyze the effect of soft prompt length on model performance by varying the number of learned soft prompt tokens and evaluating outputs. Results for the GO and MSigDB datasets are shown in Figures 5 and 6. Across both datasets, performance varies only modestly across the evaluated prompt lengths. Since increasing prompt length yields no significant performance gains, we select 10 tokens as an empirical choice to reduce computational cost while preserving information.
3.4.4 Gene-Disjoint Generalization
To further evaluate whether SoftGene learns biologically meaningful sequence representations rather than memorizing gene co-occurrence patterns, we conduct additional experiments using a gene-disjoint train-test split. In this setting, train and test partitions are constructed such that genes appearing in the test set are excluded from the training set as much as possible while maintaining an approximate 70/30 split ratio. This provides a substan- tially more challenging evaluation setting by requiring the model to generalize to previously unseen genes rather than relying on overlap between training and evaluation gene sets. Results are reported in Table 4. We observe that SoftGene trained under the gene-disjoint split performs comparably to the standard random split across all evaluation metrics on both the GO and MSigDB datasets. While modest decreases in performance are expected due to the stricter evaluation protocol, the overall degradation remains limited. These findings suggest that SoftGene is not solely memorizing recurring gene compositions, but instead learns transferable biological sequence patterns and functional relationships that generalize to unseen genes.
3.4.5 Per-Domain PLM Embedding Ablation
To better understand the contribution of protein language model embeddings within the SoftGene framework, we present a fine-grained ablation broken down by GO domain (MF, BP, CC) in Table 5. For each domain, we compare SoftGene with real
Table 4: Performance comparison between random and gene-disjoint train-test splits.
| Split | Gene Ontology (GO) | MSigDB | ||||
|---|---|---|---|---|---|---|
| METEOR | ROUGE-L | BERTScore | METEOR | ROUGE-L | BERTScore | |
| Gene-Disjoint | ||||||
| Random | ||||||
Table 5: Per-domain ablation of PLM embeddings on the GO dataset. Comparison between real PLM embeddings and randomized embeddings, with differences.
| Domain | PLM | Randomized | Δ | ||||||
|---|---|---|---|---|---|---|---|---|---|
| METEOR | ROUGE-L | BERTScore | METEOR | ROUGE-L | BERTScore | METEOR | ROUGE-L | BERTScore | |
| BP | 0.223 | 0.264 | 0.802 | 0.222 | 0.256 | 0.798 | -0.001 | -0.008 | -0.004 |
| CC | 0.164 | 0.212 | 0.784 | 0.102 | 0.151 | 0.769 | -0.062 | -0.061 | -0.015 |
| MF | 0.236 | 0.314 | 0.825 | 0.213 | 0.285 | 0.820 | -0.023 | -0.029 | -0.005 |
PLM embeddings against a randomized embedding baseline, where protein embeddings are replaced with random noise of the same dimensionality. This isolates the domains in which protein sequence information provides the greatest benefit. Notably, the effect of PLM embeddings varies across domains, with larger improvements observed in CC compared to BP and MF, suggesting that different GO domains may differentially benefit from sequence-derived representations.
3.4.6 Case Verification: Zinc Ion Transmembrane Transport
We first examine the gene set GO:0071577 (zinc ion transmembrane transport), for which the model produces a near-perfect prediction. The highest attention weights are assigned to genes from known zinc transporter families, including SLC39 (ZIP) and SLC30 (ZnT), which mediate zinc influx and efflux across cellular membranes (Jeong and Eide, 2013; Eide, 2006). The top-ranked genes, SLC39A5 and SLC39A4, are well-characterized zinc importers (Wang et al., 2004); SLC39A4 is mutated in acrodermatitis enteropathica (Wang et al., 2002), a classic inherited zinc deficiency disorder. Genes less directly related to zinc transport, such as the glutamate transporter SLC1A1 (Kanai and Hediger, 2003), receive lower attention weights. This indicates that the gene-level attention layer ranks genes by functional relevance rather than treating all set members equally.
3.4.7 Interpretability: Smooth Muscle Signaling
We next analyze attention scores for GO:0045986 (negative regulation of smooth muscle contraction), shown in Figure 7. SoftGene predicts the related term “negative regulation of cGMP biosynthetic process,” consistent with the nitric oxide–cGMP pathway that regulates vascular smooth muscle relaxation (Hofmann et al., 2006). At the gene level, the highest attention weights are assigned to CALCA, encoding the vasodilator calcitonin gene-related peptide (Brain and Grant, 2004), and the beta-adrenergic receptors ADRB2 and ADRB3, which promote smooth muscle relaxation via cAMP signaling (Johnson, 2006). At the isoform level, the highest-weighted PRKG1 protein is ENSP00000363092.5 (PRKG1α). Unlike PRKG1β, PRKG1α localizes to smooth muscle stress fibers and mediates vascular relaxation in response to cGMP (Francis et al., 2010; Hofmann et al., 2006). This preference emerges without isoform-level supervision, suggesting that protein language model embeddings encode sequence signals distinguishing functional splice variants.
4 Related Works
Automatic Gene Set Annotation: Recent evaluations show that large language models outperform traditional methods for gene set annotation by synthesizing knowledge from biomedical text, while remaining susceptible to hallucinated biological associations (Hu et al., 2025). TALISMAN evaluates instruction-tuned LLMs for gene set function summarization and finds that their outputs remain dependent on curated biological knowledge bases to ensure reliability (Joachimiak et al., 2024). GeneAgent introduces a self-verifying language agent for gene set knowledge discovery, using iterative verification to improve factual consistency (Wang et al., 2024). Discovera integrates LLMs with retrieval-based biological tools to ground gene negative regulation of smooth muscle contraction

Figure 7: Attention visualization for GO:0045986. The tree depicts the three-level hierarchy of the gene set encoder, with the top five protein isoforms (by attention weight) shown beneath each gene. Node size reflects learned attention weights, indicating the relative contribution of each gene and protein isoform.
set annotations in external knowledge sources and mitigate hallucinations (Pinto Veizaga et al., 2025). LLM Soft Prompting: Advances in parameter-efficient fine-tuning have led to a family of methods that steer frozen models through learned prompts rather than updating model weights. Prefix-Tuning introduces continuous, learnable vectors prepended to Transformer layers, enabling parameter-efficient steering of frozen models (Li and Liang, 2021). Prompt Tuning shows that, for sufficiently large models, optimizing soft tokens at the input embedding layer can achieve performance comparable to full fine-tuning (Lester et al., 2021). P-Tuning models dependencies among soft prompts using a continuous prompt encoder, improving stability and allowing prompts to be conditioned on specific inputs (Liu et al., 2024b). P-Tuning v2 extends soft prompting to deeper Transformer layers to maintain effectiveness on smaller-scale models (Liu et al., 2022). Soft prompting has also been explored in biological domains, including multimodal protein modeling in ProCyon (Queen et al., 2025), gene-focused dialogue systems in GeneChat (Dhanasekar et al., 2025), and genomic reasoning such as BioReason (Fallahpour et al., 2025).
5 Conclusion
In this work, we presented SoftGene, a hybrid prompting framework that integrates a hierarchical attention-based encoder over protein sequences with soft prompt conditioning for language model-driven gene set annotation. Experimental results on the Gene Ontology and MSigDB benchmarks show that SoftGene outperforms prompt-based, agent-based, and prompt-tuning baselines across the reported metrics. Additional analyses show that protein-sequence representations provide complementary information, while their contribution varies substantially across biological domains. These findings support sequence-aware soft prompting as a promising approach for interpretable gene set annotation while highlighting the importance of domain-specific evaluation and biological validation.
6 Ethical Considerations
SoftGene should not be used as a substitute for expert biological judgment or experimental validation, particularly in high-stakes biomedical or clinical settings. We encourage users to treat generated annotations as hypothesis-generating tools rather than definitive functional claims, and future work should explore mechanisms for uncertainty estimation, expert-in-the-loop evaluation, and bias-aware benchmarking in gene set interpretation.
7 Limitations
Dataset Coverage: SoftGene is trained and evaluated on curated resources biased toward well-studied genes and biological processes, which may limit generalization to poorly annotated or emerging functions. Moreover, the contribution of protein-sequence embeddings varies across GO domains. Future work should evaluate on less curated gene sets and further characterize when sequence information provides the greatest benefit.
Evaluation Scope: Although we supplement lexical metrics with biomedical semantic and ontology-aware measures, these evaluations remain reference-based and do not fully capture biological correctness or experimental validity. Future work should incorporate expert evaluation and downstream biological validation to more rigorously assess generated annotations.
8 Acknowledgments
This work is dedicated to the memory of Drew Ross and to his family. Drew’s brilliance, warmth, and dedication drove this project from its inception, and he is deeply missed by all of us.
This work was supported by the National Science Foundation under Grant No. OIA-2531881.
References
Christian B Anfinsen. 1973. Principles that govern the folding of protein chains. Science, 181(4096):223–230.
Michael Ashburner, Catherine A Ball, Judith A Blake, David Botstein, Heather Butler, J Michael Cherry, Allan P Davis, Kara Dolinski, Seth S Dwight, Janan T Eppig, et al. 2000. Gene ontology: tool for the unification of biology. Nature genetics, 25(1):25–29.
David A Barbie, Pablo Tamayo, Jesse S Boehm, So Young Kim, Susan E Moody, Ian F Dunn, Anna C Schinzel, Peter Sandy, Etienne Meylan, Claudia Scholl, et al. 2009. Systematic rna interference reveals that oncogenic kras-driven cancers require tbk1. Nature, 462(7269):108–112.
William A Baumgartner Jr, K Bretonnel Cohen, Lynne M Fox, George Acquaah-Mensah, and Lawrence Hunter. 2007. Manual curation is not sufficient for annotation of genomic databases. Bioinformatics, 23(13):i41–i48.
Tim Beissbarth and Terence P Speed. 2004. Gostat: find statistically overrepresented gene ontologies within a group of genes. Bioinformatics, 20(9):1464–1465.
Susan D Brain and Andrew D Grant. 2004. Vascular actions of calcitonin gene-related peptide and adrenomedullin. Physiological reviews, 84(3):903–934.
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
Shashi Dhanasekar, Akash Saranathan, and Pengtao Xie. 2025. Genechat: A multi-modal large language model for gene function prediction. bioRxiv.
David J Eide. 2006. Zinc transporters and the cellular trafficking of zinc. Biochimica et Biophysica Acta (BBA)-Molecular Cell Research, 1763(7):711–722.
Ahmed Elnaggar, Michael Heinzinger, Christian Dallago, Ghalia Rehawi, Yu Wang, Llion Jones, Tom Gibbs, Tamas Feher, Christoph Angerer, Martin Steinegger, et al. 2022. Protrans: toward understanding the language of life through self-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 44(10):7112–7127.
VP Eswarakumar, I Lax, and J Schlessinger. 2005. Cellular signaling by fibroblast growth factor receptors. Cytokine & growth factor reviews, 16(2):139–149.
Antonio Fabregat, Steven Jupe, Lisa Matthews, Konstantinos Sidiropoulos, Marc Gillespie, Phani Garapati, Robin Haw, Bijay Jassal, Florian Korninger, Bruce May, et al. 2018. The reactome pathway knowledgebase. Nucleic acids research, 46(D1):D649–D655.
Adibvafa Fallahpour, Andrew Magnuson, Purav Gupta, Shihao Ma, Jack Naimer, Arnav Shah, Haonan Duan, Omar Ibrahim, Hani Goodarzi, Chris J Maddison, et al. 2025. Bioreason: Incentivizing multimodal biological reasoning within a dna-llm model. arXiv preprint arXiv:2505.23579.
Noelia Ferruz, Steffen Schmidt, and Birte Höcker. 2022. Protgpt2 is a deep unsupervised language model for protein design. Nature communications, 13(1):4348.
Sharron H Francis, Jennifer L Busch, and Jackie D Corbin. 2010. cgmp-dependent protein kinases and cgmp phosphodiesterases in nitric oxide and cgmp action. Pharmacological reviews, 62(3):525–563.
Sander F Garrelfs, Serhii Chornyi, Heleen Te Brinke, Jos Ruiter, Jaap Groothoff, and Ronald JA Wanders. 2024. Glyoxylate reductase: definitive identification in human liver mitochondria, its importance for the compartment-specific detoxification of glyoxylate. Journal of Inherited Metabolic Disease, 47(2):280–288.
Christos Gekas, Katrin E Rhodes, Laurraine M Gereige, Hildur Helgadottir, Roberto Ferrari, Siavash K Kurdistani, Encarnación Montecino-Rodriguez, Rhonda Bassel-Duby, Eric Olson, Andrei V Krivtsov, et al. 2009. Mef2c is a lineage-restricted target of scl/tall and regulates megakaryopoiesis and b-cell homeostasis. Blood, The Journal of the American Society of Hematology, 113(15):3461–3471.
Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, et al. 2024. The llama 3 herd of models. arXiv preprint arXiv:2407.21783.
Yu Gu, Robert Tinn, Hao Cheng, Michael Lucas, Naoto Usuyama, Xiaodong Liu, Tristan Naumann, Jianfeng Gao, and Hoifung Poon. 2021. Domain-specific language model pretraining for biomedical natural language processing. ACM Transactions on Computing for Healthcare (HEALTH), 3(1):1–23.
Sylvain Gugger, Lysandre Debut, Thomas Wolf, Philipp Schmid, Zachary Mueller, Sourab Mangrulkar, Marc Sun, and Benjamin Bossan. 2022. Accelerate: Training and inference at scale made simple, efficient and adaptable. https://github.com/huggingface/accelerate.
Sonja Hänzelmann, Robert Castelo, and Justin Guinney. 2013. Gsva: gene set variation analysis for microarray and rna-seq data. BMC bioinformatics, 14(1):7.
Thomas Hayes, Roshan Rao, Halil Akin, Nicholas J Sofroniew, Deniz Oktay, Zeming Lin, Robert Verkuil, Vincent Q Tran, Jonathan Deaton, Marius Wiggert, et al. 2025. Simulating 500 million years of evolution with a language model. Science, 387(6736):850–858.
Winston A Haynes, Aurelie Tomczak, and Purvesh Khatri. 2018. Gene annotation bias impedes biomedical research. Scientific reports, 8(1):1362.
F Hofmann, R Feil, T Kleppisch, and Jens Schlossmann. 2006. Function of cgmp-dependent protein kinases as revealed by gene deletion. Physiological reviews, 86(1):1–23.
Mengzhou Hu, Sahar Alkhairy, Ingoo Lee, Rudolf T Pillich, Dylan Fong, Kevin Smith, Robin Bachelder, Trey Ideker, and Dexter Pratt. 2025. Evaluation of large language models for discovery of gene set function. Nature methods, 22(1):82–91.
Panu Jaakkola, David R Mole, Ya-Min Tian, Michael I Wilson, Janine Gielbert, Simon J Gaskell, Alexander von Kriegsheim, Holger F Hebestreit, Mridul Mukherji, Christopher J Schofield, et al. 2001. Targeting of hif- to the von hippel-lindau ubiquitylation complex by o2-regulated prolyl hydroxylation. Science, 292(5516):468–472.
Jeeyon Jeong and David J Eide. 2013. The slc39 family of zinc transporters. Molecular aspects of medicine, 34(2-3):612–619.
Hyun Joo Ji, Mihaela Pertea, and Steven L Salzberg. 2026. Annotating genomes at increased scale and resolution. Nature Reviews Genetics, 27(6):429–441.
Qiao Jin, Yifan Yang, Qingyu Chen, and Zhiyong Lu. 2024. Genegpt: augmenting large language models with domain tools for improved access to biomedical information. Bioinformatics, 40(2):btae075.
Marcin P. Joachimiak, J. Harry Caufield, Nomi L. Harris, Hyeongsik Kim, and Christopher J. Mungall. 2024. Gene set summarization using large language models. Preprint, arXiv:2305.13338.
Malcolm Johnson. 2006. Molecular mechanisms of 2-adrenergic receptor function, response, and regulation. Journal of Allergy and Clinical Immunology, 117(1):18–24.
Adam Tauman Kalai, Ofir Nachum, Santosh S Vempala, and Edwin Zhang. 2025. Why language models hallucinate. arXiv preprint arXiv:2509.04664.
Yoshikatsu Kanai and Matthias A Hediger. 2003. The glutamate and neutral amino acid transporter family: physiological and pharmacological implications. European journal of pharmacology, 479(1-3):237–247.
Minoru Kanehisa and Susumu Goto. 2000. Kegg: kyoto encyclopedia of genes and genomes. Nucleic acids research, 28(1):27–30.
Alon Lavie and Abhaya Agarwal. 2007. Meteor: an automatic metric for mt evaluation with high levels of correlation with human judgments. In Proceedings of the Second Workshop on Statistical Machine Translation, StatMT '07, page 228–231, USA. Association for Computational Linguistics.
Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. Preprint, arXiv:2104.08691.
Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1: Long papers), pages 4582–4597.
Arthur Liberzon, Chet Birger, Helga Thorvaldsdóttir, Mahmoud Ghandi, Jill P Mesirov, and Pablo Tamayo. 2015. The molecular signatures database hallmark gene set collection. Cell systems, 1(6):417–425.
Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pages 74–81.
Zeming Lin, Halil Akin, Roshan Rao, Brian Hie, Zhongkai Zhu, Wenting Lu, Nikita Smetanin, Robert Verkuil, Ori Kabeli, Yaniv Shmueli, et al. 2023. Evolutionary-scale prediction of atomic-level protein structure with a language model. Science, 379(6637):1123–1130.
Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenyu Zhang, Chong Ruan, et al. 2024a. Deepseek-v3 technical report. arXiv preprint arXiv:2412.19437.
Xiao Liu, Kaixuan Ji, Yicheng Fu, Weng Lam Tam, Zhengxiao Du, Zhilin Yang, and Jie Tang. 2022. P-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. Preprint, arXiv:2110.07602.
Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. 2024b. Gpt understands, too. AI Open, 5:208–215.
Renqian Luo, Liai Sun, Yingce Xia, Tao Qin, Sheng Zhang, Hoifung Poon, and Tie-Yan Liu. 2022. Biogpt: generative pre-trained transformer for biomedical text generation and mining. Briefings in bioinformatics, 23(6):bbac409.
Fergal J Martin, M Ridwan Amode, Alisha Aneja, Olanrewaju Austine-Orimoloye, Andrey G Azov, If Barnes, Arne Becker, Ruth Bennett, Andrew Berry, Jyothish Bhai, et al. 2023. Ensembl 2023. Nucleic acids research, 51(D1):D933–D941.
Joshua Meier, Roshan Rao, Robert Verkuil, Jason Liu, Tom Sercu, and Alex Rives. 2021. Language models enable zero-shot prediction of the effects of mutations on protein function. Advances in neural information processing systems, 34:29287–29303.
Seiji Mori and Yoshikazu Takada. 2013. Crosstalk between fibroblast growth factor (fgf) receptor and integrin through direct integrin binding to fgf and resulting integrin-fgf-fgfr ternary complex formation. Medical Sciences, 1(1):20–36.
Darryl Nishimura. 2001. Biocarta. Biotech software & internet report, 2(3):117–120.
Joy Omini, Taiwo Dele-Osibanjo, Heejeong Kim, Jing Zhang, and Toshihiro Obata. 2024. Is the tca cycle malate dehydrogenase-citrate synthase metabolon an illusion? Essays in Biochemistry, 68(2):99–106.
Daniela Pinto Veizaga, Aécio Santos, Juliana Freire, Wenke Liu, Sarah Keegan, and David Fenyö. 2025. Gene set function discovery with LLM-based agents and knowledge retrieval. In ICLR Workshop on Machine Learning for Genomics Explorations (ML-GenX).
Owen Queen, Yepeng Huang, Robert Calef, Valentina Giunchiglia, Tianlong Chen, George Dasoulas, LeAnn Tai, Gianmarco Abbadessa, Owain Howell, Michelle M Li, et al. 2025. Procyon: A multimodal foundation model for protein phenotypes. BioRxiv.
Roshan M Rao, Jason Liu, Robert Verkuil, Joshua Meier, John Canny, Pieter Abbeel, Tom Sercu, and Alexander Rives. 2021. Msa transformer. In International conference on machine learning, pages 8844–8856. PMLR.
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, C Lawrence Zitnick, Jerry Ma, et al. 2021. Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. Proceedings of the national academy of sciences, 118(15):e2016239118.
Steven L Salzberg. 2019. Next-generation genome annotation: we still struggle to get it right. Genome biology, 20(1):92.
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108.
Carl F Schaefer, Kira Anthony, Shiva Krupa, Jeffrey Buchoff, Matthew Day, Timo Hannay, and Kenneth H Buetow. 2009. Pid: the pathway interaction database. Nucleic acids research, 37(suppl_1):D674–D679.
Gregg L Semenza. 2012. Hypoxia-inducible factors in physiology and medicine. Cell, 148(3):399–408.
Elana Simon and James Zou. 2025. Interplm: discovering interpretable features in protein language models via sparse autoencoders. Nature methods, 22(10):2107–2117.
Thomas Stoeger, Martin Gerlach, Richard I Morimoto, and Luís A Nunes Amaral. 2018. Large-scale investigation of the reasons why potentially important genes are ignored. PLoS biology, 16(9):e2006643.
Aravind Subramanian, Pablo Tamayo, Vamsi K Mootha, Sayan Mukherjee, Benjamin L Ebert, Michael A Gillette, Amanda Paulovich, Scott L Pomeroy, Todd R Golub, Eric S Lander, et al. 2005. Gene set enrichment analysis: a knowledge-based approach for interpreting genome-wide expression profiles. Proceedings of the National Academy of Sciences, 102(43):15545–15550.
Yawen Sun, Rui Wang, Zeyu Luo, Lejia Tan, Junhao Liu, Ruimeng Li, Dongqing Wei, and Yu-Juan Zhang. 2025. Esm2_amp: an interpretable framework for protein–protein interactions prediction and biological mechanism discovery. Briefings in Bioinformatics, 26(4):bbaf434.
Adi Laurentiu Tarca, Sorin Draghici, Purvesh Khatri, Sonia S Hassan, Pooja Mittal, Jung-sun Kim, Chong Jai Kim, Juan Pedro Kusanovic, and Roberto Romero. 2009. A novel signaling pathway impact analysis. Bioinformatics, 25(1):75–82.
Gemma Team, Aishwarya Kamath, Johan Ferret, Shreya Pathak, Nino Vieillard, Ramona Merhej, Sarah Perrin, Tatiana Matejovicova, Alexandre Ramé, Morgane Rivière, et al. 2025. Gemma 3 technical report. arXiv preprint arXiv:2503.19786.
Vineet Thumuluri, José Juan Almagro Armenteros, Alexander Rosenberg Johansen, Henrik Nielsen, and Ole Winther. 2022. Deeploc 2.0: multi-label subcellular localization prediction using protein language models. Nucleic acids research, 50(W1):W228–W234.
Leandro Von Werra, Lewis Tunstall, Abhishek Thakur, Sasha Luccioni, Tristan Thrush, Aleksandra Piktus, Felix Marty, Nazneen Rajani, Victor Mustar, and Helen Ngo. 2022. Evaluate & evaluation on the hub: Better best practices for data and model measurements. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 128–136, Abu Dhabi, UAE. Association for Computational Linguistics.
Ronald JA Wanders, Jaap W Groothoff, Lisa J Deesker, Eduardo Salido, and Sander F Garrelfs. 2025. Human glyoxylate metabolism revisited: New insights pointing to multi-organ involvement with implications for sirna-based therapies in primary hyperoxaluria. Journal of inherited metabolic disease, 48(1):e12817.
Fudi Wang, Byung-Eun Kim, Michael J Petris, and David J Eide. 2004. The mammalian zip5 protein is a zinc transporter that localizes to the basolateral surface of polarized cells. Journal of Biological Chemistry, 279(49):51433–51441.
Kun Wang, Bing Zhou, Yien-Ming Kuo, Jason Zemansky, and Jane Gitschier. 2002. A novel member of a zinc transporter family is defective in acrodermatitis enteropathica. The American Journal of Human Genetics, 71(1):66–73.
Zhizheng Wang, Qiao Jin, Chih-Hsuan Wei, Shubo Tian, Po-Ting Lai, Qingqing Zhu, Chi-Ping Day, Christina Ross, and Zhiyong Lu. 2024. Geneagent: Self-verification language agent for gene set knowledge discovery using domain databases. Preprint, arXiv:2405.16205.
Zhizheng Wang, Yifan Yang, Qiao Jin, and Zhiyong Lu. 2025. Gene-r1: Reasoning with data-augmented lightweight llms for gene set analysis. In Biocomputing 2026: Proceedings of the Pacific Symposium, pages 494–507. World Scientific.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. 2019. Huggingface's transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771.
Li Zhang, Ngoc-Tung Tran, Hairui Su, Rui Wang, Yuheng Lu, Haiping Tang, Sayura Aoyagi, Ailan Guo, Alireza Khodadadi-Jamayran, Dewang Zhou, et al. 2015. Cross-talk between prmt1-mediated methylation and ubiquitylation on rbm15 controls rma splicing. elife, 4:e07938.
Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675.
Xiaoxiao Zhang, Siyu Qu, Huanhuan Zhong, Yulu Yang, Bo Cheng, and Yan Zeng. 2025. Citrate synthase knockdown suppresses cell proliferation and induces apoptosis in select human cancer cell lines. International Journal of Molecular Sciences, 27(1):83.
Appendix Contents
A Additional Experiments 13
A.1 LLM Backbone for Context Generation ..... 13
A.2 Encoder Protein Language Model ..... 13
A.3 Performance by Description Length ..... 13
A.4 Performance by Gene Set Cardinality ..... 14
A.5 Performance by Domain and Collection ..... 14
A.6 Performance by Gene Uniqueness ..... 15
A.7 Performance by Ontology Depth ..... 16
A.8 Additional Performance Metrics ..... 16
A.9 Additional Case Studies ..... 18
B Qualitative Analysis 19
B.1 High- and Low-Scoring Completions ..... 19
B.2 Failure Mode Analysis ..... 19
C Implementation Details 19
C.1 Hyperparameters ..... 19
C.2 Baselines ..... 20
C.3 Runtime Analysis ..... 20
D Dataset Preparation 21
D.1 Protein Sequences and Isoforms ..... 21
D.2 GO Dataset ..... 21
D.3 MSigDB Dataset ..... 22
D.4 Dataset Contamination Analysis ..... 22
E LLM Prompts 22
E.1 SoftGene Prompt ..... 22
E.2 Zero-Shot Prompt ..... 22
E.3 Few-Shot Prompt ..... 22
E.4 One-Shot Chain-of-Thought Prompt ..... 23
F Additional Related Works 23
F.1 Protein Language Models ..... 23
F.2 Traditional Gene Set Annotation Methods ..... 23
A Additional Experiments
A.1 LLM Backbone for Context Generation
We evaluate the impact of different commercial large language models for generating textual context describing each gene set in Figures 8 and 9. Specifically, we compare contexts produced by GPT, DeepSeek (Liu et al., 2024a), Claude, and Gemma (Team et al., 2025) while keeping all other components fixed. Contexts generated by GPT and DeepSeek result in the strongest overall performance across all performance metrics, with DeepSeek achieving the highest average scores. Claude yields slightly lower but comparable performance, while Gemma consistently underperforms the other models.
A.2 Encoder Protein Language Model
We evaluate the robustness of our approach to the choice of protein language model by training with embeddings generated from multiple protein encoders, including three ESM-2 checkpoints of varying capacity and ProtBERT (Elnaggar et al., 2022), a BERT model trained on amino acid sequence data. As shown in Figures 10 and 11, performance is highly consistent across models, with minimal variation in performance metrics across random seeds. These results indicate that our method is not sensitive to the specific protein embedding backbone used, suggesting that improvements stem from how gene set representations are integrated into the language model rather than from any particular protein encoder.
A.3 Performance by Description Length
We analyze model performance as a function of annotation length, stratified by the number of words in the reference description, for both the GO and MSigDB datasets in (A) of Figures 12 and 13. On GO, performance is relatively stable across short and mid-length descriptions (1–6 words), with a modest improvement for longer annotations (7+ words), suggesting that more descriptive ground-truth labels are easier for the model to approximate. On MSigDB, the trend is reversed: shorter descriptions (1–2 words) yield the highest BERTScore F1, with performance declining as description length increases. This may reflect the fact that short MSigDB annotations tend to describe well-defined, canonical pathways that are more straightforwardly predicted, whereas longer descriptions capture more complex or nuanced bio-
METEOR

ROUGE-L

BERTScore

Figure 8: Performance comparison of SoftGene across different commercial models using the GO dataset.
METEOR

ROUGE-L

BERTScore

Figure 9: Performance comparison of SoftGene across different commercial models using the MSigDB dataset.
logical processes. Together, these results suggest that annotation complexity is a meaningful factor in model performance, and that the relationship between description length and difficulty varies across databases.
A.4 Performance by Gene Set Cardinality
We analyze model performance as a function of gene set cardinality across both datasets in (D) of Figure 12 and 13. On GO, performance increases monotonically with set size, with the exception of the largest gene sets (100+ genes) achieving noticeably lower BERTScore than smaller sets. Larger gene sets may provide more aggregate sequence information, although differences in annotation composition and difficulty across size bins may also contribute to this trend.
On MSigDB, the trend is reversed, with performance decreasing monotonically across cardinality bins. This may reflect the fact that larger MSigDB gene sets tend to describe broader, more complex pathway-level concepts that are inherently harder to summarize concisely, whereas smaller sets often correspond to well-defined, canonical pathways with more predictable annotations. Together, these results suggest that the relationship between set size and annotation difficulty is database-dependent, reflecting the structural differences between GO and MSigDB annotation schemas.
A.5 Performance by Domain and Collection
We examine performance across biological domains in GO and collection sources in MSigDB. The results are presented in (B) of Figure 12 and 13. Across GO domains, molecular function annotations achieve the highest BERTScore, followed by biological process, with cellular component yielding the lowest scores. However, absolute performance does not directly reflect the contribution of protein-sequence representations. As shown by the per-domain PLM ablation in Table 5, the benefit of protein embeddings varies across domains, with negligible gains for biological process, modest gains for molecular function, and the largest improvements for cellular component. These results suggest that sequence-derived representations provide complementary information whose contribution depends on the biological domain.
Across MSigDB collections, the PID collection achieves the strongest performance despite its small number of examples (n=64). BIOCARTA, KEGG LEGACY, and REACTOME show comparable and slightly lower performance, with higher variance, potentially reflecting greater heterogeneity in an-

Figure 10: Performance comparison of SoftGene across different protein language models using the GO dataset.

Figure 11: Performance comparison of SoftGene across different protein language models using the MSigDB dataset.
notation style and the smaller number of examples available for each collection.
The performance differences observed across GO domains and MSigDB collections are consistent with the differing compositional structure of each database. GO terms group genes that share a specific annotated function by definition, meaning gene membership alone is already highly predictive of the annotation and leaves limited room for protein sequence embeddings to provide additional signal beyond what co-occurrence patterns already encode. MSigDB gene sets are instead drawn from heterogeneous experimental signatures across diverse sources, with their authors explicitly noting heterogeneity within gene sets; in this setting, symbolic gene identity is a less reliable cue and aggregating protein sequence information across diverse gene members provides a substantially stronger discriminative signal. This also explains the asymmetry observed in the PLM embedding ablation (Table 3), where protein embeddings provide a larger performance gain on MSigDB than GO, which is a pattern that is biologically interpretable rather than anomalous. The gene-disjoint generalization results (Table 4) further support this interpretation that SoftGene exploits transferable sequence-level features rather than memorizing gene identity or co-occurrence patterns.
A.6 Performance by Gene Uniqueness
To determine if model performance is influenced by the specificity of the underlying genes, we analyzed BERTScore F1 as a function of Mean Gene Frequency, stratified into quintiles from Q1 (most unique) to Q5 (least unique).
For a gene set with genes , we define mean gene frequency as
where denotes the number of gene sets in the dataset that contain gene g.
The results are presented in (C) of Figure 12 and 13. In GO, median performance exhibits a gradual decline from Q1 to Q5, with modestly higher variance in lower quintiles, indicating that gene sets composed of highly unique genes are somewhat more variable in difficulty. In MSigDB, median performance remains largely stable across Q1–Q4, followed by a slight increase in Q5. This pattern suggests that sets containing frequently reused (i.e.,
A

B
C

D
Figure 12: BERTScore F1 performance across gene set characteristics in the GO dataset. Box plots display the distribution of BERTScore F1 scores stratified by four gene set properties: (A) description length in words, (B) GO domain (biological process, cellular component, molecular function), (C) mean gene frequency across all gene sets (binned into quintiles Q1–Q5, where Q1 represents the most unique genes and Q5 the least unique), and (D) number of genes per gene set. Sample sizes (n) are indicated at the bottom of each panel.
less unique) genes may be marginally easier to annotate, potentially because such genes are enriched in well-characterized canonical pathways.
Overall, the effect of gene uniqueness is limited relative to the broader performance range, indicating that SoftGene remains robust across varying levels of gene reuse.
A.7 Performance by Ontology Depth
We further evaluate model performance on the GO dataset stratified by ontology depth, which serves as a proxy for functional specificity. As shown in Figure 14, BERTScore tends to increase with ontology depth. This upward trend suggests that the model is more effective at approximating the descriptions of highly specific biological terms than those of broader, more generic categories located near the root of the ontology. This may be due to more specific terms having distinct, well-defined lexical profiles in the training data compared to the abstract and often overlapping definitions of high-level terms.
A.8 Additional Performance Metrics
To further assess biological validity beyond surface-level text similarity, we evaluate SoftGene and all other baseline methods using two biologically-grounded metrics: semantic similarity computed using PubMedBERT (Gu et al., 2021), which is a biomedical domain-specific encoder, and Hierarchical Semantic Similarity (HSS) (following Wang et al. (2024)), which measures whether predicted Gene Ontology (GO) terms are consistent with the hierarchical structure of the GO directed acyclic graph (DAG).
For HSS, we first construct a hierarchical neighborhood for each ground-truth GO term by traversing the GO DAG upward to collect ancestor terms. The traversal includes standard GO relationships such as “is a”, “part of”, and regulatory edges (e.g., “regulates”, “positively regulates”, and “negatively regulates”), and is restricted to a maximum hop distance of K = 3. This yields a set of biologically related ancestor terms that represent general functional abstractions of the original annotation.
Each annotation is represented using a biomedi-

Description Length
B

MSigDB Collection
C

Mean Gene Frequency
D

Number of Genes per Gene Set
Figure 13: BERTScore F1 performance across gene set characteristics in the MSigDB dataset. Box plots display the distribution of BERTScore F1 scores stratified by four gene set properties: (A) description length in words, (B) MSigDB collection (BIOCARTA, KEGG LEGACY, PID, REACTOME), (C) mean gene frequency across all gene sets (binned into quintiles Q1–Q5, where Q1 represents the most unique genes and Q5 the least unique), and (D) number of genes per gene set. Sample sizes (n) are indicated at the bottom of each panel.

Figure 14: BERTScore F1 performance stratified by GO ontology depth. Box plots display the distribution of BERTScore F1 scores across gene sets binned by their depth within the Gene Ontology hierarchy (0–3, 4–5, 6–7, 8–9, and 10+).
cal sentence encoder (PubMedBERT), which maps both predicted annotations and ancestor terms into a shared semantic embedding space. HSS is then defined as the maximum cosine similarity between the embedding of the predicted annotation and the embeddings of all ancestor terms:
where and denote the embeddings of the predicted annotation and ancestor term respectively. HSS is computed exclusively for the Gene Ontology dataset, as MSigDB does not define an explicit term hierarchy. Results are reported in Table 6. SoftGene achieves the strongest performance across the biologically grounded metrics, indicating improved semantic alignment and ontology-aware consistency. However, the margins over competing methods are smaller than those observed for lexical metrics such as METEOR and ROUGE-L. This suggests that part of the larger lexical improvement may reflect better alignment with the phrasing and style of the reference annotations, while the gains in biological content are more modest. Thus, we interpret the biologically grounded metrics as complementary evidence of improved annotation quality rather than as showing improvements of the same magnitude as the lexical metrics.
Table 6: Performance of SoftGene and baselines on the Gene Ontology (GO) and MSigDB datasets using additional performance metrics. Best results are indicated by boldface.
| Configuration | Gene Ontology (GO) | MSigDB | |
|---|---|---|---|
| Semantic Similarity | Hierarchical Semantic Similarity | Semantic Similarity | |
| Prompt Engineering Methods | |||
| Zero-shot | |||
| Few-shot | |||
| One-shot CoT | |||
| Prompt-tuning Methods | |||
| Gene Symbol Soft Prompting | |||
| P-Tuning | |||
| Prefix Tuning | |||
| Agentic Systems | |||
| Discovera | |||
| TALISMAN | |||
| GeneAgent | |||
| SoftGene | |||
| SoftGene (Llama 3.1 8B) | |||
A.9 Additional Case Studies
A.9.1 Regulation of Megakaryocyte Differentiation
We examine the biological process gene set GO:0045652 (regulation of megakaryocyte differentiation), for which the model produces a near-perfect prediction. The highest gene-level attention weight is assigned to MEF2C, a transcription factor known to be essential for megakaryocyte differentiation and platelet production (Gekas et al., 2009). RBM15, which directly regulates alternative splicing of key megakaryopoiesis transcription factors including GATA1 and RUNX1, receives an intermediate attention weight, consistent with its established role in this process (Zhang et al., 2015). In contrast, LOX and EIF6, which are a matrix-remodeling enzyme and a general translation factor, respectively, receive among the lowest attention weights, reflecting their more peripheral relevance to megakaryocyte differentiation specifically. These results suggest that the hierarchical attention encoder successfully distinguishes between genes that are central to megakaryocyte differentiation and those with more general cellular functions within the same gene set.
A.9.2 Hypoxia-Inducible Factor in the Cardiovascular System
We examine the BIOCARTA_HIF_PATHWAY gene set, which represents hypoxia-inducible factor (HIF) signaling. The model assigns its highest attention to HIF1A, VHL, and VEGFA. HIF1A and VHL form the central oxygen-sensing regulatory mechanism, where VHL controls degradation of HIF1A under normal oxygen conditions (Jaakkola et al., 2001). VEGFA is a key downstream target that drives vascular growth in response to hypoxia (Semenza, 2012). In contrast, genes with more general cellular functions, such as HSP90AA1 and P4HB, receive lower attention weights, consistent with roles in protein folding and cellular maintenance rather than hypoxia-specific signaling. Overall, the model concentrates attention on core pathway regulators and outputs, while assigning lower importance to broadly expressed housekeeping genes.
A.9.3 Glyoxylate and Dicarboxylate Metabolism
We examine the KEGG_GLYOXYLATE_AND_DICARBOXYLATE_METABOLISM pathway, for which the model assigns elevated attention to several canonical metabolic enzymes. The highest attention weight is assigned to CS (citrate synthase), a core enzyme of central carbon metabolism that catalyzes entry into the tricarboxylic acid cycle (Zhang et al., 2025). Related enzymes including ACO1/ACO2 and MDH1/MDH2 also receive high attention weights, consistent with their established roles in interconnected dicarboxylate and mitochondrial metabolic processes (Omini et al., 2024). The model additionally assigns elevated attention to
HAO1, HAO2, and GRHPR, which are more directly associated with glyoxylate metabolism and detoxification pathways (Wanders et al., 2025; Garrelfs et al., 2024). Together, these patterns suggest that the model upweights metabolically related enzymes within the pathway rather than assigning attention uniformly across all genes.
B Qualitative Analysis
B.1 High- and Low-Scoring Completions
Tables 7 and 8 present the top and bottom performing gene set predictions for GO and MSigDB, respectively, as measured by BERTScore F1. High-scoring examples demonstrate the model's ability to precisely capture enzymatic activities and metabolic pathways, whereas lower-scoring cases often involve more complex regulatory processes or nuanced phenotypic descriptions.
B.2 Failure Mode Analysis
While SoftGene achieves strong performance across both benchmarks, a qualitative analysis of low-scoring predictions reveals systematic and interpretable failure patterns. Rather than reflecting random errors, these cases illuminate specific limitations of the model's learned representations and, in some instances, expose shortcomings of the evaluation metrics themselves. We identify three recurring failure modes below.
Substrate Specificity Failure
Example Gene Set: GO:0015756
Predicted: "sodium:sugar symporter"
Reference: "fucose transmembrane transport"
Analysis: This failure mode involves the accurate identification of a molecular mechanism while failing to specify the precise chemical substrate. This example suggests that while the PLM embeddings may encode structural signals associated with the transporter class, the gene set encoder may aggregate residue-level signals to an extent that subtle active-site configurations are smoothed over. Consequently, the model prioritizes robust functional class recognition over minute chemical variations.
Pathway Pleiotropy Failure
Example Gene Set: GO:0045743
Predicted: "cell-substrate adhesion"
Reference: "fibroblast growth factor receptor signaling"
Analysis: The model occasionally identifies biological processes that are functionally coupled with, or downstream of, the primary reference term. In the case of the example, biologically, fibroblast growth factor receptors are primary regulators of focal adhesions and cytoskeletal remodeling (Mori and Takada, 2013; Eswarakumar et al., 2005). These results indicate that the soft prompt tokens are capturing a broader, pleiotropic signature of the gene set. This suggests the model is identifying a valid biological "neighborhood" or a high-level structural consequence of the signaling pathway, suggesting that the learned representation may capture broader functional relationships among cellular processes.
Semantic Granularity Failure
Example Gene Set: GO:0045187
Predicted: "regulation of circadian rhythm"
Reference: "regulation of circadian sleep/wake cycle"
Analysis: This failure mode highlights instances where the model generates semantically valid synonyms or parent terms that are penalized by rigid string-matching metrics. While the predicted and reference terms are functionally nearly identical, the resulting ROUGE-L score is low despite a high BERTScore. This discrepancy underscores a limitation of standard NLP evaluation in the biological domain and confirms that SoftGene is capturing the core biological concept with high fidelity, even when the generated output diverges from the specific granularity of the curated ground truth.
C Implementation Details
We use the Hugging Face Transformers library (Wolf et al., 2019) for all local LLM inference and training, the Accelerate library (Gugger et al., 2022) for distributed training, and the Evaluate library (Von Werra et al., 2022) for evaluation metrics. For the BERTScore metric, we use DistilBERT (Sanh et al., 2019). We utilize a server equipped with three NVIDIA A6000 GPUs, 512 GB of RAM, and a 48-core CPU.
C.1 Hyperparameters
The hyperparameters used for training SoftGene on the GO and MSigDB datasets are presented in Table 14. To obtain , LLM inference was conducted using the default generation hyperparameters, with the sole modification that the number of max new tokens was set to 100.
Table 7: Top 5 and bottom 5 scoring gene set predictions from GO by BERTScore F1 (excluding perfect scores).
| Group | Gene Set | Score | Reference | Predicted |
|---|---|---|---|---|
| Top 5 | GO:0004143 | 0.9500 | ATP-dependent diacylglycerol kinase activity | diacylglycerol kinase activity |
| GO:0045588 | 0.9500 | positive regulation of gamma-delta T cell differentiation | positive regulation of T cell differentiation | |
| GO:0042129 | 0.9499 | regulation of T cell proliferation | positive regulation of T cell activation | |
| GO:0140950 | 0.9496 | histone H2A deubiquitinase activity | histone H2A deubiquitination | |
| GO:0006563 | 0.9493 | L-serine metabolic process | serine metabolic process | |
| Bottom 5 | GO:0030431 | 0.5774 | sleep | positive regulation of interleukin-18 production |
| GO:0043276 | 0.5747 | anoikis | positive regulation of cell cycle G1/S phase transition | |
| GO:0014705 | 0.5672 | C zone | myosin binding | |
| GO:0030628 | 0.5530 | pre-mRNA 3'-splice site binding | U2 snRNP | |
| GO:1990603 | 0.5337 | dark adaptation | regulation of G protein-coupled receptor signaling pathway |
Table 8: Top 5 and bottom 5 scoring gene set predictions from MSigDB by BERTScore F1 (excluding perfect scores).
| Group | Gene Set | Score | Reference | Predicted |
|---|---|---|---|---|
| Top 5 | REACTOME_SARS_COV_INFECTIONS | 0.9477 | SARS-CoV Infections | SARS-CoV-2 infection |
| REACTOME_DOWNSTREAM_SIGNALING_OF_ACTIVATED_FGFR4 | 0.9458 | Downstream signaling of activated FGFR4 | Signaling by FGFR4 | |
| REACTOME_DOWNSTREAM_SIGNALING_OF_ACTIVATED_FGFR2 | 0.9454 | Downstream signaling of activated FGFR2 | Signaling by FGFR2 | |
| BIOCARTA_MTOR_PATHWAY | 0.9453 | mTOR Signaling Pathway | mTOR signaling | |
| REACTOME_METHIONINE_SALVAGE_PATHWAY | 0.9450 | Methionine salvage pathway | Methionine salvage | |
| Bottom 5 | REACTOME_S_PHASE | 0.6173 | S Phase | Regulation of APC/C activators in early mitosis |
| PID_ALPHA_SYNUCLEIN_PATHWAY | 0.6088 | Alpha-synuclein signaling | Parkinson's disease | |
| KEGG_HUNTINGTONS_DISEASE | 0.5938 | Huntington's disease | Mitochondrial ATP synthase complex | |
| REACTOME_MISCELLANEOUS_SUBSTRATES | 0.5279 | Miscellaneous substrates | CYP4A11, CYP4A22, CYP4B1, ... | |
| REACTOME_FATTY_ACIDS | 0.5047 | Fatty acids | CYP4A11, CYP4A22, ... |
C.2 Baselines
Prompt Engineering Methods
For all prompt engineering baselines, we use the Llama-3.1-8B-Instruct model. We conducted inference via the Replicate API using the default inference configuration.
Prompt-Tuning Methods
For all prompt-tuning baselines, we use the base Llama-3.1-8B model. We employ soft prompt tuning with 10 virtual tokens. We omit commercial LLM context ( ) for this setting, but note that SoftGene outperforms prompt tuning baselines even without this context (see "w/o Context ( )" in Table 3). Models were trained for one epoch on the GO dataset and two epochs on the MSigDB dataset. Due to the short length of both the prompts and target gene set annotations, prompt tuning converged rapidly.
Agentic Systems
For all agentic system baselines, we use the GPT-4o-mini model accessed via the OpenAI API. To ensure comparable inference costs with SoftGene, we limit the number of self-verification iterations in the GeneAgent baseline to three. Similarly, for Discovera, we restrict the number of genes passed to the INDRA API to 10, as the API returns pairwise interactions between genes, which otherwise leads to substantially longer inference times.
C.3 Runtime Analysis
In this section, we report the runtime for each phase of the SoftGene framework. Protein embedding inference is performed once over the entire human proteome prior to training and cached for all subsequent use; runtime details for this step are reported in Table 9. Because protein embeddings are pre-computed and cached, no repeated PLM forward pass is required during SoftGene training or evaluation; the runtime cost of the hierarchical attention encoder is limited to a linear-time sparse scatter aggregation and a small MLP projection, both of which are negligible relative to the LLM forward pass. Training time and memory details are reported in Table 10. Evaluation time and memory details are reported in Table 11. We note that for novel gene sets not present in GO or MSigDB, an additional commercial LLM inference pass is required to generate the auxiliary context ; we omit this from our runtime reporting due to its highly variable network latency.
Table 9: Protein embedding inference runtime using ESM-2 on a single NVIDIA A6000 GPU.
| Metric | Value |
|---|---|
| Total Time | 6,575.92s (1.83 hr) |
| Average Time per Protein | 26.80 ms |
| Throughput | 37.3 proteins/s |
| Peak GPU Memory | 2.250 GB |
Table 10: SoftGene training runtime on the GO dataset using two NVIDIA A6000 GPUs.
| Metric | Value |
|---|---|
| Total Training Time | 1,709.11s (0.47 hr) |
| Peak GPU Memory | 46.39 GB |
Table 11: Inference runtime comparison between SoftGene and the zero-shot baseline on the GO dataset using a single NVIDIA A6000 GPU.
| Metric | SoftGene | Zero-Shot |
|---|---|---|
| Total Inference Time | 584.72s | 478.91s |
| Average Time per Sample | 103.18 ms | 84.51 ms |
| Throughput | 9.69 samples/s | 11.83 samples/s |
| Peak GPU Memory | 19.84 GB | 18.87 GB |
Table 12: Inference runtime of SoftGene on the five largest gene sets in the GO evaluation set.
| Metric | Value |
|---|---|
| Total Time | 2.43 s |
| Average Time per Sample | 467.45 ms |
| Throughput | 2.14 samples/s |
C.3.1 Scalability to Large Gene Sets
A potential concern is the scalability of SoftGene to large gene sets, as the GO dataset contains gene sets with up to 13,616 member genes (Table 1). Our attention pooling operates in time with respect to gene set size, as we employ query-only attention rather than pairwise attention, avoiding the quadratic memory bottleneck common to standard self-attention. We additionally leverage sparse scatter operations to perform efficient aggregation across variable-length gene sets in a single batched operation. To empirically validate this, we report inference runtime on the five largest gene sets in our evaluation set in Table 12, observing that even at this scale SoftGene remains computationally tractable in this setting.
D Dataset Preparation
In this section, we outline the steps taken to prepare the benchmark datasets.
D.1 Protein Sequences and Isoforms
We obtain protein sequences from the Ensembl proteome (Homo_sapiens.GRCh38.pep.all.fa ) (Martin et al., 2023). This resource also provides a mapping from gene symbols to their corresponding splice isoforms, giving us the hierarchical gene-to-protein information required for the gene set annotation task. The Ensembl proteome thus provides all necessary information to construct input representations for both the GO and MSigDB datasets, enabling the model to leverage gene- and protein-level features consistently across benchmarks.
D.2 GO Dataset
To construct the GO gene sets, we use two primary input files: the GO ontology file (go.obo ) and the human gene annotation file (goa_human.gaf ) obtained from the GO Consortium. The ontology file defines all GO terms and their hierarchical relationships, while the GAF file provides gene-to-term annotations.
We load the ontology using GODag from the goatools library and read the GAF following the GAF v2.2 format. For each GO term, we collect all associated human gene symbols, storing the term's name and namespace (biological process, molecular function, or cellular component). Finally, gene sets are exported as a JSON object mapping each GO ID to its genes, description, and domain.
https://useast.ensembl.org/info/data/ftp/index.html
https://geneontology.org/docs/download-ontology/
https://current.geneontology.org/products/pages/downloads.html
D.3 MSigDB Dataset
To construct the MSigDB gene sets from the C2:CP collection, we use two input sources: the GMT file (c2.all.v2025.1.Hs.symbols.gmt ) and the accompanying SQLite database (msigdb_v2025.1.Hs.db ). The GMT file provides the gene sets as lists of gene symbols, while the database contains metadata including gene set descriptions and collection information.
We first read the GMT file, extracting gene set names and their associated gene symbols. Next, we query the database to retrieve brief descriptions and collection names for all C2:CP gene sets, excluding certain sub-collections (e.g., WIKIPATHWAYS and KEGG_MEDICUS) to focus on canonical pathway sets. Gene sets are filtered to retain only those present in both the GMT file and the database. The gene sets, including cleaned descriptions, gene symbols, and collection names, are exported as a structured JSON object mapping gene set names to their content.
D.4 Dataset Contamination Analysis
Data contamination is a common concern in NLP and LLM research, particularly when evaluation datasets are drawn from publicly available resources that may overlap with model pretraining corpora. We address two potential sources of contamination relevant to our evaluation.
Memorization of GO and MSigDB annotations. We construct the datasets from late-2025 releases of GO and MSigDB. For GPT-4.1 nano, the documented knowledge cutoff predates these releases, reducing the possibility that release-specific updates were included in its pretraining data. However, many underlying genes, pathways, and annotations predate the selected releases and may have appeared in model pretraining corpora. Therefore, the use of recent database releases reduces but does not eliminate the possibility of contamination.
Data leakage through auxiliary context. A separate concern is whether encodes ground-truth label information, as commercial LLMs may have memorized annotations and pathway descriptions from biomedical literature. We address this in two ways. First, as shown in Table 3, SoftGene without auxiliary context (“w/o Context ”) still outperforms all competitive baselines across both datasets. If were truly encoding ground-truth label information, removing it would cause a catastrophic performance drop; instead, we observe only a moderate decrease, confirming that it provides supplementary biological context rather than label information. Second, we directly measured lexical overlap between GPT-generated context and ground-truth annotations across both datasets, reported in Table 13. The negligible overlap confirms that observed performance cannot be attributed to verbatim copying from the generated context.
Table 13: Lexical overlap between GPT-generated auxiliary context and ground-truth annotations.
| Dataset | Ground Truth Overlap |
|---|---|
| GO | 1.37% |
| MSigDB | 3.41% |
E LLM Prompts
In this section, we share the LLM prompts used in our method as well as the prompts used for each of the prompting baselines.
E.1 SoftGene Prompt
Figure 15 shows the prompt used for SoftGene. We deliberately keep the prompt concise, providing minimal details, so that the model can freely learn task-relevant information during training. This approach allows the soft prompt to adapt effectively to the gene prediction task.
E.2 Zero-Shot Prompt
Figure 16 shows the zero-shot prompt. In this setup, we provide only task instructions, forcing the model to rely entirely on its pretraining knowledge to perform the task. No examples or task-specific demonstrations are given, making this a baseline for evaluating the model's generalization abilities.
E.3 Few-Shot Prompt
Figure 17 shows the few-shot prompt. In this setup, we provide the model with a small number of task examples along with the instructions, allowing it to infer the desired output format and style. This few-shot context helps the model leverage both its pretraining knowledge and the provided demonstrations to perform the task more accurately.
https://www.gsea-msigdb.org/gsea/msigdb/collections.jsp
https://www.gsea-msigdb.org/gsea/downloads.jsp
Table 14: Hyperparameter settings.
| Parameter | GO | MSigDB |
|---|---|---|
| Hierarchical Attention Encoder | ||
| Learning Rate α | ||
| Protein Pooling Hidden Size | 512 | 512 |
| Gene Pooling Hidden Size | 512 | 512 |
| Weight Decay | ||
| Gradient Clipping Norm | 1 | 1 |
| Hybrid Soft Prompting Module | ||
| Training Epochs | 1 | 5 |
| Batch Size | 4 | 4 |
| Gradient Accumulation Steps | 4 | 4 |
| Learning Rate β | ||
| Hidden Dimension | 4096 | 4096 |
| Weight Decay | ||
| Dropout Rate | ||
| Soft Prompt Length | 10 | 10 |
E.4 One-Shot Chain-of-Thought Prompt
Figure 18 shows the one-shot chain-of-thought prompt. This prompt includes a single example that demonstrates step-by-step reasoning, guiding the model to analyze the system before producing a final output. By providing both the instructions and a worked example, the prompt encourages the model to follow a reasoning process.
F Additional Related Works
F.1 Protein Language Models
Protein language models (PLMs) apply the self-supervised pretraining paradigm from NLP to amino acid sequences, learning representations of protein structure and function directly from evolutionary data. Rives et al. (2021) established the foundation for this line of work by training ESM-1b on 250 million protein sequences, demonstrating that structural and functional properties emerge from sequence-level pretraining alone without explicit structural supervision. Lin et al. (2023) scaled this approach to 15 billion parameters with ESM-2 and ESMFold, enabling direct inference of atomic-level protein structure from primary sequence. Elnaggar et al. (2022) introduced ProtTrans, a family of transformer models pretrained on protein sequences, demonstrating that NLP pretraining strategies transfer effectively to amino acid data; ProtBERT serves as one of the encoder backbones in our ablation study. Meier et al. (2021) showed that PLMs support zero-shot prediction of mutational effects without any task-specific supervision, demonstrating that PLM representations encode functional information beyond structural topology and motivating our use of these embeddings to distinguish functionally distinct isoforms. Rao et al. (2021) introduced the MSA Transformer, which interleaves row and column attention across multiple sequence alignments to incorporate co-evolutionary context, achieving substantially improved contact prediction over single-sequence models. Hayes et al. (2025) presented ESM3, a multimodal generative PLM that jointly reasons over protein sequence, structure, and function, representing the frontier of PLM capability and pointing toward richer biological representations for gene annotation tasks.
F.2 Traditional Gene Set Annotation Methods
The analysis of gene sets has a long history in functional genomics, with early methods framing the problem as statistical over-representation testing. Beissbarth and Speed (2004) introduced one of the first automated approaches, identifying statistically overrepresented GO terms within a gene list by comparing observed annotation frequencies against a background distribution. While conceptually straightforward, such over-representation methods treat gene sets as unordered collections and discard magnitude and directionality information present in expression data. Subramanian et al. (2005) addressed this by operating on ranked gene lists derived from differential expression, using a weighted Kolmogorov-Smirnov statistic to detect coordinated shifts in gene set activity. However, GSEA produces enrichment scores at the cohort level, limiting applicability to single-sample settings. Barbie et al. (2009) extended this to individual samples by computing per-sample enrichment scores, while Hänzelmann et al. (2013) further generalized the approach as a non-parametric kernel estimation problem applicable across microarray and RNA-Seq platforms. A separate line of work recognized that gene membership alone is insufficient to capture signaling complexity. Tarca et al. (2009) incorporated pathway topology by weighting genes according to their connectivity within curated signaling graphs, though such methods remain dependent on the completeness of curated databases (Liberzon et al., 2015). Collectively, these methods share a fundamental limitation: they map gene sets to predefined categorical labels rather than generating descriptive natural language annotations, and the methods discussed above do not directly incorporate protein-sequence representations. SoftGene is designed to address both of these gaps.
| Instruction Prompt |
|---|
| Input: Genes: {genes} |
| {commercial_llm_context} |
| Task: Predict GO term. |
| Output: |
Figure 15: Instruction prompt used for SoftGene.
| System Prompt |
|---|
| You are an efficient and insightful assistant to a molecular biologist. |
| Human Prompt |
|---|
| You are a knowledgeable bioinformatics assistant. Given a set of related genes, generate one concise biological pathway or molecular function label that represents the overall shared function of the entire gene set, not individual genes. |
| The output must:- Be a single short description (3–5 words)- Capture the common biological theme- Contain only the description, no explanation or extra text |
| Now complete the task:{gene_symbols} |
Figure 16: System and user prompt used for zero-shot prompting baseline.
| System Prompt |
|---|
| You are an efficient and insightful assistant to a molecular biologist. |
| Human Prompt |
|---|
| You are a knowledgeable bioinformatics assistant. Given a set of related genes, generate one concise biological pathway or molecular function label that represents the overall shared function of the entire gene set, not individual genes. |
| The output must:- Be a single short description (3–5 words)- Capture the common biological theme- Contain only the description, no explanation or extra text |
| Consider the following examples:{examples} |
| Now complete the task:{gene_symbols} |
Figure 17: System and user prompt used for few-shot prompting baseline.
| System Prompt |
|---|
| You are an efficient and insightful assistant to a molecular biologist. |
| Human Prompt |
|---|
| Write a critical analysis of the biological processes performed by this system of interacting genes. Base your analysis on prior knowledge available in your training data. After completing your analysis, propose a short descriptive name for the most prominent biological process performed by the system. Put your chosen name at the top of the analysis as 'Process: '. Be concise, do not use unnecessary words. Be factual, do not editorialize. Be specific, avoid overly general statements such as "the genes are involved in various cellular processes". Avoid listing facts about individual proteins. Instead, try to group proteins with similar functions and discuss their interplay, synergistic or antagonistic effects, and functional integration within the system. Also, avoid choosing generic process names such as "Cellular Signaling and Regulation". If you cannot identify a prominent biological process for the proteins in the system, I want you to communicate this in your analysis and name the process: "System of unrelated genes"To help you in your work, I am providing an example system of interacting genes and the corresponding example analysis output. |
| {example} |
| Here are the interacting genes:Genes: {gene_symbols} |
| After completing your analysis, output the most relevant Gene Ontology biological process description for these proteins. |
Figure 18: System and user prompt used for one-shot chain-of-thought prompting baseline.