DAInfer+: Neurosymbolic Inference of API Specifications from Documentation via Embedding Models

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Masoudian, Maryam, Zhou, Anshunkang, Wang, Chengpeng, Zhang, Charles
Formato: Preprint
Publicado: 2026
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866918416743399424
author Masoudian, Maryam
Zhou, Anshunkang
Wang, Chengpeng
Zhang, Charles
author_facet Masoudian, Maryam
Zhou, Anshunkang
Wang, Chengpeng
Zhang, Charles
contents Modern software systems heavily rely on various libraries, which require understanding the API semantics in static analysis. However, summarizing API semantics remains challenging due to complex implementations or unavailable library code. This paper presents DAInfer+, a novel approach for inferring API specifications from library documentation. We employ Natural Language Processing (NLP) to interpret informal semantic information provided by the documentation, which enables us to reduce the specification inference to an optimization problem. Specifically, we investigate the effectiveness of sentence embedding models and Large Language Models (LLMs) in deriving memory operation abstractions from API descriptions. These abstractions are used to retrieve data-flow and aliasing relations to generate comprehensive API specifications. To solve the optimization problem efficiently, we propose neurosymbolic optimization, yielding precise data-flow and aliasing specifications. Our evaluation of popular Java libraries shows that zero-shot sentence embedding models outperform few-shot prompted LLMs in robustness, capturing fine-grained semantic nuances more effectively. While our initial attempts using two-stage LLM prompting yielded promising results, we found that the embedding-based approach proved superior. Specifically, these models achieve over 82% recall and 85% precision for data-flow inference and 88% recall and 79% precision for alias relations, all within seconds. These results demonstrate the practical value of DAInfer+ in library-aware static analysis.
format Preprint
id arxiv_https___arxiv_org_abs_2603_28060
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle DAInfer+: Neurosymbolic Inference of API Specifications from Documentation via Embedding Models
Masoudian, Maryam
Zhou, Anshunkang
Wang, Chengpeng
Zhang, Charles
Software Engineering
D.2.3; D.2.5; H.3.7
Modern software systems heavily rely on various libraries, which require understanding the API semantics in static analysis. However, summarizing API semantics remains challenging due to complex implementations or unavailable library code. This paper presents DAInfer+, a novel approach for inferring API specifications from library documentation. We employ Natural Language Processing (NLP) to interpret informal semantic information provided by the documentation, which enables us to reduce the specification inference to an optimization problem. Specifically, we investigate the effectiveness of sentence embedding models and Large Language Models (LLMs) in deriving memory operation abstractions from API descriptions. These abstractions are used to retrieve data-flow and aliasing relations to generate comprehensive API specifications. To solve the optimization problem efficiently, we propose neurosymbolic optimization, yielding precise data-flow and aliasing specifications. Our evaluation of popular Java libraries shows that zero-shot sentence embedding models outperform few-shot prompted LLMs in robustness, capturing fine-grained semantic nuances more effectively. While our initial attempts using two-stage LLM prompting yielded promising results, we found that the embedding-based approach proved superior. Specifically, these models achieve over 82% recall and 85% precision for data-flow inference and 88% recall and 79% precision for alias relations, all within seconds. These results demonstrate the practical value of DAInfer+ in library-aware static analysis.
title DAInfer+: Neurosymbolic Inference of API Specifications from Documentation via Embedding Models
topic Software Engineering
D.2.3; D.2.5; H.3.7
url https://arxiv.org/abs/2603.28060