Abstract
Humanization is a critical process in designing antibodies and nanobodies for clinical trials. Developing widely recognized deep learning frameworks for this task remains valuable yet challenging. Here, inspired by the success of diffusion models, we introduce HuDiff, an adaptive diffusion approach for humanizing antibodies and nanobodies from scratch, referred to as HuDiff-Ab and HuDiff-Nb. This approach initiates humanization exclusively with complementarity-determining region sequences, eliminating the need for humanized templates. On public benchmarks, HuDiff-Ab generates humanized antibodies that more closely resemble experimentally humanized sequences than existing models. Similarly, HuDiff-Nb produces nanobodies with higher humanness scores and nativeness than alternative methods. We apply HuDiff to humanize a murine antibody targeting the SARS-CoV-2 receptor-binding domain and two alpaca-derived nanobodies, one targeting the receptor-binding domain and the other targeting the C345c domain of C3. Bio-layer interferometry shows the best-performing humanized antibody retains binding affinity comparable to the parental antibody (0.15 nM versus 0.12 nM). Both humanized nanobodies maintain binding to their respective antigens, with the best-performing one exhibiting a substantially enhanced affinity (2.52 nM versus 5.47 nM), corresponding to a 54% improvement over the parental nanobody. Neutralization assays confirm that the humanized sequences effectively neutralize the virus. These results demonstrate that HuDiff improves antibody and nanobody humanness while preserving or enhancing binding and function.
This is a preview of subscription content, access via your institution
Access options
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our best-value online-access subscription
$32.99 / 30 days
cancel any time
Subscribe to this journal
Receive 12 digital issues and online access to articles
$119.00 per year
only $9.92 per issue
Buy this article
- Purchase on SpringerLink
- Instant access to full article PDF
Prices may be subject to local taxes which are calculated during checkout






