How to Evaluate AI Q&A Systems: Core Capabilities, Testing, and Composable Workflows
When choosing an AI Q&A system, start by defining your task type, then compare candidate models on the same test set. This guide breaks down four key capabilities—knowledge retrieval, text rewriting, code assistance, and conversational experience—and shows how to build a composable workflow with a pre-launch checklist.
When selecting an AI Q&A system, first determine your task type, then compare candidate models using the same test set to measure real-world performance. This guide covers four capability areas: knowledge retrieval, text rewriting, code assistance, and conversational experience, along with a method for building composable workflows and a pre-launch checklist.
1. Knowledge Retrieval: Verify Evidence Before Trusting Answers
Retrieval-Augmented Generation (RAG) means the system first retrieves relevant passages from external documents or a search index, then generates an answer based on those passages. Regular search returns a list of links, while RAG returns a natural-language answer organized by the model—which means you need to additionally check whether the answer is consistent with the evidence.
A complete RAG pipeline typically involves four stages:
- Recall: Use keyword or vector search to retrieve candidate passages. A common approach is to fetch the top 20 to 50.
- Reranking: Use a cross-encoder or rules to sort candidates, keeping the top 3 to 8 for the model.
- Generation: Pass the passages to the model along with the user’s question, and require the model to cite the source of each factual claim.
- Citation verification: Check each fact in the answer against the retrieved passages. Remove or flag anything that cannot be traced to a source as uncertain.
There are three typical failure modes in retrieval. First, the index is not updated in time, so the system gives outdated answers on recent events. Second, the recall stage misses key documents, and subsequent reranking and generation cannot recover the missing information. Third, the model generates plausible-sounding content even when evidence is insufficient. Therefore, when evaluating, record both recall rate and factual consistency separately—don’t judge by fluency alone.
2. Text Rewriting: Choose Models by Task Type
Differences between models in rewriting typically show up in three areas: whether they faithfully preserve the facts of the original text, whether they can switch to a specified writing style, and whether they stay consistent across long documents. Refer to the table below when selecting a model.
| Task Type | Input Material | Key Metrics | Common Failures |
|---|---|---|---|
| Explainer articles | Fact passages from retrieval | Factual consistency, terminology accuracy | Fabricated data, missing qualifications |
| Q&A drafts | Structured points and question lists | Style consistency, question coverage | Repetition between answers, inconsistent tone |
| Podcast scripts | Long-form material with listener profiles | Conversational tone, reading-time match | Overly long sentences, unsuitable for narration |
For evaluation, prepare 30 to 50 rewriting samples and have two reviewers score each independently on a 1-to-5 scale, then measure agreement between the two sets of scores. Define the scoring rubric clearly before starting, otherwise results cannot be compared fairly. Adjust sample size and scoring criteria based on your business scale.
3. Code Assistance: Fast Generation Demands Human Review
Models with strong coding capabilities typically have training data rich in open-source code and are specifically trained for tasks like code completion and bug fixing. These models understand syntax accurately and can infer call relationships from context.
Code ability and general conversational ability differ in training objectives. As a result, a model may excel at code but be weak at casual conversation, or vice versa. Test these capabilities separately during evaluation—never substitute one for the other.
Generated code still requires human verification. Common practices include:
- Write unit tests for generated code and track the pass rate.
- Scan introduced dependencies for vulnerabilities and license issues, for example with pip-audit or npm audit.
- Never include secrets, internal API endpoints, or other sensitive information in prompts.
- Logic involving authentication, payments, or data deletion must pass human code review before being merged.
4. Conversational Experience: Fine-Tuning Needs Data and Metrics
Supervised fine-tuning (SFT) trains a model on human-written instructions paired with reference answers. It is well suited for teaching a model fixed output formats and task workflows. Training data should cover the phrasing real users actually use; sample size depends on task complexity. Start with a few hundred samples for small-scale validation, then scale up once results are stable.
Reinforcement Learning from Human Feedback (RLHF) first trains a reward model on human preference rankings, then optimizes the generation policy accordingly. It makes answers better aligned with user preferences, but annotation costs are high. Overtraining can make answers overly conservative, with frequent refusals to answer.
Evaluate fine-tuning results against a held-out test set, tracking these metrics:
- Task completion rate
- Factual error rate
- Coreference consistency in multi-turn conversations
- Rate of justified refusals
A fine-tuned model performing well on demo samples does not mean it is equally reliable in real scenarios. Re-test against the same test set after every fine-tuning run, and do not deploy any version that fails to meet the metrics.
5. Composable Workflows: Interface Definitions and Fault Tolerance
A single model rarely performs best across all tasks. A more practical approach is to split retrieval and rewriting into independent nodes connected by a pipeline:
Retrieval node → Rewriting node → Verification node → Output
Nodes can exchange data through a unified JSON structure, for example:
{"query": "User's original question","sources": [{"doc_id": "d001", "text": "Original passage", "url": "Source URL"}],"style": "Explainer article","answer": "Rewritten content","citations": ["d001"]}
The following configuration works as a starting point and should be tuned based on actual latency and cost:
- Set the retrieval node timeout to 3 seconds and the rewriting node timeout to 30 seconds.
- Retry failed requests up to 2 times with exponential backoff, at intervals of 1 second and 2 seconds.
- If the rewriting node fails repeatedly, return the structured summary from retrieval directly, marked as “not rewritten,” to avoid breaking the entire pipeline.
On the infrastructure side, object storage can hold raw materials, message queues can decouple long-running rewriting tasks, and an API gateway can handle authentication and rate limiting uniformly.
6. Pre-Launch Checklist
- Retrieval: Sample 100 real user questions and record recall rate and first-hit rate.
- Rewriting: Keep 30 samples per writing style, with human review of factual consistency.
- Code: All generated code passes unit tests and human review; dependency scans show no high-severity vulnerabilities.
- Conversation: Maintain an independent test set; after each fine-tuning run, compare factual error rate and refusal justifiability. Do not launch if metrics fall short.
The key to model selection is evaluating each capability independently. Define your task type first, compare candidate models on the same test set, then connect their respective strengths through a composable workflow. Base your conclusions on test data from your own business—not on the results of a single demo.
