← Back to site
Technical Analysis · 27 August 2026

Frontier and open-weights
model architecture

A layer-by-layer look at how modern language models are built and trained, what degrades them, how they are tested, and how enterprise data systems and agents connect to them. Eleven interactive modules. Open and closed models compared on the same axis.

ByVikram Rathour, Enterprise Data & AI
Models18 open · 8 closed
Sources12 reports · 30+ papers
Sections10
01

The stack has barely changed since 2019

Every model here is a decoder-only autoregressive transformer. That includes Claude, GPT, Gemini, Grok, DeepSeek, Qwen, Llama and Gemma. Click any component for its mechanism, its formula, and where the design choices diverge.

This section applies to closed models as much as open ones. The components below are common to all of them. What is not public for Claude, GPT, Gemini and Grok is the configuration: how many layers, how wide the residual stream is, how many heads, dense or sparse, and how many parameters. Wherever a specific number appears in this report it comes from a published technical report, which is why the named examples are open-weights models.

Interactive

Layer explorer

Click a component

The finding that matters most

Reading several years of technical reports back to back, the core block is unchanged: pre-norm, attention, gated feed-forward, residual. What changed is the efficiency work around it: the KV cache, the sparsity pattern, the numeric precision and the training recipe. The intelligence gains of the last two years came overwhelmingly from data quality and post-training, not architecture. Worth establishing before any business case rests on architecture selection being the decisive variable.

02

Attention: what the heads do, and what the cache costs

Two things happen in the attention sublayer that matter in production. Specific heads perform identifiable, testable functions. And the key-value cache they populate is the largest serving cost at any realistic concurrency.

The head taxonomy below is general. It was established on models researchers could open up, including GPT-2, Claude 3 Sonnet and Claude 3.5 Haiku through Anthropic's own interpretability work, and it holds across architectures. The efficiency ladder names open models in its last column because those are the ones that publish their attention configuration. All closed frontier models almost certainly sit somewhere on the same ladder, since full multi-head attention at 1M context would price far above what they charge.

Interactive

Attention head taxonomy

Click a head type
Interactive

KV cache calculator

70B-class · 80 layers · d_head 128

The attention efficiency ladder

VariantMechanismCache reductionQuality costUsed by
MHAEvery query head has its own K and V head1×BaselineGPT-2/3 era, now rare
MQAAll query heads share a single K/V headn_heads×Measurable, plus instabilityLargely superseded
GQAQuery heads grouped; each group shares one K/V head4–8×NegligibleQwen3, gpt-oss, Llama, Mistral, Gemma
MLAK/V compressed to a low-rank latent, reconstructed on the fly. Needs decoupled RoPE because rotation is position-dependent and compression is not~10×Reported noneDeepSeek V3/V4, Kimi K2
Sliding windowEach token attends to the previous W tokens; receptive field grows as L×W across layers. Needs attention sinks or the model destabilises when the first token falls out of windowseq/W×Small, task-dependentgpt-oss (1:1 interleave, W=128), Gemma
NoPE interleaveLayers with no positional encoding at all, alternating with RoPE layers, plus inference-time attention temperature scalingn/aLength generalisation gainLlama 4 (iRoPE, ~1 in 4 blocks)
Linear / hybridFixed-size recurrent state that does not grow with sequence length, interleaved with a minority of full-attention layersO(1) in lengthStill being establishedQwen3-Next (Gated DeltaNet), Kimi K3 (KDA, 3:1)
Interactive

Prefill vs decode

Advertised context is not usable context

Llama 4 Scout advertises 10M tokens but was pre-trained and post-trained at 256K. Liu et al. documented the lost-in-the-middle effect: performance is highest when relevant information sits at the beginning or end and degrades significantly in the middle, even in models explicitly built for long context. Retrieval heads explain why. Long-context recall depends on a small, specific set of heads rather than being a general property of the model. Anthropic's own long-context retrieval score moving from 18.5% on Opus 4.5 to roughly 76% on 4.6 makes the point: the window did not change, the retrieval behaviour did. Test on your own documents with synthesis across separated passages, not needle-in-a-haystack.

03

Parameter count is a meaningless comparison metric

Mixture-of-experts splits the feed-forward layer into many independent experts and routes each token to a handful. Total parameters set your memory bill. Active parameters set your compute bill and latency. Those numbers have now diverged by up to 32×.

The frontier models are in the selector below, but with no numbers. Anthropic, OpenAI, Google and xAI do not publish parameter counts, expert counts or routing for their production models. Select one to see what can be inferred and what cannot.

Interactive

Sparsity visualiser

Expert activation for one token

Each square is one expert in one MoE layer. Filled squares compute. Blue is an always-on shared expert.

Routing design differs meaningfully

Shared experts. DeepSeek and Kimi keep one expert always active on the theory that general capability should not be routed. Qwen3 dropped shared experts, unlike Qwen2.5-MoE, to force specialisation. When JetBrains scaled a Qwen3-style architecture down for Mellum2 they found a shared expert gave no measurable quality gain and consistently hurt inference performance from the always-on FFN compute. The answer is scale-dependent.

Load balancing. Routers collapse if left alone. A few experts get slightly better, attract more tokens, improve faster, and the rest stop learning. The classic fix is an auxiliary loss, but it competes with the language modelling objective. DeepSeek-V3 pioneered an auxiliary-loss-free strategy using a learnable per-expert bias adjusted dynamically to equalise load, with no gradient conflict. Qwen3 took the other path with a global-batch balancing loss.

The catch for enterprises

All experts must be resident in memory even though only a fraction compute. DeepSeek-V3 at BF16 needs well over a terabyte of weight memory. You pay the memory of a 671B model and get the compute cost of a 37B model.

Excellent at high utilisation on a multi-node cluster. Poor for a single node at low request volume, which describes most enterprise deployments. This is the most common sizing error in on-prem LLM projects.

Note the counter-examples: Mistral Medium 3.5 is dense at 128B and currently the only frontier-credible non-MoE model, and Gemma 4 31B is dense and leads small-footprint deployments. For a fixed single-node budget, dense often wins.

04

The training pipeline, and where capability actually comes from

A model is grown rather than built, and the recipe matters more than the architecture. Click any stage. The post-training stages are where the last two years of capability gains were manufactured.

Interactive

Training pipeline

Click a stage

Preference optimisation methods compared

MethodMechanismCostWhen to use it
RLHF / PPOHuman comparisons train a reward model; policy optimised against it with PPO, KL-constrained against the SFT model to prevent collapseHighest. Reward model plus critic plus rolloutsFrontier labs with dedicated RL infrastructure. Rarely correct for an enterprise
DPOClosed-form loss directly on preference pairs. No separate reward model, no RL loopLow. Looks like supervised trainingThe default for enterprise preference alignment. Slightly lower ceiling, vastly simpler
GRPOSample multiple completions per prompt; the group mean reward is the baseline, replacing a learned value network entirelyMedium. No critic, so much lower memoryThe method behind the reasoning-model wave. Needs a reward signal
RLVRWhere correctness is checkable, the verifier is the reward. No reward model, no human labellersLow per-sample, high engineeringThe one with real differentiation potential for a data practice. See callout below
Rubric / self-critiqueExtends verifiable rewards to unverifiable tasks via a model-generated rubric score. Kimi K2 combines both in one frameworkMediumSubjective quality dimensions where no verifier exists
Distillation / MOPDTrain specialised experts then merge. Kimi K3 trained nine task-specific RL models at different reasoning efforts and merged via Multi-Teacher On-Policy DistillationHigh to produce, cheap to serveCompressing a large capable model into a servable one

RLVR is the capability worth building deliberately

Where a task has a checkable answer, you do not need a reward model or human labellers. The verifier is the reward signal. This is why reasoning models improved so fast: it removes the human bottleneck so the loop runs at machine scale. For data engineering workloads, verification is often mechanically available. Does the generated SQL execute? Does it return the expected row count? Does the extracted field match the source system? Does the lineage graph resolve? Does the migrated report produce identical numbers to the original? If you can define correctness, you can improve a model on your own workloads without labelling anything. That is worth more than fine-tuning on a pile of documents.

Data curation

The least visible stage, the most decisive one, and the last real trade secret in the field. Scale: Qwen3 used ~36T tokens across 119 languages; DeepSeek-V3 14.8T; Kimi K2 15.5T; Kimi K3 with a progressive context-length curriculum; Llama 4 ~30T.

Pipeline: bulk crawl, language ID, dedup at document and near-duplicate level, quality classification, toxicity and PII filtering, then deliberate up-weighting of code and mathematics far beyond natural web frequency because both give dense verifiable reasoning signal.

Your domain is underrepresented. Insurance policy language, clinical coding, trade settlement messaging, utility asset hierarchies are not in web crawl. That is the root of most "the model does not understand our business" complaints. It is a data problem, not an architecture problem.

Optimizer and stability

AdamW is standard. DeepSeek-V3 used β₁ 0.9, β₂ 0.95, weight decay 0.1. Two optimizer states per parameter, so 8 bytes per parameter at FP32 on top of weights and gradients.

The interesting exception is Muon, used by Kimi K2 for better token efficiency. At scale it hit a wall: attention logits rapidly exceeded 1000 mid-run, risking divergence. The fix was MuonClip, adding QK-Clip to rescale query and key projections. With it they pre-trained a trillion-parameter model on 15.5T tokens with zero loss spike.

A clean illustration that architecture, optimizer and normalisation are not separable concerns. QK-Norm solves the same problem structurally.

Parallelism

Five strategies compose. Data parallel splits the batch (gradient all-reduce per step). Tensor parallel splits individual matrices (all-reduce inside every layer, so very high traffic, keep it intra-node). Pipeline parallel splits layers (activations at stage boundaries, creates bubble idle time). Expert parallel distributes MoE experts (all-to-all token routing). Sequence/context parallel splits sequence length.

DeepSeek built DualPipe specifically to overlap computation with communication and hide the pipeline bubble, and hand-wrote cross-node all-to-all kernels because the off-the-shelf ones bottlenecked.

Their reported 2.788M H800 GPU hours (~$5–6M) is the marginal cost of the final run, not of the capability. It excludes failed runs, data pipeline construction, staff, and the ablations that found the recipe.

05

Quantization and quality loss prevention

Quantization is how a model that needs 240GB fits on one 80GB card. It is also where quality is lost in ways that benchmarks often miss. This section covers what breaks, why, in what order, and how to get the loss back.

Interactive

Precision sizing and expected degradation

What actually breaks first: activation outliers

Dettmers et al. established that activation outliers emerge suddenly around 6.7B parameters, affecting all transformer layers and roughly 75% of sequence dimensions. They are about 0.1% of features, yet zeroing them collapses top-1 attention softmax mass by over 20% and degrades validation perplexity by 600–1000%. Formally: dimensions with magnitude ≥6.0 in ≥25% of layers and ≥6% of sequence positions. Mechanically they stretch the quantization range so every other value compresses into a handful of buckets. This single phenomenon explains why weights quantize easily and activations do not, and why W4A16 is near-lossless while W4A4 remains hard.

Post-training quantization methods

MethodMechanismHandles outliers byPractical note
LLM.int8()Mixed-precision decomposition: the 0.1% outlier dimensions stay in 16-bit, the other 99.9% multiply in 8-bitIsolating them~1.96× memory reduction on BLOOM-176B with essentially no loss. The reference for why 8-bit is free
SmoothQuantMigrates quantization difficulty from activations to weights via per-channel scaling before quantizingMoving the problemEnables W8A8, which is what makes 8-bit activations viable at all
GPTQLayer-wise weight updates using approximate second-order (Hessian) information to minimise reconstruction errorCompensating for themStrong at 4-bit, extends to 3-bit. Sensitive to calibration data
AWQIdentifies the ~1% salient weight channels by activation magnitude and protects them with per-channel scalingProtecting what they touchActivation-aware, so calibration data quality matters directly
MXFP4Two fp4 (e2m1) values per byte with a shared power-of-two scale per 32-element group. 4.25 bits per parameterGroup-wise scalingUsed natively by gpt-oss and Kimi K3, applied during post-training rather than after, which is why it holds quality
NF4 (QLoRA)Each value assigned to one of 16 quantile bins of a normal distribution; double quantization compresses the scales to 8 bitsDistribution-matched binsBuilt for fine-tuning on quantized frozen weights, not primarily for serving
AQLM / 2-bitAdditive quantization for extreme compressionPoorly, aloneAccuracy degrades substantially below 3 bits. Needs a recovery mechanism to be usable

Loss prevention: getting the quality back

Post-training quantization is training-free and cheap, and it leaves quality on the table. There are four established ways to recover it, in ascending cost.

1 · Calibration data quality

The cheapest lever and the most neglected. GPTQ and AWQ both depend on a calibration set to estimate activation distributions. Generic calibration data on a domain-specific workload produces biased quantization parameters. Calibrate on your own representative traffic. Recent work on family-aware calibration regenerates calibration samples using a larger model from the same family. The samples carry chain-of-thought and match the expected activation distribution. This reported up to 28.5% less accuracy loss than baseline calibration data on Qwen3-8B.

2 · Quantization-aware training (QAT)

Fine-tune the quantized model with the same loss function, quantizing weights and activations in the forward pass while gradients stay high-precision. PyTorch reported QAT recovering 62% of the normalized accuracy degradation on hellaswag and 58% / 57% of word and byte perplexity degradation on wikitext, versus PTQ, for Llama 8da4w. Cost is a retraining run, which is why parameter-efficient variants exist.

3 · Recover-LoRA and adapter-based repair

Train a low-rank adapter on the quantized model, distilling from the full-precision original on synthetic data. This is the practical recovery mechanism for aggressive quantization. Recent work shows selective 2-bit quantization of gate and up projections delivering 7.5 to 23.3% throughput gains over uniform W4 across 4B to 20B models, with Recover-LoRA reclaiming the accuracy that would otherwise be lost. Far cheaper than full QAT.

4 · Quantization-aware distillation (QAD)

For models whose capability came from RL post-training, plain QAT is awkward, because quantization-aware RL is barely explored. QAD distils from the full-precision model instead, which sidesteps the problem. This matters increasingly because reasoning capability is RL-derived, and it is exactly the capability most damaged by aggressive quantization.

Two failure modes nobody tests for

Safety degrades separately from capability. Research on quantized model safety found that quantization can degrade alignment even where utility benchmarks hold, and that calibration data with harmful content makes it worse. Quantization-aware safety patching exists specifically to re-align quantized models. If you quantize a model and only measure task accuracy, you have not measured what changed.

Degradation is not uniform across tasks. A model that holds its benchmark scores at 4-bit can still fall apart on your specific structured extraction task, on long-chain arithmetic, or on precise code generation. Per-channel quantization vulnerability is even model-specific. The Llama3-70B series showed a distinct susceptibility traced to weight outliers in its early layers. Llama2, the 8B variants and the 405B did not share it. Test on your workload. Never on someone else's leaderboard.

06

Evaluation: the artefact that makes everything else safe

Public benchmarks are useful for rough ranking and close to useless for choosing a model for your own work. Without your own evaluation set you cannot tell whether any change you made helped. With a new release roughly every week, model swaps are now routine.

Why public benchmarks fail you

  • Contamination. Test sets leak into training corpora. A model may have memorised the answers rather than derived them, and there is no reliable way to audit this from outside
  • Saturation. Top models now cluster within noise of each other. Claude Opus 5 at 63, Fable 5 at 62, GPT-5.6 Sol and Grok 4.6 at 61. That spread is too narrow to decide anything
  • Construct mismatch. None of MMLU, GPQA, SWE-bench, AIME or LiveCodeBench measures whether a model can extract entities from your claims documents
  • Self-reporting. Vendor-published charts are selectively framed. Kimi K3's headline numbers are self-reported; the independent score puts it tied with GLM-5.3, not clear of the field
  • Metric discontinuity. Apparently emergent capabilities are partly real phase changes and partly artifacts of discontinuous scoring

The evaluation layers you actually need

  • Component evals. Retrieval measured separately from generation. Most RAG failures are retrieval failures that look like generation failures
  • Task evals. A few hundred real examples with agreed correct answers, scored automatically. About one week of work, and the highest-value asset your practice will build
  • Regression evals. Run on every model swap, prompt change, and quantization change. This is what makes routine model migration safe
  • Agent trajectory evals. Did it use the right tools in the right order? Getting the right answer by luck is not a working agent
  • Safety and guardrail evals. Run separately from capability, especially after quantization
  • Production evals. Sampled live traffic scored continuously, because distribution drifts

Scoring methods and their failure modes

  • Exact match / assertion. Best when available. Free, deterministic and hard to argue with. Use it everywhere correctness is checkable. This is the same property that enables RLVR
  • Execution-based. Does the SQL run and return the expected shape? Does the code pass tests? Strongest signal for engineering workloads
  • Reference-based similarity. Weak. Correct answers phrased differently score badly
  • LLM-as-judge. Scales well, but inherits biases: position bias, verbosity bias, and self-preference toward its own model family. Check it against human labels on a sample before you trust it, and check again whenever you change judge models
  • Groundedness checks. Is every claim in the answer supported by a retrieved chunk? The single most useful production check for RAG
Interactive

Evaluation coverage self-assessment

Toggle what you have today

The observability layer this rests on

Evaluation without instrumentation is guesswork. Standardise on OpenTelemetry GenAI semantic conventions for spans and attributes. Track token accounting including hidden reasoning tokens. They bill as output and do not appear in the response body, so a cost model built on visible output length will be wrong by an order of magnitude on reasoning models. Decompose latency into TTFT (prefill) and TPOT / inter-token latency (decode), The two have different fixes. TTFT regressions point at oversized context. Inter-token latency regressions point at memory bandwidth and batch composition.

07

The model matrix

Open and closed on one axis. Open-weights rows are verifiable from published technical reports; closed rows carry no architecture figures because none are published. Anything circulating that claims them is speculation. Click any column header to sort.

ModelAccessTotalActive SparsityAttentionContext $ In$ OutLicence

Sparsity = total ÷ active; dense shows 1×. Prices are per million tokens as of late Aug 2026 and move roughly monthly. OpenAI repriced twice in one month. Open-weights prices are representative hosted rates, not your self-hosted cost. Verify the licence on the exact checkpoint: terms have changed within families, and Qwen variants above the 27B tier now carry commercial restrictions.

Interactive

Monthly cost model

Caching and batch are the two big levers

Three billing mechanics that break naive TCO models

Reasoning tokens bill as output on both platforms. You pay for the full internal chain though the API returns only a summary. Anthropic hides raw thinking behind opaque signatures to prevent distillation. A hard task can emit 5–50× the visible output. Claude 4.7+ changed tokenizer and produces roughly 30% more tokens for the same text, so nominal rate comparisons against older models understate cost. And OpenAI applies a 2× input / 1.5× output surcharge on the entire request once input exceeds 272K tokens. That applies to the whole request, not only the part above the limit.

What is knowable about closed models

Not public: parameter counts, layer counts, attention configuration, expert counts and routing, training data composition, tokenizer details, training compute.

Reasonable inference: all are decoder-only with pre-norm, RMSNorm or equivalent, gated FFN, rotary-derived position encoding. All flagships are almost certainly sparse MoE, because the pricing and latency profiles do not fit dense models at that capability level. All use grouped or latent attention; serving cost at long context makes full MHA implausible. All offer variable inference-time compute, implying reasoning-mode training.

The window into each: for Anthropic it is the interpretability work. They trained sparse autoencoders with up to 34 million features on the middle-layer residual stream of a stated production model. Attribution graphs then showed two-hop reasoning with a manipulable intermediate step, and forward planning in poetry. For OpenAI it is gpt-oss, which reveals the design conventions: attention sinks, sliding/full interleave, MXFP4, Harmony, o200k.

Governance frameworks

Anthropic RSP v3.0 (Feb 2026) defines AI Safety Levels with Deployment and Security standards. It is outcome-focused rather than prescriptive, and adds Frontier Safety Roadmaps and recurring Risk Reports. ASL-3 active since May 2025 for CBRN.

OpenAI Preparedness v2 (Apr 2025) tracks three categories: Biological/Chemical, Cybersecurity, and AI Self-improvement. Two thresholds, High and Critical. GPT-5.6 Sol assessed High, not Critical, for cyber.

Data residency. Anthropic inference_geo: "us" applies a 1.1× multiplier on Claude 4.6+. Bedrock and Vertex have independent regional endpoints at roughly +10%. ZDR available on both.

The precedent worth modelling. Claude Fable 5 was suspended on 12 June 2026 under a US export-control directive and restored on 1 July. First frontier model switched off and back on by regulatory action. A capability you depend on can vanish for reasons outside your vendor relationship, your SLA and your control.

08

What happens behind the scenes

Vendor-neutral reference architecture. From a document landing in a bucket to a token arriving in a response. Every stage, what it mechanically does, and where it fails.

Interactive

Document to answer

Click a stage
Interactive

Context window assembly

What actually occupies the window

Retrieval quality: the documented numbers

Contextual retrieval prepends a 50–100 token LLM-generated blurb situating each chunk in its document, before both embedding and BM25 indexing. Measured effect on top-20 retrieval failure rate:

One-time contextualisation costs roughly $1.02 per million document tokens with prompt caching enabled. Hybrid search fuses dense embeddings with BM25 at roughly 0.8 / 0.2 weighting, then a cross-encoder reranker rescores the top-20 down to the 3–5 chunks actually injected. BM25 catches the exact matches that dense retrieval reliably misses: part numbers, policy codes, ISINs and dates. Those are the tokens enterprise queries turn on.

The rest of the stack

LayerWhat it doesFailure mode it prevents
Constrained decodingA grammar compiled from the schema masks non-conforming tokens at sampling time. Implementations include JSON mode, strict schema, XGrammar, Outlines, Guidance and llama.cpp grammars. Output is valid by construction, not validated afterwardsMalformed output breaking parsers. Note: structure guaranteed, semantics not
Semantic layerModel queries governed metric and dimension definitions rather than raw schemas; emitted query is parsed, dry-run or EXPLAINed, then executed with row and cost guardsHallucinated joins and invented metric definitions. The most effective anti-hallucination control for analytics agents
Input guardrailsPII detection and redaction, prompt-injection and jailbreak classifiers, before the model sees the requestInjection reaching the model; regulated data leaving the estate
Output guardrailsPII, toxicity, policy and groundedness or citation checks after generationUngrounded assertions reaching a user. Never rely on model alignment alone
Semantic cacheEmbed the query, serve a cached response for semantically similar prior queriesRepeat cost on near-duplicate questions. Watch staleness and false hits
Identity propagationOAuth token exchange so the agent acts with the user's scoped permissions; identity passed to the data layer so row-level security applies at query timeThe confused deputy problem. See section 09
Gateway / routerOne abstraction across providers, centralised auth and key management, model routing, fallback chains, canary rolloutProvider lock-in and single-provider availability risk
09

Agentic systems: memory, instruction, and communication

Three things separate a working agent from a demo: how it remembers across sessions, how it is instructed, and how it talks to other agents and to your systems.

Interactive

Agent memory architecture

Click a memory type

The mistake almost every team makes

Collapsing all memory types into a single retrieval problem. Working memory is a context-budget problem, not a retrieval problem. There is nothing external to retrieve from, so manage it by compression and prioritisation. Running semantic similarity search across episodic logs is the specific mistake. Episodic memory is indexed by time and cause, not by meaning. Treating "what did I try last Tuesday" as a nearest-neighbour question returns results that look right and are not. Different memory types require different retrieval logic. Most production systems implement two layers well and handle the transitions between layers with crude heuristics.

Prompts, skills, and where instruction actually lives

Instruction reaches a model through four distinct channels with different persistence, cost and cache behaviour. Confusing them is why agents behave inconsistently across sessions.

ChannelPersistenceCache behaviourWhat belongs here
System promptEvery request, whole sessionStable prefix. Cache at 0.1×Role, constraints, output conventions, refusal boundaries. Keep it stable; every edit invalidates the cache for everything after it
Tool schemasEvery request while tools are availableStable prefix, but changing mid-conversation historically invalidated the cache. Opus 5 now permits tool changes without invalidating itCapability surface. Note the overhead: 286–406 tokens of injected system prompt on Opus 5 just for having tools, plus ~4,500 for the computer-use toolset and ~6,600 for browser use
SkillsLoaded conditionally, on relevanceLoading one mid-session breaks the cache prefix unless skills sit in a stable blockProcedural memory made explicit. Reusable task recipes, house style, review checklists, domain workflows. The right home for "how we do this here" that would otherwise be re-explained in every prompt
Retrieved contextPer requestNever cacheable. Always freshFacts. Not behaviour, not procedure. Retrieval solves knowledge; it does not solve how the agent works

The architectural point. Procedural memory is undergoing a transition from explicit non-parametric templates toward implicit parametric policies. What lives in a skill file today may live in a fine-tuned executor model tomorrow. In practice today it manifests as skill libraries and workflow templates, and the deciding question is whether a behaviour needs to be inspectable and editable by a human (keep it a skill) or fast and consistent at volume (distil it into weights).

Interactive

The agent loop, step by step

Agent communication protocols

Four protocols address four different layers. They are complementary, not competing, and the sensible enterprise path is phased adoption rather than picking one.

ProtocolLayerMechanismEnterprise position
MCPAgent ↔ toolJSON-RPC 2.0. Hosts run clients connecting to servers exposing tools, resources and prompts, plus sampling. Two official transports: stdio for local subprocesses, Streamable HTTP for remote (POST+GET, optional SSE, Mcp-Session-Id, OAuth). The older HTTP+SSE transport is deprecatedStage 1, adopt now. Servers must validate the Origin header against DNS rebinding. Solves connectivity, not governance
A2AAgent ↔ agentGoogle, contributed to the Linux Foundation 2026. Agents discover each other via Agent Cards, which are JSON metadata files at a public URL describing capabilities, skills, endpoint and auth. Core objects: Agent Card, Task, Message, Artifact. Sync, streaming and async push. Delegation-centric: answers "which agent can handle this task?"Stage 3, for cross-team and cross-vendor work. Preserves opacity, so agents collaborate without exposing internal memory, logic or tools. v1.0.1 added an extension mechanism
ACPAgent ↔ agent, negotiatedIBM Research, drawing on FIPA-ACL heritage. Formalises multi-agent communication with typed performatives (propose, accept, reject, counter) and multi-turn negotiation semantics. Merged under the A2A umbrella in 2025Stage 2. Useful where agents have to negotiate rather than simply hand off work
ANPOpen agent marketsDecentralised discovery, DID-based identity verification, peer-to-peer communication over JSON-LD graphsStage 4. Not yet an enterprise concern; watch it

None of these express governance

Recent analysis of governance gaps found that MCP, A2A and ACP all lack the vocabulary to express policy constraints, data handling obligations or accountability. A2A's four official extensions do not close this: Secure Passport, Timestamp, Traceability and Agent Gateway. Gartner projects that 60% of agentic analytics projects relying solely on MCP will fail by 2028 without semantic foundations, and that by 2030 half of enterprise agent deployment failures will trace to insufficient governance runtime enforcement rather than capability gaps. The protocol layer is necessary and nowhere near sufficient.

Multi-agent topologies

  • Single agent. One loop, one context. The correct default. Most multi-agent designs are built too early
  • Orchestrator–worker. A lead agent spawns sub-agents with isolated context windows so each explores without polluting the others, returning condensed results. The main benefit is context isolation rather than parallelism
  • Sequential handoff. Explicit state passed between specialised agents. Easier to audit, easier to test, slower
  • Negotiated peer. Agents with different objectives reaching agreement. Needs ACP-style performatives. Rare, and hard to make repeatable
  • Swarm. Many parallel agents on sub-components with central orchestration resolving conflicts. Kimi K2.5 reported ~4.5× faster execution on complex multi-step tasks versus sequential single-agent

Durable execution matters more than topology. Long-running agents need checkpointing and resume. A four-hour run that dies at minute 200 with no saved state is worse than no agent at all.

The confused deputy problem

The hardest unsolved problem in enterprise agent architecture. A privileged agent is tricked into using its authority on the attacker's behalf, usually via prompt injection embedded in a document or an MCP tool result. The agent is not compromised. It is doing exactly what it was told to do, by the wrong party.

Service accounts make this worse. An agent with broad credentials can read everything, so any successful injection reaches everything. A2A widens the exposure again, because a remote agent's output is now untrusted input to yours.

Layered defence. Delegated auth via OAuth token exchange so the agent carries the user's scoped permissions. Identity propagated to the data layer so row-level security applies at query time. Least-privilege scopes per tool. Human-in-the-loop for high-impact actions. And an explicit invariant: content arriving from retrieval, tools or other agents can never change the agent's permission set. Design for this before the first agent reaches production.

10

Architecture decisions

There is no single answer to open versus closed. There is an answer per workload, and a short list of patterns that hold up.

Open weightsClosed API

    Reference workload profiles

    High-volume extraction

    Open

    Structured fields from documents at millions of pages a month. Repetitive, verifiable, latency-tolerant.

    Model · Qwen3-8B or 14B, fine-tuned
    Serving · vLLM, continuous batching
    Adapt · LoRA + RLVR against source truth
    Eval · Exact match on field values

    Agentic engineering

    Closed

    Multi-step tool use, code generation, long-horizon planning across systems. Low volume, high value per task.

    Model · Claude Opus 5 or Grok 4.6
    Serving · API
    Adapt · Skills + tool design
    Eval · Trajectory and outcome

    Regulated analysis

    Open

    Reasoning over data that cannot leave the estate. BFSI, healthcare, public sector, sovereignty-constrained.

    Model · gpt-oss-120b or Mistral Medium 3.5
    Serving · On-prem, single node
    Adapt · Retrieval + semantic layer
    Eval · Groundedness + safety post-quant

    Knowledge assistant

    Hybrid

    Internal assistant over enterprise content. Bursty traffic, wide query variety, moderate stakes.

    Model · Small open router + closed tail
    Serving · Router in front of both
    Adapt · Retrieval quality dominates
    Eval · Retrieval separately from generation

    Migration & codegen

    Hybrid

    Translating between platforms. Verifiable output, project-shaped rather than continuous volume.

    Model · Closed for hard cases, open for bulk
    Serving · Batch, off-peak
    Adapt · RLVR, it compiles or it does not
    Eval · Execution-based, output parity

    Edge / embedded

    Open

    Constrained hardware, intermittent connectivity, or per-device deployment.

    Model · gpt-oss-20b MXFP4, Gemma 4, Qwen3-4B
    Serving · Local runtime
    Adapt · Distillation from a larger sibling
    Eval · Task accuracy at target precision

    The adaptation ladder

    Ascending cost. Finish each rung before climbing. Most teams jump straight to fine-tuning because it feels like real engineering, and most of those projects could have been solved at rung one or two.

    • 1 · Prompting and context engineering. Solves more than teams expect
    • 2 · Skills. Procedural knowledge made explicit and reusable. Cheaper than fine-tuning, readable by people, and versioned in git
    • 3 · Retrieval augmentation. Solves knowledge, not behaviour. Chunking, hybrid search and reranking matter more than model choice
    • 4 · LoRA / QLoRA. Format, tone, structured output. Adapters swap per tenant at serve time. Not for injecting facts, because facts live in MLP key-value memories and adapters are poor at editing those
    • 5 · Full fine-tuning. Rarely justified; locks you to a base that will be superseded
    • 6 · Continued pretraining. Only for domains far outside the training data, with very large proprietary corpora
    • 7 · RLVR on verifiable tasks. The one with real differentiation potential

    Impact ranking: what determines effectiveness

    #FactorTypical failure
    1Right data at the right momentBlamed on the model; it is a retrieval problem
    2Task decompositionOne impressive leap instead of reliable steps
    3Verification of outputsGenerated artefacts trusted directly
    4Evaluation on real workloadsPublic benchmarks used as a proxy
    5Memory and instruction architectureAll memory types collapsed into one retrieval problem
    6Cost and latency fitSized for weights, not KV cache
    7Raw model capabilityOver-weighted in almost every proposal

    Architecture sets your cost structure and your deployment limits. It does not decide whether the system works.

    Serving stack, since it is where the economics land

    TechniqueWhat it doesWhere it pays
    Continuous batchingIteration-level scheduling; requests join and retire mid-flight rather than waiting for a batch boundaryUniversal. The default primitive in vLLM and SGLang
    PagedAttentionManages KV cache as virtual memory pages, eliminating fragmentation and enabling large flexible batchesHigh-throughput multi-user serving
    RadixAttentionRadix tree caches and shares KV state across requests with matching prefixes, LRU evictionLong shared system prompts; reported 30–50% savings on 2K+ prefixes
    Chunked prefillMixes prefill chunks with decode tokens to relieve prefill/decode interference (Sarathi-Serve)Mixed short and long request workloads
    P/D disaggregationSeparates prompt encoding from generation across node pools to co-optimise TTFT and TPOT independentlyCluster scale, tight latency SLOs. Moonshot's Mooncake reports ~90% cache hit on coding workloads
    Speculative decodingDraft k tokens, verify in one parallel pass via rejection sampling, which is lossless. EAGLE-3 autoregresses at feature level with dynamic draft trees; DeepSeek's MTP head bakes it into the model2–3× throughput on the same hardware, no quality loss. The least used optimisation in enterprise deployments

    The line worth using in client conversations

    The architectural gap between a frontier closed model and a strong open model is small and narrowing. The gap in data curation, RL infrastructure and post-training scale is large. But neither one decides whether an enterprise deployment succeeds. That is decided by data access, decomposition, verification, evaluation, and the memory and instruction architecture around the model. That is the work a data practice is already good at, and the market currently assumes the opposite.