How To

How to Improve Your AI Chatbot's Accuracy with Better Training Data

When a chatbot gives wrong answers the instinct is to blame the model. Research and production experience both point upstream. This guide covers diagnosis, deduplication, chunking, metadata, and the measurement loop that actually moves accuracy.

Stan

Stan

@stan

How to Improve Your AI Chatbot's Accuracy with Better Training Data

When a support chatbot starts giving wrong answers, the first suggestion in almost every room is to upgrade the model. It is the most visible lever and the easiest to pull. It is also, in most deployments, close to irrelevant.

The reason is architectural. A business chatbot does not answer from the model's memory. It answers from passages retrieved out of your documents, and if the retrieval step hands over the wrong three paragraphs, a better model will write a more articulate wrong answer. Practitioners who run these systems in production are direct about where the bottleneck sits: the leading cause of poor RAG performance is not the model, it is the knowledge base, and embedding and chunk quality outweigh model choice in determining answer accuracy.

This guide covers what to actually change. It assumes you already have a chatbot trained on your content and are unhappy with the results, and it works from diagnosis outward. If you are still at the ingestion stage, the companion guide on building an FAQ chatbot from existing documentation covers the earlier steps.

Accuracy Is Three Failures Wearing One Name

"The bot is inaccurate" describes at least three distinct faults, and they have different fixes. Before changing anything, classify twenty recent bad answers.

SymptomWhat actually failedWhere to fix it
Answer is about the right topic but wrong in detailRetrieval pulled a related passage, not the correct oneChunking, metadata, document structure
Answer is confidently inventedNothing relevant was retrieved and the model filled the gapCorpus coverage, plus a grounding instruction
Answer is correct but partialThe full answer was split across passages, only one came backChunk size and overlap
Answer contradicts another answerTwo passages in the corpus disagreeDeduplication and content ownership
Answer is correct but uselessRetrieval worked, the passage assumes missing contextRewrite the passage to stand alone
Answer is staleThe old version was never removedVersioning and review dates

Only one of those rows is plausibly a model problem, and even then it is a prompt problem before it is a model problem. Every other row is data. This is why diagnosing before retraining saves weeks: teams routinely re-ingest an entire corpus to fix a problem that was one contradictory PDF.

Fix 1: Remove Noise Before Adding Signal

The single most common intervention that improves accuracy is deleting things. A smaller, curated corpus consistently outperforms a large, noisy one, because every irrelevant passage is another candidate competing for the top five retrieval slots.

Work through the corpus and remove:

  • Near-duplicates. The same policy pasted into three documents with small variations. A practical rule is to flag pairs above 0.95 cosine similarity after embedding and have a human pick the survivor. Duplicates do not just waste slots, they crowd out the diversity of the retrieved set.
  • Superseded versions. Old pricing pages, previous terms of service, last year's shipping policy. If both versions are in the index, the retriever has no way to know which is current.
  • Contradictions. Two documents that disagree on the refund window, the SLA, or the plan limits. A human reading both notices the conflict; a retrieval system silently picks one.
  • Drafts and internal chatter. Meeting notes, unapproved proposals, "we should probably change this" comments. Anything that is not a statement of fact becomes a fact once the model quotes it.
  • Unreadable files. Scanned PDFs without OCR and image-only documents contribute nothing but occupy the illusion of coverage.
  • Navigation and boilerplate. If you crawled a site, the cookie banner, footer, and menu text got crawled too. Scope the crawl narrowly.

Assign every remaining document an owner and a review date. Content drift is the failure mode that never announces itself: nothing errors, the answers simply become wrong over months.

Fix 2: Get Chunking Right, and Stop Looking for the Universal Number

Chunking, the way documents are split into retrievable passages, has more effect on accuracy than any other single setting, and the advice circulating online is unhelpfully confident. There is no correct chunk size, and the research is unambiguous about why.

A 2025 multi-dataset analysis measured retrieval quality across six question-answering corpora at chunk sizes from 64 to 1024 tokens. The results move in opposite directions depending on what kind of content is being retrieved.

There Is No Universal Chunk Size

Recall@1 by chunk size across three corpora. Short factual content degrades as chunks grow, while technical support documentation improves sharply.

Source: Recall@1 with the Stella embedding model, from Rethinking Chunk Size for Long-Document Retrieval: A Multi-Dataset Analysis (arXiv:2505.21700, 2025).

Read the three curves carefully, because they map onto real business content:

  • SQuAD is short, self-contained factual passages. Recall@1 is highest at 64-token chunks (64.2 percent) and falls steadily as chunks grow, reaching 38.6 percent at 1024 tokens. Small facts want small chunks.
  • TechQA is technical support documentation, which is the closest analogue to most business knowledge bases. It behaves in the exact opposite way: 4.9 percent at 64 tokens, rising to 61.4 percent at 512. A troubleshooting answer chopped into 64-token fragments retrieves almost nothing useful.
  • NarrativeQA is long-form narrative, where the answer requires reading around it. It improves with size throughout, but never gets good, because retrieval is the wrong tool for that shape of question.

The practical guidance that follows is a starting range rather than a rule. Most business knowledge bases sit closer to the TechQA end than the SQuAD end, which is why 400 to 600 token chunks with 50 to 80 tokens of overlap is the common recommendation for support content. But if your corpus is mostly short policy facts, that range is too large, and the only way to know is to measure on your own questions.

StrategyHow it splitsBest forCost
Fixed sizeEvery N tokens, ignoring meaningUniform, low-structure textCheapest, splits mid-sentence
RecursiveOn paragraph, then sentence, then word boundariesGeneral-purpose defaultCheap, respects structure
Document-awareOn headings and sectionsWell-structured docs and help centersCheap, depends on good headings
SemanticWhere the topic shifts, measured by embedding distanceDense, long-form materialSeveral times the ingestion cost
HierarchicalSmall chunks for matching, larger parents for contextMixed corpora, technical documentationHighest complexity

Two adjustments matter more than the strategy label. Overlap of roughly 15 to 20 percent stops answers from being cut in half at a boundary. And splitting on structure rather than character count keeps a procedure's steps together, which is what makes the difference on the kind of content the TechQA curve represents.

Fix 3: Attach Metadata, Then Use It

Most knowledge bases are a flat pile of text with no attributes, which forces every query to search the entire index. Attaching metadata at ingestion lets you filter before you search, and filtering is a far stronger accuracy lever than reranking after the fact.

The fields worth having on every document:

  • Source and version. Where it came from and which revision it is.
  • Effective date and review deadline. Makes staleness visible and auditable.
  • Owner. A named person, not a team inbox.
  • Topic hierarchy. Two or three levels, for example Billing, then Invoices, then Tax.
  • Audience and status. Public or internal, active or archived.
  • Language. Essential once the bot serves more than one.

The payoff is concrete. A question about the current refund policy can be restricted to active, public, billing documents before similarity search runs, which removes the possibility of retrieving the 2024 archived version no matter how similar it looks in vector space.

Fix 4: Write Passages That Stand Alone

Retrieval hands the model a passage with no surroundings. Any phrase that depends on the surroundings becomes a hole the model has to fill, and filling holes is precisely what hallucination is.

Search your corpus for these and rewrite them:

  • Backward references: "as described above", "in the previous section", "see the table below".
  • Implicit process references: "follow the standard escalation path" without saying what it is.
  • Unlabelled pronouns at the start of a section: "It requires admin permissions" with no nearby antecedent.
  • Bare numbers without units or currency: "the limit is 500".
  • Screenshots carrying information the text does not repeat.

Repeating a key fact in several passages feels wrong to a technical writer and is correct for a retrieval corpus. The reader who arrives via chat did not read the section above, because there is no section above.

The same logic applies to headings, which are indexed and heavily influence matching. "Refund eligibility window" retrieves less reliably than "How long do I have to request a refund?" because the second is closer in meaning to what a customer types. This is one of the mechanisms behind how chatbots learn from business content, and it is cheap to exploit.

Fix 5: Close the Vocabulary Gap

Your documents say "deprovisioning". Your customers say "how do I remove someone". Embedding models bridge some of that distance but not all of it, and the gap is widest exactly where it hurts most, on the informal, misspelled, half-typed questions that make up real traffic.

Two cheap fixes:

Add the customer phrasing to the corpus. A short document of the top 30 questions in customer language, each with a two-sentence answer, gives the retriever a target that matches the query almost exactly. This is usually the highest-return single document in a knowledge base.

Mine the failures. Every conversation where the bot refused or answered badly contains the exact phrasing that failed. Feeding those phrasings back as new content closes real gaps rather than imagined ones, and it is why the weekly transcript review habit outperforms any amount of upfront speculation.

Fix 6: Keep One Embedding Model on Both Sides

A quieter failure worth checking: the model used to embed documents at ingestion must be the same one used to embed queries at runtime. Mixing them produces retrieval that is subtly, unfixably wrong, with no error anywhere. If you change embedding models, re-index the entire corpus. Managed platforms handle this internally, which is one of the practical arguments for not assembling a pipeline yourself unless you need to.

Fix 7: Build the Measurement Loop

Every change above is a hypothesis, and without measurement you are redecorating.

  1. Fix a golden set. Fifty to five hundred questions with approved answers, drawn from real tickets and search logs. It does not change between experiments.
  2. Measure retrieval separately from generation. For each question, was the correct passage in the top five results? Precision@5 above 0.8 is a workable production baseline for business documentation, and if you are below it, no prompt change will save you.
  3. Change one thing. Chunk size, or overlap, or the deduplication pass, never all three.
  4. Re-run and compare. Keep the numbers. Chunking changes in particular often improve one class of question while degrading another, and only the golden set makes that visible.
  5. Track unanswered questions in production. They are the highest-value content queue you will ever get, because they are gaps customers actually hit.

This loop is the same instrument used in a pre-launch testing pass, just run continuously instead of once.

When More Data Makes Things Worse

Because "training data" sounds like something you want more of, it is worth stating the opposite plainly. Adding documents reduces accuracy whenever the new material is redundant, contradictory, off-topic, or stale, because retrieval is a competition for a fixed number of slots. Dumping the entire company drive into a support bot reliably produces a worse bot than a curated fifty pages.

The useful mental model is a shelf with room for five books. Every book you add pushes one off. The question is never "do we have more content", it is "is this passage the best possible answer to some question a customer will ask".

Where the Platform Helps

Much of the work above is editorial and no tool removes it. What a platform can remove is the infrastructure tax: chunking and re-indexing on every content change, keeping ingestion and query embeddings consistent, scheduled re-crawls so published content and the corpus never drift apart, and transcript visibility so the failure-mining loop is a weekly habit rather than a data engineering project. Paperchat handles those parts by default, which leaves the corpus itself as the thing you are responsible for, which is the correct division of labour.

The Bottom Line

Chatbot accuracy is a content discipline that happens to involve a model. The research points the same direction as production experience: retrieval fidelity dominates answer quality, and retrieval fidelity is determined by what is in the corpus, how it is split, how it is labelled, and how ruthlessly it is pruned.

Delete the duplicates and contradictions. Match chunk size to the shape of your content rather than to a number from a blog post. Attach metadata and filter on it. Rewrite passages to survive being read alone. Then measure retrieval separately from generation, so the next change you make is the one that matters.