Skip to content
followmy.ai
Blog

Cleaning Up Claude 5's Output: Why Builders Are Talking About Post-Processing LLMs

Why builders are using smaller LLMs to clean up Claude 5's output, and how to decide if this approach fits your workflow.

By Craig Mason 8 min read

The tension between raw AI output and production-ready reliability is pushing builders to explore a new layer in their stacks: post-processing LLMs. The recent Hacker News discussion ‘Vomit: Clean up Claude 5’s token output with a separate LLM’ highlights a growing realization that even the best models sometimes need a second pass to be usable.

The short version

Builders are noticing that Claude 5, like other powerful LLMs, can produce verbose, inconsistent, or overly creative output that needs cleaning before it’s production-ready. Using a smaller, cheaper LLM to refine the output is emerging as a cost-effective way to balance quality and reliability. This approach adds complexity but can save money and improve consistency for certain use cases.

Why is this happening now?

As LLMs move from prototypes to production, teams are hitting a predictable wall: the gap between what a model generates and what users expect. Claude 5’s strength (its ability to generate rich, nuanced responses) can also be a liability when you need concise, structured output. The ‘vomit’ metaphor captures the frustration of getting a brilliant but messy response that requires manual cleanup.

This isn’t new, but three factors are bringing it to the forefront:

Cost pressure: Running Claude 5 at scale is expensive, and wasting tokens on output you’ll discard hurts. When a model generates three paragraphs of background context before answering a simple question, you’re paying for tokens your users will never see. For applications handling thousands of requests daily, these excess tokens compound into real budget concerns. Teams monitoring their API spend often discover that a significant portion goes toward content they strip out before displaying to users.

Consistency needs: Products require predictable formatting and tone, which creative models don’t always deliver. A customer-facing chatbot can’t randomly switch between formal and casual language across conversations. Documentation generators need uniform heading structures. API response formatters must produce valid JSON every time, not mostly-correct JSON with occasional creativity. When your application promises users a specific experience, model variability becomes a reliability problem rather than a feature.

Tool maturity: Smaller, cheaper models are now good enough for simple cleanup tasks. Models designed for narrow, well-defined tasks often outperform frontier models on those specific jobs. A model trained or tuned for formatting doesn’t need the full reasoning capacity of Claude 5 to convert prose into bullet points or strip hedging language. This creates an economic arbitrage opportunity: let the expensive model handle the hard thinking, then hand off mechanical cleanup to a cheaper specialist.

How does post-processing work?

The basic workflow is straightforward:

  1. Generate the initial response with your primary LLM (e.g., Claude 5).
  2. Pass that output to a smaller, cheaper model (e.g., GPT-3.5 Turbo, Claude Haiku) with instructions to clean, shorten, or reformat it.
  3. Use the refined output in your application.

The second model’s prompt is typically specific and narrow. Instead of asking it to “answer a question,” you give it concrete transformation instructions: “Remove any prefacing phrases like ‘Here’s the answer’ or ‘To answer your question.’ Convert the main points into a numbered list. Keep all technical details but remove conversational filler.” This precision helps smaller models perform reliably.

This is especially useful for:

Trimming verbose responses: Cutting filler words and tangential asides. Many models, when given complex reasoning tasks, produce thinking-out-loud style responses that include their reasoning process alongside the actual answer. While this transparency can be valuable during development, production users typically want just the conclusion. A post-processor can identify and remove phrases like “Let me think about this step by step” or “Upon consideration” without losing the substantive content.

Enforcing structure: Converting freeform text into consistent markdown, JSON, or bullet points. Frontier models sometimes treat structure suggestions as guidelines rather than requirements. They might generate valid JSON for ten requests, then slip into a JSON-like format with trailing commas or unescaped quotes on the eleventh. A cleanup pass can catch these deviations and normalize the output format, turning approximate compliance into guaranteed structure.

Standardizing tone: Adjusting voice to match brand guidelines or user expectations. Different prompts, even to the same model, can yield responses ranging from academic to chatty. A company with strict brand voice requirements can use post-processing to normalize this variation, ensuring every customer interaction sounds consistent regardless of what specific query triggered the response.

What are the tradeoffs?

Adding a post-processing step introduces complexity but can offer significant benefits:

TradeoffBenefitDrawback
CostCheaper than running the primary model for longerAdds latency and another point of failure
QualityMore consistent outputRisk of over-smoothing or losing nuance
WorkflowSeparates creativity from polishRequires tuning both models

The latency consideration deserves specific attention. Adding a second model call typically adds several hundred milliseconds to your response time. For batch processing or asynchronous workflows, this overhead barely matters. For real-time chat interfaces where every second counts, it can damage user experience. Some teams mitigate this by running the post-processing step in parallel with other tasks (like logging or analytics), hiding some of the latency cost.

The over-smoothing risk is subtle but real. Heavy-handed cleanup can strip out the personality or precision that made the original response valuable. If your post-processor is told to “remove unnecessary detail,” it might cut technical specifics that expert users need. This makes the cleanup prompt itself a critical piece of infrastructure that requires its own testing and refinement.

When should you consider this?

Post-processing makes sense when:

Your primary model is overqualified for simple cleanup tasks. If you’re using Claude 5 to answer complex questions but then asking it to also format those answers as markdown and remove its own hedging language, you’re essentially paying frontier-model prices for basic text manipulation. Splitting these responsibilities can optimize your token budget.

You need strict formatting or tone control. When your application feeds LLM output into downstream systems (databases expecting specific fields, APIs requiring exact schemas, templates with fixed placeholders), the flexibility of frontier models becomes a compatibility problem. A post-processor acts as a reliability adapter, ensuring your creative model’s output always fits the rigid expectations of the rest of your stack.

You’re optimizing for cost over raw capability. Some applications don’t need frontier-model quality for every token. If you’re generating draft content that humans will edit anyway, or producing internal documentation where “good enough” truly is good enough, paying for maximum capability end-to-end wastes money. Running the expensive model for substance and a cheap model for polish threads this needle.

It’s less useful when:

Every token of creativity matters (e.g., storytelling, brainstorming). For tasks where unexpected turns of phrase or novel formulations are the value proposition, cleanup risks sanitizing away the good stuff. Fiction writing, creative marketing copy, and ideation sessions benefit from keeping the model’s full, unfiltered output even when it’s a bit messy.

Latency is critical (e.g., real-time chat). Adding hundreds of milliseconds to response time can break the conversational flow that makes chat interfaces feel natural. Users notice delays over about half a second, so unless you can hide the post-processing latency, direct output from your primary model may provide a better experience even if it’s less polished.

Your primary model already delivers exactly what you need. This sounds obvious, but it’s worth stating: post-processing is a solution to a specific problem. If careful prompting and few-shot examples already produce reliable, production-ready output from your primary model, adding a cleanup step is pure overhead. Not everyone hits the verbosity or consistency issues that make this pattern valuable.

How to get started

Try a simple experiment: take a sample of Claude 5’s output that frustrates you, and manually edit it to your ideal version. Save both versions. Then, prompt a smaller model with the original output and instructions to transform it into something matching your ideal edit. Compare the model’s cleanup to your own. If they’re reasonably close, you’ve validated that the transformation is automatable.

Start with a narrow use case rather than trying to post-process everything. Pick one workflow where output quality issues are causing the most pain (maybe API responses that occasionally break JSON parsers, or customer-facing text that’s too verbose for mobile screens). Build the two-model pipeline for just that case, measure the impact on cost and quality, and expand from there if it works.

Test failure modes explicitly. What happens when your post-processor encounters output it can’t clean up? You’ll need error handling that either falls back to the original response, retries with adjusted instructions, or fails gracefully. Understanding these edge cases before they hit production saves debugging time later.

Consider logging both the raw and cleaned output during your initial rollout. This gives you data on how much the post-processor actually changes things, which helps tune your cleanup instructions and catch cases where it’s being too aggressive or too passive.

FAQ

Does this mean Claude 5 is flawed? No, it means even the best models have strengths that don’t always align with production needs. Post-processing lets you keep the strengths while fixing the mismatches. Frontier models are optimized for capability across an enormous range of tasks. That generality sometimes produces outputs that aren’t ideal for your specific, narrow use case. This isn’t a flaw, it’s a predictable consequence of building models for breadth rather than specialization.

Won’t this double my API costs? Not necessarily. If the second pass uses a cheaper model and reduces your primary model’s usage, it can save money overall. The math depends on your specific pricing tiers and token volumes. Many smaller models cost a tenth as much per token as frontier models. If your cleanup step processes the same number of tokens but costs a fraction as much, and if it lets you prompt your primary model more concisely (since you know cleanup will handle polish), total costs can actually drop.

What’s the simplest way to test this? Use the OpenAI playground or Anthropic’s console to manually chain prompts before building anything. Copy output from your primary model, paste it into a new conversation with a smaller model, and give cleanup instructions. Do this for ten or twenty real examples from your application to get a feel for how reliably the cleanup works and what instructions produce the best results.

Found this useful? Read more from the blog →