Uppsats

Uppgiftsanpassning av LLM:er för programvarutillförlitlighet

Master-uppsats

Jönköping University/Jönköping AI Lab (JAIL)

Publicerad: 2025

Språk: Svenska

Sammanfattning

Detecting memory leaks in C programs remains a persistent and critical challenge. It is particularly applicable in systems that rely on complex libraries such as GLib and GStreamer. These libraries introduce unique memory ownership patterns and lifecycle rules that traditional analysis tools often fail to interpret correctly. Static analysis tools may miss tiny leaks or generate False Positives (FP) due to limited contextual understanding. Dynamic tools like Valgrind are having significant runtime overhead and are not suitable for all development environments. To address these challenges, this thesis proposes a hybrid memory leak detection system that explores the capabilities of Large Language model (LLM). The system combines two key strategies. A Low-Rank Adaptation (LoRA), a Parameter Efficient Fine- Tuning Technique (PEFT) that adapts the LLM using a small, task-specific dataset and Retrieval- Augmented Generation (RAG), which provides the model with external, domain-specific knowledge during inference. Together, these techniques allow the model to analyze memory safety both from learned examples and relevant documentation. An uncertainty scoring mechanism is also introduced to control the influence of LoRA based on how reliable the retrieved context is. If the external documentation is well-matched, the model relies more on it; if it is uncertain or incomplete, the model falls back on its fine-tuned knowledge. This adaptive approach helps to improve accuracy and reduces the risk of false predictions or hallucinations. The system was evaluated on a dataset of C code examples involving GLib and GStreamer. Comparative results show that the combination of LoRA and RAG, guided by uncertainty scoring, significantly outperforms baseline models in terms of accuracy, recall and precision. The proposed solution is not only lightweight and efficient but also explainable and suitable for integration into development workflows such as code reviews or Continuous Integration (CI)pipelines.

Information

Lärosäte / institution
Jönköping University/Jönköping AI Lab (JAIL)
Publiceringsdatum
2025
Uppsatstyp
Master-uppsats
Språk
Svenska

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.