{"id":4996,"date":"2024-12-11T22:44:32","date_gmt":"2024-12-11T14:44:32","guid":{"rendered":"https:\/\/mayanknauni.com\/?p=4996"},"modified":"2024-12-11T22:44:32","modified_gmt":"2024-12-11T14:44:32","slug":"experimenting-with-fine-tuning-and-peft-lora-for-threat-modelling-for-cii","status":"publish","type":"post","link":"https:\/\/mayanknauni.com\/?p=4996","title":{"rendered":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII"},"content":{"rendered":"<p data-pm-slice=\"1 1 []\">With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches with Parameter Efficient Fine-Tuning (PEFT), specifically leveraging LoRA (Low-Rank Adaptation), and evaluate the trade-offs in performance versus computational resource usage.<\/p>\n<h3>Overview of the Experiment<\/h3>\n<h4>Threat Model and Objective<\/h4>\n<p>The primary threat model focuses on identifying potential vulnerabilities in Critical Information Infrastructure (CII) by leveraging dialogue-based cybersecurity insights. The goal is to enable accurate, context-aware summarization of threat intelligence reports to support decision-making and incident response.<\/p>\n<p>Initially, the experiment started with a <strong>Retrieval-Augmented Generation (RAG)<\/strong> approach. While RAG performed reasonably well for generating summaries by combining a retriever and generator, it lacked the domain-specific precision needed for CII threat modelling. This limitation prompted an evaluation of full fine-tuning and Parameter Efficient Fine-Tuning (PEFT) approaches to achieve:<\/p>\n<ol start=\"1\" data-spread=\"false\">\n<li>Improved domain adaptation of the FLAN-T5 model.<\/li>\n<li>Optimal balance between computational cost and performance.<\/li>\n<\/ol>\n<h3>Overview of the Experiment<\/h3>\n<h4>Objective<\/h4>\n<p>The experiment aimed to fine-tune FLAN-T5 for cybersecurity threat modelling tasks using two approaches:<\/p>\n<ol start=\"1\" data-spread=\"false\">\n<li><strong>Full Fine-Tuning:<\/strong> Updating all model parameters to optimize for the threat modelling task.<\/li>\n<li><strong>Parameter Efficient Fine-Tuning (PEFT &#8211; LoRA):<\/strong> Updating a subset of parameters using Low-Rank Adaptation to achieve similar performance while using significantly fewer resources.<\/li>\n<\/ol>\n<h4>Tools and Frameworks<\/h4>\n<ul data-spread=\"false\">\n<li><a href=\"https:\/\/aws.amazon.com\/sagemaker\/\"><strong>AWS SageMaker<\/strong><\/a><strong>:<\/strong> Managed service for scalable machine learning.<\/li>\n<li><a><strong>Hugging Face Transformers Library<\/strong><\/a><strong>:<\/strong> For model fine-tuning and evaluation.<\/li>\n<li><strong><a>ROUGE Metrics<\/a><\/strong><em>:<\/em> Evaluation of threat modelling output quality.<\/li>\n<\/ul>\n<h3>Original Model Performance<\/h3>\n<p>Before applying any fine-tuning techniques, the ROUGE metrics for the original FLAN-T5 model were as follows:<\/p>\n<ul data-spread=\"false\">\n<li><strong>ROUGE-1:<\/strong> 23.34<\/li>\n<li><strong>ROUGE-2:<\/strong> 7.60<\/li>\n<li><strong>ROUGE-L:<\/strong> 20.15<\/li>\n<li><strong>ROUGE-Lsum:<\/strong> 20.15<\/li>\n<\/ul>\n<p>These baseline results highlighted the need for fine-tuning to achieve better performance for the specific task of cybersecurity threat modelling.<\/p>\n<h3>Full Fine-Tuning of FLAN-T5<\/h3>\n<h4>Training Data<\/h4>\n<p>For this experiment, the training data consisted of domain-specific threat intelligence reports and dialogue transcripts from cybersecurity incident analysis. These datasets were curated to include:<\/p>\n<ol start=\"1\" data-spread=\"false\">\n<li><strong>Threat Intelligence Reports:<\/strong> Detailed documents covering various cyber threat vectors, vulnerabilities, and mitigation strategies.<\/li>\n<li><strong>Dialogue Transcripts:<\/strong> Contextual discussions from incident response scenarios to help the model adapt to conversational and situational nuances.<\/li>\n<\/ol>\n<p>The combination of structured reports and unstructured dialogue data was designed to improve the model&#8217;s ability to summarize diverse inputs effectively.<\/p>\n<p>One significant challenge encountered during full fine-tuning is <strong>catastrophic forgetting<\/strong>, a phenomenon where the model loses previously learned knowledge as it adapts to a new task. For cybersecurity threat modelling, this can manifest as a degradation in the model&#8217;s ability to generalize or respond to non-specific inputs after fine-tuning. To mitigate this, careful attention was paid to preserving general capabilities while optimizing the model for domain-specific tasks.<\/p>\n<p>In the first phase, I fine-tuned the FLAN-T5 model using traditional methods, updating all its parameters. While the model delivered high-quality outputs, the process required substantial computational power and memory, often necessitating multiple GPUs.<\/p>\n<h4>Results<\/h4>\n<p>The ROUGE metrics for the full fine-tuning approach were as follows:<\/p>\n<ul data-spread=\"false\">\n<li><strong>ROUGE-1:<\/strong> 42.16<\/li>\n<li><strong>ROUGE-2:<\/strong> 18.03<\/li>\n<li><strong>ROUGE-L:<\/strong> 33.84<\/li>\n<li><strong>ROUGE-Lsum:<\/strong> 33.83<\/li>\n<\/ul>\n<p>These results confirmed the potential of FLAN-T5 for cybersecurity threat modelling but highlighted the high resource costs of full fine-tuning.<\/p>\n<h4>When to Use Full Fine-Tuning<\/h4>\n<ul data-spread=\"false\">\n<li><strong>High-Accuracy Applications:<\/strong> When the task demands the highest possible performance, such as critical decision-making systems.<\/li>\n<li><strong>Availability of Resources:<\/strong> When sufficient computational resources (e.g., multiple GPUs) are available to support the training process.<\/li>\n<\/ul>\n<h3>Parameter Efficient Fine-Tuning (PEFT &#8211; LoRA)<\/h3>\n<p>PEFT techniques like LoRA inherently help mitigate catastrophic forgetting by freezing most of the model\u2019s parameters and only updating a smaller subset. This approach ensures that the model retains its general-purpose capabilities while adapting to the specific requirements of cybersecurity threat modelling. By using LoRA, the trade-off between resource efficiency and preserving prior knowledge is more manageable.<\/p>\n<p>In the second phase, I implemented PEFT using the Low-Rank Adaptation (LoRA) technique. Instead of fine-tuning all parameters, LoRA modifies only a small subset of parameters by adding low-rank matrices to freeze the rest of the model. This significantly reduces the computational requirements, making it feasible to train on a single GPU.<\/p>\n<h4>Results<\/h4>\n<p>The ROUGE metrics for the PEFT-LoRA approach were slightly lower but still competitive:<\/p>\n<ul data-spread=\"false\">\n<li><strong>ROUGE-1:<\/strong> 40.81<\/li>\n<li><strong>ROUGE-2:<\/strong> 16.33<\/li>\n<li><strong>ROUGE-L:<\/strong> 32.51<\/li>\n<li><strong>ROUGE-Lsum:<\/strong> 32.49<\/li>\n<\/ul>\n<p>While the performance dipped by a small percentage, the reduction in resource consumption made PEFT-LoRA a compelling alternative.<\/p>\n<h4>When to Use PEFT-LoRA<\/h4>\n<ul data-spread=\"false\">\n<li><strong>Resource-Constrained Environments:<\/strong> When limited computational resources are available.<\/li>\n<li><strong>Rapid Iteration:<\/strong> For quick experimentation and prototyping with minimal infrastructure.<\/li>\n<li><strong>Production Deployment:<\/strong> When the slight performance trade-off is acceptable in exchange for cost and resource efficiency.<\/li>\n<\/ul>\n<h3>Trade-Offs Between Approaches<\/h3>\n<table>\n<tbody>\n<tr>\n<th>Approach<\/th>\n<th>ROUGE-1<\/th>\n<th>ROUGE-2<\/th>\n<th>ROUGE-L<\/th>\n<th>ROUGE-Lsum<\/th>\n<th>Example Use Cases<\/th>\n<\/tr>\n<tr>\n<td>Original Model<\/td>\n<td>23.34<\/td>\n<td>7.60<\/td>\n<td>20.15<\/td>\n<td>20.15<\/td>\n<td>Baseline; useful for testing out-of-the-box capabilities<\/td>\n<\/tr>\n<tr>\n<td>Full Fine-Tuning<\/td>\n<td>42.16<\/td>\n<td>18.03<\/td>\n<td>33.84<\/td>\n<td>33.83<\/td>\n<td>High-stakes applications where accuracy is paramount<\/td>\n<\/tr>\n<tr>\n<td>Parameter Efficient FT<\/td>\n<td>40.81<\/td>\n<td>16.33<\/td>\n<td>32.51<\/td>\n<td>32.49<\/td>\n<td>Cost-effective production systems and rapid iterations<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The table highlights the performance metrics and example scenarios for each approach. Full fine-tuning offers slightly better metrics at the cost of higher resource consumption, whereas PEFT-LoRA balances performance with efficiency.<\/p>\n<h3>Implementation in Jupyter Notebook<\/h3>\n<p>Below is a screenshot of my Jupyter Notebook on AWS SageMaker, showcasing the ROUGE metrics evaluation:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4997\" src=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?resize=1676%2C695&#038;ssl=1\" alt=\"\" width=\"1676\" height=\"695\" srcset=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?w=1676&amp;ssl=1 1676w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?resize=300%2C124&amp;ssl=1 300w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?resize=1024%2C425&amp;ssl=1 1024w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?resize=768%2C318&amp;ssl=1 768w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?resize=1536%2C637&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h3>Key Takeaways<\/h3>\n<ol start=\"1\" data-spread=\"false\">\n<li><strong>Efficiency Matters:<\/strong> PEFT-LoRA is an excellent approach for scenarios with limited computational resources.<\/li>\n<li><strong>Performance Trade-Offs:<\/strong> The marginal drop in performance with PEFT-LoRA is often acceptable for real-world applications.<\/li>\n<li><strong>AWS SageMaker Simplifies Experiments:<\/strong> SageMaker\u2019s integration with Hugging Face models makes it easier to fine-tune and deploy LLMs at scale.<\/li>\n<\/ol>\n<h3>Next Steps<\/h3>\n<p>In future experiments, I plan to explore additional PEFT techniques and investigate their impact on performance and efficiency. Additionally, I aim to evaluate the deployment of these fine-tuned models for real-time threat modelling tasks.<\/p>\n<p>By leveraging AWS SageMaker and Hugging Face\u2019s tools, organizations can build efficient and scalable solutions for cybersecurity threat modelling and beyond.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[79,53],"tags":[156,125,155],"class_list":["post-4996","post","type-post","status-publish","format-standard","hentry","category-artificial-intelligence","category-cyber-security","tag-cii","tag-genai","tag-threat-modelling"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Mayank Nauni\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/mayanknauni.com\/?p=4996\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Cloud Whisperer \u2013 Taming the Digital Dragon\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer\" \/>\n\t\t<meta property=\"og:description\" content=\"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mayanknauni.com\/?p=4996\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2023\/08\/cropped-cropped-Blue-and-Green-Modern-Technology-Logo.png?fit=333%2C342&#038;ssl=1\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2023\/08\/cropped-cropped-Blue-and-Green-Modern-Technology-Logo.png?fit=333%2C342&#038;ssl=1\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-12-11T14:44:32+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-12-11T14:44:32+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer\" \/>\n\t\t<meta name=\"twitter:description\" content=\"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2023\/08\/cropped-cropped-Blue-and-Green-Modern-Technology-Logo.png?fit=333%2C342&amp;ssl=1\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#blogposting\",\"name\":\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer\",\"headline\":\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII\",\"author\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/mayanknauni.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/PEFT.png?fit=1676%2C695&ssl=1\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996\\\/#articleImage\",\"width\":1676,\"height\":695},\"datePublished\":\"2024-12-11T22:44:32+08:00\",\"dateModified\":\"2024-12-11T22:44:32+08:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#webpage\"},\"articleSection\":\"Artificial Intelligence, Cyber Security, CII, GenAI, Threat Modelling\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mayanknauni.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?cat=53#listItem\",\"name\":\"Cyber Security\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?cat=53#listItem\",\"position\":2,\"name\":\"Cyber Security\",\"item\":\"https:\\\/\\\/mayanknauni.com\\\/?cat=53\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#listItem\",\"name\":\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#listItem\",\"position\":3,\"name\":\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?cat=53#listItem\",\"name\":\"Cyber Security\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/#person\",\"name\":\"Mayank Nauni\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8adb58e2795dfce95a74d7fd72c38f682f8514e4545ad8099e86a0a34d736417?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"Mayank Nauni\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/mayanknauni.com\\\/?author=1\",\"name\":\"Mayank Nauni\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8adb58e2795dfce95a74d7fd72c38f682f8514e4545ad8099e86a0a34d736417?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"Mayank Nauni\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#webpage\",\"url\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996\",\"name\":\"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer\",\"description\":\"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\\u2014an instruction-tuned LLM\\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?p=4996#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/?author=1#author\"},\"datePublished\":\"2024-12-11T22:44:32+08:00\",\"dateModified\":\"2024-12-11T22:44:32+08:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/#website\",\"url\":\"https:\\\/\\\/mayanknauni.com\\\/\",\"name\":\"Cloud Whisperer\",\"description\":\"Taming the Digital Dragon\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mayanknauni.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer","description":"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches","canonical_url":"https:\/\/mayanknauni.com\/?p=4996","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/mayanknauni.com\/?p=4996#blogposting","name":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer","headline":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII","author":{"@id":"https:\/\/mayanknauni.com\/?author=1#author"},"publisher":{"@id":"https:\/\/mayanknauni.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2024\/12\/PEFT.png?fit=1676%2C695&ssl=1","@id":"https:\/\/mayanknauni.com\/?p=4996\/#articleImage","width":1676,"height":695},"datePublished":"2024-12-11T22:44:32+08:00","dateModified":"2024-12-11T22:44:32+08:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/mayanknauni.com\/?p=4996#webpage"},"isPartOf":{"@id":"https:\/\/mayanknauni.com\/?p=4996#webpage"},"articleSection":"Artificial Intelligence, Cyber Security, CII, GenAI, Threat Modelling"},{"@type":"BreadcrumbList","@id":"https:\/\/mayanknauni.com\/?p=4996#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mayanknauni.com#listItem","position":1,"name":"Home","item":"https:\/\/mayanknauni.com","nextItem":{"@type":"ListItem","@id":"https:\/\/mayanknauni.com\/?cat=53#listItem","name":"Cyber Security"}},{"@type":"ListItem","@id":"https:\/\/mayanknauni.com\/?cat=53#listItem","position":2,"name":"Cyber Security","item":"https:\/\/mayanknauni.com\/?cat=53","nextItem":{"@type":"ListItem","@id":"https:\/\/mayanknauni.com\/?p=4996#listItem","name":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mayanknauni.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mayanknauni.com\/?p=4996#listItem","position":3,"name":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII","previousItem":{"@type":"ListItem","@id":"https:\/\/mayanknauni.com\/?cat=53#listItem","name":"Cyber Security"}}]},{"@type":"Person","@id":"https:\/\/mayanknauni.com\/#person","name":"Mayank Nauni","image":{"@type":"ImageObject","@id":"https:\/\/mayanknauni.com\/?p=4996#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/8adb58e2795dfce95a74d7fd72c38f682f8514e4545ad8099e86a0a34d736417?s=96&r=g","width":96,"height":96,"caption":"Mayank Nauni"}},{"@type":"Person","@id":"https:\/\/mayanknauni.com\/?author=1#author","url":"https:\/\/mayanknauni.com\/?author=1","name":"Mayank Nauni","image":{"@type":"ImageObject","@id":"https:\/\/mayanknauni.com\/?p=4996#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/8adb58e2795dfce95a74d7fd72c38f682f8514e4545ad8099e86a0a34d736417?s=96&r=g","width":96,"height":96,"caption":"Mayank Nauni"}},{"@type":"WebPage","@id":"https:\/\/mayanknauni.com\/?p=4996#webpage","url":"https:\/\/mayanknauni.com\/?p=4996","name":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer","description":"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mayanknauni.com\/#website"},"breadcrumb":{"@id":"https:\/\/mayanknauni.com\/?p=4996#breadcrumblist"},"author":{"@id":"https:\/\/mayanknauni.com\/?author=1#author"},"creator":{"@id":"https:\/\/mayanknauni.com\/?author=1#author"},"datePublished":"2024-12-11T22:44:32+08:00","dateModified":"2024-12-11T22:44:32+08:00"},{"@type":"WebSite","@id":"https:\/\/mayanknauni.com\/#website","url":"https:\/\/mayanknauni.com\/","name":"Cloud Whisperer","description":"Taming the Digital Dragon","inLanguage":"en-US","publisher":{"@id":"https:\/\/mayanknauni.com\/#person"}}]},"og:locale":"en_US","og:site_name":"Cloud Whisperer \u2013 Taming the Digital Dragon","og:type":"article","og:title":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer","og:description":"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches","og:url":"https:\/\/mayanknauni.com\/?p=4996","og:image":"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2023\/08\/cropped-cropped-Blue-and-Green-Modern-Technology-Logo.png?fit=333%2C342&#038;ssl=1","og:image:secure_url":"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2023\/08\/cropped-cropped-Blue-and-Green-Modern-Technology-Logo.png?fit=333%2C342&#038;ssl=1","article:published_time":"2024-12-11T14:44:32+00:00","article:modified_time":"2024-12-11T14:44:32+00:00","twitter:card":"summary_large_image","twitter:title":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII Cloud Whisperer","twitter:description":"With the growing importance of large language models (LLMs) in tasks such as cybersecurity threat modelling for Critical Information Infrastructure (CII), efficient model training techniques are essential. Recently, I conducted an experiment on AWS SageMaker to fine-tune the FLAN-T5 model\u2014an instruction-tuned LLM\u2014for enhanced cybersecurity threat modelling. The primary goal was to compare traditional fine-tuning approaches","twitter:image":"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2023\/08\/cropped-cropped-Blue-and-Green-Modern-Technology-Logo.png?fit=333%2C342&ssl=1"},"aioseo_meta_data":{"post_id":"4996","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-12-11 14:44:32","updated":"2025-08-04 08:49:26","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/mayanknauni.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/mayanknauni.com\/?cat=53\" title=\"Cyber Security\">Cyber Security<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tExperimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/mayanknauni.com"},{"label":"Cyber Security","link":"https:\/\/mayanknauni.com\/?cat=53"},{"label":"Experimenting with Fine-Tuning and PEFT (LoRA) for Threat Modelling for CII","link":"https:\/\/mayanknauni.com\/?p=4996"}],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts\/4996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4996"}],"version-history":[{"count":1,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts\/4996\/revisions"}],"predecessor-version":[{"id":4998,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts\/4996\/revisions\/4998"}],"wp:attachment":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}