Domain-Aware Reasoning with Lightweight Models via Knowledge Distillation

dc.contributor.authorRadovac, Rikard
dc.contributor.authorRönnewall, Carolina
dc.contributor.departmentChalmers tekniska högskola / Institutionen för data och informationstekniksv
dc.contributor.departmentChalmers University of Technology / Department of Computer Science and Engineeringen
dc.contributor.examinerDubhashi, Devdatt
dc.contributor.supervisorJohansson, Rickard
dc.date.accessioned2025-12-02T12:47:16Z
dc.date.issued2025
dc.date.submitted
dc.description.abstractLarge Language Models (LLMs) offer powerful reasoning capabilities but their computational demands often hinder deployment in domain-specific applications like cybersecurity. This thesis investigates the efficacy of knowledge distillation for transferring advanced reasoning from a large teacher model (DeepSeek-R1) to a lightweight student model (Meta-Llama-3.1-8B-Instruct) within a Retrieval-Augmented Generation (RAG) framework for cybersecurity intelligence. Using a dataset of real-world queries and RAG-retrieved context, the student model was fine-tuned via Supervised Fine-Tuning (SFT) on the teacher’s generated reasoning chains, employing Parameter-Efficient Fine-Tuning (PEFT) with Low-Rank Adaptation (LoRA). Comprehensive evaluation, incorporating both AI-assisted analysis and blind domainexpert assessments, demonstrated that the distilled model significantly outperformed both the existing production RAG system at Recorded Future and its base Meta- Llama-3.1-8B-Instruct model. The distilled model exhibited superior contextual accuracy, a marked reduction in hallucinations, and higher overall response quality. This research successfully validates knowledge distillation as a potent strategy for creating computationally efficient, yet highly capable, domain-aware reasoning models, offering a practical pathway to enhance AI-driven solutions in specialized fields.
dc.identifier.coursecodeDATX05
dc.identifier.urihttp://hdl.handle.net/20.500.12380/310787
dc.language.isoeng
dc.relation.ispartofseriesCSE 25-79
dc.setspec.uppsokTechnology
dc.subjectComputer, science, computer science, engineering, project, thesis, Retrieval- Augmented Generation, RAG, Knowledge Distillation, Lightweight Language Models, Cybersecurity, Natural Language Processing, NLP, Reasoning Chains
dc.titleDomain-Aware Reasoning with Lightweight Models via Knowledge Distillation
dc.type.degreeExamensarbete för masterexamensv
dc.type.degreeMaster's Thesisen
dc.type.uppsokH
local.programmeData science and AI (MPDSC), MSc

Ladda ner

Original bundle

Visar 1 - 1 av 1
Hämtar...
Bild (thumbnail)
Namn:
CSE 25-79 RR CR.pdf
Storlek:
1.52 MB
Format:
Adobe Portable Document Format

License bundle

Visar 1 - 1 av 1
Hämtar...
Bild (thumbnail)
Namn:
license.txt
Storlek:
2.35 KB
Format:
Item-specific license agreed upon to submission
Beskrivning: