A/B Testing and Online Experimentation for LLM Features


A team running a customer-support assistant on GPT-4o reported a beautiful number to their CFO: 47% cache hit-rate, $18,000 per month saved, p95 latency down from 2.4s to 380ms. Three weeks later the same team was reading a customer-trust incident report. The semantic cache had decided two refund-policy questions were "the same enough" at cosine similarity 0.93 — and 0.93 had been a reasonable threshold on the eval set, which had not contained two refund policies. The cache was not broken; the cache was working exactly as designed. The architecture was wrong. This article is the deep-architecture answer to the question the team had not asked: when does semantic cache help, and when does it lie? Four-tier hierarchy from exact-key through normalised through semantic to LLM, three-step threshold calibration using a risk-weighted decision rule, multi-tenant key design that prevents the cross-tenant-pollution incident, TTL and model-version discipline, eight failure patterns to retire, five-stage maturity ladder, and the Monday-morning checklist that ships sustainable savings without the customer-trust incidents.
Building HIPAA-compliant AI systems requires more than a Business Associate Agreement. This guide covers the complete architecture: PHI de-identification and pseudonymisation layers, sensitivity-based model routing, RBAC for minimum necessary compliance, immutable audit trails, and clinical use cases — ambient scribing, decision support, and patient-facing chatbots.
The $100k to $1M monthly LLM-spend transition is the architecturally serious crossing in the life of an LLM product. The teams that handle it well treat cost as a first-class architectural property — instrumented, budgeted, gated, attributed, and tuned — and they build the five-layer stack of budget gate, semantic cache, dynamic router, prompt compactor, and inference layer with an attribution feedback loop wrapped around it. This article is the architecture, the order to build it in, the 10k-RPM unit-economics drill-down that produces a 64% reduction through composed savings, the unglamorous levers (prefill/decode separation, KV-cache reuse, speculative decoding, batch endpoints, output-length discipline), the spot/reserved/on-demand procurement mix, 8 anti-patterns that produce the bad spend curve, and the 5-stage maturity ladder.
The same query: 2ms or 3,000ms — the difference is one B-tree. How database indexes actually work, composite column order, covering indexes, and when the planner says no.
Advertise and partner
Reach engineering leaders and CTOs reading about AI, mobile and cloud architecture.
Sponsored mentions and co-authored articles or technical deep-dives. Relevant products only, always disclosed.