Not Everything Needs an LLM: Where Boosting, Embeddings, and Rules Win in Production

The LLM Hype Cycle and the Blind Spot

Large language models (LLMs) are the poster child of modern AI. Companies everywhere are rushing to integrate ChatGPT, GPT-4, and open-source alternatives into every possible workflow. But as a recent deep-dive on Habr highlights, the assumption that LLMs are the best tool for every task is not only wrong — it’s costly and often counterproductive.

The article, titled «Не всё надо решать LLM. Где в продакшене побеждают бустинги, эмбеддинги и правила» (Not everything needs to be solved by LLMs. Where boosting, embeddings, and rules win in production), presents a sobering reality check. The authors, who work on real-world machine learning pipelines, share concrete cases where simpler, more deterministic methods outperform general-purpose LLMs in speed, accuracy, and cost. You can read the original piece here: Source.

This article is not an anti-LLM rant. It’s a practical guide for engineers and product managers who need to choose the right tool for the right job. The core message: LLMs are great for open-ended generation and reasoning, but for structured classification, ranking, and low-latency decisions, boosting, embeddings, and rule-based systems often deliver better results.

Let’s break down the key takeaways and explore where and why these alternative approaches win in production.

The Case Against Using LLMs for Everything

1. Latency and Cost

LLMs are slow and expensive. A typical GPT-4 request can take 2–5 seconds and cost $0.03–$0.12 per 1K tokens. For a production system handling thousands of requests per second, that’s untenable. Boosting models like XGBoost or LightGBM, on the other hand, can make predictions in microseconds and cost pennies per million inferences.

Example from the article: A team needed to classify customer support tickets into 50 categories. They tried an LLM-based zero-shot classifier. Accuracy was decent (92%), but latency averaged 3 seconds per ticket. They switched to a boosting model trained on historical data. Accuracy rose to 97%, latency dropped to 2 milliseconds, and infrastructure costs fell by 95%.

2. Interpretability and Debugging

When an LLM misclassifies a request, understanding why is nearly impossible. The model is a black box. Boosting models, especially with tools like SHAP or LIME, offer clear feature importance scores. Rule-based systems are even more transparent — you can trace every decision to a specific condition.

Real-world scenario: A fintech company used an LLM to approve or reject loan applications. Regulators demanded explanations. The LLM couldn’t provide them. They replaced it with a gradient-boosted decision tree (GBDT) and a small set of hard rules for edge cases. The new system was not only explainable but also more accurate and faster.

3. Hallucination and Reliability

LLMs are notorious for hallucinating facts. In production, especially in domains like medicine, law, or finance, a single hallucination can have serious consequences. Rule-based systems and boosting models never invent information — they operate strictly on the input features.

Case from the article: A legal document summarization system using GPT-4 occasionally inserted clauses that didn’t exist. The team replaced the LLM with a two-stage pipeline: first, an embedding-based retrieval system to find similar past summaries; second, a rule-based template filler. Hallucinations dropped to zero, and output quality actually improved.

Where Boosting Wins

Boosting models (XGBoost, LightGBM, CatBoost) are the unsung heroes of structured data. They excel at:

  • Tabular data classification and regression — fraud detection, credit scoring, churn prediction.
  • High-dimensional sparse features — click-through rate prediction, recommendation systems.
  • Imbalanced datasets — rare event detection (e.g., equipment failure, fraud).

Key advantage: Boosting models require far less data and compute than LLMs. A well-tuned XGBoost model can achieve state-of-the-art results on many tabular benchmarks, often outperforming neural networks and LLMs.

Practical tip: If your data fits into rows and columns — customer attributes, transaction records, sensor readings — start with a boosting model. It’s almost always the fastest path to a deployable model.

Where Embeddings Win

Embeddings — dense vector representations of text, images, or other data — are a powerful alternative to LLMs for similarity and retrieval tasks.

  • Semantic search: Instead of using an LLM to answer a query, use embeddings to find the most relevant documents and return them directly. This approach is faster, cheaper, and never hallucinates.
  • Deduplication and clustering: Embedding-based similarity can detect near-duplicate content, group similar products, or identify anomalies.
  • Recommendation systems: User and item embeddings can be compared with simple cosine similarity to generate recommendations.

