Choosing an LLM for Intelligent Q&A: Combining Search and Rewriting
This article explains why no single large language model handles every task well, and how to compare candidate models across four dimensions: information retrieval, text rewriting, logical reasoning, and code generation. It also describes a search-then-rewrite workflow that separates fact gathering from writing, along with steps for selecting and reviewing models.
As large language models develop rapidly, intelligent Q&A tools keep multiplying. Developers and enterprise users often do not know where to start when choosing one. Models differ in architecture, training data, and fine-tuning strategy, so their performance on specific tasks varies widely. No single model performs well in every scenario. Understanding the capability boundaries of each model and then adopting a combined strategy is a practical way to improve content production efficiency.
1. Why Relying on One Model Is Not Enough
Many people use a single model for every problem. This works fairly well for simple Q&A. But for tasks that require fast retrieval of up-to-date information, fine-grained control over writing style, or multi-step reasoning, the results are often unstable. Knowing the strengths and weaknesses of each model is more useful in practice than aiming for a model that does everything.
2. Four Evaluation Dimensions and a Scoring Table
The practical value of an intelligent Q&A model can be broken down into four dimensions: information retrieval, text rewriting, logical reasoning, and code generation. Each dimension needs specific tasks and measurable metrics. Without them, conclusions tend to stay at the level of impressions.
The table below shows one way to approach evaluation. Teams can replace the task examples and thresholds to fit their own business. The thresholds are only examples, and they should be set according to the business risk involved.
| Dimension | Typical Task Example | Core Metrics | Pass Criteria (Example) |
|---|---|---|---|
| Information retrieval | Looking up how a product’s version changed over the past year | Factual accuracy, source traceability, information timeliness | Accuracy of key facts is at least 90%, and every conclusion includes a source |
| Text rewriting | Rewriting a technical document as a beginner-friendly science article | Fact retention, style compliance, readability | No facts beyond the source material are added. Human ratings are at least 4 on a 5-point scale |
| Logical reasoning | Multi-step math word problems, conditional elimination questions | Final answer accuracy, completeness of reasoning steps | Accuracy on a fixed question bank meets the threshold set by the team |
| Code generation | Writing a function from a requirement and passing unit tests | Unit test pass rate, number of security vulnerabilities | All unit tests pass, with no high-severity security alerts |
Prepare 50 to 200 test cases and run the same set against every candidate model. Record the model name, version number, and test date for each run. Models are updated frequently, so older conclusions can become outdated quickly.
3. How to Choose a Model
Step 1: Identify the task type that makes up the largest share of your business. If most work involves factual queries, prioritize retrieval capability. If most work involves content production, prioritize rewriting quality.
Step 2: Score the candidate models using the same test set, and review the scores for each dimension separately. A model with a high average score is not necessarily the best choice for a specific task.
Step 3: Compare cost and response latency. A model with slightly lower accuracy but faster responses and a lower price may be more suitable for batch tasks.
Step 4: Keep at least two candidate models. If the primary model’s quality drops or the service is interrupted, you can switch quickly.
4. Implementing “Search First, Then Rewrite”
This workflow splits retrieval and rewriting into two stages, and assigns each stage to a model that handles it well. The search model collects facts and sources. The rewriting model only processes the collected material and does not browse the web. As a result, factual sources can be traced, and the rewriting model has less opportunity to add content on its own. However, this does not fully eliminate the risk of models fabricating information, so a review step remains essential.
The process has four steps.
Step 1: The search model collects material. The prompt asks it to list key facts, figures, and source links.
Step 2: Check whether the material is sufficient. If no reliable source is found, the process stops immediately, so the rewriting model does not fill in gaps on its own.
Step 3: The rewriting model generates the article based on the material. The prompt should specify the target readers, the writing style, and the output format, and prohibit any facts that are not in the material.
Step 4: Review manually or with rules. Focus on verifying key figures, dates, and source links.
The code below is a skeleton of this workflow, included to illustrate how the calls are made. Replace the API URL and model names with those of the service you actually use. Read the keys from environment variables and do not write them into the code.
```python
import os
import time
import requests
API_URL = os.environ[“MODEL_API_URL”]
API_KEY = os.environ[“MODEL_API_KEY”]
def call_model_api(model: str, prompt: str, timeout: float = 30.0, retries: int = 2) -> str:
“””Call the model API and return the text. Retry with exponential backoff on failure.”””
headers = {“Authorization”: f”Bearer {API_KE
