Reasoning Capabilities of Large Language Models in Network Traffic Mining: A Comparative Evaluation of Zero-Shot and Few-Shot Prompting | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Article Reasoning Capabilities of Large Language Models in Network Traffic Mining: A Comparative Evaluation of Zero-Shot and Few-Shot Prompting Uğur Dagtekin, Ahmet Kamil Kabakuş This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-9162005/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract This study investigates the reasoning capabilities of Large Language Models (LLMs) in network traffic mining by comparing zero-shot and few-shot prompting strategies for anomaly identification. The analysis was conducted using a publicly available network traffic dataset obtained from Kaggle, where structured flow summaries were used as input for model-based reasoning. In the experimental design, the complete dataset consisting of 25,192 network flow records was analyzed under both zero-shot and few-shot prompting configurations. While the zero-shot setup performed classification without prior examples, the few-shot configuration incorporated labeled flow samples within the prompt to guide the reasoning process. The results demonstrate that the inclusion of limited contextual examples significantly improves classification stability and interpretability when analyzing ambiguous traffic patterns. The comparative evaluation of different large language models further reveals notable differences in reasoning behavior and detection performance across models. Overall, the findings highlight the potential of prompt-based LLM reasoning as a complementary analytical tool for network traffic mining, offering an interpretable and lightweight alternative to conventional machine learning-based detection approaches. Physical sciences/Engineering Physical sciences/Mathematics and computing Large Language Models Network Traffic Analysis Anomaly Detection Data Mining Zero-shot and Few-shot Learning Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-9162005","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Article","associatedPublications":[],"authors":[{"id":617693266,"identity":"2b9c0f50-397b-49cf-9147-7e5c23393df3","order_by":0,"name":"Uğur Dagtekin","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABDUlEQVRIiWNgGAWjYNACNghxgKHiAJTHRoQWHrCWM0haeIjRwsDYRoQWg/NrzD4wlNnZ7WdvSzxcOO+OnHx7WwLDh7LDDPbSB7BrufHGeAbDueTkHp5jBw7P3PbMmLHn2AHGGecOM/DwJeDQcsYY6B7mZB6J9IbDvNsOJzYDGcy8bUAtOFwG1VKfzCP/HKhlzuHENpCWv/i0nO8BaTlsxyPBduAwb8PhxB6JtAPMjHi0SN5gK2ZIOHc8gedMWsJhnmPPjCV4jiUc7DmXzsNzBrsWvvOHNwPDp9qevf2Y8WeeGnCIGT74UWYtx96DXQuDBDBYgCixAVnwAAO+mOQ/AKbscSoYBaNgFIyCUQAAPrBdnbx2vKAAAAAASUVORK5CYII=","orcid":"","institution":"Bozok Universitesi","correspondingAuthor":true,"prefix":"","firstName":"Uğur","middleName":"","lastName":"Dagtekin","suffix":""},{"id":617693267,"identity":"6b7965c3-665c-463c-8029-f784ec3752e6","order_by":1,"name":"Ahmet Kamil Kabakuş","email":"","orcid":"","institution":"Atatürk University","correspondingAuthor":false,"prefix":"","firstName":"Ahmet","middleName":"Kamil","lastName":"Kabakuş","suffix":""}],"badges":[],"createdAt":"2026-03-18 17:38:31","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-9162005/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-9162005/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":106845961,"identity":"a30a29fe-500d-42c2-8ff5-1edc9b6232aa","added_by":"auto","created_at":"2026-04-14 04:55:09","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":775107,"visible":true,"origin":"","legend":"","description":"","filename":"EngATrafiiAnomaliTespitiVol2.pdf","url":"https://assets-eu.researchsquare.com/files/rs-9162005/v1_covered_86b98df0-78b3-4245-b63e-95b5a8499c8f.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Reasoning Capabilities of Large Language Models in Network Traffic Mining: A Comparative Evaluation of Zero-Shot and Few-Shot Prompting","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Large Language Models, Network Traffic Analysis, Anomaly Detection, Data Mining, Zero-shot and Few-shot Learning","lastPublishedDoi":"10.21203/rs.3.rs-9162005/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-9162005/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eThis study investigates the reasoning capabilities of Large Language Models (LLMs) in network traffic mining by comparing zero-shot and few-shot prompting strategies for anomaly identification. The analysis was conducted using a publicly available network traffic dataset obtained from Kaggle, where structured flow summaries were used as input for model-based reasoning. In the experimental design, the complete dataset consisting of 25,192 network flow records was analyzed under both zero-shot and few-shot prompting configurations. While the zero-shot setup performed classification without prior examples, the few-shot configuration incorporated labeled flow samples within the prompt to guide the reasoning process. The results demonstrate that the inclusion of limited contextual examples significantly improves classification stability and interpretability when analyzing ambiguous traffic patterns. The comparative evaluation of different large language models further reveals notable differences in reasoning behavior and detection performance across models. Overall, the findings highlight the potential of prompt-based LLM reasoning as a complementary analytical tool for network traffic mining, offering an interpretable and lightweight alternative to conventional machine learning-based detection approaches.\u003c/p\u003e","manuscriptTitle":"Reasoning Capabilities of Large Language Models in Network Traffic Mining: A Comparative Evaluation of Zero-Shot and Few-Shot Prompting","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-04-06 10:45:37","doi":"10.21203/rs.3.rs-9162005/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"70282eab-0541-4837-b948-ca3c7be369e3","owner":[],"postedDate":"April 6th, 2026","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":65737362,"name":"Physical sciences/Engineering"},{"id":65737363,"name":"Physical sciences/Mathematics and computing"}],"tags":[],"updatedAt":"2026-04-14T04:53:34+00:00","versionOfRecord":[],"versionCreatedAt":"2026-04-06 10:45:37","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-9162005","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-9162005","identity":"rs-9162005","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.