Real-world example from the article: A content moderation system needed to flag toxic comments. The team first tried an LLM-based classifier. It was slow and expensive. They switched to a sentence transformer model (a type of embedding model) that maps comments into a 768-dimensional vector. Then, they used a simple k-nearest neighbors (k-NN) algorithm to compare new comments against a labeled dataset. The embedding-based approach was 50x faster, equally accurate, and cost pennies per million inferences.

Important note: Embeddings are not a silver bullet either. They work best when you have a fixed set of categories or a reference dataset. For open-ended tasks (e.g., generating a response), an LLM is still necessary.

Where Rules Win

Rule-based systems — if-then-else logic, decision trees, or business rules engines — are often dismissed as primitive. But in many production scenarios, they are the best choice.

  • High-stakes decisions: When a wrong decision is catastrophic (e.g., medical diagnosis, credit approval), rules provide 100% deterministic behavior.
  • Regulatory compliance: Laws and policies are encoded as rules. A machine learning model might learn to bypass them.
  • Simple tasks: If a problem can be solved with a few if-else statements, don’t use a model at all.

Example from the article: An e-commerce platform used an LLM to determine whether a product review was helpful. The LLM was overkill. The team replaced it with a simple rule: “If review length > 100 words AND rating is 4 or 5, mark as helpful.” This rule covered 80% of cases with 99% accuracy. The remaining 20% were handled by a lightweight boosting model. Total cost savings: 90%.

When to Use an LLM (and When Not To)

Task Best Tool Why
Sentiment analysis on short text Boosting model (e.g., XGBoost) Fast, cheap, interpretable
Open-ended chatbot LLM (GPT-4, Claude, Llama) Needs generation and reasoning
Document classification into 10 categories Embedding + k-NN Fast, no hallucinations
Summarizing a legal contract LLM + rule-based post-processing LLM generates, rules ensure accuracy
Fraud detection on transaction logs Boosting model Tabular data, high dimensionality
Content moderation (toxic vs. safe) Embedding + simple classifier Fast, scalable, explainable
Generating a personalized email LLM Needs creativity and variable content

The Hybrid Approach: Best of All Worlds

The most successful production systems don’t choose one tool — they combine them. A classic architecture:

  1. Rule-based pre-filter: Handles simple, deterministic cases (e.g., “if email contains ‘unsubscribe’, route to spam”).
  2. Embedding-based retrieval: Finds similar historical cases or relevant documents.
  3. Boosting model: Makes the final classification or prediction based on structured features.
  4. LLM (optional): Handles edge cases or generates human-readable explanations.

Case study from the article: A customer support triage system used this exact stack. Rules handled 30% of tickets (password resets, account lockouts). Embedding-based retrieval matched 50% of tickets to known solutions. A boosting model classified the remaining 20% into priority levels. Only 5% of tickets ever reached an LLM for complex reasoning. The result: average resolution time dropped from 15 minutes to 2 minutes, and support costs fell by 60%.

How to Get Started

If you’re building a production ML system, here’s a practical checklist:

  1. Start with rules. Can you solve 80% of cases with simple if-then logic? Do it.
  2. Add embeddings for similarity. Use libraries like sentence-transformers or text-embeddings-inference for fast vector search.
  3. Train a boosting model for prediction. Use XGBoost or LightGBM with your structured features. Tune hyperparameters with cross-validation.
  4. Only then consider an LLM. Use it for tasks that require generation, reasoning, or handling novel cases.

Tool recommendations (all confirmed active in 2026):
- Boosting: XGBoost, LightGBM, CatBoost — all open-source and well-maintained.
- Embeddings: Sentence Transformers (Hugging Face), OpenAI Embeddings API, Cohere Embeddings.
- Vector databases: Pinecone, Qdrant, Weaviate — for storing and searching embeddings at scale.
- Rule engines: Drools (Java), EasyRules (Java), or simple Python conditional logic.

Conclusion

LLMs are a remarkable technology, but they are not the only tool in the AI toolbox. For many production tasks — especially those involving structured data, low latency, or high stakes — boosting, embeddings, and rules are faster, cheaper, more accurate, and more reliable.

As the Habr article concludes: “The best model is the one that solves the problem with minimal complexity.” Don’t let the hype blind you. Start simple, measure everything, and add complexity only when justified.

Next time you’re tempted to throw an LLM at a problem, ask yourself: Can a rule do it? Can a boosting model do it faster? Can an embedding do it cheaper? The answer might surprise you.

For those building production systems, ASI Biont supports connecting to tools like XGBoost, Pinecone, and custom rule engines via API — learn more at asibiont.com/courses.

← All posts

Comments