Define tokens, inference, and classification in plain language, using networking terms you already know
Distinguish classification and scoring from open-ended text generation, and explain why the difference matters for automation
Explain what a calibrated probability distribution is and why calibration is the property that makes confidence thresholds safe
Decide which parts of a NOC workflow should stay deterministic code and which parts can safely be handed to a model
Pre-Quiz: Models, Tokens, and Inference
A network engineer wants to rate-limit token consumption for the triage service by tapping the link between the triage service and the model API and counting tokens in a packet capture. Why won't this work?
Tokens are encrypted and cannot be inspected on the wire
Tokens are produced by a tokenizer inside the model API's inference stack and never travel across the network as a nameable unit — the wire shows JSON text, not tokens
Token counts vary too much between requests to be useful for rate-limiting
The API does not report token usage, so there is nothing to capture
Why does the TypeSafe SDK require each system_one call to carry its own complete state, including facts like "this is the fourth flap on this interface today," rather than relying on the API to remember prior calls?
Because inference is a stateless request/response call — the server has no memory of previous calls, unlike the illusion created by chat clients that silently resend the whole conversation
Because storing state server-side would violate data retention policies
Because the model can only process one fact per request
Because state must be encrypted separately from the questions payload
A Monday-morning maintenance window dumps 400 Arista EOS interface-flap alerts into Splunk within 90 seconds, all destined for the triage service's model endpoint. Which response best matches the chapter's networking analogy for throughput?
Treat it like a congested uplink and queue, pace, and batch the requests, because throughput is a committed rate and traffic above it should be shaped rather than blasted at the endpoint
Increase the context window so all 400 alerts fit in a single inference call
Switch to generation instead of classification so the model can summarize all 400 alerts in one response
Ignore it, because inference latency is dominated by the decode phase and volume does not matter
Models, Tokens, and Inference
Key Points
A token is the basic unit a model reads and bills on — a word or word fragment, produced by a tokenizer inside the inference server, never visible on your network wire.
Get token counts from the API's usage object (input_tokens / output_tokens), not from packet capture or NetFlow — tokens never exist as a networked unit.
Different model families tokenize differently, so one model's token budget does not transfer to another.
Inference is a stateless HTTP request/response call — nothing is remembered between calls, so every fact the model needs must be in that call's state.
Inference splits into a compute-bound prefill phase (time to first token, TTFT) and a memory-bandwidth-bound decode phase (tokens per second, TPS) — they scale differently and must be measured separately.
Latency, throughput, and cost per million tokens describe a model dependency the same way latency, committed rate, and metered cost describe a circuit.
A token is the basic unit a language model processes — roughly a word or word fragment ("inference" might be one token, "engineering" might split into two). A model reads a sequence of tokens, and every economic property of a request — size limits, price, speed — is expressed in tokens, the same way your switch thinks in frames while your billing thinks in bytes.
Two consequences matter operationally. First, a token is not a networking object: tokenizers run inside the AI stack, so tapping the wire shows JSON text, not tokens. TypeSafe reports counts back explicitly, so every response carries a usage object your service can log like an interface counter. Second, different models tokenize differently — an accurate count requires that specific model's tokenizer, so token budgets do not transfer between models.
Inference is a stateless request/response call: you send a payload, you get a payload back, and the server remembers nothing afterward. TypeSafe exposes this as POST /v1/systemone, wrapped by client.system_one(...). Unlike a chat assistant — which only appears to remember earlier turns because the client resends the whole conversation — a typed decision call carries its own state and questions and is judged on its own merits. If the model needs to know this is the fourth flap today, that fact must be placed in state.
Figure 2.1: Inference as a stateless request/response call
sequenceDiagram
participant Triage as Triage Service
participant API as TypeSafe API
Triage->>API: POST /v1/systemone with state and questions
API->>API: Process request with no memory of prior calls
API-->>Triage: Response with answers and request_id
Note over Triage,API: Each call is independent and idempotent
Because each call is independent, retries are safe and re-running a failed triage is idempotent. Every response also carries a request_id and the model that answered — log both next to your ServiceNow ticket number as a correlation pair.
Inference runs in two internal phases with different bottlenecks. Prefill pushes the whole input through the model in parallel to produce the first token — compute-bound, measured by TTFT, and analogous to serialization delay that scales with how much you sent. Decode then emits each subsequent token one at a time, each depending on all previous ones — memory-bandwidth-bound, measured in TPS, and paid once per output token. A model that emits a long essay pays decode cost on every token of it; a model that emits a label and a probability barely enters decode at all. That is the structural reason bounded answers are fast.
Three numbers describe a model dependency in production. Latency is round-trip time for one call — the tail (p99) matters more than the average, the same way a BFD timer cares about worst-case path latency, not typical latency. Throughput is tokens per second and requests per minute the endpoint will accept, like a circuit's committed information rate: traffic above it should be shaped, not blasted. Cost is quoted per million tokens and usually dominated by input size, so cost control is a data-shaping problem — sending a full show tech-support dump when three syslog lines would do is the AI equivalent of leaving a packet capture running on a metered circuit.
AI term
What it is
Closest networking analogy
Token
The unit a model reads and bills on
A byte in a byte budget — the accounting unit under what humans care about
Context / request size
How many tokens one call may carry
MTU: a ceiling on one unit of work, not total work
Inference
One model call: input in, answer out
A stateless REST API call; nothing remembered between calls
Prefill (TTFT)
Processing the whole input to produce the first token
Serialization delay — scales with how much you sent
Decode (TPS)
Emitting each subsequent token in sequence
Per-hop processing delay, paid once per output unit
Throughput
Tokens/sec and requests/min the API will serve
Committed information rate on a circuit
Visual animation — coming soon
A token is the model's unit of accounting, produced inside the AI stack and never visible on your wire, so token counts come from the API's usage field rather than from your monitoring. Inference is a stateless request/response call, with the timeouts, retries, and request IDs that implies. Latency, throughput, and per-token cost define the dependency, and all three are shaped mainly by how much you choose to send.
Post-Quiz: Models, Tokens, and Inference
A network engineer wants to rate-limit token consumption for the triage service by tapping the link between the triage service and the model API and counting tokens in a packet capture. Why won't this work?
Tokens are encrypted and cannot be inspected on the wire
Tokens are produced by a tokenizer inside the model API's inference stack and never travel across the network as a nameable unit — the wire shows JSON text, not tokens
Token counts vary too much between requests to be useful for rate-limiting
The API does not report token usage, so there is nothing to capture
Why does the TypeSafe SDK require each system_one call to carry its own complete state, including facts like "this is the fourth flap on this interface today," rather than relying on the API to remember prior calls?
Because inference is a stateless request/response call — the server has no memory of previous calls, unlike the illusion created by chat clients that silently resend the whole conversation
Because storing state server-side would violate data retention policies
Because the model can only process one fact per request
Because state must be encrypted separately from the questions payload
A Monday-morning maintenance window dumps 400 Arista EOS interface-flap alerts into Splunk within 90 seconds, all destined for the triage service's model endpoint. Which response best matches the chapter's networking analogy for throughput?
Treat it like a congested uplink and queue, pace, and batch the requests, because throughput is a committed rate and traffic above it should be shaped rather than blasted at the endpoint
Increase the context window so all 400 alerts fit in a single inference call
Switch to generation instead of classification so the model can summarize all 400 alerts in one response
Ignore it, because inference latency is dominated by the decode phase and volume does not matter
Pre-Quiz: Classification Versus Generation
A team writes a model's Choice output ("team": "routing") directly into an automated ServiceNow assignment with no human review. Someone then proposes doing the same with a model-generated paragraph recommending a remediation, writing it directly into an automated change ticket. Using the ACL-versus-design-document analogy, why is the second case different?
A Choice answer is bounded by a criteria dictionary defined in advance, like an ACL match — testable and auditable; a generated paragraph is open-ended prose like a design document, meant for human judgment, not a downstream action
There is no meaningful difference — both are model outputs and equally safe to automate
Generation is safer because it gives more context than a bounded label
Choice questions are riskier because they force the model to guess even when it is unsure
Why can a team fail a CI build automatically when classification accuracy drops, but cannot write an equivalent automated test for a generated post-incident summary?
Generated text has no bounded answer space to assert against, while a Choice output is one of a finite set of known labels that can be checked against labeled historical tickets
Generated text takes longer to produce, which times out CI pipelines
CI systems cannot parse JSON, only plain text
Classification models are retrained more often than generation models
The severity question is declared as Score(criteria=[...]) with a custom rubric in the team's own language, rather than asking the model to "rate severity 1-10." What is the advantage of the custom rubric?
It anchors severity in the team's own operational language ("single user or cosmetic" vs. "multiple sites or business-critical app down") instead of a generic scale the model would interpret inconsistently
It makes the request use fewer tokens than a generic 1-10 scale
It allows the model to invent new severity levels as needed
It converts the Score question into a Choice question automatically
Classification Versus Generation
Key Points
Classification picks one option from a set defined before the model answers; generation produces open-ended text with no bounded answer space.
The SDK expresses classification as Choice (pick one label), Score (place on an ordered rubric), and Noul (yes/no as a probability).
Bounded outputs are testable against labeled history, comparable across time, and aggregable into metrics; generated prose is none of those things without a second, error-prone parsing layer.
An ACL entry is a bounded, auditable match decision; a design document is open-ended prose reviewed by judgment. A Choice question is an ACL match; a chatbot prompt is a design document.
Rule of thumb: if another system will act on the answer automatically, it needs to be an ACL match, not a design document.
Classification is choosing one option from a defined set; generation is producing open-ended text. Confusing the two is the most common reason AI projects in network operations go sideways. Generation is what most people have used — you ask, you get paragraphs, and the output space is effectively infinite, with nothing telling you how sure the model was. It suits tasks a human will read and judge: a post-incident summary, an explanation of protocol behavior, a design document sketch.
Figure 2.2: Classification versus generation
flowchart TD
A[Model Input] --> B{Bounded Answer Set Defined}
B -->|Yes| C[Classification]
C --> D[Choice, Score, or Noul]
D --> E[Testable and Comparable Output]
B -->|No| F[Generation]
F --> G[Open Ended Text]
G --> H[Requires Human Judgment]
Classification constrains the output before the model answers. The TypeSafe SDK declares this per question:
Choice(instructions=..., criteria={...}) — pick one label from a dictionary of labels and meanings; classification in its purest form.
Score(instructions=..., criteria=[...]) — place the input on an ordered rubric you define, low to high.
Noul(instructions=...) — a yes/no judgment, returned as a probability of "yes."
For a ServiceNow ticket correlating a Cisco IOS-XE BGP flap with an Arista EOS port flap:
response = client.system_one(
state=ticket,
questions={
"team": Choice(
instructions="Which NOC team should own this incident",
criteria={
"routing": "BGP, OSPF, route policy, and WAN reachability",
"switching": "Campus and data-center L2, VLANs, port flaps, STP",
"wireless": "APs, WLAN controllers, RF and client association",
"transport": "Circuits, optics, carrier faults, physical plant",
},
),
"severity": Score(
instructions="How severe is the business impact described",
criteria=[
"Single user or cosmetic",
"One site degraded, workaround exists",
"Multiple sites or a business-critical app down",
],
),
"customer_facing": Noul(
instructions="The incident affects an externally visible service",
),
},
)
The team set is closed — the model cannot invent a fifth team. The severity rubric is the team's own operational language, not a generic scale the model imagined. The yes/no question returns a number between 0 and 1, because the useful output is a degree of belief, not a verdict.
A bounded output is testable in the ordinary software sense: run three hundred historical tickets with known owning teams, compute accuracy, diff month over month, fail CI on regression. None of that works on a paragraph — there is no assertion for "the answer sounded reasonable." Bounded outputs are also comparable and aggregable, while free text needs a second parsing layer that adds its own errors. There is a performance dividend too: a classification answer is a handful of output tokens, while a generated explanation is hundreds or thousands, each paid sequentially in the decode phase.
The cleanest way to hold the distinction: an ACL entry matches a packet against a finite ordered list of conditions and returns permit or deny — testable, diffable, provable, auditable, because the answer space was defined before the packet arrived. A network design document is open-ended prose, varies by author, and is reviewed by judgment, not assertion. A Choice question is an ACL match; a chatbot prompt is a design document. If generated text is about to feed a field another system will act on, a design document has been written where an ACL belonged.
Classification picks one option from a set you defined in advance; generation produces open-ended text with no bounded answer space. Bounded outputs can be unit-tested against labeled history, compared across time, aggregated into metrics, and returned in a few tokens instead of thousands. The test is simple: if another system will act on the answer, it needs to be an ACL match, not a design document.
Post-Quiz: Classification Versus Generation
A team writes a model's Choice output ("team": "routing") directly into an automated ServiceNow assignment with no human review. Someone then proposes doing the same with a model-generated paragraph recommending a remediation, writing it directly into an automated change ticket. Using the ACL-versus-design-document analogy, why is the second case different?
A Choice answer is bounded by a criteria dictionary defined in advance, like an ACL match — testable and auditable; a generated paragraph is open-ended prose like a design document, meant for human judgment, not a downstream action
There is no meaningful difference — both are model outputs and equally safe to automate
Generation is safer because it gives more context than a bounded label
Choice questions are riskier because they force the model to guess even when it is unsure
Why can a team fail a CI build automatically when classification accuracy drops, but cannot write an equivalent automated test for a generated post-incident summary?
Generated text has no bounded answer space to assert against, while a Choice output is one of a finite set of known labels that can be checked against labeled historical tickets
Generated text takes longer to produce, which times out CI pipelines
CI systems cannot parse JSON, only plain text
Classification models are retrained more often than generation models
The severity question is declared as Score(criteria=[...]) with a custom rubric in the team's own language, rather than asking the model to "rate severity 1-10." What is the advantage of the custom rubric?
It anchors severity in the team's own operational language ("single user or cosmetic" vs. "multiple sites or business-critical app down") instead of a generic scale the model would interpret inconsistently
It makes the request use fewer tokens than a generic 1-10 scale
It allows the model to invent new severity levels as needed
It converts the Score question into a Choice question automatically
Pre-Quiz: Probabilities and Calibration
In the example distribution (routing 0.71, switching 0.19, transport 0.07, wireless 0.03), what does the 0.19 on switching tell an engineer, beyond the fact that routing won?
The ticket contains genuine ambiguity — an Arista leaf port flap alongside the BGP adjacency change gives switching a real, non-trivial case, information a bare label would discard
The model is uncertain and the response should be discarded
Switching is a backup value used only if the routing team rejects the ticket
The probabilities are noise and can be ignored once the top choice is known
A model states 90% confidence on 1,000 decisions, and 700 of them turn out correct. What does this indicate?
The model is overconfident and miscalibrated at that confidence level — matching the documented pattern where modern deep networks can express 90% confidence while being right only about 70% of the time
The model is well-calibrated, since 90% is just an upper bound on accuracy
The model should be trusted more, since 700 correct decisions is a large number
This is a sign the model needs more training data specifically about the wireless team category
A NOC manager reviews one incident where the model was 92% confident and wrong, and concludes the auto-assign threshold of 0.85 is unsafe and must be raised immediately. What is the flaw in this reasoning?
Calibration is a property of a population of decisions, not any single case — a well-calibrated model at 92% confidence is expected to be wrong roughly 8% of the time, so one wrong case proves nothing without bucket-level accuracy data
There is no flaw; any wrong high-confidence decision is proof the threshold is unsafe
The manager should have looked at 10 incidents instead of 1, which is a large enough sample
The threshold is unrelated to confidence and should be set by ticket volume alone
Probabilities and Calibration
Key Points
A classification model produces a probability distribution across every allowed option, summing to 1.0 — the "answer" is just the top-scoring option.
Runner-up values are real information: a genuine second-place option signals ambiguity in the input, the way a human triage engineer would weigh it.
Calibration is the alignment between stated confidence and observed accuracy — 80% confidence should be right about 80% of the time.
Modern deep networks are systematically overconfident by default; TypeSafe's RLCD training targets calibrated probabilities instead of persuasive text.
Calibration is a population property, verified across buckets of many decisions with confirmed outcomes — never provable or disprovable from one incident.
A threshold is a statement about an acceptable error rate, not a promise of correctness, and it must be monitored continuously as vendor mix and alert shapes change.
A classification model does not really pick one answer — it produces a probability distribution, a confidence value for every allowed option, and the "answer" is whichever came out on top. For the ticket example:
Read it like a routing table, not a verdict. Routing won at 0.71; switching is a genuine runner-up at 0.19, unsurprising since the ticket mentions an Arista leaf port flapping alongside the BGP adjacency change; transport at 0.07 fits "flapping could be an optic"; wireless is effectively ruled out at 0.03. The distribution summarizes real ambiguity in the ticket.
Figure 2.3: Probability distribution across four NOC teams
flowchart LR
T[Incident Ticket] -->|0.71| Routing[Routing Team]
T -->|0.19| Switching[Switching Team]
T -->|0.07| Transport[Transport Team]
T -->|0.03| Wireless[Wireless Team]
With a distribution instead of a bare label, code gets graduated behavior that mirrors how a NOC already tiers severity:
confidence = 0.71 # the ChoiceAnswer's confidence value
if confidence >= 0.85:
assign_to_queue(team) # auto-assign
elif confidence >= 0.60:
assign_to_queue(team, flag="review") # assign, mark for review
else:
assign_to_queue("NOC-Triage") # a human decides
Calibration is the alignment between predicted probability and observed outcome frequency: a well-calibrated model assigns 80% confidence to decisions correct about 80% of the time. It is the same property as a link-utilization gauge reading true — 80% on the dial really is 80% of line rate. To check it, bin decisions by stated confidence and compare each bin's actual accuracy:
Confidence bucket
Decisions
Expected correct
Actually correct
Observed accuracy
0.50 – 0.59
240
~132
129
53.8%
0.60 – 0.69
310
~202
198
63.9%
0.70 – 0.79
480
~360
371
77.3%
0.80 – 0.89
690
~587
579
83.9%
0.90 – 0.99
1,280
~1,216
1,225
95.7%
Every bucket's observed accuracy lands close to its stated confidence — that is the whole test, formalized as Expected Calibration Error (ECE), a single scalar tracked over time. Modern deep neural networks are systematically overconfident by default — a network may express 90% confidence while being right only about 70% of the time. For automation the consequence is direct: a model claiming "95% safe" while its real accuracy at that level is 70% will approve unsafe changes at a catastrophic rate. This is precisely what TypeSafe's RLCD (Reinforcement Learning for Calibrated Decisions) is designed against, in contrast to RLHF, which optimizes for human-preferred responses and can reinforce confident-sounding hallucinations, and can also cause mode dropping — narrowing the output distribution and suppressing the runner-up alternatives that signal ambiguity. When calibration drifts, temperature scaling and similar post-hoc techniques can often repair it without retraining.
Calibration is a property of a population of decisions, not any single decision — a model that is never wrong at 90% confidence is under-confident, not accurate. Three implications follow: you cannot audit calibration from one incident, you need the bucket table; a threshold is a statement about an acceptable error rate, not a promise of correctness (auto-assigning at 0.85 accepts roughly one mis-assignment in seven at the boundary, a deliberate business tradeoff); and calibration must be monitored continuously as vendor mix and alert shapes drift, the same way an interface error-rate baseline is re-examined, not set once.
A classification answer is a probability distribution across every allowed option, and the runner-up values tell you how ambiguous the input was. Calibration means those numbers correspond to reality — 80% confidence is right about 80% of the time — and it is verified across buckets of many decisions, never on a single case. Thresholds are only safe on a calibrated model, so measure calibration before you automate and monitor it after.
Post-Quiz: Probabilities and Calibration
In the example distribution (routing 0.71, switching 0.19, transport 0.07, wireless 0.03), what does the 0.19 on switching tell an engineer, beyond the fact that routing won?
The ticket contains genuine ambiguity — an Arista leaf port flap alongside the BGP adjacency change gives switching a real, non-trivial case, information a bare label would discard
The model is uncertain and the response should be discarded
Switching is a backup value used only if the routing team rejects the ticket
The probabilities are noise and can be ignored once the top choice is known
A model states 90% confidence on 1,000 decisions, and 700 of them turn out correct. What does this indicate?
The model is overconfident and miscalibrated at that confidence level — matching the documented pattern where modern deep networks can express 90% confidence while being right only about 70% of the time
The model is well-calibrated, since 90% is just an upper bound on accuracy
The model should be trusted more, since 700 correct decisions is a large number
This is a sign the model needs more training data specifically about the wireless team category
A NOC manager reviews one incident where the model was 92% confident and wrong, and concludes the auto-assign threshold of 0.85 is unsafe and must be raised immediately. What is the flaw in this reasoning?
Calibration is a property of a population of decisions, not any single case — a well-calibrated model at 92% confidence is expected to be wrong roughly 8% of the time, so one wrong case proves nothing without bucket-level accuracy data
There is no flaw; any wrong high-confidence decision is proof the threshold is unsafe
The manager should have looked at 10 incidents instead of 1, which is a large enough sample
The threshold is unrelated to confidence and should be set by ticket volume alone
Pre-Quiz: Where AI Belongs in a Network Workflow
An engineer proposes asking the model "Is this maintenance window still open right now?" instead of comparing the current time against a stored window in code. Why is this the wrong design choice?
It is deterministic logic — same input always yields the same provable answer — and a model can only be validated statistically for something code can prove by inspection and a two-line unit test
The model would need too many tokens to answer a yes/no question
Time comparisons require a Score question type, not a Noul, and would return a confusing scale
The model cannot access clocks at all, so it would always error out
Which of the following is the best candidate to hand to the model rather than keep in deterministic code, per the chapter's rule of thumb?
Deciding whether four differently-worded vendor log lines (Cisco, Arista, Junos, Aruba) describe the same physical fault
Checking whether GigabitEthernet0/1 is currently down
Computing the number of minutes between the first flap and ticket creation
Writing the final team assignment back to ServiceNow
According to the chapter, why does "amplified blast radius" make LLM-driven automation categorically different from a typo in a traditional script?
An AI can replicate a single flawed piece of logic across thousands of devices or configuration lines in one push, trading many small localized failures for rare but catastrophic ones
LLMs are slower than traditional scripts, so errors take longer to detect
LLMs only affect one device at a time, making errors easier to isolate
Blast radius only applies to routing protocols, not switching or wireless
Where AI Belongs in a Network Workflow
Key Points
Deterministic logic — status checks, thresholds, date math, string matching, every write action — stays in code permanently, because a proof beats a probability.
The model belongs on questions that require interpreting unstructured language: which team owns a ticket, how severe described impact is, whether a change looks risky, whether multi-vendor alerts describe one event.
Semantic blindness means syntactically valid model output can still be operationally unsafe, because the model has no awareness of history, business rules, or dependencies.
Amplified blast radius: AI-driven mistakes trade frequent small errors for rare, catastrophic, large-scale ones.
Hallucination and context drift hide inside generated output at scale, escaping line-by-line review and degrading further as scope grows.
The responsible pattern is human-in-the-loop: the model returns a bounded judgment, deterministic code decides the action and executes it — the model never touches a device directly.
Deterministic logic is any computation whose answer follows from the input by fixed rules — same input, same output, provably. Interface status checks, threshold comparisons, date arithmetic, regex matching, unit conversions: these stay in code permanently. Not because a model would necessarily get them wrong, but because it might, and there is no way to prove otherwise. if utilization > 80 is verified by inspection and a two-line unit test; "ask the model whether utilization is high" can only be validated statistically — a proof traded for a probability, for nothing gained. Language models are pattern-matching engines, not calculators or clocks: date math and arithmetic belong in Python, with the computed value placed into state as a fact if the model needs it. This is the same division of labor as BGP and a route-map: the protocol computes best paths by deterministic rules, the route-map encodes policy judgment.
What benefits from a model is language interpretation a reasonable engineer would judge rather than compute: interpreting a vague ticket description no regex can parse; ranking severity from a caller's words against a rubric; spotting a risky change touching core policy or a shared-services VLAN; and reconciling four vendors' different log dialects describing one physical fault. In every case, the input is language, the output is a bounded label or score, and the alternative is a human reading the text.
Figure 2.4: Deciding what stays in code versus what goes to the model
flowchart TD
A[NOC Task] --> B{Can the Answer Follow Fixed Rules}
B -->|Yes| C[Keep in Code]
B -->|No| D[Ask the Model]
D --> E[Model Returns Bounded Label or Score]
E --> F[Code Decides the Action and Executes It]
C --> F
NOC task
Keep in code
Ask the model
Is GigabitEthernet0/1 currently down?
X
Minutes between first flap and ticket creation
X
Is the change window still open right now?
X
Which of four NOC teams owns this ticket?
X
How severe is the impact the caller describes?
X
Are these four vendor alerts the same incident?
X
Should this ticket be auto-assigned?
X (threshold on the model's confidence)
Write the assignment back to ServiceNow
X (an API call, never a generated action)
The documented consensus is direct: LLMs should not operate as autonomous pilots in network automation, for four reasons. Semantic blindness — an LLM has no awareness of network history, unstated business rules, or dependencies, so it can produce output that is syntactically correct but semantically unsafe, such as reading "optimize BGP for the new Dallas link" as license to disrupt long-standing peering policy. Amplified blast radius — AI-driven mistakes trade many small, localized errors for rare, catastrophic ones, such as an AI updating ACLs across hundreds of firewalls on flawed logic in a single push. Hallucination and undetectable error — invented commands or nonexistent parameters hide inside a thousand-line generated script that nobody can audit line by line. Context drift and structural violations — LLMs struggle to hold state across sequential steps, and research on LLM-generated topologies found violations (duplex mismatches, ring loops, oversubscription) that worsened sharply as network size grew, meaning a small lab test can mask failures that appear only at production scale.
Figure 2.5: Failure path of an LLM holding control authority
flowchart TD
A[LLM Given Direct Control Authority] --> B[Generates Syntactically Valid Output]
B --> C{Semantically Safe}
C -->|Unknown to the Model| D[Semantic Blindness]
D --> E[Change Pushed at Scale]
E --> F[Amplified Blast Radius]
E --> G[Hallucinated Command or Syntax]
E --> H[Context Drift Across Steps]
F --> I[Catastrophic Failure]
G --> I
H --> I
Visual animation — coming soon
The responsible pattern is human-in-the-loop with automated safeguards: the model generates a candidate judgment, and diffing, rollback, staged deployment, and audit trails govern what happens next. A model that can only return one of four team labels with a probability distribution cannot hallucinate a nonexistent command and cannot push anything to a device — it has no control authority, and deterministic code decides what happens next.
Anything provable — status, thresholds, arithmetic, dates, string matching, and every write action — stays in deterministic code, because a proof beats a probability. The model handles interpretation of language: which team owns this, how bad the described impact is, whether a change looks risky. Keeping the model out of the control path defuses the documented failure modes of generative automation, because a bounded label with a probability cannot execute anything.
Post-Quiz: Where AI Belongs in a Network Workflow
An engineer proposes asking the model "Is this maintenance window still open right now?" instead of comparing the current time against a stored window in code. Why is this the wrong design choice?
It is deterministic logic — same input always yields the same provable answer — and a model can only be validated statistically for something code can prove by inspection and a two-line unit test
The model would need too many tokens to answer a yes/no question
Time comparisons require a Score question type, not a Noul, and would return a confusing scale
The model cannot access clocks at all, so it would always error out
Which of the following is the best candidate to hand to the model rather than keep in deterministic code, per the chapter's rule of thumb?
Deciding whether four differently-worded vendor log lines (Cisco, Arista, Junos, Aruba) describe the same physical fault
Checking whether GigabitEthernet0/1 is currently down
Computing the number of minutes between the first flap and ticket creation
Writing the final team assignment back to ServiceNow
According to the chapter, why does "amplified blast radius" make LLM-driven automation categorically different from a typo in a traditional script?
An AI can replicate a single flawed piece of logic across thousands of devices or configuration lines in one push, trading many small localized failures for rare but catastrophic ones
LLMs are slower than traditional scripts, so errors take longer to detect
LLMs only affect one device at a time, making errors easier to isolate
Blast radius only applies to routing protocols, not switching or wireless
Key Terms
Term
Definition
Token
The basic unit a language model processes — roughly a word or word fragment. Produced by a tokenizer inside the inference server and never appears on your network; request size, rate limits, and cost are all measured in tokens.
Tokenizer
The component that splits input text into tokens. Different model families tokenize differently, so token counts do not transfer between models.
Inference
One execution of a trained model over an input to produce an output. Operationally a stateless HTTP request/response call — in TypeSafe, POST /v1/systemone, wrapped by client.system_one(...).
Prefill
The compute-bound first phase of inference that processes the whole input and produces the first output token. Measured by time to first token (TTFT).
Decode
The memory-bandwidth-bound second phase that emits each subsequent token sequentially. Measured by tokens per second (TPS).
Throughput
How much work a model endpoint will serve per unit time, expressed as tokens per second and requests per minute — the model equivalent of a circuit's committed rate.
Classification
Choosing one option from a set defined in advance. In the SDK, a Choice question whose criteria dictionary enumerates every allowed label.
Generation
Producing open-ended text with no bounded answer space. Useful for human readers; unsuitable for feeding automated actions.
Score
A TypeSafe question type that places an input on an ordered rubric supplied as a list of criteria, returning an expected score, confidence, a legend, and probabilities per integer score.
Noul
A TypeSafe question type for yes/no judgments, returned as a probability of "yes" between 0 and 1.
Probability distribution
Confidence values spread across every allowed option, summing to 1.0. The selected answer is simply the highest value; the runner-ups quantify ambiguity.
Confidence
The probability the model assigns to the answer it selected. Only meaningful as a decision input if the model is calibrated.
Calibration
Alignment between predicted probability and observed outcome frequency: 80%-confidence decisions should be correct about 80% of the time. The property that makes confidence thresholds safe.
Expected Calibration Error (ECE)
A scalar metric of miscalibration computed by binning predictions by confidence and taking the weighted average deviation between confidence and observed accuracy.
Over-confidence
The systematic tendency of modern deep neural networks to state higher confidence than their true accuracy, driven by network depth, width, weight decay, and batch normalization.
Temperature scaling
A single-parameter post-hoc calibration technique that rescales logits before the softmax, improving probability alignment without retraining.
RLCD
Reinforcement Learning for Calibrated Decisions — TypeSafe's training approach, which optimizes for decisions and probabilities aligned with true outcome frequencies.
RLHF
Reinforcement Learning from Human Feedback — optimizes for human-preferred responses; enables chatbots but can reinforce sycophancy and confident-sounding hallucinations.
Mode dropping
An RLHF side effect in which a model narrows its output distribution toward preferred styles and suppresses alternatives — destroying exactly the runner-up information that signals ambiguity.
Deterministic logic
Computation whose output follows from its input by fixed rules, identically every time: status checks, threshold comparisons, date math, string matching. Belongs in code, not in a model.
Hallucination
Confident model output not grounded in reality — in network terms, invented commands, incorrect syntax, or parameters that do not exist in the target device OS.
Semantic blindness
An LLM's lack of awareness of network history, business rules, and dependencies, producing changes that are syntactically correct but operationally unsafe.
Blast radius
The scope of damage from a single error. AI-driven automation trades frequent small localized mistakes for rare catastrophic ones affecting hundreds of devices at once.
Human-in-the-loop
The pattern in which a model produces candidates or judgments and a human or deterministic system validates and executes — the documented requirement for responsible LLM use in network automation.