(*contributed equally to this work) 发布: 2026年09月05日第16卷第17期 DOI: 10.21769/BioProtoc.5816 浏览次数: 44
评审: Anonymous reviewer(s)
Abstract
Antibody (Ab) and nanobody (Nb) humanization is essential for reducing immunogenicity in therapeutic applications. HuDiff is an adaptive autoregressive diffusion approach that generates humanized antibodies and nanobodies from scratch using only complementarity-determining region sequences as input, eliminating the need for preexisting human templates. The method follows a two-stage training pipeline: pretraining on human antibody sequences to learn framework region patterns, followed by fine-tuning on target-species sequences. HuDiff-Ab processes paired heavy and light chains for conventional antibodies, while HuDiff-Nb can incorporate a specialized inpainting mode to preserve critical nanobody framework residues. This protocol provides a complete step-by-step guide for implementing HuDiff, covering data preparation, model training, and sequence generation.
Key features
• Requires only CDR sequences as input and does not require human template selection.
• Uses a two-stage training strategy, with pretraining on human antibody sequences and fine-tuning on target-species sequences guided by humanness scores.
• HuDiff-Ab humanizes paired heavy and light chains simultaneously, whereas HuDiff-Nb provides an inpainting mode to preserve key framework residues.
• Generates multiple diverse humanized candidates for downstream experimental screening.
Keywords: HumanizationGraphical overview
Graphical overview of the humanization and 3D structure prediction pipeline. The antibody and nanobody are humanized using HuDiff-Ab and HuDiff-Nb, respectively. Both resulting humanized constructs are modeled by AlphaFold2 to obtain their 3D structures. Antibodies and nanobodies are processed by their corresponding models to generate humanized antibodies and nanobodies. The humanized portions are the red parts in the middle of the antibody and nanobody diagrams. Then, AlphaFold is used to generate their 3D structures.
Background
Monoclonal antibodies and nanobodies derived from non-human sources, such as rodents and camelids, are widely used in research and therapy due to their high specificity and affinity. However, their clinical application is often limited by immunogenicity, as the human immune system may recognize these foreign proteins and trigger anti-drug antibody responses, such as human anti-mouse antibody (HAMA) reaction [1]. Such responses can reduce drug efficacy and cause adverse effects, highlighting the necessity of reducing immunogenicity through humanization while preserving antigen-binding activity.
Traditional humanization methods, particularly complementarity-determining region (CDR) grafting, involve transplanting the CDRs from a non-human antibody onto a human framework template. This approach is labor-intensive and often requires back-mutations to maintain structural integrity and binding affinity [2]. The success of this strategy depends strongly on the availability of suitable human frameworks and, in many cases, prior structural knowledge. Compared to template-based methods (e.g., CDR grafting), HuDiff [3] eliminates manual template selection and back-mutations. Unlike structure-based approaches (e.g., AbAdapt), HuDiff does not require 3D structures. Compared to sequence-based tools like Sapiens or AbNatiV, HuDiff generates full sequences rather than scoring existing ones, enabling de novo humanization.
Computational approaches have been developed to address these limitations. Structure-based methods rely on three-dimensional models to guide residue selection but are computationally demanding. More recent machine learning tools such as Sapiens, Llamanade, and AbNatiV leverage large-scale sequence data to predict humanness and guide humanization [4]. While these methods improve efficiency, many still depend on preexisting human frameworks or require structural modeling. Nanobodies, the variable domains of camelid heavy-chain antibodies, offer advantages including small size and high stability [5]. However, their humanization presents additional challenges, as certain framework residues critical for stability must be preserved.
HuDiff is a template-free generative approach based on autoregressive diffusion models. Without requiring human templates, it generates humanized antibodies or nanobodies by reconstructing humanized framework regions using only CDR sequences as input [3]. Here, we provide a step-by-step protocol for humanizing antibodies and nanobodies using HuDiff.
Software and datasets
| Type | Software/dataset/resource | Version | Date | License | Access |
|---|---|---|---|---|---|
| Software | Ubuntu | 22.04 LTS | 2022 | Open-source | Free |
| Software | Python | 3.9 | 2020 | Open-source | Free |
| Software | PyTorch | 1.13.0 | 2022 | BSD-3-Clause | Free |
| Software | CUDA Toolkit | 11.6 | 2022 | NVIDIA End User License Agreement | Free |
| Software | abnumber | 1.0.0 | 2024 | MIT | Free |
| Software | pandas | 1.5.3 | 2022 | BSD-3-Clause | Free |
| Software | scikit-learn | 1.2.0 | 2022 | BSD-3-Clause | Free |
| Software | HuDiff source code repository | V1 | 2025 | MIT | Free (https://github.com/TencentAI4S/HuDiff) (https://doi.org/10.5281/zenodo.16974296) |
| Software | AlphaFold2 (ColabFold) | 2.3.0 | 2021 | Apache-2.0 | Free |
| Software | pymol-open-source | 2.5 | — | BSD-3-Clause | Free |
| Software | AbNatiV | 1.0 | 2024 | GPL-3.0 | Free (https://gitlab.developers.cam.ac.uk/ch/sormanni/abnativ) |
| Dataset | HuDiff release dataset | V1 | 2025-03-15 | CC BY 4.0 | Free (https://huggingface.co/cloud77/HuDiff/resolve/main/release_data_dir.tar.gz) |
Note: AbNatiV installation requires the environment.yml file provided in the GitLab repository.

Figure 1. Architecture diagram of HuDiff. HuDiff-Ab architecture: In the pretraining stage, the model receives paired human heavy and light chain sequences with random masking in the framework (FR) regions. These sequences sequentially pass through dual convolutional neural network (CNN) blocks and RoFormer blocks to output the amino acid probabilities for the masked positions. In the fine-tuning stage, the model processes paired mouse heavy and light chain sequences with random FR masking, similarly utilizing the dual CNN and RoFormer blocks to predict the amino acid probabilities. HuDiff-Nb architecture: In the pretraining stage, the model takes human antibody heavy chain sequences with random FR masking as input. These sequences pass through a single CNN block and a RoFormer block to output the amino acid probabilities for the masked positions. In the fine-tuning stage, the model processes nanobody sequences with random FR masking, employing the same single CNN and RoFormer block architecture to generate the probability outputs. RoFormer: Rotary Transformer. N: number of layers in the neural network.
Procedure
登录/注册后免费查看全文
文章信息
稿件历史记录
提交日期: Apr 9, 2026
接收日期: Jul 2, 2026
在线发布日期: Aug 24, 2026
出版日期: Sep 5, 2026
版权信息
© 2026 The Author(s); This is an open access article under the CC BY-NC license (https://creativecommons.org/licenses/by-nc/4.0/).
如何引用
Nan, Y., Sun, H., Zhang, B., Yang, Y., He, J. and Bai, Q. (2026). Humanizing Antibodies and Nanobodies From Scratch With HuDiff. Bio-protocol 16(17): e5816. DOI: 10.21769/BioProtoc.5816.
分类
生物信息学与计算生物学
生信
您对这篇实验方案有问题吗?
在此处发布您的问题,我们将邀请本文作者来回答。同时,我们会将您的问题发布到Bio-protocol Exchange,以便寻求社区成员的帮助。
Share
Bluesky
X
Copy link

