Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Article
  • Published:

An adaptive autoregressive diffusion approach to design active humanized antibodies and nanobodies

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

Buy this article

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: Diffusion process and model architecture.
Fig. 2: Humanization process and performance of HuDiff-Ab model.
Fig. 3: Humanness and binding affinity of humanized antibodies.
Fig. 4: Humanization process and performance of HuDiff-Nb model.
Fig. 5: Humanness and validation of humanized 3-2A2-4 nanobodies.
Fig. 6: Humanness and binding affinity of humanized hC3Nb3 nanobodies.

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

  1. Davies, D. R. & Chacko, S. Antibody structure. Acc. Chem. Res. 26, 421–427 (1993).

    Article  Google Scholar 

  2. 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).

  3. Goldsby, R. A. Immunology (Macmillan, 2003).

  4. 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).

  5. Lu, R.-M. et al. Development of therapeutic antibodies for the treatment of diseases. J. Biomed. Sci. 27, 1 (2020).

    Article  Google Scholar 

  6. Wu, Q., Yang, S., Liu, J., Jiang, D. & Wei, W. Antibody theranostics in precision medicine. Med 4, 69–74 (2023).

    Article  Google Scholar 

  7. 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).

    Article  Google Scholar 

  8. Jovčevska, I. & Muyldermans, S. The therapeutic potential of nanobodies. BioDrugs 34, 11–26 (2020).

    Article  Google Scholar 

  9. Bannas, P., Hambach, J. & Koch-Nolte, F. Nanobodies and nanobody-based human heavy chain antibodies as antitumor therapeutics. Front. Immunol. 8, 309808 (2017).

    Article  Google Scholar 

  10. Wesolowski, J. et al. Single domain antibodies: promising experimental and therapeutic tools in infection and immunity. Med. Microbiol. Immunol. 198, 157–174 (2009).

    Article  Google Scholar 

  11. Salvador, J.-P., Vilaplana, L. & Marco, M.-P. Nanobody: outstanding features for diagnostic and therapeutic applications. Anal. Bioanal. Chem. 411, 1703–1713 (2019).

    Article  Google Scholar 

  12. Kaneko, Y. & Takeuchi, T. Targeted antibody therapy and relevant novel biomarkers for precision medicine for rheumatoid arthritis. Int. Immunol. 29, 511–517 (2017).

    Article  Google Scholar 

  13. Garattini, L. & Padula, A. Precision medicine and monoclonal antibodies: breach of promise? Croat. Med. J. 60, 284 (2019).

    Article  Google Scholar 

  14. Klee, G. G. Human anti-mouse antibodies. Arch. Pathol. Lab. Med. 124, 921–923 (2000).

    Article  Google Scholar 

  15. 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).

    Article  Google Scholar 

  16. Almagro, J. C. & Fransson, J. Humanization of antibodies. Front. Biosci. 13, 1619–33 (2008).

    Google Scholar 

  17. Presta, L. G. Antibody engineering. Curr. Opin. Struct. Biol. 2, 593–596 (1992).

    Article  Google Scholar 

  18. Jolliffe, L. K. Humanized antibodies: enhancing therapeutic utility through antibody engineering. Int. Rev. Immunol. 10, 241–250 (1993).

    Article  Google Scholar 

  19. Vaswani, S. K. & Hamilton, R. G. Humanized antibodies as potential therapeutic drugs. Ann. Allergy Asthma Immunol. 81, 105–119 (1998).

    Article  Google Scholar 

  20. Co, M. S. et al. Chimeric and humanized antibodies with specificity for the CD33 antigen. J. Immunol. 148, 1149–1154 (1992).

    Article  Google Scholar 

  21. Katoh, M., Tateno, C., Yoshizato, K. & Yokoi, T. Chimeric mice with humanized liver. Toxicology 246, 9–17 (2008).

    Article  Google Scholar 

  22. 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).

  23. Winter, G. & Harris, W. J. Humanized antibodies. Immunol. Today 14, 243–246 (1993).

    Article  Google Scholar 

  24. 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).

  25. Hu, W.-G., Yin, J., Chau, D., Hu, C. C. & Cherwonogrodzky, J. W. in Ricin Toxin (ed. Cherwonogrodzky, J. W.) 159 (Bentham Science, 2014).

  26. 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).

    Article  Google Scholar 

  27. Safdari, Y., Farajnia, S., Asgharzadeh, M. & Khalili, M. Antibody humanization methods–a review and update. Biotechnol. Genet. Eng. Rev. 29, 175–186 (2013).

    Article  Google Scholar 

  28. Kashmiri, S. V., De Pascalis, R., Gonzales, N. R. & Schlom, J. SDR grafting-a new approach to antibody humanization. Methods 36, 25–34 (2005).

    Article  Google Scholar 

  29. 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).

  30. 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).

    Article  Google Scholar 

  31. 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).

  32. 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).

    Article  Google Scholar 

  33. 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).

    Article  Google Scholar 

  34. 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).

    Article  Google Scholar 

  35. Tennenhouse, A. et al. Computational optimization of antibody humanness and stability by systematic energy-based ranking. Nat. Biomed. Eng. 8, 30–44 (2024).

    Article  Google Scholar 

  36. Sang, Z., Xiang, Y., Bahar, I. & Shi, Y. Llamanade: an open-source computational pipeline for robust nanobody humanization. Structure 30, 418–429 (2022).

    Article  Google Scholar 

  37. Ramon, A. Assessing antibody and nanobody nativeness for hit selection and humanization with AbNatiV. Nat. Mach. Intell. 6, 74–91 (2024).

    Article  Google Scholar 

  38. Thullier, P., Huish, O., Pelat, T. & Martin, A. C. The humanness of macaque antibody sequences. J. Mol. Biol. 396, 1439–1450 (2010).

    Article  Google Scholar 

  39. Gao, S. H., Huang, K., Tu, H. & Adler, A. S. Monoclonal antibody humanness score and its applications. BMC Biotechnol. 13, 55 (2013).

    Article  Google Scholar 

  40. Abhinandan, K. & Martin, A. C. Analyzing the ‘degree of humanness’ of antibody sequences. J. Mol. Biol. 369, 852–862 (2007).

    Article  Google Scholar 

  41. 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).

    Article  Google Scholar 

  42. 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).

  43. 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).

  44. Bian, T. et al. Hierarchical graph latent diffusion model for molecule generation. Preprint at OpenReview https://openreview.net/forum?id=RSincg5RBe (2024).

  45. Abramson, J. et al. Accurate structure prediction of biomolecular interactions with AlphaFold 3. Nature 630, 493–500 (2024).

    Article  Google Scholar 

  46. Lisanza, S. L. et al. Multistate and functional protein design using RoseTTAFold sequence space diffusion. Nat. Biotechnol. 43, 1288–1298 (2025).

    Article  Google Scholar 

  47. Watson, J. L. et al. De novo design of protein structure and function with RFdiffusion. Nature 620, 1089–1100 (2023).

    Article  Google Scholar 

  48. Baek, M. et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science 373, 871–876 (2021).

    Article  Google Scholar 

  49. 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).

  50. 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).

  51. Hoogeboom, E. et al. Autoregressive diffusion models. In International Conference on Learning Representations (ICLR, 2022) https://openreview.net/forum?id=Lm8T39vLDTE (ICLR, 2022).

  52. 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).

  53. 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).

    Article  Google Scholar 

  54. Lan, J. et al. Structure of the SARS-CoV-2 spike receptor-binding domain bound to the ACE2 receptor. Nature 581, 215–220 (2020).

    Article  Google Scholar 

  55. 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).

    Article  Google Scholar 

  56. Burbach, S. M. & Briney, B. Improving antibody language models with native pairing. Patterns 5, 100967 (2024).

    Article  Google Scholar 

  57. 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).

    Article  Google Scholar 

  58. 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).

    Article  Google Scholar 

  59. Lefranc, M.-P. et al. IMGT, the international ImMunoGeneTics information system. Nucleic Acids Res. 37, D1006–D1012 (2009).

    Article  Google Scholar 

  60. 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).

    Article  Google Scholar 

  61. Errico, J. M. et al. Structural mechanism of SARS-CoV-2 neutralization by two murine antibodies targeting the RBD. Cell Rep. 37, 109882 (2021).

    Article  Google Scholar 

  62. Kovaltsuk, A. et al. Observed Antibody Space: a resource for data mining next-generation sequencing of antibody repertoires. J. Immunol. 201, 2502–2509 (2018).

    Article  Google Scholar 

  63. 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).

    Article  Google Scholar 

  64. 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).

  65. Webb, B. & Sali, A. Comparative protein structure modeling using modeller. Curr. Protoc. Bioinforma. 54, 5–6 (2016).

    Article  Google Scholar 

  66. Dunbar, J. & Deane, C. M. Anarci: antigen receptor numbering and receptor classification. Bioinformatics 32, 298–300 (2016).

    Article  Google Scholar 

  67. Levenshtein, V. Binary codes capable of correcting deletions, insertions, and reversals. Proc. Soviet Physics Doklady 10, 707–710 (1966).

    MathSciNet  Google Scholar 

  68. 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).

  69. 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).

  70. 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).

    Article  Google Scholar 

  71. Ma, J. et al. HuDiff. Zenodo https://doi.org/10.5281/zenodo.16974296 (2025).

Download references

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

Correspondence to Qifeng Bai, Junyu Xiao or Jianhua Yao.

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.

Source data

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.

Extended Data Table 1 Comparison of humanness performance across methods on diverse public test datasets

Supplementary information

Supplementary Information

Supplementary Discussion, Figs. 1–9 and Tables 1–4.

Reporting Summary

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1038/s42256-025-01120-9

Search

Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing