{"slug": "my-llm-pipeline-failed-its-own-tests-and-that-was-the-point-published-true", "title": "My LLM Pipeline Failed Its Own Tests (and That Was the Point) published: true", "summary": "A developer built a multi-stage LLM writing pipeline—outline, draft, refine, plus four guardrails for length, outline-copying, structure and repetition—and found that testing the checks against deliberately bad and good output exposed flaws in the guardrails themselves. A planted-error test showed the fact-checker caught all three injected mistakes from a source file, but on a real post it reported zero issues while missing an error describing attention scores as divided by the \"inverse square root\" of the key dimension instead of the square root. The developer traced an over-length problem to the draft prompt's paragraph rules rather than the trimming pass, and fixed it by scaling paragraph rules to each section's word budget with a hard ceiling.", "body_md": "The outline stage returns validated JSON. The draft stage writes each section separately, passing in the previous text for flow. The refine stage edits for repetition and can fact-check against a source file. Four guardrails then check length, outline-copying, structure and repetition. Tone, audience and length are configurable, and I ran it on three different topics.\n\nMy first fix was to trim the draft afterwards, but each pass removed only 10 to 20 words. The real cause was my own draft prompt, which demanded 2 to 3 paragraphs of 3 to 5 sentences per section. Five sections of that can never fit in 700 words. Scaling the paragraph rules to each section's word budget and adding a hard ceiling fixed it at the source.\n\nI tested the checks with deliberately bad input. A pasted outline must fail the \"not just the outline\" check, and it did (12 of 12 key points copied). But testing also showed that my structure check wrongly flagged the one-paragraph conclusion, and my outline-copy threshold was too strict for short posts. A check you haven't tested against both bad and good output only measures your assumptions.\n\nI planted three errors in a test draft, such as \"PostgreSQL cannot store vectors\", and the fact-checker found and fixed all three from the source file. Then I ran it on the real Transformer post. It reported zero issues, yet the post said attention scores are divided by the \"inverse square root\" of the key dimension. The correct operation is dividing by the square root. I caught it by reading the post myself.", "url": "https://wpnews.pro/news/my-llm-pipeline-failed-its-own-tests-and-that-was-the-point-published-true", "canonical_source": "https://dev.to/abhi18/my-llm-pipeline-failed-its-own-tests-and-that-was-the-pointpublished-true-2f4p", "published_at": "2026-11-27 07:42:06+00:00", "updated_at": "2026-11-27 07:44:29.987592+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "generative-ai"], "entities": [], "also_reported_by": [], "takeaway": "Test each pipeline guardrail against both deliberately bad and known-good output, since an untested check only measures your assumptions—and a fact-checker that passed three planted errors still missed a real one, so human review remains necessary.", "recommendation": {"advice": "Validate fact-checking and guardrail stages against planted errors and known-good drafts before trusting a zero-issue report, and keep a human read of the final output.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/my-llm-pipeline-failed-its-own-tests-and-that-was-the-point-published-true", "markdown": "https://wpnews.pro/news/my-llm-pipeline-failed-its-own-tests-and-that-was-the-point-published-true.md", "text": "https://wpnews.pro/news/my-llm-pipeline-failed-its-own-tests-and-that-was-the-point-published-true.txt", "jsonld": "https://wpnews.pro/news/my-llm-pipeline-failed-its-own-tests-and-that-was-the-point-published-true.jsonld"}}