Starts Nov 23Live Cohort 3 of Vibe Coding & AI Agents (Nov 23, 18:30 MSK): 3 weeks, 9 live hands-on sessionsCohort 3 (Nov 23) →
ReleaseInsight · On RadarHabr: MTS AI→ original

A Classifier Instead of an LLM Decides Whether RAG Needs Retrieval, Using Less Than 1% of the Compute

RAG means the model searches an external database before answering, while adaptive schemes still spend several extra LLM calls deciding whether to search at all. Researchers from MWS AI, AIRI, and Skoltech assigned this decision to a lightweight classifier that looks only at the question: whether its entities are known and how complex it is. The decision costs less than 1% of the compute needed to generate the answer, and the share of correct answers is 38.9% versus 38.4% when every question triggers a search. For production, this is a cheap router.

AI-processed from Habr: MTS AI; edited by Hamidun News
A Classifier Instead of an LLM Decides Whether RAG Needs Retrieval, Using Less Than 1% of the Compute
Source: Habr: MTS AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr: MTS AI ↗
Editor-in-Chief
27 features in 7 groupsWikipedia page views, question type and complexity
LLM calls per question1.0 versus 5.2 for AdaptiveRAG and 6.3 for DRAGIN
The leaders are slightly more accurateAdaptiveRAG at 40.3% and DRAGIN at 41.1%

RAG is a scheme in which a large language model (LLM) searches for information in an external database before answering, rather than relying only on its memory. This reduces hallucinations. But the scheme has a cost: every search adds compute and latency, and poor or irrelevant context can spoil an answer the model would have gotten right on its own.

That is why adaptive RAG emerged: retrieval is triggered only when it is needed. The problem is that the decision "search or not" is usually also made by the LLM, which spends extra calls on it. Researchers from MWS AI, AIRI, Skoltech, and several universities showed at EMNLP 2025 how to make this decision based on the question itself: it takes less than 1% of the compute (FLOPs) required to generate the answer.

The problem with conventional adaptive RAG

Almost all existing approaches look inside the model: at its internal states, at signals in the output, or they ask the model to assess its own uncertainty. The result is a paradox: to save on unnecessary retrieval, the system makes extra calls to the large model. The gain the whole effort was meant to deliver is partly eaten up.

This shows in the average number of LLM calls per question. Hybrid UE, the best of the simple uncertainty-estimation approaches, uses 1.7–2.0. AdaptiveRAG uses up to 5.2, DRAGIN up to 6.3, SeaKR up to 14.6, and RowenCM reaches 42.1. For a service handling thousands of requests per minute, these are direct GPU costs.

How the router looks at the question

The authors propose not to look inside the model, but to analyze the question and the entities in it. Picture a duty officer deciding whether to call an expert. A question about the capital of France, they can answer themselves. A question about an obscure person from a city archive will require a search. For this assessment, 27 features are collected in seven groups:

  • connections between entities in the Wikidata knowledge graph;
  • the number of views of their Wikipedia pages over the past year;
  • how often the entities appear in a large text corpus;
  • how well the LLM "knows" the entity: this score is computed in advance, offline;
  • the question type, from nine categories: comparison, counting, yes/no, multi-step, and others;
  • whether the question is a single step or requires a chain of reasoning;
  • how relevant the retrieved context is to the question.

Entities are extracted with the ready-made tools BELA and DeepPavlov. The question type is determined by a BERT-based classifier, which identifies the type correctly in 93% of cases on the validation set. Complexity is estimated by DistilBERT with an F1 of 0.82 on the test set (a combined measure of precision and recall). The relevance of retrieved passages is scored by a BERT cross-encoder. The decision is made not by a giant neural network but by an ordinary ML classifier: the final version is an ensemble of the two best standard models. Because the model's knowledge scores for entities are computed in advance, no new LLM call is needed for each question.

What the tests showed

The router was tested with LLaMA 3.1-8B-Instruct using BM25 retrieval, and separately with Qwen2.5-7B-Instruct. The data were six question-answering datasets: SQuAD, Natural Questions, TriviaQA, MuSiQue, HotpotQA, and 2WikiMultiHopQA. Quality was measured as the share of answers that contain the correct answer.

The strongest external features turned out to be the model's knowledge score for entities and question complexity: 38.9% and 38.8%. The "always search" mode gives 38.4%, and Hybrid UE with uncertainty estimation gives 39.3%. The strongest are AdaptiveRAG at 40.3% and DRAGIN at 41.1%. There is no accuracy record here, but the external features come close to the expensive methods, and they average one LLM call per question.

Limitations and the practical takeaway

Combining external features with uncertainty signals is usually pointless: across most datasets they tend to replace rather than complement each other. A noticeable benefit from the combination shows up mainly on MuSiQue. The tests ran on models in the 7–8B class and on open QA sets, so results on your internal documents will need to be verified. Popularity on Wikipedia says little about closed corporate data: there, the role of these signals would have to be played by your own metrics, such as question types and the quality of retrieved context.

The practical point is simple: the routing decision should not cost as much as generating the answer. If your RAG triggers a search on every request, start with an inexpensive classifier based on question type and complexity. Check how many searches and model calls you can cut without losing quality. A lightweight ML router in front of a heavy model fits well into the broader effort to reduce inference costs.

Story

Key Questions Answered

What are the key details on The problem with conventional adaptive RAG?

Almost all existing approaches look inside the model: at its internal states, at signals in the output, or they ask the model to assess its own uncertainty. The result is a paradox: to save on unnecessary retrieval, the system makes extra calls to the large model. The gain the whole effort was meant to deliver is partly eaten up. This shows in the average number of LLM calls per question. Hybrid UE, the best of the simple uncertainty-estimation approaches, uses 1.7–2.0.

How the router looks at the question?

The authors propose not to look inside the model, but to analyze the question and the entities in it. Picture a duty officer deciding whether to call an expert. A question about the capital of France, they can answer themselves. A question about an obscure person from a city archive will require a search.

What the tests showed?

The router was tested with LLaMA 3.1-8B-Instruct using BM25 retrieval, and separately with Qwen2.5-7B-Instruct. The data were six question-answering datasets: SQuAD, Natural Questions, TriviaQA, MuSiQue, HotpotQA, and 2WikiMultiHopQA. Quality was measured as the share of answers that contain the correct answer. The strongest external features turned out to be the model's knowledge score for entities and question complexity: 38.9% and 38.8%.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…