arXiv:2610.30180cs.IROct 2026

Manuscript Offprint

arXiv:2610.30180

QProtFuse: Query-Guided Layer Fusion for Retrieval-Augmented Protein Function Prediction

Mianzhi Pan, Peishuo Liu, Yawen Ouyang, Botian Wang, Yiming Rong, Hao Zhou, Jianbing Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Predicting protein functions from amino acid sequences is essential to understanding biological processes. Large language models (LLMs) offer flexible function descriptions to natural-language queries, yet their limited protein understanding motivates retrieval-augmented generation (RAG). Existing protein RAG methods primarily expand external retrieval signals while overlooking the rich knowledge encoded within a single protein language model (PLM). We show that retrieval performance varies across PLM layers and biological tasks, making conventional final-layer selection suboptimal. To this end, we propose QProtFuse, which uses queries to adaptively fuse multilayer protein features and jointly learns protein and annotation retrieval through intra-modal and cross-modal contrastive objectives. On Prot-Inst-OOD, QProtFuse achieves the best protein and annotation retrieval scores, reaching 16.4% Recall@1 with annotation reranking. These gains improve downstream RAG-based function descriptions, yielding the highest LLM-as-a-judge scores for both Qwen3-8B (6.22/10) and DeepSeek-V4-Pro (6.68/10). Ablations and weight analyses demonstrate the value of query-guided fusion and complementary training objectives for exploiting a PLM's internal knowledge. 1^{1}

1 Introduction

Proteins are essential to biological processes. Predicting their functions from amino acid sequences is therefore a central task in computational biology. Traditional sequence analysis uses BLAST (Altschul et al., 1990) to find homologs and InterPro (Blum et al., 2025) to identify family and domain signatures. These methods depend on informative matches and cannot directly

(a)

Figure

Answer: It exhibits DNA binding and zinc ion binding, and may contribute to regulation of DNA-templated transcription.

(b)

(c)

Figure 1: (a) A typical retrieval-augmented pipeline for protein function description. (b) Layer-wise retrieval performance of ESM2-650M across four Prot-Inst-OOD tasks. (c) Retrieval performance comparison of final-layer ESM, ESM with MMseqs2, ESM with ProstT5, and averaged ESM layer features.

answer specific biological questions. More recently, broader large language models (LLMs) for life-science research have begun to tackle protein-related tasks (OpenAI, 2026; Anthropic, 2026). Protein-oriented LLMs incorporate amino acid sequences through direct tokenization (Wang et al., 2024b; Bai et al., 2025; Qiu et al., 2026) or dedicated protein encoders (Zhuo et al., 2024; Fei et al., 2025; Zhou et al., 2026). Together, these models offer the potential to answer complex biological questions in free-form by leveraging their internal pretrained knowledge and reasoning capabilities.

Despite these advances, the inherent gap between proteins and natural language remains a major obstacle to reliable protein understanding by LLMs (Zhuang et al., 2026). For protein function description, Wu et al. (2025) show that retrieval-based methods can outperform direct LLM generation. This highlights the value of external biological knowledge, motivating retrieval-augmented generation (RAG) approaches (Wu et al., 2025;

∗^{*}Corresponding author

1^{1}Data and code are available at https://github.com/panmianzhi/QProtFuse.

Ma et al., 2026; Ding et al., 2026). As illustrated in Figure 1(a), these approaches retrieve relevant proteins and annotations to enhance LLM-based protein function description.

However, current protein RAG methods focus on incorporating external retrieval signals, such as those from sequence alignment tools (Altschul et al., 1990; Steinegger and Söding, 2017) and additional protein language models (PLMs) (Lin et al., 2023; Wang et al., 2024a; Heinzinger et al., 2024), while leaving the knowledge within a single PLM insufficiently explored. Previous studies reveal that PLMs encode rich and distinct biological features across different layers (Rao et al., 2021; Lin et al., 2023; Vig et al., 2021; Kumar and Jha, 2025). These findings raise two questions:

Q1: Do different PLM layers exhibit distinct strengths in protein retrieval?

Q2: If so, how can we effectively use this internal knowledge to improve protein RAG?

To answer these questions, we first probe the layer-wise retrieval performance of ESM-2 (Lin et al., 2023) on Prot-Inst-OOD (Wu et al., 2025). As shown in Figure 1(b), the four subtasks achieve their best retrieval performance using features from different intermediate layers. These observations answer Q1 and show that relying solely on final-layer features is suboptimal. As a first step toward Q2, we test a simple fusion strategy by uniformly averaging features across all layers. Even this simple strategy outperforms those incorporating MM-seqs2 sequence similarity or ProstT5 features (Figure 1(c)). 2^{2} However, uniform averaging still generally falls short of task-specific best-performing layers (see Appendix A). This gap calls for a more adaptive fusion strategy that exploits the distinct strengths of different layers.

Inspired by multi-layer visual feature fusion in multimodal LLMs (Yao et al., 2024; Lin et al., 2025, 2026), we propose QProtFuse (Query-guided multi-layer Protein Feature Fusion) for retrieval-augmented protein function prediction. QProtFuse leverages the query to adaptively assign layer-wise weights and fuse multi-layer features. To optimize this fusion, we propose a dual-objective contrastive learning framework that couples an intra-modal protein-to-protein objective with an inter-modal protein-to-annotation objective. These two objectives are mutually reinforcing and jointly enable both protein and annotation retrieval during inference, thereby broadening the applicability of QProtFuse. On Prot-Inst-OOD, QProtFuse achieves superior protein and annotation retrieval performance compared with all baselines, reaching a Recall@1 of 16.4% and Recall@10 of 25.9% with our reranking configuration. These retrieval gains improve downstream function descriptions, yielding the highest LLM-as-a-judge scores among the evaluated methods, with 6.22/10 on Qwen3-8B and 6.68/10 on DeepSeek-V4-Pro.

Our contributions are summarized as follows:

• We present the first systematic study of multi-layer PLM features for protein retrieval, showing that the best layer varies across tasks and using only final-layer features is suboptimal.

• We propose QProtFuse, which combines query-guided layer fusion with joint protein-to-protein and protein-to-annotation alignment to exploit the internal knowledge of PLMs.

• We achieve SOTA retrieval and RAG-based protein function description performance, demonstrating the value of adaptive layer fusion for protein search and annotation.

References (19)