DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Architecting a Production-Ready GenAI Service Desk
  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  • Understanding MCP Architecture: LLM + API vs Model Context Protocol
  • The LLM Selection War Story: Part 4 - Your Production Failure Testing Suite

Trending

  • Architecting Petabyte-Scale Hyperspectral Pipelines on AWS
  • Stop Writing Dialect-Specific SQL: A Unified Query Builder for Node.js
  • Evaluating SOC Effectiveness Using Detection Coverage and Response Metrics
  • When Perfect Data Breaks: The Journey from Data Quality to Data Observability
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. The Architecture Tax: What Nobody Tells You About Deploying LLMs in Production

The Architecture Tax: What Nobody Tells You About Deploying LLMs in Production

This article is by a technology correspondent who has seen too many AI pilots fail in staging — and too few engineers ask why.

By 
Igboanugo David Ugochukwu user avatar
Igboanugo David Ugochukwu
DZone Core CORE ·
Apr. 16, 26 · Opinion
Likes (0)
Comment
Save
Tweet
Share
2.9K Views

Join the DZone community and get the full member experience.

Join For Free

There is a particular kind of confidence that comes from a successful demo. A founder clicks through a polished Jupyter notebook, the model answers beautifully, the investors lean forward. Three months later, the same system is generating patient summaries that cite studies that don't exist, or drafting customer emails that quote refund policies that were updated fourteen months ago. The model hasn't changed. The confidence has.

I've had some version of this conversation a dozen times in the past year alone. The engineers are competent. The models are capable. What's missing — what almost always turns out to be missing — is architecture. Not infrastructure, not compute, not even the model itself. The deliberate, principled design of how an LLM sits inside a larger system of data, verification, and feedback.

The industry has spent the better part of three years obsessing over which model wins benchmarks. It has spent considerably less time on a question that matters more in practice: what has to be true about the surrounding system for any model to be trustworthy in production?

The Expense Report That Invented Receipts

Late 2024, a conversation with a VP of Engineering at a logistics company in Rotterdam. They'd built an internal tool to help finance teams process expense reports — summarizing, categorizing, flagging anomalies. Straightforward use case. The model they chose was competitive. The prompt engineering was careful. They shipped it in Q2.

By Q3, their auditors had found a pattern: for expense entries the model didn't understand — ambiguous descriptions, foreign-language receipts, unusual vendor names — it wasn't returning uncertainty. It was inventing plausible-sounding completions. A meal at a hotel became a "client dinner, three attendees." A train ticket from an unfamiliar carrier became "intercity rail, business class." Technically coherent. Factually fabricated.

The model wasn't broken. It was doing exactly what it was designed to do: complete the sequence in the most statistically probable direction. The system was broken because nobody had built a layer around the model that could catch the difference between confidence and correctness.

This is not an isolated story. It is, in various forms, the dominant failure mode of early enterprise LLM deployments. And it was entirely preventable.

Retrieval Is Not Optional

The first and most durable lesson the field has learned — slowly, expensively — is that a language model operating purely from its training weights is, in production contexts, a liability dressed as a feature.

Training cutoffs are obvious enough. Less obvious is the degree to which even current models confabulate on topics where they have partial knowledge. Ask a model about your company's Q3 revenue figures and it will answer with the same fluency it brings to questions about the French Revolution. The answer will be wrong. The presentation will be convincing.

Retrieval-Augmented Generation — RAG, in the acronym the field has settled on — addresses this by forcing the model to work from documents you provide, not from weights you can't inspect. The query hits a vector database. Relevant passages come back. Those passages go into the prompt. The model's job, in the most constrained version, is to synthesize what you've given it rather than invent what it doesn't have.

The compliance team at a mid-size European bank I spent time with in early 2025 made this point more bluntly than I expected. Their previous system — a finetuned model with no retrieval — flagged 60% fewer false policy citations once they switched to a RAG architecture pulling from their actual, current policy documentation. They didn't change the base model. They changed what the model could see.

The principle generalizes. For any LLM application where factual accuracy matters — which is most of them — the retrieval layer isn't an optimization. It's a prerequisite.

Why Agents Break in Ways That Are Hard to Anticipate

The move from RAG toward agentic systems — where the LLM doesn't just answer but plans, calls tools, and coordinates sequences of actions — is where things get genuinely complicated. And where I've watched the most expensive failures happen.

The appeal is obvious. An agent can, in principle, query a database, check an external API, write a draft, verify it against a source document, and return a finished output without a human touching any step. For tasks that are well-defined, repetitive, and reasonably bounded, this works remarkably well. In 2025, roughly a third of enterprise AI deployments in production involved some form of agentic orchestration, according to multiple surveys I've reviewed. The adoption curve is steep.

The failure modes are subtler than the demos suggest. An agent's behavior at step five depends on its interpretation of results at step three, which depends on what tool it called at step one. Errors don't stay local — they accumulate, and sometimes they amplify. I spoke with a machine learning engineer at a healthcare technology company in November 2025 who described their intake-processing agent as "a very confident game of telephone." The agent would misclassify an initial symptom description, route it to the wrong knowledge-base query, get back marginally relevant results, and produce a triage recommendation that was wrong in a way that no single step would have predicted.