Similar content being viewed by others
Data availability
All unprocessed sequences from the OAS database are available at https://opig.stats.ox.ac.uk/webapps/oas/. The PLAbDab database can be accessed at https://opig.stats.ox.ac.uk/webapps/plabdab/, and the ABSD database is available at https://absd.pasteur.cloud/about. All preprocessed datasets for training models, along with model checkpoints, are accessible at https://huggingface.co/cloud77/HuDiff. The Sapiens model can be obtained from the GitHub at https://github.com/Merck/BioPhi. Humatch can be obtained from GitHub at https://github.com/oxpig/Humatch. Llamanade can be obtained from GitHub at https://github.com/sangzhe/Llamanade. AbNatiV can be obtained from GitLab at https://gitlab.developers.cam.ac.uk/ch/sormanni/abnativ. Source data are provided with this paper.
Code availability
The implementation of our proposed humanization framework, including the model architecture, training procedures and evaluation scripts, is publicly available at https://github.com/TencentAI4S/HuDiff (ref. 71) to support transparency, reproducibility and further research.
References
Davies, D. R. & Chacko, S. Antibody structure. Acc. Chem. Res. 26, 421–427 (1993).
Stanfield, R. L. & Wilson, I. A. Antibody structure. in Antibodies for Infectious Diseases (eds Crowe, J. E., Boraschi, D. & Rappuoli, R.) 49–62 (ASM Press, 2015).
Goldsby, R. A. Immunology (Macmillan, 2003).
Waldmann, H. Human monoclonal antibodies: the benefits of humanization. in Human Monoclonal Antibodies Methods in Molecular Biology, vol. 1904 (ed Steinitz, M.) 1–10 (Humana Press, 2019).
Lu, R.-M. et al. Development of therapeutic antibodies for the treatment of diseases. J. Biomed. Sci. 27, 1 (2020).
Wu, Q., Yang, S., Liu, J., Jiang, D. & Wei, W. Antibody theranostics in precision medicine. Med 4, 69–74 (2023).
Vincke, C. et al. General strategy to humanize a camelid single-domain antibody and identification of a universal humanized nanobody scaffold. J. Biol. Chem. 284, 3273–3284 (2009).
Jovčevska, I. & Muyldermans, S. The therapeutic potential of nanobodies. BioDrugs 34, 11–26 (2020).
Bannas, P., Hambach, J. & Koch-Nolte, F. Nanobodies and nanobody-based human heavy chain antibodies as antitumor therapeutics. Front. Immunol. 8, 309808 (2017).
Wesolowski, J. et al. Single domain antibodies: promising experimental and therapeutic tools in infection and immunity. Med. Microbiol. Immunol. 198, 157–174 (2009).
Salvador, J.-P., Vilaplana, L. & Marco, M.-P. Nanobody: outstanding features for diagnostic and therapeutic applications. Anal. Bioanal. Chem. 411, 1703–1713 (2019).
Kaneko, Y. & Takeuchi, T. Targeted antibody therapy and relevant novel biomarkers for precision medicine for rheumatoid arthritis. Int. Immunol. 29, 511–517 (2017).
Garattini, L. & Padula, A. Precision medicine and monoclonal antibodies: breach of promise? Croat. Med. J. 60, 284 (2019).
Klee, G. G. Human anti-mouse antibodies. Arch. Pathol. Lab. Med. 124, 921–923 (2000).
Tjandra, J. J., Ramadi, L. & McKenzie, I. F. Development of human anti-murine antibody (HAMA) response in patients. Immunol. Cell Biol. 68, 367–376 (1990).
Almagro, J. C. & Fransson, J. Humanization of antibodies. Front. Biosci. 13, 1619–33 (2008).
Presta, L. G. Antibody engineering. Curr. Opin. Struct. Biol. 2, 593–596 (1992).
Jolliffe, L. K. Humanized antibodies: enhancing therapeutic utility through antibody engineering. Int. Rev. Immunol. 10, 241–250 (1993).
Vaswani, S. K. & Hamilton, R. G. Humanized antibodies as potential therapeutic drugs. Ann. Allergy Asthma Immunol. 81, 105–119 (1998).
Co, M. S. et al. Chimeric and humanized antibodies with specificity for the CD33 antigen. J. Immunol. 148, 1149–1154 (1992).
Katoh, M., Tateno, C., Yoshizato, K. & Yokoi, T. Chimeric mice with humanized liver. Toxicology 246, 9–17 (2008).
Lo, B. K. C. Antibody humanization by CDR grafting. in Antibody Engineering Methods in Molecular Biology vol. 248 (ed Lo, B. K. C.) 135–159 (Humana Press, 2004).
Winter, G. & Harris, W. J. Humanized antibodies. Immunol. Today 14, 243–246 (1993).
Williams, D. G., Matthews, D. J. & Jones, T. Humanising antibodies by CDR grafting. in Antibody Engineering Springer Protocols Handbooks (eds Kontermann, R. & Dübel, S.) 319–339 (Springer, 2010).
Hu, W.-G., Yin, J., Chau, D., Hu, C. C. & Cherwonogrodzky, J. W. in Ricin Toxin (ed. Cherwonogrodzky, J. W.) 159 (Bentham Science, 2014).
Choi, Y., Hua, C., Sentman, C. L., Ackerman, M. E. & Bailey-Kellogg, C. Antibody humanization by structure-based computational protein design. MAbs 7, 1045–1057 (2015).
Safdari, Y., Farajnia, S., Asgharzadeh, M. & Khalili, M. Antibody humanization methods–a review and update. Biotechnol. Genet. Eng. Rev. 29, 175–186 (2013).
Kashmiri, S. V., De Pascalis, R., Gonzales, N. R. & Schlom, J. SDR grafting-a new approach to antibody humanization. Methods 36, 25–34 (2005).
Kashmiri, S. V. S, De Pascalis, R. & Gonzales, N. R. Developing a minimally immunogenic humanized antibody by SDR grafting. in Antibody Engineering Methods in Molecular Biology vol. 248 (ed Lo, B. K. C.) 361–376 (Human Press, 2004).
Gonzales, N. R. et al. SDR grafting of a murine antibody using multiple human germline templates to minimize its immunogenicity. Mol. Immunol. 41, 863–872 (2004).
Kim, J. H. & Hong, H. J. Humanization by CDR grafting and specificity-determining residue grafting. in Antibody Engineering Methods in Molecular Biology vol. 907 (ed Chames, P.) 237–245 (Human Press, 2012).
Marks, C., Hummer, A. M., Chin, M. & Deane, C. M. Humanization of antibodies using a machine learning approach on large-scale repertoire data. Bioinformatics 37, 4041–4047 (2021).
Clavero-Álvarez, A., Di Mambro, T., Perez-Gaviro, S., Magnani, M. & Bruscolini, P. Humanization of antibodies using a statistical inference approach. Sci. Rep. 8, 14820 (2018).
Prihoda, D. et al. Biophi: a platform for antibody design, humanization, and humanness evaluation based on natural antibody repertoires and deep learning. MAbs 14, 2020203 (2022).
Tennenhouse, A. et al. Computational optimization of antibody humanness and stability by systematic energy-based ranking. Nat. Biomed. Eng. 8, 30–44 (2024).
Sang, Z., Xiang, Y., Bahar, I. & Shi, Y. Llamanade: an open-source computational pipeline for robust nanobody humanization. Structure 30, 418–429 (2022).
Ramon, A. Assessing antibody and nanobody nativeness for hit selection and humanization with AbNatiV. Nat. Mach. Intell. 6, 74–91 (2024).
Thullier, P., Huish, O., Pelat, T. & Martin, A. C. The humanness of macaque antibody sequences. J. Mol. Biol. 396, 1439–1450 (2010).
Gao, S. H., Huang, K., Tu, H. & Adler, A. S. Monoclonal antibody humanness score and its applications. BMC Biotechnol. 13, 55 (2013).
Abhinandan, K. & Martin, A. C. Analyzing the ‘degree of humanness’ of antibody sequences. J. Mol. Biol. 369, 852–862 (2007).
Wollacott, A. M. et al. Quantifying the nativeness of antibody sequences using long short-term memory networks. Protein Eng. Des. Sel. 32, 347–354 (2019).
Ho, J., Jain, A. & Abbeel, P. Denoising diffusion probabilistic models. In 34th Conference on Neural Information Processing Systems (NeurIPS 2020) https://proceedings.neurips.cc/paper/2020/file/4c5bcfec8584af0d967f1ab10179ca4b-Paper.pdf (NeurIPS, 2020).
Yan, D., Qi, L., Hu, V. T., Yang, M.-H. & Tang, M. Training class-imbalanced diffusion model via overlap optimization. Preprint at https://arxiv.org/abs/2402.10821 (2024).
Bian, T. et al. Hierarchical graph latent diffusion model for molecule generation. Preprint at OpenReview https://openreview.net/forum?id=RSincg5RBe (2024).
Abramson, J. et al. Accurate structure prediction of biomolecular interactions with AlphaFold 3. Nature 630, 493–500 (2024).
Lisanza, S. L. et al. Multistate and functional protein design using RoseTTAFold sequence space diffusion. Nat. Biotechnol. 43, 1288–1298 (2025).
Watson, J. L. et al. De novo design of protein structure and function with RFdiffusion. Nature 620, 1089–1100 (2023).
Baek, M. et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science 373, 871–876 (2021).
Alamdari, S. et al. Protein generation with evolutionary diffusion: sequence is all you need. Preprint at bioRxiv https://doi.org/10.1101/2023.09.11.556673 (2023).
Wang, X. et al. Diffusion language models are versatile protein learners. In Proc. 41st International Conference on Machine Learning (eds Salakhutdinov, R. et al.) 52309–5233 (JMLR, 2024).
Hoogeboom, E. et al. Autoregressive diffusion models. In International Conference on Learning Representations (ICLR, 2022) https://openreview.net/forum?id=Lm8T39vLDTE (ICLR, 2022).
Austin, J., Johnson, D. D., Ho, J., Tarlow, D. & Van Den Berg, R. Structured denoising diffusion models in discrete state-spaces In 35th Conference on Neural Information Processing Systems (NeurIPS 2021) https://proceedings.neurips.cc/paper_files/paper/2021/file/958c530554f78bcd8e97125b70e6973d-Paper.pdf (NeurIPS, 2021).
Li, M. et al. Broadly neutralizing and protective nanobodies against SARS-CoV-2 Omicron subvariants BA.1, BA.2, and BA.4/5 and diverse sarbecoviruses. Nat. Commun. 13, 7957 (2022).
Lan, J. et al. Structure of the SARS-CoV-2 spike receptor-binding domain bound to the ACE2 receptor. Nature 581, 215–220 (2020).
Pedersen, H. et al. A complement C3–specific nanobody for modulation of the alternative cascade identifies the C-terminal domain of C3b as functional in C5 convertase activity. J. Immunol. 205, 2287–2300 (2020).
Burbach, S. M. & Briney, B. Improving antibody language models with native pairing. Patterns 5, 100967 (2024).
Olsen, T. H., Boyles, F. & Deane, C. M. Observed Antibody Space: a diverse database of cleaned, annotated, and translated unpaired and paired antibody sequences. Protein Sci. 31, 141–146 (2022).
Abanades, B. et al. The patent and literature antibody database (PLAbDab): an evolving reference set of functionally diverse, literature-annotated antibody sequences and structures. Nucleic Acids Res. 52, D545–D551 (2024).
Lefranc, M.-P. et al. IMGT, the international ImMunoGeneTics information system. Nucleic Acids Res. 37, D1006–D1012 (2009).
Pavlinkova, G. et al. Effects of humanization and gene shuffling on immunogenicity and antigen binding of anti-TAG-72 single-chain Fvs. Int. J. Cancer 94, 717–726 (2001).
Errico, J. M. et al. Structural mechanism of SARS-CoV-2 neutralization by two murine antibodies targeting the RBD. Cell Rep. 37, 109882 (2021).
Kovaltsuk, A. et al. Observed Antibody Space: a resource for data mining next-generation sequencing of antibody repertoires. J. Immunol. 201, 2502–2509 (2018).
Abanades, B. et al. The Patent and Literature Antibody Database (PLAbDab): an evolving reference set of functionally diverse, literature-annotated antibody sequences and structures. Nucleic Acids Res. 52, D545–D551 (2023).
Hadsund, J. T. et al. nanoBERT: A deep learning model for gene agnostic navigation of the nanobody mutational space. Bioinform. Adv. https://doi.org/10.1093/bioadv/vbae033 (2024).
Webb, B. & Sali, A. Comparative protein structure modeling using modeller. Curr. Protoc. Bioinforma. 54, 5–6 (2016).
Dunbar, J. & Deane, C. M. Anarci: antigen receptor numbering and receptor classification. Bioinformatics 32, 298–300 (2016).
Levenshtein, V. Binary codes capable of correcting deletions, insertions, and reversals. Proc. Soviet Physics Doklady 10, 707–710 (1966).
Jang, E., Gu, S. & Poole, B. Categorical reparametrization with Gumbel–Softmax. In International Conference on Learning Representations (ICLR, 2017) https://openreview.net/forum?id=rkE3y85ee (ICLR, 2017).
Devlin J. et al. BERT: pre-training of deep bidirectional transformers for language understanding. In Proc. 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT 2019) https://doi.org/10.18653/v1/N19-1423 (2019).
Mullis, K. et al. Specific enzymatic amplification of DNA in vitro: the polymerase chain reaction. Cold Spring Harb. Symp. Quant. Biol. 51, 263–273 (1986).
Ma, J. et al. HuDiff. Zenodo https://doi.org/10.5281/zenodo.16974296 (2025).
Acknowledgements
We are grateful to the Tencent AI Lab Rhino-Bird Focused Research Program (Tencent AI Lab grant nos. RBFR2023006 and RBFR2022006) who provides the grants for this manuscript. We also thank W. Zhang, Supercomputing Center of Lanzhou University and Gansu Computation Center for supporting this study. This work was further supported by the National Natural Science Foundation of China (grant no. 32325018).
Author information
Authors and Affiliations
Contributions
J.M.: writing—review and editing, writing—original draft, visualization, validation, resources, methodology, investigation, formal analysis, data curation, conceptualization. F.W.: writing—review and editing, writing—original draft, visualization, validation, supervision, resources, methodology, investigation, formal analysis, data curation, conceptualization. T.X.: writing—review and editing, visualization, validation, resources, methodology, investigation, formal analysis, data curation, conceptualization. S.X.: writing—review and editing, visualization, validation, resources, methodology, formal analysis, data curation, conceptualization. W.L.: writing—review and editing, visualization, validation, resources, methodology, formal analysis, data curation. L.Y.: writing—review and editing, visualization, validation, methodology, formal analysis, data curation. M.Q.: writing—review and editing, methodology, validation, formal analysis, data curation. X.Y.: writing—review and editing, methodology, validation, formal analysis, data curation. Q.B.: writing—review and editing, visualization, validation, supervision, resources, project administration, methodology, investigation, funding acquisition, formal analysis, data curation, conceptualization. J.X.: writing—review and editing, validation, supervision, resources, methodology, investigation, formal analysis, data curation, conceptualization. J.Y.: writing—review and editing, visualization, validation, supervision, resources, project administration, methodology, investigation, formal analysis, data curation, conceptualization.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Machine Intelligence thanks the anonymous reviewers for their contribution to the peer review of this work.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Extended data
Extended Data Fig. 1 Thermostability measurements of the remaining antibodies and nanobodies.
a, Thermal stability profiles of four humanized antibodies compared with the parental 2B04. The melting temperature (Tm) of 2B04 is 68.5 ∘C. Humanized variants 2B04-hAb1.1, 2B04-hAb1.4, and 2B04-hAb1.5 exhibit comparable thermostability, with Tm values of 67.0 ∘C, 67.6 ∘C, and 66.1 ∘C, respectively. The 2B04-hAb1.3 variant displays a lower Tm of 62.8 ∘C. b, Thermal stability profiles of two humanized nanobodies compared with the parental 3-2A2-4. The melting temperature (Tm) of 3-2A2-4 is 56.8 ∘C. Humanized variants 2A2-hNb1.1 and 2A2-hNb1.2 exhibit lower thermostability, with Tm values of 52.9 ∘C and 50.2 ∘C, respectively.
Extended Data Fig. 2 Sequence alignment of humanized 2B04 antibodies.
a, Alignment of the heavy chains of humanized antibodies, with residues in the CDRs highlighted in green. Residues underlined in red represent mutations introduced into the humanized heavy chain relative to the parental antibody heavy chain. The “full-human” sequence was generated using the abnumber Python package. b, Alignment of the light chains of humanized antibodies, with residues in the CDRs highlighted in green. Residues underlined in red indicate mutations introduced into the humanized light chain compared with the parental antibody light chain.
Extended Data Fig. 3 Sequence alignment of humanized nanobodies.
a, Sequence alignment of the parental nanobody 3-2A2-4 and its humanized variants. Residues in the complementarity-determining regions (CDRs) are highlighted in green. Residues in light blue correspond to CDR2, as defined by the Llamanade classification. Key residues preserved through the ‘inp’ sampling method are shown in purple. Red underlined residues indicate mutations introduced in the humanized nanobodies relative to the parental nanobody. b, Sequence alignment of the nanobody hC3Nb3 and its corresponding humanized variant. CDR regions are highlighted in green. The last sequence represents the variant generated using the CDR grafting method.
Extended Data Fig. 4 Structural analysis of two humanized 2B04 variants with distinct binding affinities.
a, The blue cartoon structure represents hAb1.4, which exhibits a binding affinity of 1.03 nM, whereas the green cartoon structure represents hAb1.5, with a binding affinity of 6.37 nM. In hAb1.4, no steric hindrance is observed between residues VAL78 and LEU29. By contrast, in hAb1.5, the bulkier phenyl ring of residue PHE78 induces steric repulsion with LEU29, resulting in a conformational change in CDR1.
Supplementary information
Supplementary Information
Supplementary Discussion, Figs. 1–9 and Tables 1–4.
Source data
Source Data Fig. 3
Statistical source data for Fig. 3.
Source Data Fig. 4
Statistical source data for Fig. 4.
Source Data Fig. 5
Statistical source data for Fig. 5.
Source Data Fig. 6
Statistical source data for Fig. 6.
Source Data Extended Data Fig. 1
Unprocessed temperature melting data.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Ma, J., Wu, F., Xu, T. et al. An adaptive autoregressive diffusion approach to design active humanized antibodies and nanobodies. Nat Mach Intell (2025). https://doi.org/10.1038/s42256-025-01120-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s42256-025-01120-9