Evaluating the Use of LLMs for Documentation to Code Traceability
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) offer new potential for automating documentation-to-code traceability, yet their capabilities remain underexplored. We present a comprehensive evaluation of LLMs (Claude 3.5 Sonnet, GPT-4o, and o3-mini) in establishing trace links between various software documentation (including API references and user guides) and source code. We create two novel datasets from two open-source projects (Unity Catalog and Crawl4AI). Through systematic experiments, we assess three key capabilities: (1) trace link identification accuracy, (2) relationship explanation quality, and (3) multi-step chain reconstruction. Results show that the best-performing LLM achieves F1-scores of 79.4% and 80.4% across the two datasets, substantially outperforming our baselines (TF-IDF, BM25, and CodeBERT). While fully correct relationship explanations range from 42.9% to 71.1%, partial accuracy exceeds 97%, indicating that fundamental connections are rarely missed. For multi-step chains, LLMs maintain high endpoint accuracy but vary in capturing precise intermediate links. Error analysis reveals that many false positives stem from naming-based assumptions, phantom links, or overgeneralization of architectural patterns. We demonstrate that task-framing, such as a one-to-many matching strategy, is critical for performance. These findings position LLMs as powerful assistants for trace discovery, but their limitations could necessitate human-in-the-loop tool design and highlight specific error patterns for future research.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 19 of its 91 references that are in the map. First posted on arXiv 19 Jun 2025.
Builds on
19 of 91 references.
References · 19
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023Using an LLM to Help With Code Understandingcited by 228
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 153
- 2024Leave No Document Behind: Benchmarking Long-Context LLMs with Extended Multi-Doc QAcited by 122
- 2024Concise Thoughts: Impact of Output Length on LLM Reasoning and Costcited by 109
- 2023Towards an Understanding of Large Language Models in Software Engineering Taskscited by 68
- 2025Can LLMs Replace Human Evaluators? An Empirical Study of LLM-as-a-Judge in Software Engineeringcited by 67
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 42
- 2018The Impact of Automated Parameter Optimization on Defect Prediction Modelscited by 38
7 more
- 2022Automatic Code Documentation Generation Using GPT-3cited by 37
- 2023A Comparative Analysis of Large Language Models for Code Documentation Generationcited by 24
- 2018Semantically Enhanced Software Traceability Using Deep Learning Techniquescited by 22
- 2024Leveraging Graph-RAG and Prompt Engineering to Enhance LLM-Based Automated Requirement Traceability and Compliance Checkscited by 6
- 2018Automatic Traceability Maintenance via Machine Learning Classificationcited by 5
- 2022Detecting Outdated Code Element References in Software Repository Documentationcited by 5
- 2024Towards identifying and minimizing customer-facing documentation debtcited by 1
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.