The fix — partial, provisional, but meaningful — was to build verification into the chain rather than at the end of it. After each consequential step, a lightweight validation pass: does this intermediate output conform to expected schema? Does it contradict a known constraint? Is the confidence score on this retrieval result above a threshold worth trusting? Catching a bad intermediate state at step two is orders of magnitude cheaper than catching a bad final output at step six.

This is not glamorous engineering. Nobody demos their validation layers. But it is the difference between an agent that works reliably and one that works brilliantly in staging and quietly degrades in production.

The Prompt Is Code. Treat It Like Code.

Something I've argued for years, which the industry is only beginning to institutionalize: prompts are software artifacts. They have versions. They have failure modes. They interact with model behavior in ways that are empirically testable. And yet, in 2024, the majority of enterprise LLM teams I spoke with were managing prompts in Notion pages or Slack threads, with no version control, no regression tests, and no systematic evaluation framework.

The consequences are predictable. A prompt that worked with GPT-4 in February 2024 may produce meaningfully different outputs with the same model after an undisclosed update. An instruction that seemed unambiguous to the engineers who wrote it may be interpreted inconsistently across edge cases they didn't test. A chain of prompts that produces correct outputs on the evaluation set may fail silently on the long tail of production inputs.

Teams that have gotten this right — and there are a growing number — treat prompt commits the same way they treat code commits. They live in Git. They have associated test suites: known queries with expected outputs or output properties, run on every pull request. They have rollback procedures. When a model provider changes underlying behavior, the regression suite catches it before it reaches users.

I watched one team — a data analytics company in Singapore, mid-2025 — catch a meaningful performance regression this way within hours of a model provider's silent update. Their CI pipeline flagged that 12% of their evaluation queries were returning outputs that fell below their quality threshold. They pinned the model version and escalated internally before any customer saw degraded output. Their competitors, without equivalent testing infrastructure, discovered the same regression through customer complaints three days later.

Feedback Loops and the Long Game

The final piece — and the most often deferred — is what happens after deployment. Not monitoring in the infrastructure sense: latency, token costs, error rates. Those matter, but they're the floor. What I'm talking about is systematic collection of evidence about whether the system is actually doing what it's supposed to do, fed back into a mechanism for making it better.

User feedback signals — explicit ratings, implicit corrections, escalation patterns — are training data whether you treat them that way or not. Teams that log them, review them, and use them to adjust prompts, retrieval configurations, or fine-tuning targets get progressively better systems. Teams that don't get systems that plateau or quietly drift.

The deeper argument is that an LLM deployment is not a software release in the traditional sense. It's the beginning of a supervised process. The model's behavior in production will reveal failure modes that no pre-deployment evaluation caught, because production inputs are stranger, more varied, and more adversarial than test sets. The architecture has to accommodate that reality — not just tolerate it.

What This Costs to Get Right, and What It Costs to Get Wrong

I want to be direct about something the consulting decks and vendor whitepapers tend to elide: building this properly is not free. A real RAG system requires ongoing curation of the retrieval corpus. Agent architectures require careful design of tool interfaces and validation checkpoints. CI/CD for prompts requires investment in evaluation infrastructure that most teams are not set up to build quickly.

The honest comparison is not "architected LLM system" versus "no LLM system." It's "architected LLM system" versus "LLM system without architecture" — and the latter is not cheaper. It's just deferred costs. The expense-reporting AI that invents receipts, the compliance assistant that cites superseded policy, the customer service agent that confidently resolves the wrong complaint — these are not hypothetical risks. They are the documented failure modes of under-architected deployments, and they carry real costs: regulatory exposure, customer trust, internal credibility for the teams that built them.

The pattern I keep seeing in organizations that get this right is that they build more slowly initially and accelerate significantly later. The teams that cut corners on architecture ship faster to their first production incident and slower to everything after it.

The Infrastructure Nobody Wants to Build

After fifteen years covering this industry, I have a fairly stable theory about why the same architectural mistakes keep getting made: the infrastructure that prevents failures is invisible when it works. Nobody demos their guardrails. Nobody writes case studies about the hallucination that didn't happen because the retrieval layer caught it. Nobody celebrates the model regression that CI surfaced before it reached users.

What gets celebrated is the capability. The demo. The thing the model can do. The surrounding architecture that makes that capability reliable and governable at scale is engineering overhead until the day it's the only thing standing between you and an incident.

The LLM industry is, in aggregate, in the middle of learning this lesson. Some teams have learned it already — usually the hard way. The good news is that the patterns are now well enough understood that you don't have to learn them through a breach or an audit finding or a board conversation you'd rather not have had.

The architecture isn't the interesting part. But it's the part that decides whether any of the interesting parts work.

The author has covered enterprise AI deployment, infrastructure security, and technology strategy across North America, Europe, and Southeast Asia for fifteen years.

Architecture Production (computer science) large language model

Opinions expressed by DZone contributors are their own.

Related

  • Architecting a Production-Ready GenAI Service Desk
  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  • Understanding MCP Architecture: LLM + API vs Model Context Protocol
  • The LLM Selection War Story: Part 4 - Your Production Failure Testing Suite

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook