LLMs or Naive Bayes? Old Gems or New Ways
Summary
The paper benchmarks Naive Bayes against large language models for text classification, finding that NB remains competitive with LLMs when labeled data is available, offering higher throughput and lower energy consumption for resource-constrained environments.
View Cached Full Text
Cached at: 09/15/26, 08:32 AM
# LLMs or Naive Bayes? Old Gems or New Ways Source: [https://arxiv.org/html/2609.13185](https://arxiv.org/html/2609.13185) Mohammad Firas Sada[0009\-0006\-6045\-2940](https://orcid.org/0009-0006-6045-2940)[mfsada@ucsd\.edu](mailto:[email protected])San Diego Supercomputer Center, University of California, San DiegoLa JollaCAUSAJohn Graham[0000\-0002\-2139\-5617](https://orcid.org/0000-0002-2139-5617)[jjgraham@ucsd\.edu](mailto:[email protected])San Diego Supercomputer Center, University of California, San DiegoLa JollaCAUSA,Mahidhar Tatineni[0009\-0003\-0709\-090X](https://orcid.org/0009-0003-0709-090X)[mahidhar@sdsc\.edu](mailto:[email protected])San Diego Supercomputer Center, University of California, San DiegoLa JollaCAUSA,Dmitry Mishin[0000\-0003\-1125\-448X](https://orcid.org/0000-0003-1125-448X)[dimm@lbl\.gov](mailto:[email protected])Lawrence Berkeley National Laboratory1 Cyclotron RoadBerkeleyCA94720USA,Seungmin Kim[0000\-0001\-8052\-723X](https://orcid.org/0000-0001-8052-723X)[ehf@yonsei\.ac\.kr](mailto:[email protected])Yonsei University College of MedicineSeoulRepublic of KoreaandFrank Würthwein[0000\-0001\-5912\-6124](https://orcid.org/0000-0001-5912-6124)[fkw@physics\.ucsd\.edu](mailto:[email protected])San Diego Supercomputer Center, University of California, San DiegoLa JollaCAUSA \(2026\) ###### Abstract\. Large language models \(LLMs\) prompt a recurring question in research computing: should classical methods like Naive Bayes \(NB\) be retired? We benchmark Complement Naive Bayes against zero\-shot and few\-shot LLMs spanning four model families and a37×37\\timesrange in scale \(27B to a 1T\-parameter mixture\-of\-experts\) across text classification tasks\. LLMs dominate only in zero\-data regimes \(98\.0% vs 88\.2% on Amazon Polarity sentiment\), and even that win is contamination\-prone: on a low\-contamination sentiment task NB*beats*the zero\-shot LLM \(81\.7% vs 73\.0%\)\. However, once labeled data is available \(e\.g\., AG News\), NB reaches 89\.1% accuracy, statistically indistinguishable from the zero\-shot 27B LLM \(89\.0%\) and*better*than the 397B frontier model \(84\.8%\), at thousands of samples/sec on a commodity CPU\. Fine\-tuned DistilBERT reaches 90\.6% but at far lower throughput than NB at batch size 1 \(Table[2](https://arxiv.org/html/2609.13185#S4.T2)\)\. Our measured GPU throughput analysis shows small\-LLM batched inference is 40–486×\\timesslower than NB CPU inference \(the multiplier depends strongly on the host CPU\), exposing a structural gap bounded by memory bandwidth, with roughly two orders of magnitude lower energy per sample\. For resource\-constrained HPC practitioners performing text classification with labeled data, NB remains the optimal choice\. We show the decision line is task\-dependent \(NB reaches LLM parity aroundN∼104N\\sim 10^\{4\}labels for topic classification, while zero\-data sentiment favors the LLM at allNNtested\) and provide a Kubernetes Helm operator that automates model selection using configurable thresholds and verifiable Prometheus metrics\. Naive Bayes, LLMs, Text Classification, Throughput Benchmarking, Research Computing, NRP, Green AI, Kubernetes Helm Operator ††conference:Practice and Experience in Advanced Research Computing; July 26–30, 2026; Minneapolis, Minnesota, USA††journalyear:2026††copyright:cc††ccs:Computing methodologies Natural language processing††ccs:Computing methodologies Supervised learning by classification††ccs:General and reference Performance## 1\.Introduction The rise of large language models \(LLMs\) such as GPT\-4 and open\-source families like Qwen3 has reshaped natural language processing\(Brown and others,[2020](https://arxiv.org/html/2609.13185#bib.bib8); Ouyanget al\.,[2022](https://arxiv.org/html/2609.13185#bib.bib11)\), raising a concrete question for practitioners who routinely classify text at scale:*should we retire classical probabilistic classifiers like Naive Bayes?*The question carries real resource implications: researchers on shared HPC clusters face steep energy and financial costs\(Strubellet al\.,[2019](https://arxiv.org/html/2609.13185#bib.bib15); Schwartzet al\.,[2020](https://arxiv.org/html/2609.13185#bib.bib16)\)when deploying large models, whereas Complement Naive Bayes \(CNB\)\(Rennieet al\.,[2003](https://arxiv.org/html/2609.13185#bib.bib2)\)with TF\-IDF bigrams\(Wang and Manning,[2012](https://arxiv.org/html/2609.13185#bib.bib3)\)trains in under one second on a commodity CPU and classifies at sub\-millisecond speeds per sample \(Section[4\.5](https://arxiv.org/html/2609.13185#S4.SS5)\)\. Concurrent work on serving LLMs in HPC clusters\(Sadaet al\.,[2025a](https://arxiv.org/html/2609.13185#bib.bib31)\)shows modern accelerators improve energy efficiency but cannot match the per\-sample efficiency of classical methods\. We benchmark CNB against zero/few\-shot LLMs spanning 27B to 1T parameters: LLMs hold a structural advantage only when labeled data is absent, while with labels NB matches or beats zero\-shot LLMs at a measured 40–486×\\timesthroughput advantage driven by memory\-bandwidth saturation, across batch sizes and two accelerators\. For the many scientific text\-classification pipelines that already possess labeled data, moving to an LLM adds unnecessary complexity and cost\. We then characterize the task\-dependent decision line where NB becomes superior and operationalize it with a configurable Kubernetes Helm operator that exports Prometheus metrics for verifiability\. ## 2\.Related Work Rennieet al\.\([2003](https://arxiv.org/html/2609.13185#bib.bib2)\)introduced Complement Naive Bayes; TF\-IDF linear models remain competitive\(Wang and Manning,[2012](https://arxiv.org/html/2609.13185#bib.bib3)\); fine\-tuned small models often beat zero\-shot LLMs when labels exist\(Bucher and Martini,[2024](https://arxiv.org/html/2609.13185#bib.bib14); Mosbachet al\.,[2023](https://arxiv.org/html/2609.13185#bib.bib34)\)\. In the low\-label regime, prompt\-free label\-efficient methods such as SetFit\(Tunstallet al\.,[2022](https://arxiv.org/html/2609.13185#bib.bib36)\)and parameter\-efficient few\-shot tuning \(T\-Few\)\(Liuet al\.,[2022](https://arxiv.org/html/2609.13185#bib.bib35)\)offer an alternative to in\-context learning, while recent zero\-shot benchmarks compare cross\-encoders, rerankers, and LLMs\(Aarab,[2026](https://arxiv.org/html/2609.13185#bib.bib46)\)\. We instead characterize the low\-label regime directly via training\-size curves \(Fig\.[1](https://arxiv.org/html/2609.13185#S5.F1)\) that locate where NB reaches LLM parity\. Energy costs of large\-scale inference are well documented\(Strubellet al\.,[2019](https://arxiv.org/html/2609.13185#bib.bib15); Schwartzet al\.,[2020](https://arxiv.org/html/2609.13185#bib.bib16); Sadaet al\.,[2025a](https://arxiv.org/html/2609.13185#bib.bib31)\)\. #### Systems and platforms\. Our benchmarks execute on the same class of federated scientific Kubernetes infrastructure as the National Research Platform \(NRP\)\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\)\. Complementary work from our group has compared LLM serving on Qualcomm Cloud AI and NVIDIA GPUs in shared HPC clusters\(Sadaet al\.,[2025a](https://arxiv.org/html/2609.13185#bib.bib31)\); studied real\-time P4\-programmable FPGA networking for in\-network machine learning\(Sadaet al\.,[2025b](https://arxiv.org/html/2609.13185#bib.bib26)\); and presented SCinet NRE demonstrations spanning live NRP telemetry and P4/FPGA/DPU testbeds\(Sada and Graham,[2025a](https://arxiv.org/html/2609.13185#bib.bib27),[b](https://arxiv.org/html/2609.13185#bib.bib28)\)\. ## 3\.Methodology ### 3\.1\.Models We evaluate models spanning classical to large\-scale\.Classical baselines: Complement Naive Bayes \(CNB\)\(Rennieet al\.,[2003](https://arxiv.org/html/2609.13185#bib.bib2)\)with TF\-IDF bigrams\(Wang and Manning,[2012](https://arxiv.org/html/2609.13185#bib.bib3)\)and Logistic Regression \(LR\), both CPU\-only\.Fine\-tuned transformer: DistilBERT \(66M\)\(Sanhet al\.,[2019](https://arxiv.org/html/2609.13185#bib.bib33)\), fine\-tuned with AdamW \(lr3×10−53\{\\times\}10^\{\-5\}, batch size 32\)\.Generative LLMs: Qwen3\.6\-27B \(served checkpointQwen/Qwen3\.6\-27B\) in zero\-shot and few\-shot \(k=5k\{=\}5\) settings, and the Qwen3\.5 \(397B\) frontier model \(Qwen/Qwen3\.5\-397B\-A17B\-FP8, a 397B mixture\-of\-experts with 17B active parameters\) in zero\-shot, served on the managed NRP endpoint\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\)\.Discriminative LLM: a LoRA fine\-tuned Qwen3\-8B sequence classifier\(Huet al\.,[2022](https://arxiv.org/html/2609.13185#bib.bib32)\)that predicts in a single forward pass, included so a large model is compared on equal \(discriminative\) footing rather than via autoregressive generation\.Throughput probe: OLMo\-2\-1B \(allenai/OLMo\-2\-0425\-1B\-Instruct, 1\.48B\)\(Groeneveldet al\.,[2024](https://arxiv.org/html/2609.13185#bib.bib40)\)on GPU\. All generative inference uses temperature 0\. ### 3\.2\.Datasets We use three benchmarks with stratified splits \(seed 42\)\.Amazon Polarity\(Zhanget al\.,[2015](https://arxiv.org/html/2609.13185#bib.bib18)\): binary sentiment, 10K/2K train/test; high pre\-training overlap for LLMs\.AG News\(Zhanget al\.,[2015](https://arxiv.org/html/2609.13185#bib.bib18)\): four\-class topic classification, 10K/2K; clean and standard\.20 Newsgroups: 20\-class topic classification, 11,314/7,532; headers/footers removed \(“hard” setting\)\. Cross\-posting introduces label noise favoring distributional methods\. We cap Amazon and AG News training at 10K to hold the labeled\-data budget constant across datasets \(20 Newsgroups is already∼\\sim11K\) and because the per\-sample LLM evaluation cost makes larger comparisons impractical; the training\-size curves \(Fig\.[1](https://arxiv.org/html/2609.13185#S5.F1)\) show NB and DistilBERT accuracy already saturating well before 10K, so a larger subsample would not change the decision\-line conclusion\. ### 3\.3\.Evaluation and Infrastructure We report accuracy, weighted F1, McNemar tests and paired\-bootstrap CIs on per\-sample predictions\. Throughput uses pre\-tokenized samples across batch sizes 1–128 on NVIDIA RTX 3090 \(24 GB\) and Tesla V100\-SXM2\-32GB, with GPU board power read from NVML\. CPU baselines run on dual Intel Xeon Gold 6248R \(48 cores\) with NUMA affinity\. Experiments run as Kubernetes batch jobs on the NRP Nautilus cluster\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\)\. This study’s≈\\approx15 GPU\-hours of self\-hosted compute, at the measured board power and U\.S\. grid intensity \(367 gCO2e/kWh\)\(U\.S\. Energy Information Administration,[2024](https://arxiv.org/html/2609.13185#bib.bib51)\), give an operational footprint of order10010^\{0\}kgCO2e under SCI\(Green Software Foundation,[2025](https://arxiv.org/html/2609.13185#bib.bib52)\), negligible beside the≈\\approx2,159 kgCO2e embodied carbon of a single V100 GPU server\(Jiet al\.,[2024](https://arxiv.org/html/2609.13185#bib.bib47)\)\. ### 3\.4\.LLM Endpoint Details The Qwen3\.6\-27B and Qwen3\.5 \(397B\) models are served with vLLM\(vLLM Team,[2025](https://arxiv.org/html/2609.13185#bib.bib48)\)\(continuous batching\) on the managed NRP endpoint, which we use for all accuracy measurements\. Controlled throughput and power measurement \(Table[5](https://arxiv.org/html/2609.13185#S4.T5)\) instead uses models we host ourselves on dedicated GPUs, namely OLMo\-2\-1B as a small generative probe and DistilBERT, so that GPU board power \(NVML\) is attributable to a single co\-located workload\. Decoding uses temperature 0 and max sequence length 8,192\. ### 3\.5\.Memory\-Bandwidth Analysis The batch\-1 inference lower bound istmin=2P/Bmemt\_\{\\text\{min\}\}=2P/B\_\{\\text\{mem\}\}, wherePPis the parameter count andBmemB\_\{\\text\{mem\}\}is memory bandwidth\. For OLMo\-2\-1B \(1\.48 B params,≈\\approx2\.96 GB in FP16; RTX 3090 at 936 GB/s\),tmin≈3\.2t\_\{\\text\{min\}\}\\approx 3\.2ms/sample \(≈\\approx316 samples/s\)\. Our measured peak of 200 samples/s reaches≈\\approx63% of this bound, the remainder lost to attention/KV and kernel\-launch overhead; batching past size 8 does not raise throughput because the decode step remains weight\-streaming\-bound rather than compute\-bound\. The NB TF\-IDF model fits in CPU cache and approaches peak sparse\-BLAS throughput\. ### 3\.6\.Reproducibility We fix splits \(seed 42\), tokenizer settings, and vLLM launch flags; jobs use namespace\-scoped quotas consistent with other NRP tenants\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\)\. A public artifact bundle \(scripts, manifests, and configs to reproduce Tables[1](https://arxiv.org/html/2609.13185#S4.T1)–[5](https://arxiv.org/html/2609.13185#S4.T5)with explicit NUMA/CUDA pinning\) is available at[https://github\.com/groundsada/llms\-or\-naive\-bayes](https://github.com/groundsada/llms-or-naive-bayes)\. ## 4\.Results ### 4\.1\.Amazon Polarity: Binary Sentiment On Amazon Polarity \(Table[1](https://arxiv.org/html/2609.13185#S4.T1)\), sentiment is easy for LLMs given heavy pre\-training overlap: zero\-shot Qwen3\.6\-27B reaches 97\.8% and few\-shot 98\.0%, versus 88\.2% for CNB, a gap that is statistically significant \(McNemarp<0\.05p<0\.05; the paired\-bootstrap CI on the accuracy difference excludes 0\)\. The Qwen3\.5 \(397B\)*frontier*model does not improve on the 27B \(98\.0%\), indicating the ceiling here is the task, not model scale\. A discriminative fine\-tuned Qwen3\-8B reaches 97\.2%, close to the generative LLMs but at a single forward pass \(91 ms vs\.∼\\sim13 s\)\. LR is statistically indistinguishable from CNB\. Crucially, CNB classifies at 0\.06 ms/sample, roughly five orders of magnitude faster than the generative LLMs\. We flag this zero\-shot win as*contamination\-prone*\(Amazon Polarity is a long\-public benchmark with high pre\-training overlap\) and test it on a low\-contamination sentiment task in §[5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px5), where the LLM advantage reverses\. Table 1\.Amazon Polarity \(2K test; LLM rows on 500\)\. Latency at batch size 1; generative\-LLM latency includes reasoning tokens\. ### 4\.2\.AG News: Clean Multi\-Class On AG News \(Table[2](https://arxiv.org/html/2609.13185#S4.T2)\), once labels are available CNB \(89\.1%\) is statistically*indistinguishable*from the zero\-shot 27B LLM \(89\.0%; McNemarp=0\.07p\{=\}0\.07\) and from few\-shot \(88\.4%\), at 0\.03 ms/sample versus∼\\sim13 s\. Strikingly, the 397B frontier model is*worse*\(84\.8%\): the reasoning\-tuned model over\-generates on a simple four\-way topic task, so scale does not help here\. The fine\-tuned models lead on accuracy \(DistilBERT 90\.6% and the discriminative Qwen3\-8B 93\.3%\), but the latter still costs 42 ms/sample \(a single forward pass\), over 1,000×\\timesslower than CNB\. Table 2\.AG News \(2K test; LLM rows on 500\)\. Latency at batch size 1\. ### 4\.3\.20 Newsgroups: Noisy Multi\-Class On 20 Newsgroups \(Table[3](https://arxiv.org/html/2609.13185#S4.T3)\), the true 20\-class topic task with headers/footers removed, CNB \(71\.2%\) is statistically*indistinguishable*from the zero\-shot 27B LLM \(71\.8%; McNemar not significant\), and few\-shot edges ahead \(73\.8%\)\. The 397B frontier model is again*worse*\(66\.4%\), significantly below both CNB and the 27B \(McNemarp<0\.05p<0\.05\): the reasoning\-tuned model is poorly calibrated for fine\-grained many\-way topic labels\. DistilBERT trails NB here \(67\.2%\); with cross\-posting label noise and only∼\\sim565 examples per class, the fine\-tuned encoder fails to overtake the sparse bag\-of\-words model at*any*training size \(Fig\.[1](https://arxiv.org/html/2609.13185#S5.F1)\)\. Only the discriminative fine\-tuned Qwen3\-8B leads on accuracy \(76\.3%\), but at 97 ms/sample, roughly 700×\\timesslower than CNB, which classifies at 0\.14 ms/sample \(five orders of magnitude faster than the generative LLMs\)\. Table 3\.20 Newsgroups \(true 20\-class; 7,532 test, LLM rows on 500\)\. Latency at batch size 1; generative\-LLM latency includes reasoning tokens\. DistilBERT at its largest training size\. ### 4\.4\.Cross\-Family and Scale Generalization A natural objection is that our decision line is an artifact of the Qwen family, or that a*larger*model would tip the trade\-off\. We test both by evaluating three additional*non\-Qwen*models under the identical protocol \(zero\-shot, 500\-sample LLM slice, temperature 0\): gpt\-oss\-120B \(OpenAI, MoE\), GLM\-5\.2 \(Zhipu, 744B MoE\), and Kimi\-K2 \(1T MoE\)\. Table[4](https://arxiv.org/html/2609.13185#S4.T4)places these alongside the Qwen 27B and 397B references; together the evaluated models span four families and a37×37\\timesrange in scale \(27B–1T\)\. The same regime holds across every family and scale: all models lead decisively only on zero\-data Amazon sentiment \(\.974\.974–\.980\.980, essentially flat from 120B to 1T\), while on the label\-rich topic tasks they cluster around or*below*Complement NB\. Crucially, accuracy is not monotone in scale: on AG News the 27B Qwen \(\.890\.890\) matches CNB and*beats*the 397B, 120B, and 744B models, and on 20 Newsgroups the 397B is the*worst*of all, so parameter count is not the lever that moves the decision line\. The trade\-off is governed by the task and by label availability, not by model lineage or scale\. Table 4\.Cross\-family/scale check: zero\-shot accuracy of three non\-Qwen models, spanning 120B–1T parameters, vs\. the CNB and Qwen references, on the shared 500\-sample LLM slice \(CNB on full test\)\. The label\-rich topic tasks neutralize the LLM advantage across every family*and*scale tested; larger models do not help once labels are present\. ### 4\.5\.GPU Throughput Analysis Table[5](https://arxiv.org/html/2609.13185#S4.T5)reports measured throughput with the NB CPU baseline and the GPU models benchmarked on the*same*node\. On the RTX 3090 node, NB classifies at 7,979 samp/s while OLMo\-2\-1B peaks at 200 samp/s \(batch 8\) and DistilBERT at 1,678 samp/s, a 40×\\timesand 4\.8×\\timesNB advantage, respectively\. On the V100 node \(faster host CPU\), NB reaches 21,587 samp/s while OLMo peaks at just 44 samp/s, a 486×\\timesgap\. GPU throughput saturates by batch 8 and does not recover, consistent with a memory\-bandwidth\-bound regime in which each forward pass streams the full weight matrix from VRAM\. The exact multiplier therefore depends strongly on the host CPU \(40–486×\\timeshere\), but in every configuration the sparse linear model is one to nearly three orders of magnitude faster than autoregressive GPU inference\. These multipliers use OLMo\-2\-1B, the*smallest*generative model; the 27B and 397B models that produced our accuracy rows are far larger and, under the same memory\-bandwidth bound, necessarily slower per sample \(their managed\-endpoint latency is∼\\sim13–32 s/sample, Tables[1](https://arxiv.org/html/2609.13185#S4.T1)–[3](https://arxiv.org/html/2609.13185#S4.T3)\)\. The reported gap is therefore a*conservative lower bound*on the throughput penalty of the LLMs that actually achieve the headline accuracies\. Table 5\.Measured throughput and GPU board power \(NVML\), NB \(CPU\) vs\. GPU models on the*same*node, pre\-tokenized, each point sampled for≥\\geq5 s\. “vs\. NB” = NB÷\\divmodel throughput\. GPU peaks are at batch size 8 \(OLMo\) / 8–32 \(DistilBERT\)\. ## 5\.Discussion  Three line plots of classification accuracy versus the number of labeled training examples on a logarithmic horizontal axis, one panel each for Amazon Polarity, AG News, and 20 Newsgroups\. Each panel plots Complement Naive Bayes and fine\-tuned DistilBERT as rising curves and the zero\-shot 27B large language model as a flat dotted reference line\. Naive Bayes meets the language\-model line only near ten thousand examples on 20 Newsgroups and AG News, and never on Amazon within the tested range\. Figure 1\.Decision line: accuracy of Complement NB and fine\-tuned DistilBERT versus the number of labeled training examplesNN\(log scale\), with the zero\-shot 27B LLM as a constant reference \(dotted\)\. The labeled break\-evenNN\(smallestNNat which NB reaches the zero\-shot LLM\) is task\-dependent: NB matches the LLM only atN≈104N\\\!\\approx\\\!10^\{4\}on 20 Newsgroups, approaches it byN≈104N\\\!\\approx\\\!10^\{4\}on AG News, and never reaches it on Amazon sentiment withinN≤104N\\leq 10^\{4\}\. There is no single universal threshold\.#### The decision line is task\-dependent, not a single threshold\. Figure[1](https://arxiv.org/html/2609.13185#S5.F1)traces accuracy against the number of labeled examplesNN\. Contrary to a fixed “N≥500N\\\!\\geq\\\!500” rule, the labeled break\-even where NB matches the zero\-shot 27B varies sharply by task:N≈104N\\\!\\approx\\\!10^\{4\}on 20 Newsgroups and AG News, but never withinN≤104N\\leq 10^\{4\}on Amazon sentiment\. DistilBERT overtakes NB at moderateNNon the two binary/clean\-topic tasks \(N≈250N\\\!\\approx\\\!250\) but trails NB at*every*NNon noisy 20\-class 20 Newsgroups\. Critically, the cost axis does not move withNN: NB retains its 40–486×\\timesthroughput and∼\\simtwo\-orders\-of\-magnitude energy advantage regardless of label count, so whenever NB is within an application’s accuracy tolerance it is the economical choice, which is why we operationalize the boundary as a configurable policy, not a fixed constant\. Our results expose a structural GPU throughput gap driven by memory\-bandwidth limits: each forward pass streams full weights from VRAM, while NB’s sparse TF\-IDF fits in CPU cache\. At its 200 samp/s peak, OLMo\-2\-1B draws a*measured*341 W \(NVML\), i\.e\. 1\.70 J/sample\. CPU package energy was not exposed via RAPL inside our containers, so we bound NB conservatively by its host\-CPU package TDP \(∼\\sim150 W\): at 7,979 samp/s this is≈\\approx0\.02 J/sample, roughly two orders of magnitude below the LLM\. Even under this conservative bound, classifying10710^\{7\}documents differs by order10210^\{2\}–103×10^\{3\}\\timesin energy, a meaningful operational saving consistent with Green AI\(Schwartzet al\.,[2020](https://arxiv.org/html/2609.13185#bib.bib16); Sadaet al\.,[2025a](https://arxiv.org/html/2609.13185#bib.bib31)\)\. We avoid extrapolating to annual fleet\-scale CO2e, which depends on workload mix and grid intensity beyond our measurements\. Line plot of classification accuracy versus the escalation fraction \(the share of samples routed from Naive Bayes to the LLM, a proxy for cost\) for the three datasets\. The left endpoint is Naive Bayes alone and the right endpoint is the LLM alone\. Amazon Polarity rises smoothly from 0\.88 to 0\.98 as escalation increases; AG News peaks near 0\.90 at about a quarter escalation, above both endpoints; 20 Newsgroups stays flat because Naive Bayes is already best\. Figure 2\.Cascade accuracy–cost frontier\. Routing only NB’s low\-confidence samples \(thresholdτ\\tau\) to the LLM traces a tunable operating point between NB\-only \(left, free\) and LLM\-only \(right, full cost\)\. On AG News a small escalation*exceeds*both endpoints; on 20 Newsgroups NB alone is already best, so escalation only adds cost\. #### Hybrid NB→\\toLLM cascade\. Rather than choosing NB*or*the LLM, we can route only NB’s low\-confidence predictions \(max class probability below a thresholdτ\\tau\) to the LLM\. Sweepingτ\\tautraces an accuracy–cost frontier \(Fig\.[2](https://arxiv.org/html/2609.13185#S5.F2)\), where the escalation fraction is a direct proxy for cost\. On Amazon, escalating 43% \(68%\) of samples reaches 97\.2% \(97\.8%\), matching the standalone LLM \(97\.8%\) while keeping more than half the workload on the CPU\. On AG News, a threshold that escalates only 24% of samples reaches 89\.6%,*exceeding*both standalone NB \(85\.6%\) and the zero\-shot LLM \(88\.8%\)\. On 20 Newsgroups NB alone is already best \(71\.8% vs\. 71\.4%\), so escalation only adds cost\. The cascade thus turns the accuracy–throughput trade\-off into a single tunable operating point\. Block diagram of the Helm operator\. Incoming requests enter a central router \(control loop\) with a measured 7\.2 microsecond per\-request overhead\. The router is configured by policy thresholds \(minLabeledExamples, maxLatencyMs, targetThroughput\) and reads live Prometheus metrics \(rate, latency, utilization, carbon\); it routes each request to either the Complement Naive Bayes CPU endpoint or the LLM GPU endpoint, and exports the active choice as a one\-hot selected\-model gauge back to Prometheus\. Figure 3\.Helm operator architecture\. A policy\- and metrics\-driven router dispatches each request to the CNB \(CPU\) or LLM \(GPU\) endpoint and exports the active choice as a one\-hotselected\_modelgauge \(plus per\-model counters and decision/inference histograms\) to Prometheus\. The control loop adds a measured 7\.2μ\\mus per request\. #### Operationalizing the Decision Boundary: A Helm Operator Because the break\-even point is task\-dependent rather than a single universal threshold, we expose it as a*configurable*policy rather than hard\-coding it\. We implement a Helm operator \(Fig\.[3](https://arxiv.org/html/2609.13185#S5.F3)\) that automates model selection: it exposes thresholds \(e\.g\.,minLabeledExamples,maxLatencyMs,targetThroughput\) that an operator sets from the relevant task’s decision line, and continuously ingests Prometheus metrics from NB and LLM endpoints \(rate, latency, utilization, carbon\)\. Requests are routed to the cheaper model whenever it satisfies the accuracy/latency policy, with the active choice exported as a one\-hotselected\_modelgauge plus per\-model counters and latency histograms, so the routing decision is auditable in Prometheus without string\-valued metrics\. The routing layer is effectively free: a server\-side microbenchmark measures a mean decision overhead of7\.2μ\\musper request \(211 requests\), negligible against either model’s inference time\. The accuracy–cost frontier of Fig\.[2](https://arxiv.org/html/2609.13185#S5.F2)is precisely the operating curve the operator selects along, so the policy is not merely plumbing: choosing the threshold moves the deployment to a measured, better accuracy/cost point \(e\.g\., the AG News knee that beats both NB\-only and LLM\-only\)\. Concretely, withminLabeledExamplesset to a task’s measured break\-even \(Fig\.[1](https://arxiv.org/html/2609.13185#S5.F1)\), the routed model flips from the LLM to CNB exactly as the available label count crosses that point: the decision boundary made operational\. This turns our findings into a deployable control loop for Kubernetes environments\. #### Reproducibility and deployment context\. Artifacts are summarized in §[3\.6](https://arxiv.org/html/2609.13185#S3.SS6)\. Jobs run in standard NRP namespaces with pinned images on shared infrastructure used for prior accelerator and networking studies\(Sadaet al\.,[2025a](https://arxiv.org/html/2609.13185#bib.bib31),[b](https://arxiv.org/html/2609.13185#bib.bib26)\)\. The reported CPU–GPU gaps are thus conservative under mixed workloads and shared power budgets\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\)\. Practical guidance\.Use zero\-shot LLMs when no labels exist; once enough labels are available to reach NB–LLM parity for the task \(order10410^\{4\}for topic classification in our experiments\), switch to CNB for similar accuracy at one\-to\-nearly\-three orders of magnitude lower cost\. Fine\-tune DistilBERT/RoBERTa only if a 1–3 pp gain justifies GPU use\. Streaming workloads favor NB and batching does not close the gap, so for high\-volume pipelines with labeled data NB minimizes both latency and cost; the Helm operator enforces the chosen policy automatically\. Limitations\.English benchmarks only; biomedical or multilingual settings may differ\. Our generative LLMs span four model families \(Qwen, gpt\-oss, GLM, Kimi\) and a37×37\\timesrange in scale \(27B–1T\); none improved accuracy over NB once labels were present \(Table[4](https://arxiv.org/html/2609.13185#S4.T4)\), so the decision line is not an artifact of one lineage or of insufficient scale\. Specialized or much larger models could still shift the trade\-off on harder, long\-context tasks we did not test\. #### Contamination control\. The Amazon zero\-shot headline sits on a long\-public benchmark with high pre\-training overlap, so its 98% may partly reflect memorization\. Re\-running the identical protocol on a domain\-specific sentiment task that is not a canonical benchmark and whose labels resist surface\-word shortcuts \(financial\-news sentiment, bearish/bullish/neutral\)111[https://huggingface\.co/datasets/zeroshot/twitter\-financial\-news\-sentiment](https://huggingface.co/datasets/zeroshot/twitter-financial-news-sentiment)reverses the LLM advantage: Complement NB reaches 81\.7%, significantly above the zero\-shot 27B \(73\.0%; McNemarp=0\.002p\{=\}0\.002\), few\-shot \(70\.6%;p<10−3p\{<\}10^\{\-3\}\), and the 397B frontier \(63\.6%;p<10−8p\{<\}10^\{\-8\}\)\. Once contamination risk is reduced, NB beats the zero\-shot LLM even in the zero\-label sentiment regime it was expected to dominate, and, consistent with §[4\.4](https://arxiv.org/html/2609.13185#S4.SS4), scale again hurts\. The conclusion is robust to the dataset’s exact provenance: any residual contamination would*inflate*the LLM scores, yet they fall well*below*NB, so the direction of the effect cannot be a memorization artifact\. #### Threats to validity\. Benchmarks favor bag\-of\-words; long\-range semantic tasks may widen transformer gains despite throughput costs\. Qwen endpoints use a fixed vLLM release\(vLLM Team,[2025](https://arxiv.org/html/2609.13185#bib.bib48)\); kernel or default changes may shift latencies without altering the order\-of\-magnitude gap\. We assume warm caches and steady clocks; thermal throttling would only further reduce LLM throughput\. ## 6\.Conclusion Naive Bayes is not dead\. For text classification tasks with labeled data, Complement Naive Bayes with TF\-IDF bigrams remains optimal for most HPC practitioners:≈\\approx89% accuracy at thousands of samples/sec on CPU, with sub\-second training and zero GPU allocation\. No batch size of GPU\-accelerated transformer inference approaches this throughput; the measured gap is 40–486×\\times\(depending on the host CPU\) and is bounded by memory bandwidth\. Notably, even a 397B frontier model does not beat NB once labels are present\. LLMs excel only in zero\-shot settings without labeled data\. For HPC practitioners, the choice is clear: use NB when labeled data exists; use LLMs only when it does not\. We have characterized the task\-dependent decision line \(NB reaches LLM parity aroundN∼104N\\sim 10^\{4\}labels for topic classification\) and operationalized it as a configurable Helm operator with Prometheus\-based verifiability and a measured 7\.2μ\\mus routing overhead\. As HPC systems increasingly emphasize energy efficiency and resource sharing, classical methods like NB deserve renewed attention\. Future work should explore hybrid pipelines that use NB for rapid filtering and LLMs only for ambiguous cases\. On the same NRP substrate that runs our endpoints and related accelerator and dataplane studies\(Sadaet al\.,[2025a](https://arxiv.org/html/2609.13185#bib.bib31),[b](https://arxiv.org/html/2609.13185#bib.bib26); Sada and Graham,[2025b](https://arxiv.org/html/2609.13185#bib.bib28),[a](https://arxiv.org/html/2609.13185#bib.bib27)\), classical baselines free scarce GPU and network capacity for workloads that genuinely require them\. ###### Acknowledgements\. We thank the open\-source AI community for making the models and software used in this study publicly available\. We also thank Derek Weitzel, Ashton Graves, Sam Albin, Huijun Zhu, and Daniel Diaz at the University of Nebraska–Lincoln and UC San Diego for maintaining the National Research Platform \(NRP\) infrastructure\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\), which hosted all LLM benchmarks\. This work was supported in part by National Science Foundation \(NSF\) awards CNS\-1730158, ACI\-1540112, ACI\-1541349, OAC\-1826967, OAC\-2112167, CNS\-2100237, and CNS\-2120019\. Portions of this paper were edited using LLMs hosted on NRP\(Weitzelet al\.,[2025](https://arxiv.org/html/2609.13185#bib.bib25)\)\. Seungmin Kim was supported by the Seok\-San Yonsei Medical Scientist Training Program \(MSTP\) Song Yong\-Sang Scholarship and a Student Research Bursary from the Song\-Dang Institute for Cancer Research at Yonsei University College of Medicine, the MD\-PhD/Medical Scientist Training Program \(MSTP\) through the Korea Health Industry Development Institute \(KHIDI\) and the Young Korean Medical Education & Research Secretariat \(Y\-KOMERS\) Medical Student Overseas Training Bootcamp Program, funded by the Ministry of Health & Welfare, Republic of Korea, the KREONET Advanced Research Program Grant by the Korea Institute of Science and Technology Information \(KISTI\), the National Research Foundation of Korea \(NRF\) grant funded by the Ministry of Science and ICT, Republic of Korea \(No\. RS\-2026\-NR121335\), and infrastructure use from the Chameleon testbed, supported by NSF awards \#1419152, \#1743354, and \#2027170\. ## References - I\. Aarab \(2026\)BTZSC: a benchmark for zero\-shot text classification across cross\-encoders, embedding models, rerankers and llms\.External Links:2603\.11991Cited by:[§2](https://arxiv.org/html/2609.13185#S2.p1.1)\. - T\. B\. Brownet al\.\(2020\)Language models are few\-shot learners\.InAdvances in Neural Information Processing Systems \(NeurIPS\),Vol\.33\.Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p1.1)\. - M\. J\. J\. Bucher and M\. Martini \(2024\)Fine\-tuned “small” LLMs \(still\) significantly outperform zero\-shot generative AI models in text classification\.arXiv preprint arXiv:2406\.08660\.Cited by:[§2](https://arxiv.org/html/2609.13185#S2.p1.1)\. - Green Software Foundation \(2025\)Software carbon intensity \(sci\) specification\.Note:[https://greensoftware\.foundation/sci\-specification/](https://greensoftware.foundation/sci-specification/)Version 1\.1\.0; the SCI methodology defines the formula: SCI = \(E x I\) \+ M, where E is operational energy, I is carbon intensity, and M is embodied carbonCited by:[§3\.3](https://arxiv.org/html/2609.13185#S3.SS3.p1.6)\. - D\. Groeneveld, I\. Beltagy, E\. Walsh, A\. Bhagia, R\. Kinney,et al\.\(2024\)OLMo: accelerating the science of language models\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 15789–15809\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.acl-long.841)Cited by:[§3\.1](https://arxiv.org/html/2609.13185#S3.SS1.p1.2)\. - E\. J\. Hu, Y\. Shen, P\. Wallis, Z\. Allen\-Zhu, Y\. Li, S\. Wang, L\. Wang, and W\. Chen \(2022\)LoRA: low\-rank adaptation of large language models\.InInternational Conference on Learning Representations \(ICLR\),External Links:[Document](https://dx.doi.org/10.48550/arXiv.2106.09685)Cited by:[§3\.1](https://arxiv.org/html/2609.13185#S3.SS1.p1.2)\. - S\. Ji, Z\. Yang, X\. Chen, S\. Cahoon, J\. Hu, Y\. Shi, A\. K\. Jones, and P\. Zhou \(2024\)SCARIF: towards carbon modeling of cloud servers with accelerators\.In2024 IEEE Computer Society Annual Symposium on VLSI \(ISVLSI\),pp\. 1–6\.Note:Reports total embodied carbon of approximately 2159 kgCO2e for a V100 GPU server and 2542 kgCO2e for an A100 GPU serverExternal Links:[Document](https://dx.doi.org/10.1109/ISVLSI61997.2024.00025)Cited by:[§3\.3](https://arxiv.org/html/2609.13185#S3.SS3.p1.6)\. - H\. Liu, D\. Tam, M\. Muqeeth, J\. Mohta, T\. Huang, M\. Bansal, and C\. Raffel \(2022\)Few\-shot parameter\-efficient fine\-tuning is better and cheaper than in\-context learning\.InAdvances in Neural Information Processing Systems 35 \(NeurIPS\),External Links:[Link](https://proceedings.neurips.cc/paper_files/paper/2022/hash/0cde695b83bd186c1fd456302888454c-Abstract-Conference.html)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.p1.1)\. - M\. Mosbach, T\. Pimentel, S\. Ravfogel, D\. Klakow, and Y\. Elazar \(2023\)Few\-shot fine\-tuning vs\. in\-context learning: a fair comparison and evaluation\.InFindings of the Association for Computational Linguistics: ACL 2023,pp\. 12284–12314\.External Links:[Document](https://dx.doi.org/10.18653/v1/2023.findings-acl.779)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.p1.1)\. - L\. Ouyang, J\. Wu, X\. Jiang, D\. Almeida,et al\.\(2022\)Training language models to follow instructions with human feedback\.InAdvances in Neural Information Processing Systems \(NeurIPS\),Vol\.35\.Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p1.1)\. - J\. D\. M\. Rennie, L\. Shih, J\. Teevan, and D\. R\. Karger \(2003\)Tackling the poor assumptions of naive bayes text classifiers\.InProceedings of the 20th International Conference on Machine Learning \(ICML\),pp\. 616–623\.Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p1.1),[§2](https://arxiv.org/html/2609.13185#S2.p1.1),[§3\.1](https://arxiv.org/html/2609.13185#S3.SS1.p1.2)\. - M\. F\. Sada, J\. J\. Graham, E\. E\. Khoda, M\. Tatineni, D\. Mishin, R\. K\. Gupta, R\. Wagner, L\. Smarr, T\. A\. DeFanti, and F\. Würthwein \(2025a\)Serving LLMs in HPC clusters: a comparative study of Qualcomm Cloud AI 100 Ultra and NVIDIA data center GPUs\.External Links:2507\.00418,[Document](https://dx.doi.org/10.48550/arXiv.2507.00418)Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p2.1),[§2](https://arxiv.org/html/2609.13185#S2.SS0.SSS0.Px1.p1.1),[§2](https://arxiv.org/html/2609.13185#S2.p1.1),[§5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px1.p2.6),[§5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px4.p1.1),[§6](https://arxiv.org/html/2609.13185#S6.p2.1)\. - M\. F\. Sada, J\. J\. Graham, M\. Tatineni, D\. Mishin, T\. A\. DeFanti, and F\. Würthwein \(2025b\)Real\-time in\-network machine learning on P4\-programmable FPGA SmartNICs with fixed\-point arithmetic and Taylor approximations\.InPractice and Experience in Advanced Research Computing 2025: The Power of Collaboration,PEARC ’25,New York, NY, USA,pp\. 1–5\.External Links:[Document](https://dx.doi.org/10.1145/3708035.3736086)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.SS0.SSS0.Px1.p1.1),[§5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px4.p1.1),[§6](https://arxiv.org/html/2609.13185#S6.p2.1)\. - M\. F\. Sada and J\. J\. Graham \(2025a\)SC25 SCinet NRE: live high\-precision per\-packet Kubernetes data telemetry from NRP to StarLight via ESnet SENSE\.Note:SCinet Network Research Exhibition \(NRE\) demo, Supercomputing \(SC25\)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.SS0.SSS0.Px1.p1.1),[§6](https://arxiv.org/html/2609.13185#S6.p2.1)\. - M\. F\. Sada and J\. J\. Graham \(2025b\)SC25 SCinet NRE: real\-time in\-network machine learning and P4 testbed deployment on FPGA SmartNICs, DPUs, and switches\.Note:SCinet Network Research Exhibition \(NRE\) demo, Supercomputing \(SC25\)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.SS0.SSS0.Px1.p1.1),[§6](https://arxiv.org/html/2609.13185#S6.p2.1)\. - V\. Sanh, L\. Debut, J\. Chaumond, and T\. Wolf \(2019\)DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter\.InNeurIPS 2019 Workshop on Energy Efficient Deep Learning,External Links:[Document](https://dx.doi.org/10.48550/arXiv.1910.01108)Cited by:[§3\.1](https://arxiv.org/html/2609.13185#S3.SS1.p1.2)\. - R\. Schwartz, J\. Dodge, N\. A\. Smith, and O\. Etzioni \(2020\)Green AI\.Communications of the ACM63\(12\),pp\. 54–63\.Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p1.1),[§2](https://arxiv.org/html/2609.13185#S2.p1.1),[§5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px1.p2.6)\. - E\. Strubell, A\. Ganesh, and A\. McCallum \(2019\)Energy and policy considerations for deep learning in NLP\.InProceedings of the 57th Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 3645–3650\.Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p1.1),[§2](https://arxiv.org/html/2609.13185#S2.p1.1)\. - L\. Tunstall, N\. Reimers, U\. E\. S\. Jo, L\. Bates, D\. Korat, M\. Wasserblat, and O\. Pereg \(2022\)Efficient few\-shot learning without prompts\.Note:Presented at NeurIPS 2022 ENLSP WorkshopExternal Links:2209\.11055,[Document](https://dx.doi.org/10.48550/arXiv.2209.11055)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.p1.1)\. - U\.S\. Energy Information Administration \(2024\)U\.s\. energy\-related carbon dioxide emissions, 2023\.Technical reportU\.S\. Department of Energy\.Note:Average US grid carbon intensity is 367 gCO2e/kWh \(0\.81 lb CO2/kWh\) based on 2023 EIA dataExternal Links:[Link](https://www.eia.gov/environment/emissions/carbon/)Cited by:[§3\.3](https://arxiv.org/html/2609.13185#S3.SS3.p1.6)\. - vLLM Team \(2025\)VLLM: easy, fast, and cheap llm serving\.Note:[https://github\.com/vllm\-project/vllm](https://github.com/vllm-project/vllm)Open\-source LLM serving engine with continuous batching, tensor parallelism, and FP8/quantized inferenceCited by:[§3\.4](https://arxiv.org/html/2609.13185#S3.SS4.p1.1),[§5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px6.p1.1)\. - S\. Wang and C\. D\. Manning \(2012\)Baselines and bigrams: simple, good sentiment and topic classification\.InProceedings of the 50th Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 90–94\.Cited by:[§1](https://arxiv.org/html/2609.13185#S1.p1.1),[§2](https://arxiv.org/html/2609.13185#S2.p1.1),[§3\.1](https://arxiv.org/html/2609.13185#S3.SS1.p1.2)\. - D\. Weitzel, A\. Graves, S\. Albin, H\. Zhu, F\. Würthwein, M\. Tatineni, D\. Mishin, E\. Khoda, M\. Sada, L\. Smarr, T\. A\. DeFanti, and J\. Graham \(2025\)The national research platform: stretched, multi\-tenant, scientific Kubernetes cluster\.InPractice and Experience in Advanced Research Computing 2025: The Power of Collaboration,PEARC ’25,New York, NY, USA,pp\. 1–5\.External Links:[Document](https://dx.doi.org/10.1145/3708035.3736060)Cited by:[§2](https://arxiv.org/html/2609.13185#S2.SS0.SSS0.Px1.p1.1),[§3\.1](https://arxiv.org/html/2609.13185#S3.SS1.p1.2),[§3\.3](https://arxiv.org/html/2609.13185#S3.SS3.p1.6),[§3\.6](https://arxiv.org/html/2609.13185#S3.SS6.p1.1),[§5](https://arxiv.org/html/2609.13185#S5.SS0.SSS0.Px4.p1.1)\. - X\. Zhang, J\. Zhao, and Y\. LeCun \(2015\)Character\-level convolutional networks for text classification\.InAdvances in Neural Information Processing Systems \(NeurIPS\),Vol\.28\.Cited by:[§3\.2](https://arxiv.org/html/2609.13185#S3.SS2.p1.1)\.
Similar Articles
LLMs Are Already Confidence-Aware Zero-Shot Classifiers
The paper evaluates eleven open-weight LLMs (1B–32B) as zero-shot text classifiers, showing that logit-based confidence methods achieve much better discrimination (AUROC 0.74–0.77) than black-box methods (0.57–0.66), and introduces a decision-only scoring technique that cuts decode steps by 88–96% while remaining competitive with commercial classifiers.
Exploring small LLMs as classifiers to rival Jev (sharing what I've found)
The author explores using small LLMs like Gemma 4 as classifiers by analyzing logit probabilities with high temperature and calibration, sharing code and findings on GitHub.
When Do LLM-Elicited Priors Help? A Controlled Audit of Language Models as Priors for Small-Sample Bayesian Regression
This paper audits the practice of using LLMs to elicit priors for small-sample Bayesian regression, finding that model errors are highly correlated across draws, LLM priors only marginally beat classical baselines, and stated uncertainty is unreliable — with data-calibrated prior scales substantially reducing harm.
Don't let the LLM speak, just probe it (8 minute read)
The article introduces a technique that extracts hidden states from an LLM at the last prompt token to perform classification without text generation, using a small MLP to read the model's internal decision, enabling fast and cheap zero-shot classifiers.
Cheaper LLM labelling
The article describes a cost-effective method for labeling commits using a cheap LLM like gpt5.6 Luna, combined with a faster naive Bayes classifier to reduce latency and expense in a Perl-based workflow.