LIVE · Thursday 3 December

LLM Classifiers vs Gradient-Boosted Trees: Use Trees for Tables, Test LLMs Only Where Language Carries the Signal

Tuned XGBoost, LightGBM or CatBoost still leads on medium-sized labeled tables in the main benchmark. Prompted LLMs earn a place with few labels or real text, and fine-tuned encoders often beat both on text classification.

By Thomas9 min read

Use gradient-boosted trees such as XGBoost, LightGBM or CatBoost when the predictive signal sits in numeric and categorical columns with historical labels. Test a prompted LLM classifier when the signal sits in the meaning of text and you have few labels. For text with a few hundred labels or more, a smaller fine-tuned encoder such as RoBERTa often matches or beats the LLM at a fraction of the cost. No published study has compared all of these pipelines, plus hybrids, on the same held-out business data, so treat any ranking as a starting point to test.

The right model depends on where the predictive information lives

The question "LLM classifiers vs gradient-boosted trees" mixes two different problems. In one, the label depends on thresholds and interactions among columns, such as account age, order value and region. In the other, the label depends on what a sentence means, such as whether a support ticket asks to cancel. Many business problems mix both.

A gradient-boosted tree learns from the rows that you give it and nothing else. It splits columns at thresholds and adds many small trees together. A prompted LLM starts from language that it learned in pre-training, so a category name like "requests cancellation" already carries meaning before you show any examples. That prior knowledge is the LLM's advantage when labels are scarce, and it adds little when column names carry no meaning.

The task matrix below sets a starting choice and a baseline for each kind of input.

Input type Where the signal is Start with Keep as a baseline
Numeric and categorical columns, many labels Historical rows Tuned gradient-boosted trees Logistic regression or rules
Columns with meaningful names, under about 256 labels Rows plus column meaning Test an LLM against trees Tuned trees
Free-text tickets, emails or intents, few labels Language Prompted LLM Keyword rules
Free text with hundreds of labels or more Language Fine-tuned encoder Embeddings plus logistic regression
Text plus structured fields Both Trees on columns plus text features Each part on its own

Trees remain the strongest default for pure tabular prediction

The most cited evidence is a NeurIPS 2022 benchmark by Léo Grinsztajn, Edouard Oyallon and Gaël Varoquaux. Across 45 datasets, it found that tree-based models "remain state-of-the-art on medium-sized data (~10K samples)." The authors ran about 400 random-search iterations per dataset and published 20,000 compute hours of tuning results.

The paper explains why trees win. Neural networks struggle with uninformative columns, and they struggle to learn irregular functions, such as a threshold that matters only for one customer segment. Trees handle both by design. XGBoost's documentation also shows native support for categorical columns through enable_categorical=True, so heavy encoding is often unnecessary.

That study has limits that matter in 2026. It truncated training sets to 10,000 rows and compared trees with MLP, ResNet, FT-Transformer and SAINT models. It did not test generative LLMs as tabular classifiers. It supports "trees beat the deep tabular models of 2022," not "trees beat every modern model."

LLMs can beat trees on tables only when labels are very scarce

TabLLM, by Stefan Hegselmann and colleagues at AISTATS 2023, turned each table row into a sentence of column names and values. It then asked the 11-billion-parameter T0 model for a label, and fine-tuned it on the labeled examples that were available. On nine public datasets, TabLLM "outperformed or was on par with the tree ensemble baselines until 256 training examples for all datasets except Calhousing and Jungle."

The result has a clear boundary. The gain came from the meaning of the column names, so the authors warn that it fails when the columns represent things such as gene names that pre-training did not cover. XGBoost did poorly with very few rows, probably because it overfitted the tiny training and validation sets. With all the training data on the Bank dataset, XGBoost reached an AUC of 0.94 against 0.92 for TabLLM. TabPFN, a model pre-trained on synthetic tables, was the strongest baseline in that study at every training size.

The authors also state the cost plainly. T0 inference "requires far more FLOPs than inference with XGBoost or LR." For a table with thousands of labeled rows, the evidence points back to trees.

For text, a fine-tuned encoder belongs in the comparison because it often beats prompted LLMs

When the input is text, trees need the text turned into features first, for example embeddings or word counts. That makes the fair comparison three-way: a prompted LLM, a tree or linear model on text features, and a small language model fine-tuned on your labels.

Branislav Pecher, Ivan Srba and Maria Bielikova tested that question at EMNLP 2025. Across eight text classification tasks and eight models, specialised small models "often need only few samples (on average 100)" to match or beat general LLMs. The average hides a wide range, which is why 100 should not be read as a universal threshold.

  • On multi-class tasks such as AG News, fine-tuning beat zero-shot prompting at about 40 labels.
  • On binary tasks, fine-tuning needed 4,250 labels to beat prompting on BoolQ, and up to 9,000 to beat in-context learning.
  • When run-to-run variance was counted, the labels needed rose by 100 to 200% on average.
  • On SNIPS, in-context learning reached the first break-even at 50 labels, and the variance-adjusted break-even never arrived, even with all 15,000 labels.

A February 2026 study by Alberto Andres Valdes Gonzalez adds production costs. On AG News, fine-tuned RoBERTa scored 94.63 macro-F1 against 87.93 for zero-shot GPT-4o and 91.35 for zero-shot Claude Sonnet 4.5. DistilBERT cost $5.73 per million requests on Google Cloud Run, against $276.00 for zero-shot GPT-4o. The exception was IMDB, where few-shot Claude Sonnet 4.5 reached 96.48 macro-F1 against 94.84 for RoBERTa. An earlier LREC-COLING 2024 study across 16 datasets reached the same broad conclusion that fine-tuning smaller models can still beat few-shot prompting.

A fair comparison uses identical splits, several seeds and the metrics that drive decisions

A fair test runs every pipeline on the same held-out examples, with the same label definitions, and reports variance across repeated runs.

  1. Split by time with scikit-learn's TimeSeriesSplit, or by customer with GroupKFold, which "ensures that the same group is not represented in both testing and training sets." Random splits leak future or same-customer information into training.
  2. Freeze one test set, and give every pipeline the same training budget at 50, 100, 250, 1,000 and all labels.
  3. Train each model with several random seeds, and run each LLM with several prompt wordings and example orderings.
  4. Name the checkpoint, the preprocessing, the hardware and the tuning budget for each pipeline.
  5. Report per-class precision and recall, macro-F1, and calibration, which means that scores of 0.8 should be correct about 80% of the time.
  6. Report deferral coverage, meaning the share of cases that each model can decide automatically while staying under a stated error limit.

The last two items matter more than accuracy in many workflows. A classifier that routes 70% of tickets correctly and sends the rest to people can be worth more than one with higher accuracy and poor confidence scores. scikit-learn's CalibratedClassifierCV can recalibrate trees and encoders. Its documentation warns that isotonic calibration overfits small datasets, so sigmoid calibration is safer under about 1,000 labels. Label accuracy also differs from workflow success, so a downstream measure such as reopened tickets should be tracked separately.

Prompt length and model tier set the cost of each thousand LLM predictions

List prices set the cost of prompting. OpenAI's pricing page lists gpt-6-luna at $0.10 per million input tokens and $0.50 per million output tokens. Anthropic's pricing page lists Claude Haiku 5.5 at the same rates for prompts up to 100,000 tokens.

Take a sample workload of one million ticket classifications a month. Assume that each request carries 300 tokens of ticket text and 300 tokens of instructions and label definitions, and returns a 5-token label.

  • On gpt-6-luna or Claude Haiku 5.5, the input costs 600 million tokens at $0.10, which is $60.00. The output costs 5 million tokens at $0.50, which is $2.50. The total is $62.50 a month, or about six cents per thousand predictions.
  • Batch processing halves both rates, which brings the total to $31.25 if results can wait.
  • Asking for a 100-token explanation with each label adds $50 a month at the output rate.
  • On Claude Sonnet 4.6 at $3 input and $15 output, the same workload costs $1,875 a month.
  • Embedding only the 300-token ticket text with OpenAI's text-embedding-3-small at $0.02 per million tokens costs $6.00 a month, before the small cost of running a classifier on those vectors.

These figures cover inference only. Labeling, tuning, retries, monitoring and retraining add costs that depend on your team. The label counts from the Pecher study are the best guide to labeling effort. The CPU cost of serving a tuned tree on this workload has not been measured, and neither has the cost of maintaining each pipeline.

Parsec, a small language model lab, sells a different option for inputs that are long and that end in a fixed set of choices. Its TOD decision model ranks a supplied list of options and returns one probability per option, without generating text. Parsec's TOD page lists a price of $0.30 per 1,000 decisions, flat regardless of context length. On the prices above, that flat fee costs less than per-token prompting only when inputs exceed about 3,000 tokens per decision. The release is LoRA adapters on a Gemma 4 base model, whose weights users download separately under the Gemma 4 licence. Its repo says that TOD is not state of the art on JevBench, and no comparison of TOD against trees or fine-tuned encoders on classification has been published.

Fluent LLM explanations are not faithful attributions

LLMs can explain their labels in plain language, and that looks like an advantage for review. The evidence does not support that. Miles Turpin and colleagues showed at NeurIPS 2023 that chain-of-thought explanations "can systematically misrepresent the true reason for a model's prediction." When the researchers reordered few-shot examples so that the answer was always "(A)," the models followed the bias. Their explanations did not mention it, and accuracy fell by as much as 36% on 13 BIG-Bench Hard tasks.

Trees offer a stronger review artifact. XGBoost's pred_contribs option returns "exact TreeSHAP feature attributions" for each prediction, so a reviewer can see which columns moved a score. Store those attributions, or the encoder's class probabilities, with every decision. Treat an LLM's explanation as a reading aid, not as evidence of why the label was chosen.

A model score is also not an authorization. A high score can mark a ticket as a likely refund request, but the application should still check whether that customer is allowed a refund.

Hybrid pipelines should be adopted only when they beat each part on the same test set

Mixed inputs invite a hybrid design: an encoder or LLM turns the text into features, and a tree combines those features with the structured columns. The Valdes Gonzalez study recommends LLMs as complementary parts of hybrid systems rather than as the default classifier. Whether such a hybrid beats its best single part on business data has not been measured in published work.

Run the text-only model, the columns-only tree and the hybrid on the same time-based split. Adopt the hybrid only if it improves macro-F1 or deferral coverage by more than the run-to-run variance. Otherwise the extra pipeline adds serving and maintenance work without a measured benefit.

Sources

More in Research

All Research →