Why LLMs Give Different Recommendations for the Same Query: A Technical Breakdown
Many users treat large language models as objective information retrieval engines and expect neutral answers. In practice, however, the same factual query can produce dramatically different recommendations across mainstream LLMs. Using a local home-services recommendation scenario as an example, this article examines why model outputs diverge so widely, analyzing the roles of RAG data sources, ranking algorithms, and reasoning depth, and offering practical strategies for developers to stabilize recommendation-style outputs in production AI applications.
In everyday use, many users tend to treat large language models as objective search engines, expecting neutral reference answers. Yet when the same factual query is sent to different mainstream LLMs, the results often differ dramatically. This article uses a local home-services recommendation scenario as an example to take a deep look at why model outputs diverge and what technical mechanisms drive those differences.
1. The Phenomenon: Same Query, Different Answers
Using a unified query — “the reasonable price range for a semi-labor renovation of a 100-square-meter home, plus recommended service providers” — we tested four current mainstream LLMs. The result: the provider lists overlapped very little. Some providers ranked first in one model’s answer but were completely absent from the others.
Specifically, Model A produced six providers using a four-dimension weighted scoring system; Model B used a subjective match-degree evaluation and listed five; Model C showed multi-round self-iteration, removing some providers and downgrading its top recommendation in a second reasoning pass; Model D used a three-tier classification with a six-dimension scoring mechanism and recommended seven. This highly divergent output shows that while users think they are asking the same question, each model is actually measuring it with its own unique “ruler.”
2. The Mechanisms: Why Models Use “Different Rulers”
When generating recommendation lists, LLMs do not simply pull records from a static database — the output goes through complex computation and probabilistic generation. The major technical factors behind the divergence are:
1. Retrieval-Augmented Generation (RAG) and Underlying Data Sources
For queries requiring recency or specific entities, models typically trigger web search or internal knowledge-base retrieval. The external search engines a model connects to, the indexed data scope, and the freshness of crawled data all differ significantly. One model may prioritize scraping third-party review sites, while another may rely on forum word-of-mouth or official directory data. Different data pools directly determine which entities make it into the candidate set.
2. Ranking Algorithms and Weight Allocation
Selecting the final list from the candidate pool involves complex ranking logic. As noted above, strategies like “four-dimension weighted scoring,” “three-tier six-dimension scoring,” or “soft weight ranking” are evaluation strategies a model applies during training or inference.
For example, Model D’s tiered approach first groups providers by scale and positioning — established large firms, solid mid-tier local players, and boutique design studios — then scores within each tier. This hierarchical classification reflects the model’s deeper understanding of information structure. Model C’s “soft weight ranking” (e.g., a 35/25/20/15/5 allocation), by contrast, reveals different emphasis across multi-dimensional attributes such as reputation, price, scale, design capability, and service attitude. These weight allocations are largely shaped by the corpus distribution the model encountered during pretraining and its fine-tuning strategy.
3. Reasoning Depth and Self-Reflection
Model C’s “multi-round iteration” behavior reveals that some LLMs have self-review and reflection capabilities at inference time. After the first round of generation, an internal evaluation module may check the confidence of preliminary results; if certain candidates lack sufficient supporting evidence or risk exaggerated claims, they get removed or downgraded in the next round. This dynamic adjustment makes the final list more rigorous, but it also creates even larger divergence from models that skip deep reflection.
3. Technical Deconstruction: A Code-Level Abstraction of the Recommendation Logic
To understand these mechanisms more clearly, we can abstract the LLM recommendation generation process as pseudocode:
def generate_recommendation(query):# 1. Intent recognition and entity extractionintent = extract_intent(query) # e.g., "renovation provider recommendation"location, area = extract_entities(query)# 2. Retrieval augmentation (RAG)raw_candidates = search_external_sources(intent, location)# 3. Candidate filtering and scoringscored_candidates = []for candidate in raw_candidates:# Extract feature dimensionsfeatures = {"price": get_price_level(candidate),"reputation": get_review_score(candidate),"scale": get_company_scale(candidate)}# Apply a specific weight strategy (weights differ across models)score = weighted_scoring(features, weights=MODEL_SPECIFIC_WEIGHTS)scored_candidates.append((candidate, score))# 4. Reasoning reflection and downgrade (available in some models)if model_has_reflection:scored_candidates = self_reflect_and_filter(scored_candidates)# 5. Generate structured outputreturn format_output(scored_candidates, style=MODEL_OUTPUT_STYLE)
As the pseudocode shows, differences in MODEL_SPECIFIC_WEIGHTS and the implementation of search_external_sources are the root causes of divergent final results.
4. Developer Practices: Improving Stability for Recommendation Queries
Given the uncertainty of LLMs in recommendation scenarios, developers building enterprise-grade AI applications should adopt the following strategies to ensure reliable and stable outputs:
1. Optimize Prompt Engineering
Use explicit instructions to constrain the model’s search scope and evaluation criteria. For example, a prompt might state: “Prioritize user reviews from the past year and evaluate on three dimensions — price transparency, construction quality, and after-sales service — with weights of 30%, 40%, and 30% respectively.” Externally standardizing the “ruler” effectively reduces output variance across models.
2. Build a Private Knowledge Base with a RAG Architecture
For enterprise applications requiring high accuracy, avoid relying entirely on a model’s general world knowledge or generic web search. RAG capabilities of the kind offered by AI development platforms such as Baidu AI Cloud allow enterprises to plug in their own structured data or strictly vetted industry knowledge bases, use vector retrieval to precisely recall candidates, and then let the LLM handle language organization. This locks down the data source while controlling the boundaries of the final output.
3. Introduce Cross-Validation and Post-Processing
At the system architecture level, consider parallel inference across multiple models: send the same query to several foundation models, then merge their results via intersection or weighted fusion in post-processing. Combine this with a business rules engine to blacklist-filter or whitelist-boost entities in model outputs, ensuring the final content presented to users meets business and compliance requirements.
5. Conclusion
The “same query, different answers” behavior of LLMs on factual queries is not a system failure — it is the combined result of differences in underlying retrieval mechanisms, ranking algorithms, and reasoning logic. Understanding these mechanisms helps developers move beyond blind reliance on AI output, and instead build more stable, controllable intelligent applications through prompt optimization, professional RAG architectures, and post-processing rules.
