top of page

Welcome to the VBNN Digital Library

Unlock a Vast Knowledge Ecosystem

Featuring over 30,000 books, academic papers, illustrations, and expert insights—continuously updated to support your research and professional growth.

​

Welcome to our library!

Here, you will find an exclusive collection created 100% by our own faculty, meaning you will not find these resources anywhere else. Over the last 20 years, our team has written much more than what is currently online, and we are actively working to upload our complete back catalog. We update our platform regularly, so be sure to check back from time to time. If you ever need help finding a specific resource, you can always contact us!

​

Maximize Your Access

Log in to instantly view and download tailored resources directly aligned with your specific program and curriculum.

Ready to begin? Sign in above to explore your personalized dashboard.

​

Please note: Login is only possible using your institutional email address; otherwise, the system will not recognize your account.

​

VBNN Library AI

Introducing our fully integrated Library AI. Designed to support your research, you may submit inquiries in any language and receive precise, evidence-based responses drawn exclusively from our published scholarly articles and textbooks.

Search...

Latest Publications:

Search this site

Results found for empty search

  • Prompt Engineering (The Art and Science of Instructing AI)

    Download the Book (PDF): Introduction: A Program With No Compiler Every developer who builds on a large language model eventually has the same experience. A feature works in the demo. It works for the first hundred users. Then a support ticket arrives showing the model doing something nobody wrote down and nobody wanted: answering in French because a customer pasted a French email, inventing a refund policy, ignoring the output format the parser depends on, or cheerfully following an instruction buried in a web page it was asked to summarise. The developer opens the prompt, stares at it, adds a sentence in capital letters, and ships again. The ticket goes away. A different one arrives a week later. This cycle is so common that it has given prompt engineering a poor reputation in some engineering circles. The phrase conjures an image of people collecting magic words, swapping incantations on social media, and treating "you are a world-class expert" as if it were a configuration flag. Some of that reputation is earned. A great deal of what circulated under the label in 2022 and 2023 was folklore: phrases that seemed to help on one model, on one task, on one afternoon, and that nobody ever measured. But the underlying discipline is real, and it has matured. Behind the folklore sits a body of research on how language models use the text they are given, a set of engineering practices for testing and versioning prompts, and a fast-growing security literature on what happens when untrusted text reaches a model that can act in the world. The developers who build reliable systems on these models are not the ones with the cleverest phrases. They are the ones who understand what the model is actually doing with their words, who design the whole context the model sees rather than one paragraph of it, who measure, and who assume that any text they did not write may be hostile. The argument of this book The central claim of this book is simple to state and takes the rest of it to develop: a prompt is a specification read by a capable but literal stranger who knows nothing except what is in front of it, and engineering a prompt means designing that entire context as an interface — explicit about what is wanted, deliberate about what is included, tested like code, and defended at every boundary where outside text enters. Each part of that sentence matters. A specification, because the prompt is the only place your intent exists from the model's point of view; anything you meant but did not write is absent. A capable but literal stranger, because modern models can reason, write, and code at a high level, yet they have no access to your team's conventions, your product's history, or the edge case you discussed in a meeting last Tuesday. The entire context, because what shapes the model's behaviour is not just your carefully worded instruction but every token in its window: retrieved documents, conversation history, tool definitions, examples, and whatever the user typed. Tested like code, because natural language is ambiguous and models are stochastic, so intuition about whether a prompt works is unreliable. Defended at every boundary, because a model cannot reliably tell the difference between instructions you gave it and instructions that arrived inside data, and that single fact makes every user-facing application a potential security problem. The phrase "no compiler" in the title of this introduction is the shortest version of the idea. When you write a function in a typed language, the compiler rejects much of what is wrong before it runs. When you write a prompt, nothing rejects anything. The model will always produce some output, often a fluent and confident one, and the only way to find out whether the instruction meant what you thought is to run it many times on many inputs and look. Prompt engineering is the practice of building the checks a compiler would have given you, out of other means. Who this is for This book is written for developers who are building, or about to build, software that calls a generative language model: a support assistant, a document-processing pipeline, a coding tool, an internal search product, an agent that books meetings or files tickets. It assumes you can read short code snippets and are comfortable with the idea of an API call. It does not assume any background in machine learning. Where the internals of the model matter to a practical decision, they are explained in plain terms. It is not a catalogue of tricks. There are several published surveys that enumerate dozens of named prompting techniques, and one of them is listed in the further reading at the end. This book is narrower and, I hope, more useful for that: it concentrates on the handful of ideas that account for most of the difference between a prompt that works in a demo and a system that works in production. What the chapters cover The book moves from the inside of a single model call outward to the system around it. Chapter 1 explains what the model actually reads: tokens, chat templates, the roles that separate system instructions from user messages, and the sampling process that turns probabilities into text. It shows why small, apparently meaningless changes to a prompt can produce large changes in behaviour, which is the fact that justifies everything else. Chapter 2 is about writing instructions. It argues that the most common failure in production prompts is not a missing technique but missing context, and it works through how to state a task, its audience, its constraints, and its output format so that a stranger could carry it out. Chapter 3 covers few-shot prompting, the practice of teaching a model by example. It explains what research has learned about why examples work, the systematic biases they introduce, and how to choose and order them. Chapter 4 covers chain-of-thought reasoning: asking a model to work through a problem before answering. It traces the technique from its discovery to its absorption into a new generation of reasoning models, and it addresses the uncomfortable evidence that a model's written reasoning is not always the reasoning that produced its answer. Chapter 5 turns to the context window. Long windows have not made context management obsolete; they have made it more important, because models do not use all positions in a long context equally well, and because every token costs money and latency. Chapter 6 widens the frame to retrieval, tools, and structured output, the components that turn a single prompt into an application. It argues that the craft is increasingly one of assembling context from many sources rather than writing one block of text. Chapters 7 and 8 are about prompt injection. Chapter 7 explains the attack: why it exists, how direct and indirect injection differ, and what real incidents have shown. Chapter 8 sets out defences, beginning with the honest admission that no prompt-level defence is complete and moving to the architectural patterns that limit what a successful injection can do. Chapter 9 closes the practical argument by treating prompts as software artefacts: evaluated against test sets, versioned, regression-tested when models change, and monitored in production. The conclusion draws out what follows from all of this for how teams should organise the work. A note on change This field moves quickly. Models released in 2026 behave differently from those of 2023, and some techniques that once required elaborate prompting are now built into the models themselves. Where that has happened, this book says so. The aim throughout has been to concentrate on principles that have survived several generations of models already and are likely to survive several more: that context determines behaviour, that examples carry more information than you intend, that reasoning benefits from room, that long contexts degrade, that data and instructions are not separated, and that nothing is known until it is measured. Specific model names and product features will date. Those principles have not, so far, and the reasons they hold are explained alongside each one. CHAPTER 1 What the Model Actually Reads A developer looking at an API call sees a tidy structure: a system prompt, a list of messages labelled "user" and "assistant", perhaps some tool definitions, and a few parameters such as temperature and maximum length. The model sees none of that structure in the way the developer imagines. It sees a single long sequence of tokens, and its only job is to predict what token comes next. Everything useful a language model does is built on that one operation, repeated. This is not a pedantic point. Most of the surprising behaviour developers encounter, and most of the techniques that fix it, follow directly from it. A prompt is not a command executed by an interpreter. It is the beginning of a document, and the model is continuing that document in the way that seems most plausible given everything it learned in training and everything it has been shown since. Understanding what that means in practice is the foundation for the rest of this book. Tokens, not words Language models do not read characters or words. They read tokens, which are fragments of text produced by a tokenizer that was fitted to a large body of training data before the model was trained. Common English words are usually a single token. Rarer words split into several pieces. Leading spaces are typically part of the token, so " cat" and "cat" are different tokens. Numbers are often split in irregular ways, so a model may see "1987" as one token and "1988" as two. Code, non-English text, and unusual formatting tend to use more tokens per character than ordinary English prose. Three practical consequences follow. First, token counts, not word counts, are what limit a context window and determine cost. A rough rule for English prose is that a token averages about three-quarters of a word, but that ratio changes sharply for code, tables, JSON, and other languages. A developer budgeting a context window by word count will be wrong, sometimes badly. Every major provider offers a tokenizer or a token-counting endpoint, and the only reliable budget is one computed with it. Second, tasks that depend on individual characters are harder than they look. Counting the letters in a word, reversing a string, or checking whether two long identifiers match exactly all require the model to reason about units it does not directly perceive. Modern models have become much better at these tasks, but where exactness matters, the robust approach is to do the character-level work in code and hand the model the result. Third, formatting is not free decoration. Whitespace, punctuation, and markup all become tokens that the model attends to. A prompt that uses a consistent structure gives the model a consistent pattern to continue. A prompt whose formatting drifts gives it noise. The chat template and its roles When you send a list of messages to a chat model, the provider's software converts that list into a single token sequence using a chat template. The template wraps each message in special tokens that mark where a message begins, which role produced it, and where it ends. The model was trained, during a later stage called instruction tuning and preference training, on enormous numbers of conversations formatted in exactly this way. It learned that text following a "system" marker tends to describe how the assistant should behave, that text following a "user" marker is a request, and that after an "assistant" marker it should produce a helpful response. This is why roles matter, and also why their protection is weaker than it appears. The system prompt carries more weight than a user message because the model was trained to give it more weight, not because there is a separate channel or a privileged register. Providers have invested considerable effort in strengthening this distinction. OpenAI described one approach in a 2024 paper on what it called an instruction hierarchy, in which models are trained to prioritise system-level instructions over conflicting instructions in user messages and, below that, in tool outputs.1 That training helps, and later chapters rely on it. But it is learned behaviour, statistically strong rather than guaranteed, and it can be overcome. Chapters 7 and 8 return to this at length, because it is the root of prompt injection. For everyday prompt design, the practical lesson is to put things in the place the model has been trained to expect them. Durable instructions about behaviour, persona, constraints, and output format belong in the system prompt. The specific request and its data belong in the user turn. Prior turns of conversation belong in the message history in their real roles, not pasted into a single user message as a transcript, because the model has learned to treat them differently when they are properly marked. A second practical lesson concerns the assistant role itself. Some APIs allow you to supply the beginning of the assistant's response, a technique usually called prefilling. If you start the assistant's turn with an opening brace, the model is strongly inclined to continue with a JSON object. If you start it with a particular heading, it will continue under that heading. Prefilling is a direct application of the next-token view of the model: you are not asking for a format, you are beginning it. Not every provider supports it, and some reasoning models restrict it, but where it is available it is one of the most reliable ways to control the shape of the output. From probabilities to text At each step the model produces a probability distribution over its entire vocabulary, typically tens of thousands to a few hundred thousand tokens. A sampling procedure then picks one, appends it to the sequence, and the process repeats. The parameters exposed by most APIs control that procedure. Temperature rescales the distribution before sampling. At low temperature the most probable token dominates and output becomes more repetitive and predictable. At higher temperature less likely tokens are chosen more often, producing more varied output and more errors. Top-p, or nucleus sampling, restricts the choice to the smallest set of tokens whose probabilities sum to a threshold. Maximum length caps the number of tokens generated. Stop sequences end generation when a particular string appears. Two misunderstandings about these settings cause recurring problems. The first is that setting temperature to zero makes a model deterministic. It makes the sampling step greedy, always taking the most probable token, but in practice outputs from hosted models can still vary between identical calls. Floating-point arithmetic on parallel hardware, batching of requests from different customers, and infrastructure changes can shift probabilities slightly, and where two tokens are nearly tied, a small shift changes the choice and everything after it. Teams that build tests assuming identical inputs yield identical outputs discover this quickly. Chapter 9 discusses how to test systems that are not deterministic. The second misunderstanding is that temperature is a creativity dial to be tuned per prompt. For most production tasks, extraction, classification, structured generation, and question answering, low temperature is appropriate and the gains from fine-tuning it are small compared with gains from improving the prompt itself. Some recent reasoning models fix or restrict sampling parameters altogether. The more important insight is the underlying one: the model is choosing among plausible continuations, and the prompt's job is to make the continuation you want overwhelmingly the most plausible. Why small changes have large effects If the model is continuing a document, then every feature of the document is evidence about what kind of document it is and what should come next. That includes features the author regarded as incidental. The clearest measurement of this comes from a 2023 study by Melanie Sclar and colleagues, published at ICLR in 2024, which examined how classification accuracy changed when the prompt's formatting was altered in ways that should not matter to a human: the separator between a field name and its value, whether a colon was followed by a space, capitalisation of field labels, the characters used between examples.2 Across a range of open models and tasks, they found large spreads in performance from these meaning-preserving changes, with differences of up to 76 accuracy points in one few-shot setting with a widely used 13-billion-parameter model. The spread shrank somewhat with larger models and instruction tuning, but it did not disappear, and the best format for one model was often not the best for another. It would be a mistake to read this as evidence that prompting is hopeless. Frontier models in 2026 are considerably more robust to trivial formatting changes than the models in that study. The right reading is narrower and more useful: you cannot assume a change is harmless because it is harmless to you. A prompt is a different object for the model than for the person who wrote it. Reformatting a prompt, moving a sentence, changing an example, or switching to a new model version are all changes that can shift behaviour, and the only way to know whether they did is to measure. The same view explains a family of behaviours that otherwise seem perverse. A model asked a question in a casual, error-strewn style tends to answer in a casual style. A model shown a document full of hedged, bureaucratic language tends to produce more of it. A prompt that describes a task in terms associated with low-quality web text tends to produce output resembling that text. A prompt that includes a confident wrong answer, even in a quoted example, raises the likelihood that the model repeats it. None of this is the model disobeying. It is the model doing exactly what it was built to do: continuing the document it was given in the most plausible way. One request, three documents A small thought experiment makes the continuation view concrete. Suppose a developer needs the model to explain what a particular SQL query does, for display in a database tool used by analysts. Consider three ways the request could arrive. In the first, the user turn contains only the query followed by "what does this do?" The model has a short, informal message and a block of code. The most plausible continuation, given what its training has rewarded, is a friendly general explanation pitched at an unknown reader, perhaps with a heading or two, a bulleted walk through each clause, and an offer to help further. That is a reasonable answer to an anonymous question. It may be far too long and too elementary for an analyst who wrote half the query themselves. In the second, the system prompt explains that the tool serves experienced data analysts who want a one-paragraph plain-English description of a query's result set, suitable for a tooltip, with no restatement of SQL syntax. The same user turn now sits inside a document that describes a different situation. The plausible continuation changes accordingly: a short paragraph about what rows come back and why, without explaining what a join is. In the third, the system prompt is the same as the second, but the conversation history includes three earlier exchanges in which the assistant produced long, heavily formatted explanations because a previous version of the prompt asked for them. The model now sees two kinds of evidence about what this document looks like: an instruction asking for brevity and a track record of verbosity. Its output often lands somewhere in between, and developers sometimes spend hours adjusting the instruction without realising that the history is pulling the other way. Nothing about the query changed across the three cases, and the model's knowledge of SQL is identical in each. What changed was the document. That is the whole lesson of this chapter in miniature: the model's behaviour is a function of the entire context, including parts the developer was not thinking of as instructions. What instruction tuning added, and what it did not remove The earliest large language models, trained only to predict web text, had to be coaxed into useful behaviour. To get a translation, you wrote the beginning of a document that looked like a translation table. To get an answer, you wrote "Q:" and "A:" and let the model fill in the gap. Much of the early craft of prompting consisted of finding document formats in which the desired output was the natural continuation. Instruction-tuned chat models changed this substantially. Through supervised training on example conversations and reinforcement learning from human or AI feedback, they learned to treat a request as a request and respond helpfully. You can now simply ask. This is the reason a great deal of older prompting advice, such as elaborate role-play framings or carefully staged document formats, has become unnecessary for many tasks. What instruction tuning did not remove is the underlying mechanism. A chat model is still predicting the next token, and its "helpfulness" is a learned tendency in that prediction, shaped by training data that you did not see and preferences you may not share. Three consequences follow for the developer. The model has defaults. Left unspecified, it will choose a length, a tone, a level of detail, a format, and a degree of caution based on what its training rewarded. Those defaults are often reasonable for a general chat product and often wrong for your application. Many complaints that a model is "too verbose", "too cautious", or "too eager to use bullet points" are complaints about defaults that the prompt never overrode. The model wants to be helpful in ways you may not want. It will try to answer when it should decline, guess when it should ask, and fill gaps with plausible content when it should say the information is missing. These are among the most consequential failure modes in production, and Chapter 2 discusses how to write instructions that counter them. The model's behaviour changes when the model changes. Every new version from a provider reflects new training data and new preference tuning. A prompt carefully adapted to one version's defaults may be over-specified, under-specified, or simply different on the next. Recent models, for example, tend to follow instructions more literally than earlier ones did; a prompt that relied on the model inferring what you "really meant" may behave differently when the model starts doing exactly what you wrote. The prompt and the model are a pair, and changing either one is a change to the system. The context is the whole program Putting these points together gives a working model of a model that is accurate enough to guide practical decisions. Everything in the context window shapes the output: the system prompt, the conversation history, the examples, the retrieved documents, the tool definitions and their results, the user's message, and any text the assistant has already produced. The model does not distinguish "instructions" from "content" except through learned patterns tied to roles and formatting. It does not have hidden knowledge of your intent. It has its training, and it has the tokens in front of it. This is why the term context engineering has gained ground since 2025 as a description of what prompt engineers actually do in production. Anthropic's engineering team, writing in September 2025, described it as the work of curating and maintaining the optimal set of tokens available to a model during inference, treating context as a finite resource with diminishing returns.3 The name is useful because it corrects a natural misconception: that the "prompt" is the paragraph of instructions a developer writes. In a real application that paragraph may be a few hundred tokens among tens of thousands, and the other tokens, assembled by code at run time from databases, documents, and users, often have more influence on what the model does. The rest of this book follows that wider view. The next three chapters concern the parts of the context a developer writes directly: instructions, examples, and the space given for reasoning. The three after that concern the parts assembled dynamically: the window as a whole, retrieved knowledge, and tool interactions. The final chapters address what happens when parts of the context are written by someone who wishes you harm, and how to know whether any of it works. A single sentence carries forward from this chapter into all of them. The model does not run your prompt; it continues it. The craft lies in arranging the beginning so that the continuation you need is the one it finds most natural, and in checking, every time something changes, that it still is. CHAPTER 2 Writing Instructions a Stranger Could Follow The most useful test for a prompt is not technical. Imagine handing it, unchanged, to a capable contractor who has never heard of your company, has never seen your product, and cannot ask you a single question. Would they produce what you want? If the honest answer is "they would need to know a few things first", those things belong in the prompt. This test catches the most common failure in production prompts, which is not the absence of some advanced technique but the absence of context the author took for granted. Developers write prompts while immersed in their own project. They know who the users are, what the output feeds into, what "short" means in their product, which edge cases matter, and why the feature exists. None of that knowledge reaches the model unless it is written down. The model fills the gaps with defaults learned from training, and those defaults are tuned for a general audience, not for your application. This chapter covers how to write instructions that close those gaps: what to say about the task, its purpose and audience, the constraints that bind it, the format of its output, and the cases where the model should not proceed. It ends with a worked rewrite of a realistic production prompt. Say what the task is for A surprising amount of model behaviour improves when the prompt explains why, not just what. Compare two instructions for a summarisation feature. The first says: "Summarise the following support ticket in three sentences." The second says: "Summarise the following support ticket for the on-call engineer who will decide in under a minute whether it needs immediate escalation. Lead with the customer-facing impact and whether it is ongoing. Mention the affected product area and any error codes. Omit pleasantries and the customer's account history unless it bears on severity." The second is longer, but every additional clause does work. It tells the model who reads the output, what decision the output supports, what information matters for that decision, and what to leave out. A model given the first instruction will produce a competent generic summary. A model given the second will produce a summary shaped for its use, and it will make better choices in cases the author never anticipated, because it can reason from the purpose rather than guessing. Explaining purpose also improves how a model handles rules. An instruction such as "never use ellipses" is a bare constraint that the model must follow without understanding. An instruction such as "the output will be read aloud by a text-to-speech system, which cannot pronounce ellipses, so never use them" gives the model a reason it can generalise from. It is then more likely to also avoid other characters a speech engine will stumble on, which the author may not have thought to list. Several providers' published guidance makes the same recommendation, and it matches what practitioners report: models follow rules better when the rule comes with its rationale. Specify the audience and the standard Models calibrate tone, vocabulary, length, and depth to an implied audience. If the prompt does not name one, the model assumes a general reader. That assumption is wrong for a large share of real applications: a legal research tool whose users are lawyers, a coding assistant whose users are senior engineers, an educational product for twelve-year-olds, an internal tool where every reader already knows the company's acronyms. Naming the audience is usually more effective than specifying a dozen stylistic rules. "The reader is a hospital pharmacist checking a drug interaction" implies a register, a level of technical vocabulary, a tolerance for detail, and a need for precision that would take many sentences to list individually. Role prompts, the familiar "You are an expert in X", are a weaker version of the same idea. They can help set register and domain, particularly in the system prompt, and they are worth including where the domain is specialised. But the role alone carries little information compared with a description of the actual situation: who the user is, what they are trying to do, and what good output looks like for them. "You are a senior tax accountant" is less useful than "You are helping small-business owners in the UK understand which of their expenses are deductible; they are not accountants, they want plain answers, and when a question depends on details they have not given, you should say what you would need to know." The same principle applies to quality. If you want output above the model's default standard, say so concretely. A prompt that asks for "a detailed analysis" gets the model's notion of detailed. A prompt that says "a reviewer will check that every claim is supported by a specific line in the contract, so cite the clause number for each point" gets something verifiable. State constraints positively and precisely Two habits make constraints more reliable. The first is to say what to do rather than only what not to do. "Do not use markdown" leaves the model to guess what it should use instead, and it may substitute some other formatting you also did not want. "Write in plain prose paragraphs with no headings, bullets, or bold text" describes the target. Negative instructions also have a subtler cost: mentioning a thing puts its tokens into the context, and in some cases this makes the model more likely to produce it. A prompt that says "do not mention our competitor Acme" has placed the word Acme in the model's immediate attention. A positive framing, "discuss only our own products", avoids this. The second habit is to replace vague quantities with specific ones. "Be concise" means different things to different models and to the same model in different contexts. "Answer in no more than two sentences" or "keep the reply under 80 words" is testable. "Use a friendly tone" is vague; "write as a helpful colleague would in a short chat message, without exclamation marks or emoji" is concrete. Where a precise rule is impossible, an example of the desired output often communicates the standard better than any adjective, which is the subject of Chapter 3. Emphasis deserves a brief note. Many production prompts contain instructions in capital letters, or preceded by "IMPORTANT" or "CRITICAL", typically added after a failure. With earlier, less attentive models this sometimes helped. With current models it more often causes overcorrection: an instruction shouted in capitals tends to be applied too broadly, triggering in cases where it was not meant to apply. If the model is ignoring an instruction, the more effective fixes are usually to explain why it matters, to move it to a more prominent position, to remove contradictory text elsewhere in the prompt, or to add an example. Emphasis should be reserved for the rare instruction whose violation is genuinely unacceptable, and even then it works better with a reason attached. Separate instructions from material A prompt usually contains two kinds of text: instructions written by the developer and material to be processed, such as a document, a user message, or retrieved records. Mixing them invites confusion. If a customer email contains the sentence "please summarise this in bullet points", is that part of the material or an instruction? If a document under review contains a heading called "Instructions", which instructions are meant? The standard remedy is to mark the boundaries explicitly. XML-style tags are widely used because models have seen vast quantities of markup in training and handle nested structure well: Classify the customer email below into one of: billing, technical, account_access, other. Respond with the label only. {customer_email} Markdown headings, triple-quoted blocks, and JSON fields serve the same purpose. The particular syntax matters less than consistency: pick a convention, use it throughout the application, and refer to the sections by name in the instructions ("using only the information in the section"). Delimiters improve clarity, and clarity improves reliability. They are not, by themselves, a security boundary. A determined attacker can include a closing tag in their input, or simply write text that persuades the model regardless of where it sits. Chapter 8 discusses how to use delimiting as one layer among several. For now the point is the ordinary one: clearly separated material is easier for the model to treat as material. Where to place long material relative to instructions is a question with a practical answer. For prompts containing long documents, placing the documents first and the question or task at the end tends to perform better than the reverse, and providers' own guidance has reported meaningful gains from this ordering on long-context tasks. The reason connects to how attention behaves over long sequences, discussed in Chapter 5: the instruction nearest the point of generation is the one most immediately in view. Define the output as a contract When a model's output feeds into code, the output format is an interface, and it should be specified with the same care as any interface between components. That means stating the exact structure, the allowed values for each field, what to do when a value is unknown, and what the output must not contain. A weak specification says: "Return the extracted information as JSON." A strong one says which keys, which types, which enumerations, whether missing values should be null or omitted, whether additional commentary is permitted outside the JSON (it usually should not be), and whether the JSON should be wrapped in a code fence (it usually should not be, if a parser will consume it directly). Since 2024 most major providers have offered structured output modes that constrain generation to a supplied JSON Schema, guaranteeing that the output parses and matches the declared structure. Where available, these should be used for any machine-consumed output; they eliminate an entire category of parsing failures. They do not guarantee that the content is correct, only that its shape is. A schema can require a field called refund_eligible with a boolean value; it cannot make the model's judgement about eligibility right. Chapter 6 discusses structured output in more detail. For output read by people, the contract is looser but still worth stating: length, structure, whether to use headings or lists, what to put first. Models tend to mirror the style of the prompt itself, so a prompt written in clean prose paragraphs is more likely to produce prose than one written as a nest of bullet points. Tell the model what to do when it cannot do the task The most damaging production failures often come from a model producing a confident answer when the honest answer was "I don't know" or "this request is outside what I should handle". Models are trained to be helpful, and absent instruction, helpful often means answering. A well-known 2024 decision from British Columbia's Civil Resolution Tribunal illustrates the stakes. In Moffatt v. Air Canada, the airline's website chatbot told a customer he could apply retroactively for a bereavement fare discount, contradicting the airline's actual policy. The tribunal held the airline responsible for what its chatbot said and rejected the argument that the chatbot was a separate entity responsible for its own statements.1 Whatever the technical cause in that case, the lesson for prompt design is direct: a model that is not told what to do when it lacks authoritative information will often produce something plausible, and the organisation deploying it owns the result. Effective prompts therefore specify the boundaries of the task and the behaviour at those boundaries. Examples include: "If the answer is not contained in the policy documents provided, say that you cannot confirm it and offer to connect the customer with an agent; do not answer from general knowledge." "If the input is not a support ticket, return the label not_a_ticket." "If the user asks for legal advice, explain that you can describe the policy but cannot advise on their specific situation." Each of these gives the model a legitimate, helpful action to take in place of guessing, which is far more effective than merely forbidding it to guess. It is also worth stating the opposite case. Some prompts make a model overcautious, refusing reasonable requests because the instructions sound restrictive. If the application needs the model to discuss medication doses with clinicians, or to analyse malware samples for a security team, the prompt should say so and say why, so that the model's general caution is calibrated to the actual context. Prompts that grow by accretion Production prompts rarely stay as they were first written. A failure appears, a sentence is added to fix it. A product manager asks for a new behaviour, a paragraph is appended. A model upgrade causes a regression, a workaround goes in. After a year, a prompt that began at two hundred words may run to three thousand, written by six people, and nobody can say with confidence what every sentence is for. Accreted prompts develop characteristic problems. The most damaging is contradiction. An instruction near the top says to keep answers brief; a later one, added to fix incomplete answers, says to be thorough and cover every relevant policy. A rule says never to mention pricing; an exception added months later says to quote the price when asked about upgrades. Faced with conflicting instructions, a model does not report the conflict. It resolves it, case by case, in ways that are hard to predict, and the resulting inconsistency looks to users like unreliability. A second problem is that patches outlive their reasons. A sentence added to stop an earlier model from inventing URLs may be unnecessary with the current model, yet it still consumes tokens and attention, and its phrasing may now cause a different side effect, such as the model refusing to include legitimate links. A third is that the overall structure decays. Instructions about tone end up scattered across five paragraphs, and the model has to reconstruct the intended behaviour from fragments. The remedy is the one software teams apply to accreted code: periodic refactoring, backed by tests. Every so often, read the whole prompt from top to bottom as a stranger would. Group related instructions together. Remove duplicates. Find contradictions and decide, explicitly, which rule wins in which case, then say so in the prompt. Delete patches whose original failures no longer occur, and confirm with the evaluation suite described in Chapter 9 that nothing regressed. A prompt that has been refactored this way is usually shorter, clearer, and more reliable than the version it replaced, and it is far easier for the next person to change safely. It also helps to keep a short record, outside the prompt itself, of why each significant instruction exists: which failure it fixed, which requirement it serves. That record is what makes it possible to remove an instruction confidently later, rather than leaving it in place because nobody remembers whether it matters. A worked rewrite Consider a prompt of a kind found in many early production systems, for a feature that drafts replies to customer reviews of a hotel: You are a helpful assistant. Write a reply to this review. Be professional and friendly. Don't be too long. IMPORTANT: Never admit fault. Review: {review_text} Apply the stranger test. A contractor would not know who is replying, what the hotel is, where the reply appears, how long "too long" is, what to do about a factual complaint, or what "never admit fault" is meant to prevent. Is apologising for a guest's bad experience admitting fault? What about acknowledging that the pool was closed, if it was? A revised version might read: You draft public replies to guest reviews for the Harbour View Hotel, a 60-room independent hotel. Replies are posted under the name of the general manager on public review sites, so other prospective guests will read them. A staff member reviews every draft before posting. Write a reply to the review in the section. - Thank the guest by first name if given. - Respond specifically to the two or three most important points they raise, positive or negative. - For complaints, acknowledge the guest's experience and say what the hotel will look into. Do not state or imply that the hotel broke a rule, law, or promise, and do not offer refunds or compensation; those decisions are made by staff, and a public commitment cannot be withdrawn. - If the review alleges something serious (injury, discrimination, theft, a health hazard), do not address the specifics. Write a short reply inviting the guest to contact the manager directly, and begin your output with the line FLAG_FOR_MANAGER. - Write 60 to 120 words in plain, warm prose. No bullet points, no emoji, no exclamation marks. {review_text} The revision is about four times longer, and almost every addition prevents a specific failure. The context section tells the model who is speaking and who is reading, which settles the register. The bullet on complaints replaces the ambiguous "never admit fault" with the actual concern, legal and commercial commitments, while leaving room for ordinary courtesy, and it explains the reason. The serious-allegation rule gives the model a safe action to take in the case most likely to cause harm, and it produces a machine-readable flag that the surrounding application can act on. The length rule is a range rather than an adjective. Nothing in it is clever. All of it is information the original author had and did not write down. The revision is still a draft. It has not been tested. The next step, covered in Chapter 9, is to run it against a set of real reviews, including the awkward ones, and see where it still fails. But it starts from a position where the model has what a stranger would need, and that is where reliable prompts begin. CHAPTER 3 Few-Shot Prompting: Teaching by Example In May 2020 a team at OpenAI published a paper with a title that named a capability: "Language Models are Few-Shot Learners".1 It described GPT-3, a model with 175 billion parameters, and its central finding was that a sufficiently large language model could perform a new task after seeing only a handful of examples placed in its prompt, with no change to its weights. Show it three English sentences followed by their French translations, then a fourth English sentence, and it would produce a French translation. Show it a few product reviews labelled positive or negative, then a new review, and it would produce a label. The authors called this in-context learning, and it changed how people thought about what a prompt could do. Six years later, instruction-tuned models can perform most tasks from a description alone, and few-shot prompting is no longer the only way to get useful behaviour. It remains one of the most powerful tools available, for a reason that is easy to state: an example communicates things that are hard or impossible to describe. A single well-chosen example conveys format, length, tone, level of detail, how to handle an edge case, and what counts as a good answer, all at once. It is also one of the most misused tools, because examples communicate far more than their author intends, including things the author would never have chosen to say. What examples actually teach A natural assumption is that examples work by teaching the model the mapping from input to output: here is a review, here is its sentiment, learn the rule. Research has shown the picture is more complicated. In a 2022 study, Sewon Min and colleagues tested what happens when the labels in few-shot examples are randomised, so that the demonstrations pair inputs with wrong answers.2 Across a range of classification and multiple-choice tasks and several models of that period, performance dropped surprisingly little. The authors concluded that much of the benefit of demonstrations came not from the correct input-output pairs but from other things the examples conveyed: the space of possible labels, the distribution of the input text, and the format of the whole sequence. The examples were telling the model what kind of task this is more than how to solve it. Later work complicated this finding in turn. Larger models, it turned out, do attend to the labels more, and can be pushed to follow flipped labels that contradict their prior knowledge, while smaller models tend to fall back on what they already know.3 The practical synthesis for a developer is this: examples do two jobs. They locate the task, telling the model which of the many things it can already do is wanted here. And, to a degree that increases with model capability, they specify the mapping, showing exactly how particular inputs should be treated. For most production uses the first job is the more important, which has a direct consequence: the surface features of your examples, their length, structure, vocabulary, and style, will strongly shape the output, whether or not you meant them to. The biases examples introduce Because examples are such a strong signal, they carry systematic biases that a careful prompt designer needs to know about. Several were documented early by researchers working with GPT-3-era models, and while modern models are less susceptible, the underlying tendencies persist and are easy to trigger. A 2021 paper by Tony Zhao and colleagues, titled "Calibrate Before Use", identified three.4 Majority label bias: if most examples carry one label, the model over-predicts that label. Recency bias: the labels of the last few examples have outsized influence, so a prompt ending with two "negative" examples tilts predictions negative. Common token bias: the model favours outputs that are frequent in its training data over rarer but correct ones. A year later, Yao Lu and colleagues showed that merely reordering the same set of examples could move a model from near state-of-the-art performance to near chance on some tasks, with no single ordering best across models.5 These are classification-era findings, but each has an analogue in generative tasks that remains important. Table 1 sets out the main biases, what they look like in a modern application, and the usual mitigation. Table 1. Common biases introduced by few-shot examples. Bias What happens Typical symptom in production Mitigation Majority label Output skews toward the most common example label Classifier over-assigns the category shown most often Balance labels across examples Recency Final examples dominate Behaviour shifts when example order changes Shuffle or rotate order; test several orders Surface copying Output mimics example length, phrasing, and structure Every reply opens with the same phrase as the examples Vary surface features across examples Content leakage Specific facts from examples appear in outputs Example customer name or product shows up in real replies Use clearly fictional or generic details; mark examples as examples Narrow coverage Model generalises only from the cases shown Unusual inputs handled as if they were the nearest example Include deliberate edge cases and a "none of these" case Source: biases synthesised from Zhao et al. (2021), Lu et al. (2022), and Min et al. (2022); production symptoms from common practitioner experience. Surface copying is the most frequent problem in practice. A team building an email-drafting feature includes three example emails, all of which happen to open with "I hope this message finds you well" and close with "Best regards". Every generated email now uses both phrases, even when the user's own style is quite different. Nothing in the instructions asked for this. The examples did. Content leakage is the most embarrassing. If an example in a customer-support prompt mentions an order number, a product name, or a person, that detail will eventually appear in a real response where it does not belong. Models are good at recognising that examples are examples, but over thousands of calls, "good" is not "always". Choosing examples Given these tendencies, the selection of examples is a design task in its own right. A few principles produce good results across most applications. Diversity over volume. Three examples that differ meaningfully in length, structure, and subject teach the model that those features are free to vary, so it attends to what the examples have in common: the task. Ten examples that all look alike teach the model to produce an eleventh that looks the same. When choosing, ask what dimensions of variation the real inputs will have, and make sure the examples span them. Cover the hard cases. The easy inputs usually need no example; the model handles them from the instructions. Examples are most valuable where the instruction is ambiguous or the correct behaviour is counterintuitive. If a classifier must label a complaint about a late refund as billing rather than shipping, show that case. If the model should decline certain requests, include an example of declining, phrased the way you want it phrased. Include the negative case. Applications often need a "none of the above", "insufficient information", or "not applicable" output. If every example shows a successful extraction or a confident classification, the model learns that every input should produce one. An example in which the correct output is the fallback teaches the model that the fallback is a legitimate answer. Match the real distribution of inputs, not just outputs. Examples should look like the inputs the system will actually receive, including their messiness. If real user messages are short, informal, and badly spelled, examples consisting of carefully written paragraphs teach the model about a different task. Mark them clearly. Wrapping each example in tags, such as with nested and , and saying explicitly in the instructions that they illustrate the format and are not to be copied, reduces leakage and helps the model separate the examples from the real input that follows. How many examples to use has no universal answer. For a strong modern model on a well-described task, one to five carefully chosen examples are typical, and more often adds cost without benefit. For tasks with many categories, idiosyncratic output styles, or domain conventions the model could not infer, more examples help, and with long context windows some teams use dozens or even hundreds. Research on what has been called many-shot in-context learning has found that performance on some tasks continues to improve well beyond the handful of examples that early work used.6 The only reliable way to choose is to test several counts against an evaluation set, which Chapter 9 describes. Where examples go and how they are framed There are two common ways to place examples in a chat-based prompt, and they behave differently. The first is to put them in the system prompt or the user message, as a block of clearly tagged demonstrations followed by the real input. This keeps the examples visibly separate from the conversation and lets the instructions refer to them by name: "the examples in the section illustrate the expected format." The second is to write them as fabricated conversation turns: a user message containing the first example input, an assistant message containing its output, and so on, followed by the real user message. This format is a very strong signal, because it shows the model not merely what an answer looks like but that it has already given answers like this. It is effective at fixing format and style. It also has drawbacks. The fabricated turns are indistinguishable, to the model, from real history, which can confuse multi-turn applications. And in products where conversation history is shown to users or logged as real interactions, fake turns create confusion downstream. For most applications the tagged block is the safer default. The fabricated-turn format is worth trying when format adherence is the main problem and the conversation is single-turn. A related decision is whether to annotate examples. A bare input and output pair shows what to do. A pair accompanied by a one-line note explaining why the output is correct teaches more. Consider a classifier deciding whether customer messages need human escalation. An example showing a message about a delayed parcel labelled no_escalation is useful; the same example with the note "routine delay with tracking available; the customer is not reporting loss or damage" tells the model which feature of the input determined the label. When the model later sees a message about a parcel that tracking shows as delivered but the customer never received, it has a basis for recognising that the case is different. Annotations are particularly valuable for the hard cases that sit close to a category boundary, which are exactly the cases examples are most needed for. Generating examples Teams sometimes lack good examples, particularly for a new feature with no real traffic yet. A common shortcut is to have a model generate them. This can work, with care. Synthetic examples tend to be cleaner, more uniform, and more typical than real inputs. Real customer messages are terse, misspelled, ambiguous, multi-topic, and occasionally hostile; model-generated ones are usually tidy and on-topic. A prompt tuned on synthetic examples may therefore perform worse on real traffic than its test results suggest. The remedy is to instruct the generating model explicitly to vary length, register, clarity, and difficulty, to include mixed and borderline cases, and to imitate the imperfections of real input, then to review the results by hand and discard the ones that look too neat. Synthetic outputs need even more scrutiny than synthetic inputs, because they become the standard the model will imitate. Every generated output should be checked by someone who knows what correct looks like for the application. As soon as real traffic exists, real examples, reviewed and corrected, should replace the synthetic ones. Dynamic examples A fixed set of examples is a compromise: the same few demonstrations must serve every input. A more effective approach for many applications is to choose examples per request. The method is straightforward. Maintain a library of high-quality input-output pairs, often drawn from real cases that were reviewed and corrected by people. When a new input arrives, retrieve the few library examples most similar to it, typically by embedding similarity, and insert those into the prompt. A support ticket about a failed payment gets examples of other payment problems; a ticket about login trouble gets login examples. This works well for three reasons. The examples are more relevant, so they carry more specific guidance. The library can grow as the team corrects errors: every fixed failure becomes a new example that will be retrieved for similar future inputs. And it turns example curation into a data-management task with clear ownership rather than a matter of editing a prompt string. Dynamic selection has costs. It adds a retrieval step and its latency. It makes behaviour harder to reason about, because the prompt differs for every input. And it can amplify errors: a bad example in the library will be retrieved repeatedly for the inputs it most resembles. Libraries need the same review discipline as any other training data. A practical middle ground used by many teams is a small fixed set of examples establishing format and tone, plus one to three retrieved examples for content. When not to use examples Few-shot prompting is not always an improvement, and sometimes it is a step backwards. For open-ended generation where variety matters, such as brainstorming, creative writing, or drafting in the user's own style, examples tend to collapse the range of outputs toward the examples' style. A clear description of the qualities wanted often does better. For tasks the model already performs well from instructions, examples add tokens, cost, and latency, and introduce the biases described above, without adding much. It is worth testing a zero-shot version before assuming examples are needed. For reasoning-heavy tasks with modern reasoning models, providers have reported that elaborate few-shot demonstrations of reasoning can constrain the model's own approach and sometimes reduce performance. OpenAI's guidance for its reasoning models, for instance, has recommended starting with zero-shot prompts and adding examples only if needed. Chapter 4 returns to this. And examples are a poor substitute for a fix that belongs elsewhere. If the model is getting a category wrong because the category definitions are ambiguous, the right fix is to clarify the definitions; an example that patches one case leaves the ambiguity in place for the next. Examples work best when they illustrate a clearly stated instruction, not when they replace one. Examples as specification The most useful way to think about few-shot examples is as a second channel of specification that runs alongside the instructions. The instructions say what to do in general terms. The examples show what doing it looks like in particular cases. When the two agree, the model has strong, consistent guidance. When they disagree, for instance when the instructions say "keep replies brief" and every example is two hundred words long, the examples usually win, because concrete evidence of the expected continuation is exactly what a next-token predictor is most responsive to. That gives a final practical rule. After writing examples, read them as if they were the only specification. Ask what someone would infer from them alone about length, tone, format, structure, what to include, and what to leave out. If any of those inferences conflicts with the instructions, change the examples. The model will read them that way whether you intended it or not. Hashtags: #PromptEngineering #ArtificialIntelligence #GenerativeAI #LargeLanguageModels #LLM #AIInstructions #PromptDesign #ContextEngineering #InContextLearning #FewShotPrompting #ZeroShotPrompting #ChainOfThought #ReasoningModels #InstructionTuning #PromptOptimization #PromptDevelopment #PromptTesting #PromptEvaluation #PromptInjection #AISecurity #StructuredOutputs #RetrievalAugmentedGeneration #RAG #AIApplications #LanguageModelDevelopment #PromptReliability #ModelAlignment #Tokenization #AIEngineering #ResponsibleAI

  • Managing Social Anxiety in Seminars (Strategies for Class Participation and Networking)

    Download the Book (PDF): Introduction There is a particular silence that happens in seminars. The tutor asks a question, looks around the table, and waits. Nobody speaks. For most people in the room the silence is mildly awkward. For some, it is something else entirely: a rising pressure in the chest, a sentence half-formed and then abandoned, a heartbeat loud enough to seem audible, a quick glance down at the notes to avoid being chosen. The moment passes. Someone else answers. And for the rest of the hour, the student who said nothing replays the thought they almost offered, which turns out to have been a good one, and adds it to the private ledger of times they stayed quiet. If that ledger feels familiar, this book is for you. It is written for university students who find seminars, tutorials, group work and networking events harder than they look from the outside—students who are shy, introverted, socially anxious, or some combination of the three. It is also written for students who move through large universities feeling like one face among thousands, and who suspect that everyone else learned some social rulebook that they were never given. I have spent a long time working with students in exactly this position, and I want to begin with two observations that shape everything that follows. The first is that the difficulty is real and common, and it is not a character flaw. Social anxiety is one of the most widespread psychological difficulties in young adulthood, and university concentrates its triggers. You are asked, often for the first time, to speak your half-formed thoughts aloud in front of peers who seem more confident, in front of staff who are grading you, in rooms full of people you do not yet know. You are told that participation counts toward your mark and that networking will shape your career. Most of this arrives without instruction. Feeling anxious in that environment is not evidence that you are unsuited to it. It is evidence that you are paying attention to something that matters to you. The second observation is less comfortable, and more hopeful. Social anxiety is kept alive less by the situations themselves than by what anxious people do to protect themselves in those situations. The careful rehearsal of every sentence before speaking, the constant monitoring of how one looks and sounds, the habit of staying near the door, of answering briefly, of avoiding eye contact, of not going at all, and the long, bruising review of every conversation afterward: these strategies feel protective, and they are sensible attempts to get through something frightening. But they turn out to be the main machinery that keeps the fear going. They consume attention that could have gone to the discussion. They make you seem more distant than you are. And they deny you the one experience that would actually reduce the fear, which is discovering that you can take part imperfectly and nothing terrible happens. That is the controlling idea of this book. You do not need to become a different person, an extrovert, or a fearless speaker in order to participate well. You need to change a small number of habits—where your attention goes, which protective behaviours you rely on, and how you plan your risks—and then practise, in steps that are small enough to take and large enough to teach you something. Structure, rather than courage, does most of the work. Who this book is for, and who it is not for A word about terms, because they matter and they are often confused. Introversion is a temperament: a preference for quieter, less stimulating environments and a tendency to recharge through solitude. Shyness is a tendency to feel awkward or inhibited in new social situations, especially with strangers. Social anxiety is fear of being judged, embarrassed or rejected, strong enough to shape what you do. These overlap but they are not the same. Many introverts are not anxious at all; they simply prefer small groups and need time alone afterward. Many anxious people are not introverted; they crave company and are frustrated by the fear that keeps them from it. The first chapter separates these threads carefully, because the right strategy depends on which one you are dealing with. This book is practical. It contains scripts for asking a question in a seminar, for joining a conversation at a reception, for leaving a conversation gracefully, for emailing a lecturer, and for handling the moment your mind goes blank. It includes exercises for shifting attention, for dropping safety behaviours, and for building a ladder of graded challenges across a term. Where research helps explain why a strategy works, I describe it, with notes at the end of the book for those who want to follow it up. I have tried to cite only well-established findings and to be honest when the evidence is thinner. It is not a substitute for professional help. For some students, social anxiety is severe enough to amount to a clinical condition—social anxiety disorder—that significantly limits their studies, friendships or health. Cognitive behavioural therapy has a strong evidence base for this, and many university counselling services offer it or can refer you. If you recognise yourself in the more severe descriptions in the chapters that follow, the strategies here can still help, but they work best alongside support from someone trained to provide it. And if at any point your distress includes thoughts of harming yourself, please do not wait: contact your local emergency services if you are in immediate danger, or, in the United States, call or text 988 to reach the 988 Suicide & Crisis Lifeline. Other countries have their own crisis lines, and your university's student services can tell you what is available locally. How the book is organised The chapters build on one another, though you may reasonably turn first to the one that addresses your most pressing situation. Chapter 1 distinguishes introversion, shyness and social anxiety, and describes the cycle through which anxiety maintains itself. Chapter 2 examines that cycle's hidden machinery in detail: self-focused attention, safety behaviours, and the painful post-mortem that follows social events. These two chapters are the foundation. Everything practical later in the book is an application of them. Chapters 3 and 4 move into the seminar room. Chapter 3 is about preparation: how to read and take notes in a way that makes speaking easier, and how to plan a first contribution without over-rehearsing it. Chapter 4 is about the room itself: speaking up, being called on unexpectedly, recovering from a blank, managing physical symptoms, and disagreeing with someone. Chapter 5 extends this to small-group work, presentations, and online seminars, each of which has its own particular pressures. Chapter 6 turns to networking—receptions, careers fairs, conferences, departmental socials—and offers a structure for walking into a crowded room, starting and ending conversations, and following up afterward. Chapter 7 addresses the scale of the university itself: large lectures, office hours, societies and clubs, and the project of building a small, known world inside a large, anonymous one. Chapter 8 brings everything together into a semester-long plan, with a ladder of graded challenges, a way of tracking progress, and guidance for setbacks and for knowing when to seek more help. A brief conclusion draws out what follows from all of this—including some things that are not your job to fix, because universities, and the people who teach in them, have responsibilities here too. A request before you begin Read this book with a pencil, or its equivalent. The exercises are not decoration; they are where change happens. Understanding why social anxiety persists is useful, but it is rarely enough on its own. Students who improve are almost always the ones who try something slightly frightening, notice what actually happens, and try something slightly more frightening the following week. You will not need to do anything reckless. You will not be asked to give a speech to a lecture hall on the first day. You will be asked to do small things—ask one question, stay five minutes longer, look up instead of down—and to pay attention to the results with honesty. That is how the ledger starts to change. Chapter 1: Shy, Introverted, Anxious: Knowing What You Are Dealing With Students often arrive at a counselling appointment or a study skills workshop with a label already in hand. "I'm an introvert, so I can't do seminars." "I'm just shy." "I think I have social anxiety." Each of these may be true, and each points toward a different kind of help. Before anything else, it is worth getting clear about which of these is actually going on, because a strategy that works well for one can be unnecessary or even counterproductive for another. Three different things that look alike Consider three students in the same second-year history seminar. None of them speaks during the first half hour. The first—call her Maya—is thinking hard. She has read the material closely and has views about it, but she likes to hear how the discussion develops before she commits. Talking in a group of fourteen feels slightly effortful, and she knows she will want a quiet evening afterward. When she does speak, about forty minutes in, it is fluent and considered. She is not afraid. She simply processes internally before speaking and finds large groups tiring. Maya is an introvert. The second—call him Daniel—wants to speak and has something to say, but every time he opens his mouth he feels a flush of awkwardness. He is not sure how to break into the flow of conversation, when it is his turn, or how to phrase things so they do not sound odd. Once he has spoken once or twice, he relaxes; by week five of term, with people he now knows, he speaks easily. Daniel is shy: his inhibition is strongest with strangers and in new situations, and it eases with familiarity. The third—call her Priya—has also done the reading. She has a point to make, and she has rehearsed it silently four times. Her heart is racing. She is certain that when she speaks her voice will shake, that she will say something obvious or wrong, that the tutor will look puzzled, and that the others will think less of her. She is monitoring her face for signs of blushing. When the tutor looks in her direction, she looks down. She leaves the seminar having said nothing, and spends the walk home going over what she should have said and what people must have thought of her silence. The same pattern has held since the first week, and in her other modules too. Priya is experiencing social anxiety. These are illustrative composites, not real people, but most readers will recognise at least one of them. The distinctions between them matter. Introversion is a dimension of temperament, one end of the introversion–extraversion spectrum that appears in almost every major model of personality. Introverts tend to prefer lower levels of stimulation, enjoy depth over breadth in conversation, and find that social interaction—even enjoyable interaction—draws down their energy rather than replenishing it. Introversion is not a problem to be solved. Susan Cain's widely read book Quiet made the case, persuasively, that schools and workplaces often undervalue the introverted style, rewarding the quick talker over the careful thinker. An introverted student may need strategies to make seminars less draining, and may need to negotiate a participation culture that rewards speed, but they do not need to be cured of anything. Shyness is a tendency to feel inhibited, awkward and self-conscious in social situations, particularly unfamiliar ones. It is common: many people describe themselves as shy at some point in their lives. Shyness often fades with familiarity and with practice at specific social skills—how to join a conversation, how to introduce yourself, how to keep an exchange going. Shy students generally benefit from structure and scripts, and from repeated contact with the same people. Social anxiety is fear of negative evaluation: the expectation that you will do or say something that leads others to judge you as incompetent, boring, strange or unlikeable, and that this judgement will be costly. It becomes a problem when it drives persistent avoidance, significant distress, or a heavy reliance on protective behaviours, and when it does not ease with ordinary familiarity. At its more severe end it meets the criteria for social anxiety disorder, a recognised mental health condition that typically begins in adolescence and, left untreated, tends to persist. The good news is that it is among the more treatable psychological difficulties, and the core methods of treatment—which later chapters translate into self-help form—are well understood. One person can be all three. An introverted, shy student may also be socially anxious. Conversely, a gregarious, talkative student may be intensely anxious about one specific situation, such as speaking in front of academic staff. The useful question is not "Which label am I?" but "What, specifically, is getting in my way?" A quick self-assessment Try answering the following questions, honestly and privately. There are no scores; the aim is to see which pattern predominates. When you stay quiet in a seminar, is it mostly because you are still thinking, because you do not know how to break in, or because you are afraid of how you will come across? If you imagine speaking up and it going reasonably well, how do you feel—relieved and pleased, or still uneasy, waiting for the criticism you think must be coming? After a social event, do you feel tired but content, or do you spend hours replaying what you said and how others reacted? When you imagine a room full of strangers, is the main feeling reluctance ("I'd rather be at home"), awkwardness ("I won't know what to say"), or dread ("They'll see that I don't belong")? Does your discomfort fade as you get to know people, or does it persist even with classmates you have sat beside for a full term? Do you avoid situations you would actually like to be in—a society you want to join, a question you want to ask, a lecturer you want to talk to—because of the fear? If your answers cluster around thinking, reluctance and tiredness, introversion is probably the main story, and the most useful chapters will be those on preparation (Chapter 3), on structuring networking so it is less draining (Chapter 6), and on building a small world inside a large university (Chapter 7). If they cluster around not knowing what to do, shyness is likely central, and the scripts throughout the book will be especially valuable. If they cluster around dread, self-monitoring, replaying and avoidance of things you want, social anxiety is at work, and Chapter 2, on the mechanisms that maintain it, is essential reading before anything else. The cycle that keeps anxiety going Social anxiety tends to operate as a cycle, and understanding the cycle is the first step to interrupting it. It begins before the event. As a seminar or social occasion approaches, the anxious student anticipates it. They imagine what might go wrong—freezing, blushing, saying something foolish—and those images bring a surge of worry. This anticipatory phase can last hours or days, and it often does more damage than the event itself. Some students find the anticipation so unpleasant that they avoid the event altogether: they skip the seminar, claim an illness, or decide the networking reception "isn't really for them." If they do attend, the anxiety shifts into a second phase. In the situation, attention turns inward. The student becomes preoccupied with monitoring themselves—how they look, how they sound, whether their hands are shaking, whether their face is red. At the same time, they use protective strategies: sitting where they are least likely to be called on, keeping contributions brief, rehearsing sentences before speaking, avoiding eye contact, holding a drink to have something to do with their hands. These strategies, which psychologists call safety behaviours, feel like they are preventing disaster. Then comes the third phase: the aftermath. Once the event is over, the anxious student reviews it. This review is rarely balanced. It focuses on moments of awkwardness, on ambiguous reactions interpreted as negative, on what should have been said. Psychologists call this post-event processing, and it has a peculiar effect: it makes memories of the event more negative over time, and it feeds directly into the anticipatory anxiety that will greet the next event. The cycle closes, and each turn strengthens it. Avoidance means the student never discovers that the feared outcome would not have happened. Safety behaviours mean that when things go well, the student credits the safety behaviour rather than their own ability ("It was only fine because I kept it short"). Post-event processing ensures that whatever actually happened, the memory is filed under "further evidence that I'm bad at this." This cycle is not unique to university, but university feeds it in particular ways. Seminars recur weekly, so there is a steady rhythm of anticipation and review. Participation is often assessed, which raises the stakes of each contribution. Networking events are loosely structured, which gives anxious people few cues about what is expected. And the scale of the institution means that students often lack the stable, familiar relationships that would naturally dampen anxiety over time. The next chapter looks at each part of this cycle more closely. For now, notice something important: every part of it is something you do—anticipating, monitoring, protecting, avoiding, reviewing. Those are habits of attention and behaviour, and habits can be changed. The situations themselves—the seminar, the reception, the crowd—do not have to change for you to feel differently in them. Why this matters for your education It is tempting to treat seminar anxiety as a private discomfort, to be endured until graduation. That underestimates what is at stake. Seminars are where much of the real thinking in a humanities or social sciences degree happens, and where students in the sciences learn to argue about evidence. Speaking your ideas aloud forces you to clarify them. Hearing them challenged strengthens them. A student who never speaks misses not only the participation mark but the intellectual work that participation involves. Many tutors will tell you that the students who improve most over a degree are those who take the risk of being wrong in front of others, because that is how thinking is sharpened. Networking matters too, though often in less obvious ways than careers advice suggests. It is not mainly about collecting contacts. It is about becoming known—to lecturers who might supervise your dissertation, write your references or mention an opportunity; to older students who can explain how things work; to peers who become collaborators and friends. Students who avoid these contacts are not merely less connected. They often lack information that others take for granted: which modules are good, how to approach a supervisor, what a particular career actually involves, that a summer research placement exists at all. There is also a quieter cost. Students who feel isolated and unseen at university are more vulnerable to low mood, disengagement and dropping out. Social anxiety is not the only cause of isolation, but it is a significant one, and it often goes unnoticed because anxious students are, by definition, working hard not to draw attention to themselves. None of this is said to add pressure. It is said because students sometimes talk themselves out of seeking help by deciding that the problem is minor, or merely a matter of personality. If fear is keeping you from things you want, it is worth addressing, and it is addressable. Context matters: not all quietness is anxiety One more distinction deserves attention, because it is often missed. Some students are quiet in seminars not because of temperament or fear but because the unwritten rules of the room are unfamiliar to them. Consider an international student—call him Kenji—who was educated in a system where students rarely interrupted a teacher, where questions were asked privately after class, and where offering an opinion before one had mastered the material seemed presumptuous. In a seminar that rewards quick, provisional contributions, Kenji's silence is a sign of good manners by the standards he learned, not anxiety. He may still feel anxious, of course, particularly if he is working in a second language and worries about his accent or vocabulary. But the first thing he needs is an accurate map of what the room expects, not a technique for calming fear. Similar mismatches affect students who are the first in their family to attend university, who may not know that tutors genuinely welcome tentative ideas, or that office hours are meant to be used and not only for emergencies. They affect mature students who worry that their experience makes them seem out of place among younger classmates. They affect students from groups that are underrepresented in a particular discipline, who may feel, sometimes accurately, that their contributions are scrutinised more closely than others'. And they affect many neurodivergent students—autistic students and students with ADHD, for instance—for whom the fast, implicit turn-taking of group discussion can be genuinely harder to track, quite apart from any anxiety about it. In each of these cases, anxiety may be present and may deserve attention in its own right. But it is worth separating the part of the difficulty that comes from fear from the part that comes from missing information or from a mismatch between how you work and how the room works. The second part is often solved more simply: by asking a tutor directly how participation is assessed, by watching how others enter the discussion for a week or two before trying it yourself, or, where relevant, by talking to your university's disability or accessibility service about reasonable adjustments. Some students, for instance, arrange to receive discussion questions in advance or to contribute in writing where live discussion is a barrier. Knowing what is expected removes a great deal of uncertainty, and uncertainty is one of anxiety's main fuels. When to seek professional help Self-help strategies are effective for many people with mild to moderate social anxiety, and they complement professional treatment for those with more severe difficulties. But there are signs that you would benefit from talking to someone trained in this area. Consider contacting your university's counselling or wellbeing service, or your doctor, if any of the following apply. Your anxiety is causing you to miss classes, seminars or assessments regularly, or you are considering leaving your course because of it. You avoid eating in public, using shared facilities, or other everyday activities because of fear of being observed. You experience panic attacks—sudden surges of intense fear with physical symptoms such as a pounding heart, breathlessness, dizziness or a sense of unreality—in social situations or in anticipation of them. You rely on alcohol or other substances to cope with social situations. Your mood has been persistently low, you have lost interest in things you usually enjoy, or you are feeling hopeless. You have thoughts of harming yourself or that life is not worth living. On that last point, please act promptly. If you are in immediate danger, contact your local emergency services. In the United States, you can call or text 988 to reach the 988 Suicide & Crisis Lifeline. Many other countries have equivalent services, and your university's student support pages will usually list them. When you contact a counselling service, it may help to know what to expect. Many services begin with a short assessment conversation, after which they may offer individual sessions, group programmes, guided self-help, or referral to specialist services outside the university. Cognitive behavioural therapy is the most widely recommended psychological treatment for social anxiety, and some services run groups specifically for it. Waiting times vary considerably between institutions and at different points in the academic year; it is worth asking early rather than waiting until a crisis. Confidentiality in counselling is taken seriously, but it is not absolute: counsellors generally explain at the outset the limited circumstances, such as serious risk to your safety or someone else's, in which they might need to share information. If this worries you, ask about it directly at the start. Students sometimes fear that seeking help is itself a kind of exposure—that saying "I'm anxious about speaking to people" to a stranger is exactly the kind of thing they cannot do. If that is you, it may help to know that you can often make initial contact by email or an online form, and that counsellors are very used to working with people who find the first conversation hard. You do not have to explain it well. "I'm finding seminars and social situations really difficult and I'd like some help" is enough. What to take from this chapter The central point is this: the right approach depends on what is actually getting in your way. Introversion calls for working with your temperament—building in preparation, recovery time and depth—rather than against it. Shyness calls for skills and familiarity. Social anxiety calls for understanding the cycle that sustains it and changing the habits that keep that cycle turning. Many students need something from all three. Before moving on, write down one or two specific situations at university that you find difficult, and for each, note which of the three threads seems most involved. Be concrete: not "seminars," but "the Tuesday politics seminar, when the tutor asks an open question and waits." Specific situations are the raw material for the plans you will build later in the book. Chapter 2: The Hidden Machinery: Self-Focus, Safety Behaviours and the Post-Mortem Anxious students usually believe that the problem lies in the situation: the seminar is intimidating, the other students are cleverer, the reception is full of strangers who already know each other. There is some truth in this; some situations are harder than others. But decades of research on social anxiety point to a more useful conclusion. What keeps the fear alive is a set of mental and behavioural habits that anxious people bring with them into the situation. Those habits are learnable, which means they are also unlearnable. The most influential account of these habits was set out by the psychologists David Clark and Adrian Wells in the mid-1990s, and it remains the basis of one of the most effective psychological treatments for social anxiety. Their model has several parts, but three of them explain most of what anxious students experience in seminars and at social events: self-focused attention, safety behaviours, and post-event processing. This chapter takes each in turn, and ends with a way of testing the model against your own experience. Self-focused attention: watching yourself instead of the room When socially anxious people enter a feared situation, their attention swings inward. They begin to monitor themselves in fine detail: the heat in their face, the tremor in their hands, the pitch of their voice, the precise wording of the sentence they are about to say. They also tend to build a mental picture of how they must look from the outside—flushed, awkward, stammering—and to treat that picture as accurate. Clark and Wells described this as processing oneself as a social object. Instead of experiencing the conversation, the anxious person watches themselves having it, as though from the other side of the table. The problem is not merely that this is unpleasant. It has three specific consequences. The first is that it uses up attention. Attention is limited. If a large share of it is devoted to monitoring your own face and voice, less is available for listening to the discussion, following an argument, or noticing what other people are actually doing. This is why anxious students often say they "lost the thread" or "couldn't think" in seminars. They are not less able; their attention is elsewhere. The second is that it supplies misleading evidence. Internal sensations are vivid. A racing heart feels as though it must be audible; a slight warmth in the cheeks feels like a scarlet blush. When you use your internal state to infer how you look, you will almost always overestimate how visible your anxiety is. The information you are relying on is simply not the information other people have. The third is that it hides the reassuring evidence. If you are looking inward, you cannot see that the person you are speaking to is nodding, that the tutor is writing down your point, or that the student opposite looks as uncomfortable as you feel. The evidence that might correct your fears goes unnoticed. Two findings from social psychology reinforce this picture, and they apply to everyone, not only to anxious people. In a series of studies published in 2000, Thomas Gilovich and his colleagues asked university students to wear a mildly embarrassing T-shirt into a room of peers, then to estimate how many people had noticed it. The wearers consistently overestimated the number; far fewer people had registered the shirt than the wearers believed. The researchers called this the spotlight effect: we tend to believe that others are paying more attention to us than they are. In related work, Gilovich, Kenneth Savitsky and Victoria Medvec described what they called the illusion of transparency—the tendency to overestimate how clearly our internal states, including nervousness, are visible to others. In studies where participants gave short speeches, speakers believed their nerves were more obvious than observers actually rated them. These findings do not mean nobody ever notices anything. They mean that the gap between how anxious you feel and how anxious you look is usually larger than it seems from the inside. Every other student in the seminar is preoccupied with their own performance, their own reading, and their own worries. You are not the centre of their attention, and that is good news. Safety behaviours: the protection that backfires The second part of the machinery is what psychologists call safety behaviours: things people do in feared situations to prevent the outcome they dread. They are intuitive, often automatic, and nearly universal among anxious people. In seminars they include rehearsing a contribution silently until it is perfect, speaking quickly to get it over with, keeping contributions short, qualifying every statement ("This is probably wrong, but…"), sitting in the least visible seat, looking at notes rather than at people, avoiding questions that might lead to follow-up, and letting others speak first so as to judge what is acceptable. At social events they include holding a drink or phone as a prop, staying with one familiar person, asking questions to avoid talking about oneself, having a ready excuse to leave, and drinking alcohol to take the edge off. These behaviours make sense. If you believe that your hands will visibly shake, gripping a cup seems wise. If you believe that saying anything unplanned will expose you as foolish, rehearsing seems wise. The trouble is that they tend to backfire in several ways, which is why they are central to understanding why anxiety persists. Safety behaviours prevent learning. If you always rehearse your contribution, and it always goes reasonably well, you never find out whether an unrehearsed contribution would have gone well too. The belief "I need to rehearse or I will make a fool of myself" survives untouched, because it is never tested. The success gets credited to the safety behaviour, not to you. Researchers working with Clark and Wells showed this directly in the 1990s: when socially anxious people were asked to enter a feared situation while deliberately dropping their usual safety behaviours, and to treat the situation as a test of their fears, their anxiety and negative beliefs reduced more than when they simply entered the situation as usual. Safety behaviours often increase the symptoms they are meant to hide. Gripping a cup tightly to hide a tremor tends to make the hand shake more. Rehearsing a sentence in your head while someone else is speaking means you stop listening, and so your eventual contribution may not quite fit the conversation—the very outcome you feared. Speaking quickly to get it over with makes you harder to understand. Safety behaviours can make you seem less warm. This is perhaps the most important and least obvious cost. Many safety behaviours involve withholding: not making eye contact, not sharing opinions, not talking about yourself, keeping answers short. To the anxious person these feel like protection. To others they can look like disinterest or aloofness. Research by Lynn Alden and Peter Bieling in the late 1990s found that when socially anxious people used safety behaviours in conversations, their partners tended to respond to them less warmly. The protective behaviour produced exactly the kind of cooler reaction that the anxious person feared, which then confirmed their belief that people did not like them. Table 1 sets out some common safety behaviours, what they cost, and what you might try instead. It is worth reading slowly and marking the ones you recognise. Table 1. Common safety behaviours, their hidden costs and alternatives to try. Safety behaviour Intended purpose Hidden cost Try instead Rehearsing a comment silently Avoid saying something foolish Stop listening; comment misses the moment Note a few keywords, then listen Keeping answers very short Limit exposure Seem uninterested; no chance to develop the idea Add one sentence of reasoning Avoiding eye contact Avoid seeing disapproval Miss nods and interest; seem distant Look at one friendly face Heavy qualifying ("probably wrong, but…") Pre-empt criticism Invites others to dismiss the point State the point, then the doubt Sitting out of sight Avoid being called on Stay peripheral; fear of being called grows Sit where you can see the tutor Staying with one familiar person at events Avoid strangers Meet no one new; confirm belief you can't Join one new group, then return Drinking to relax Dampen nerves Credit goes to alcohol, not to you Stay sober for the first half hour Not every item in the table is always a safety behaviour. Making notes before a seminar is sensible preparation; it becomes a safety behaviour when it turns into word-for-word scripting you feel unable to depart from. Sitting beside a friend at a networking event is natural; it becomes a safety behaviour when it is the only way you can bear to attend and you never leave their side. The test is function: are you doing this because it helps you engage, or because it helps you hide? A useful rule of thumb is that preparation happens before the situation and makes you freer during it, while safety behaviours happen during the situation and make you more constrained. The post-mortem: how memories get worse The third part of the machinery happens after the event. Anxious people tend to conduct a detailed review—a post-mortem—of social situations once they are over. They replay the conversation, focusing on moments of awkwardness, and they interpret ambiguous signals negatively: the tutor moved on quickly after my comment, so it must have been stupid; the person at the reception looked at their phone, so I must have been boring. This review feels like analysis. It seems as though it should help you do better next time. In practice it rarely does, for three reasons. It works from biased evidence. Because your attention during the event was turned inward, you did not collect much accurate information about how others were responding. The review is therefore built mainly from your internal feelings and your self-image, both of which, as we have seen, exaggerate how badly things went. It is selective. Post-event processing homes in on what went wrong and skips over what went right or was neutral. Ten minutes of perfectly ordinary conversation fade; one clumsy sentence becomes the headline. It makes memories worse over time. The more a moment is rehearsed in a negative light, the more vivid and negative the memory becomes. Anxious students often find that an event which felt merely uncomfortable at the time seems, a week later, to have been a humiliation. Nothing new happened. The memory was rewritten by the review. Post-event processing also links directly to the next round of anticipatory anxiety. The worse your memory of last week's seminar, the more you dread this week's. The cycle described in Chapter 1 is kept turning largely by this after-the-fact review. It is worth being clear that reflection is not the enemy. There is a difference between a brief, balanced review ("That went okay. Next time I might speak a bit earlier.") and a long, repetitive, self-critical rumination ("Why did I say that? Everyone must have thought…"). The first is useful and usually takes a minute or two. The second takes hours, repeats itself, and leaves you feeling worse without any new plan. Chapter 8 offers a structured way to replace the second with the first. Anticipation: rehearsing a disaster that rarely arrives Before the post-mortem comes the pre-mortem. In the hours or days before a feared situation, anxious students tend to imagine what might go wrong. They picture themselves freezing, being asked a question they cannot answer, blushing, being laughed at. These images are often vivid and are experienced almost as memories of the future. Anticipatory worry has two effects. It raises baseline anxiety going into the situation, so that you arrive already on edge. And it primes you to notice exactly the things you feared—a flicker of warmth in your face, a pause before someone responds—and to interpret them as confirmation. Some anticipation is useful: thinking about what you might say, preparing a question, planning how you will get to the venue. The difference, again, lies in function. Useful preparation ends with a plan. Anxious anticipation ends with more anxiety and no plan, because it circles around images of disaster rather than around what you will actually do. A quick check on anticipatory images is to apply the double-standard test. Picture another student in the seminar—someone you neither especially admire nor dislike—doing exactly what you fear doing: pausing mid-sentence, blushing slightly, making a point that the tutor gently corrects. Ask yourself honestly what you would think of them. Most anxious students answer that they would barely notice, or that they would feel some sympathy, or that they would think the point was reasonable. Then ask why the same moment, in your own case, should mean something so much worse. The images that dominate anticipation are usually judged by a standard you would never apply to anyone else. Testing the model on yourself Models are only useful if they fit your experience. Here is an exercise, adapted from methods used in cognitive therapy for social anxiety, that lets you test this one. It takes one seminar or conversation and about twenty minutes. Choose a situation you will be in this week that is moderately difficult for you—not the most frightening thing you can imagine, but something that reliably brings some anxiety. It might be a seminar, a small-group session, or a conversation with a classmate before a lecture. Before the situation, write down briefly what you fear will happen, how likely you think it is on a scale from zero to one hundred, and how you think you will come across. Then write down the safety behaviours you usually use in this situation. Enter the situation twice, if possible, on two separate occasions. On the first occasion, behave as you usually do, including your safety behaviours, and let your attention go wherever it usually goes. On the second, deliberately drop one or two of the safety behaviours and direct your attention outward: onto what people are saying, onto their faces, onto the content of the discussion. If you can only manage one occasion, try the second version. After each occasion, rate how anxious you felt, how well you think you came across, and whether the feared outcome happened. If possible, gather some outside evidence: did anyone respond to what you said? Did the conversation continue? Did anything you feared actually occur? Most students who try this find three things. Their anxiety is often lower, not higher, when they drop safety behaviours and focus outward—not always on the first attempt, but often. The feared outcome occurs far less often than they predicted. And their rating of how they came across is more favourable when they were engaged in the conversation than when they were watching themselves. If that is not what you find, that is useful information too. It may be that your fears are about something more specific than the model captures, or that the situation you chose was too difficult for a first test. Choose something slightly easier and try again. The aim is not to prove the model right but to replace assumptions with evidence from your own life. Why this is good news It can feel discouraging to learn that much of your distress is being generated by your own habits. But consider the alternative. If the problem lay mainly in the situation—if seminars were inherently threatening, or other students genuinely hostile—there would be little you could do except avoid them. Because the problem lies largely in habits of attention and behaviour, you have leverage. You cannot control whether a tutor asks you a difficult question. You can control where you look, how you prepare, what you do with your hands, and how you review the event afterward. The remaining chapters apply this machinery to specific settings. In each case the principles are the same: turn attention outward, drop safety behaviours gradually, prepare in ways that free you rather than bind you, and review events briefly and fairly rather than at length and harshly. Chapter 3: Preparing for the Seminar: Reading, Notes and the First Contribution Much of what happens in a seminar is decided before you walk into the room. Students who speak easily are rarely more confident by nature than those who do not. More often, they have prepared in a way that gives them something to say and a sense of where they might say it. Anxious students, by contrast, often prepare in one of two unhelpful ways: they either avoid thinking about the seminar at all, because it brings on dread, or they over-prepare, scripting contributions so tightly that they cannot use them when the discussion takes an unexpected turn. This chapter describes a middle path: preparation that is thorough enough to give you material, loose enough to let you respond to the room, and designed specifically to make a first contribution easier. Reading for discussion, not just for understanding Students often read seminar material the way they read for an exam: trying to absorb and remember what the author says. That is necessary, but it is not sufficient for discussion. Seminars are not tests of whether you have understood the reading. They are conversations about it—about what is persuasive, what is puzzling, what is missing, how it connects to other things. Reading for discussion means reading with a second set of questions in mind. As you go, ask: What is the author's main claim? What evidence or reasoning supports it? Where did I find myself disagreeing, or unconvinced? What did I not understand? What does this remind me of, from another reading, a lecture, or my own experience? What would I want to ask the author if they were in the room? You do not need answers to all of these. In fact, some of the best seminar contributions come from honest confusion. "I couldn't work out how the author gets from the second section to the conclusion—did anyone else find that?" is a genuinely useful contribution. It invites others in, it identifies a real difficulty, and it takes the pressure off you to have the final word. A second-year sociology student—call him Tom—described his habit this way: he would read everything carefully, highlight heavily, and arrive at the seminar with a head full of the author's arguments but nothing of his own to say. When he began stopping every few pages to write a one-line reaction in the margin—"really?", "this contradicts last week", "what about women?"—he found that he walked in with half a dozen small hooks on which to hang a contribution. None of them was polished. That turned out to be an advantage, because he could adapt them to wherever the conversation went. The one-page seminar sheet For anxious students, a single sheet of preparation notes can be enormously useful. It gives you something to look at, a reminder of what you want to say, and evidence to yourself that you are ready. The trick is to keep it short and flexible, so that it supports rather than replaces live thinking. A good seminar sheet has four sections, each with no more than a few lines. The first is the core argument: two or three sentences summarising what the reading claims. This helps if you are asked directly, and it steadies you if your mind goes blank. The second is my reactions: three to five short notes on what you found convincing, surprising, doubtful or confusing, with a page reference for each. Write these as keywords or phrases, not full sentences. "p. 42—sample only from cities?" is better than a paragraph, because it forces you to phrase the point live, in response to the room. The third is questions: two or three genuine questions, the kind you would like answered. These are your lowest-risk contributions, and we will come back to them. The fourth is connections: one or two links to other material—a lecture, another reading, a current event. Connections are valued in seminars because they show you are thinking across the module. The deliberate brevity matters. If you write out a full paragraph for each point, you will be tempted to read it aloud, and reading aloud in a discussion tends to sound stilted and to disconnect you from the conversation. Keywords keep the thought yours to phrase in the moment. If you notice that you are writing full scripts, treat that as a safety behaviour to be phased out gradually: script one point fully this week, and the rest in keywords; next week, keywords only. Choosing your first contribution The first contribution in a seminar is usually the hardest. Anticipation builds while you wait, and the longer you stay silent, the more significant your eventual words seem to become—both to you and, you imagine, to everyone else. A student who speaks in the first ten minutes often finds the rest of the seminar easier; one who is still silent after forty minutes may find it almost impossible to begin. This suggests a simple strategy: plan to speak early, and plan to speak in a low-risk way. Not every contribution carries the same exposure. Some ask very little of you and are almost impossible to get wrong; others commit you to a position that might be challenged. Table 2 arranges common types of contribution from lower to higher exposure, so that you can choose a starting point that fits where you are. Table 2. Types of seminar contribution, arranged roughly from lower to higher exposure. Type of contribution Example opening Why it helps Exposure Building on someone else "Following on from what Sam said…" Borrows momentum; shows listening Low Clarifying question "Could you say a bit more about…?" No position to defend Low Pointing to the text "There's a line on page 12 that seems relevant…" Evidence carries the weight Low to moderate Sharing confusion "I found the second section hard to follow…" Invites others in; often shared Moderate Making a connection "This reminded me of last week's reading…" Shows range; hard to be wrong Moderate Offering an interpretation "I read the ending as…" Genuine view, open to discussion Moderate to high Disagreeing "I'm not sure I agree with that, because…" Sharpens debate; most valued Higher The table is not a hierarchy of worth. A clarifying question can be the most useful thing said in a seminar. It is a hierarchy of exposure—how much you have to put yourself forward—and it is meant to help you choose a first step that is challenging but manageable. For many anxious students, a sensible starting point is to aim for one low-exposure contribution in the first fifteen minutes of each seminar. Building on what someone else has said is especially useful, because it has a natural cue: the moment someone finishes speaking, there is a gap, and a phrase like "Just to add to that…" slots into it easily. You do not need to have a whole point prepared; you need only to pick up a thread. Pointing to the text is another excellent early move. "There's a sentence on page 34 that I thought was interesting—the author says…" lets you read out a short quotation, which gives you a moment to settle your voice and takes the spotlight partly off you and onto the material. Most tutors welcome contributions that bring the group back to the text. Preparing without over-rehearsing There is a difference between preparing a point and rehearsing a performance. Preparation means knowing roughly what you want to say and why. Rehearsal, in the anxious sense, means scripting the exact words, repeating them silently, and feeling unable to speak until they are perfect. The problem with rehearsal was described in Chapter 2: it pulls your attention away from the discussion, it means your contribution may not fit by the time you deliver it, and it prevents you from learning that you can speak adequately without it. It also tends to delay your contribution, because the perfect moment for the perfect sentence rarely arrives. A useful rule is to prepare the idea and the first few words, and to leave the rest to the moment. Knowing how you will begin—"I wanted to pick up on…"—is often enough to get you started, and once you have started, the rest usually follows. If it does not follow perfectly, that is fine. Seminar contributions are meant to be provisional. Tutors and experienced students regularly say things like "I haven't quite worked this out, but…" or "I'm thinking aloud here…" and nobody regards it as weakness. It can help to rehearse aloud once, the night before, to hear your own voice saying the kind of thing you want to say. Some students find it useful to explain the reading to a friend, a housemate or even to themselves while walking. This is different from silent, repeated scripting: it builds fluency with the material rather than dependency on a particular form of words. Telling the tutor One of the most underused strategies is simply talking to the tutor. Many anxious students assume that seminar leaders will see their difficulty as a lack of engagement or ability. In practice, most tutors are keen to help students participate and would much rather know about a difficulty than guess at it. You might send a short email or speak to them briefly after a session. Something like: "I wanted to let you know that I find speaking in seminars quite difficult, though I'm very engaged with the material. I'm working on it. Is there anything you'd suggest, or anything that would help?" You do not need to disclose a diagnosis or explain in detail. Most tutors respond warmly to a message like this. Some tutors will offer practical help. They might give you advance notice of a question they plan to ask you, so you can prepare. They might invite you to begin a particular discussion, which removes the problem of breaking in. They might avoid putting you on the spot with an unexpected question, or tell you in advance if they are going to. Some will suggest alternative forms of participation—written responses, online discussion boards—at least while you build confidence. Where a formal adjustment is warranted, particularly if you have a diagnosed condition, your university's disability or accessibility service can help arrange this. Telling the tutor has a further, less obvious benefit. It turns one member of the room into an ally. Knowing that the person leading the discussion is aware and supportive can lower anxiety considerably, and it makes it less likely that their reactions will be misread as disapproval. The hour before What you do in the hour before the seminar affects how you feel in it. A few practical points are worth considering. Arrive a few minutes early rather than exactly on time or late. Arriving early lets you choose your seat and settle before the room fills. It also gives you a chance for low-stakes conversation with one or two classmates as they come in—a brief exchange about the reading or the weather—which can take the edge off the formal discussion to follow. Arriving late, by contrast, means entering a room where everyone is already seated, which is one of the most exposed moments of the whole session. Sit where you can see the tutor and most of the group. This may feel counterintuitive, since hiding at the edge seems safer. But a central seat makes it easier to catch the flow of conversation, to make eye contact when you want to speak, and to be noticed when you raise a hand—all of which make contributing easier. It also removes a safety behaviour. Avoid last-minute cramming or re-reading your notes obsessively in the corridor. Glance at your seminar sheet, remind yourself of your one planned early contribution, and then turn your attention outward: to the room, to the people arriving, to what is happening around you. If anxiety is high, a few slow breaths, with the out-breath longer than the in-breath, can help settle your body; Chapter 4 says more about this. Finally, set a modest, specific goal. Not "I'll be brilliant today," or "I'll speak a lot," but "I'll make one contribution before the first half hour is up." Specific, achievable goals give you something to succeed at, and success—even small success—is what gradually shifts the cycle. A worked example: one week, one seminar To see how these pieces fit together, follow a first-year politics student—call her Aisha—through a single week. Aisha is conscientious and anxious. In her first four seminars she spoke once, in week two, when the tutor asked her a direct question, and she has replayed her answer many times since. On Monday she does the reading, an article on why turnout in elections is falling among young people. Instead of highlighting, she stops at the end of each section and writes a single line in the margin. Her lines read: "assumes voting is the main form of participation?", "what about online campaigns?", "p. 7—data is from one country only", and "this is basically what the lecture said about trust." She also writes one genuine question: "Would compulsory voting fix this or just hide it?" On Tuesday evening she makes her one-page sheet. The core argument gets three sentences. Her reactions are the four margin notes, copied over with page numbers. Her question goes into the questions section. The connection to the lecture goes into connections. The whole sheet takes fifteen minutes. She notices a pull to write out her compulsory voting question as a full paragraph, with an introduction explaining why she is asking it, and decides not to. She writes the first four words—"I was wondering whether…"—and stops. She also sends a short email to her tutor, whom she has not spoken to individually: "I wanted to mention that I find speaking in seminars hard, though I'm really enjoying the module. I'm trying to contribute more. Is there anything you'd suggest?" The tutor replies that evening, thanks her, and says that the question of whether young people participate differently rather than less will come up early in the session, if she wants to be ready for it. On Wednesday she arrives five minutes early, sits in a seat facing the tutor rather than at the corner by the door, and says a few words to the student beside her about how long the article was. Her goal is written at the top of her sheet: "one contribution in the first twenty minutes." Eleven minutes in, a student argues that young people are simply apathetic. Another student disagrees. There is a short pause. Aisha's heart is racing, and she notices the familiar urge to rehearse the full sentence silently. Instead, she glances at her sheet, sees "online campaigns?", and says, "Following on from that—I wondered whether the article assumes voting is the only kind of participation that counts. What about online campaigns?" Her voice feels thin to her. The tutor says, "Good—that's exactly the tension I wanted to get to," and asks the group what they think. Two other students respond to her point. Afterward, Aisha notices the urge to replay the moment and pick at how her voice sounded. She gives herself two minutes to write three lines instead: what she did (spoke in the first fifteen minutes, from keywords), what happened (tutor and two students picked up the point), and what she will try next week (ask her question as well as making a point). Then she closes the notebook. Nothing in this sequence is dramatic, and that is the point. The preparation was short and structured. The contribution was low-exposure. The tutor was an ally. The review was brief and balanced. One seminar like this does not end anxiety, but a term of them changes the record the anxiety relies on. When you have not done the reading It happens to everyone. You meant to do the reading and did not, or you read it but understood little of it. For anxious students, this can feel like grounds for staying silent or not attending at all. Neither is usually necessary. You can still participate honestly. You might build on others' contributions, ask a clarifying question about something someone has said, or contribute from the lecture material rather than the reading. You might even say, briefly and without apology, "I only managed part of the reading, but from the first section…" Tutors generally prefer an honest, partial contribution to silence or absence. Skipping the seminar entirely, meanwhile, strengthens the avoidance cycle and makes the next one harder. That said, if you find that you are regularly unable to do the reading, it is worth asking why. Sometimes it is a workload problem that can be solved with better planning. Sometimes, though, avoidance of the reading is part of avoidance of the seminar: if you do not prepare, you have an explanation ready for your silence. If that pattern sounds familiar, it is worth naming it honestly and addressing the underlying anxiety rather than the reading alone. Hashtags: #ManagingSocialAnxietyInSeminars #SocialAnxiety #SeminarParticipation #ClassParticipation #StudentConfidence #UniversityLife #PublicSpeakingAnxiety #AcademicConfidence #NetworkingSkills #SocialConfidence #OvercomingShyness #Introversion #EmotionalWellbeing #StudentMentalHealth #CommunicationSkills #AssertiveCommunication #CognitiveBehavioralTherapy #CBT #GradualExposure #FearOfJudgment #SelfFocusedAttention #SafetyBehaviors #OvercomingAvoidance #SocialSkills #AcademicSuccess #UniversityNetworking #ConfidenceBuilding #GroupDiscussions #PersonalGrowth #StudentWellbeing

  • Agentic Workflows (Building Autonomous AI Systems with LangChain and AutoGPT)

    Download the Book (PDF): Introduction On 30 March 2023, a game developer named Toran Bruce Richards published a small Python program to GitHub under the name Auto-GPT. It did something that, at the time, felt slightly illicit. Instead of asking GPT-4 a question and reading the answer, it gave the model a name, a role and a handful of goals, then fed the model's own output back to it as the next input. The model was told it could issue commands: search Google, browse a website, read and write files, run Python, even spawn other copies of itself. Each turn it produced a block of structured text containing its "thoughts", its "reasoning", its "plan", a line of "criticism" aimed at itself, and the command it wanted to run. The program executed the command, appended the result to the conversation, and went round again. Within weeks it was the most talked-about repository on GitHub. People set it to work on market research, on building websites, on running small businesses. One well-publicised fork, ChaosGPT, was given the goal of destroying humanity, and mostly tweeted about it. What actually happened when people ran Auto-GPT was more instructive than the headlines. It got stuck. It searched for the same thing five times in a row. It wrote a file, forgot it had written it, and wrote it again. It decided the best next step was to research how to do the task rather than doing it. It ran up bills, because every turn sent the whole growing conversation back to GPT-4, which at the time cost three cents per thousand input tokens. Every so often it did something genuinely impressive, and that was enough to keep people coming back. But very few of the businesses it was asked to start ever opened. Three and a half years later, the same basic shape (a language model, a set of tools, and a loop that feeds results back to the model) sits underneath coding assistants that resolve real issues in real repositories, customer service systems that issue refunds, research tools that read hundreds of pages before writing a report, and back-office automations that reconcile invoices against purchase orders. LangChain and LangGraph, the most widely used open-source frameworks for building such systems, reached their 1.0 releases in October 2025 and list Uber, LinkedIn, Klarna and JP Morgan among their users. AutoGPT itself has turned into a platform with a visual builder in which agents are assembled from typed blocks. The Model Context Protocol, which standardises how models discover and call tools, was handed to a Linux Foundation body in December 2025 with more than ten thousand public servers already in existence. The loop did not get dramatically more clever between 2023 and 2026. Models improved, a great deal, and that matters. But the more important change was in what surrounds the model. The systems that work now bound what the model may do, record what it has done, check what it claims, stop it when it wanders, recover when the network fails halfway through a payment, and ask a person before doing anything irreversible. The systems that failed in 2023 did none of that. They treated autonomy as a property you grant to a model by removing constraints. The systems that succeed treat it as something you build, deliberately and in layers, around a component you know to be unreliable. The argument of this book That observation is the controlling idea of everything that follows: an agent's reliability lives in the loop you build around the model, not in the model itself, so autonomy should be engineered and earned step by step rather than granted. Each chapter takes one part of that loop and shows how to build it well. This is not a pessimistic position. Models will keep improving, and a better model makes every part of the loop easier. But even an excellent model is a probabilistic component. If a step succeeds 95 percent of the time, twenty such steps in a row succeed about 36 percent of the time. That arithmetic does not care how impressive any single step looks in a demo. It is why a research group at METR, measuring how long a task (in human working time) an agent can complete half the time, found in 2025 that models of that era succeeded almost always on tasks a human finishes in under four minutes and less than one time in ten on tasks that take a human more than four hours. The length of task agents can handle has been growing fast, doubling roughly every seven months by METR's estimate, and that is precisely why the engineering around the loop matters more each year rather than less. Longer tasks mean more steps, more state, more chances to fail, and more damage when failure goes unnoticed. The practical upshot is that the decisions which determine whether an agent works are mostly ordinary software engineering decisions applied to an unusual component. What exactly does a tool accept and return? What happens when it times out? Where is the state stored, and can the run resume after a crash without charging the customer twice? Which actions require a human signature? How is the agent stopped when it begins to repeat itself? How will you know, before your users tell you, that last week's prompt change halved the success rate on refund requests? None of these questions is answered by a better prompt. Who this is for and what it covers This book is written for practitioners: software engineers, technical leads, data scientists and technically minded product people who have used language models through a chat interface or a single API call and now want to build systems that take multiple steps on their own. It assumes you can read Python and know roughly what an HTTP request is. It does not assume you have built an agent before. The two names in the subtitle are there for a reason. LangChain, with its companion runtime LangGraph, is the most widely adopted toolkit for building agentic systems in code, and its evolution from a library of composable "chains" in 2022 to a graph-based runtime with persistence and human approval in 2025 is a compressed history of what the field learned. AutoGPT is the project that made the idea of an autonomous agent famous, and its evolution from an open-ended loop to a platform of constrained, inspectable blocks tells the same story from the other direction. Studying both together shows that the practitioners who started from opposite ends of the design space converged on the same conclusions. The book uses both as worked material, but it is not a manual for either. APIs change; the reasons behind them change much more slowly. Where code appears, it is short and illustrative, and the prose carries the argument. The chapters run in the order you would build a system. Chapter 1 defines an agent precisely, separating it from the many things that are called agents, and traces how the loop came to be. Chapter 2 argues that most multi-step AI systems should begin as fixed chains of calls, and shows how to compose them. Chapter 3 treats tools as contracts between a model and the world, and explains how to design them so a model can use them correctly. Chapter 4 takes the most common and most dangerous tool, access to the web, and covers search, fetching, scraping, and the legal and adversarial terrain around them. Chapter 5 deals with state and memory: what the model sees on each turn, what is stored outside it, and why a larger context window does not remove the problem. Chapter 6 puts these pieces together in LangChain and LangGraph, including durable execution and human interruption. Chapter 7 studies AutoGPT, from its original loop to its current platform, as a case study in the costs and lessons of maximal autonomy. Chapter 8 is the core of the engineering argument: how to design loops that tolerate failure through budgets, retries, idempotency, checkpoints, verification and escalation. Chapter 9 covers the two disciplines without which no agent should reach production, security against prompt injection and systematic evaluation. A note on terms and time Vocabulary in this field is unsettled, and marketing has made it worse. "Agent" is applied to everything from a chatbot with a search box to a system that runs unattended for days. This book uses the term narrowly, and Chapter 1 explains the definition. "Workflow" is used in the sense that has become common among practitioners: a system in which the sequence of steps is fixed by code, even if each step involves a model. "Agentic workflow", the phrase in the title, covers the whole range between the two, and much of the craft lies in choosing where on that range a given problem belongs. The book describes the field as it stands in late 2026. Specific version numbers, model names and benchmark scores will date quickly, and the text uses them sparingly, mainly where a specific number makes an argument concrete. The incidents and research it cites are real and are listed in the notes. Where the evidence is thin or disputed, the text says so. The design principles are the part meant to last. They are drawn from things that went wrong, often expensively, and from the patterns that the people who build these systems for a living have settled on after trying the alternatives. One more expectation is worth setting. Building a good agent is less glamorous than the demos suggest. Most of the work is in defining interfaces, handling errors, writing evaluation cases and reading traces of runs that went wrong. That work is what turns an impressive prototype into a system you can leave running. If this book does its job, you will come away less excited about autonomy as a spectacle and more capable of delivering it as a product. CHAPTER 1 From Prompt to Loop A single call to a language model is a function. Text goes in, text comes out, and whatever the model "decided" exists only in the words it returned. You can chain such calls together, inspect each output, and decide in your own code what to do next. Nothing about this is autonomous. The interesting shift happens at a specific and identifiable moment: when the output of the model is allowed to determine what the program does next, and the result of that action is fed back to the model so it can decide again. At that point the program contains a loop whose control flow is chosen, turn by turn, by a probabilistic component. That is what this book means by an agent. The definition is deliberately narrow. It excludes a great deal of what is sold as agentic: a chatbot that answers questions from a knowledge base, a classifier that routes emails, a pipeline that summarises documents and writes the summaries to a database. Those systems may use models well and may be extremely valuable. But their sequence of steps is fixed by the programmer. The model fills in content; it does not choose the path. The distinction matters because the engineering problems are different. A fixed pipeline fails in predictable places and can be tested step by step. A loop whose path is chosen at runtime can fail anywhere, in combinations nobody wrote down, and its cost and duration are not known in advance. Anthropic's engineering team drew the same line in a widely read December 2024 essay, "Building Effective Agents", by Erik Schluntz and Barry Zhang. They called the first kind of system a workflow, in which models and tools are orchestrated through predefined code paths, and the second an agent, in which the model dynamically directs its own process and tool use. Their central advice was that most problems are better served by workflows, and that complexity should be added only when simpler designs demonstrably fall short. The rest of this book agrees, and tries to make that advice operational. But to know when you need an agent, you first have to see exactly what one is made of. The anatomy of the loop Strip away the frameworks and every agent has the same five parts. The first is the model, which reads a context and produces either a final answer or a request to take an action. Modern models do this through a feature that providers call function calling or tool use: the developer describes available tools with names, descriptions and parameter schemas, and the model can respond with a structured request such as "call search_orders with customer_id set to 4471" instead of, or alongside, ordinary text. The second is the tool set, the code that actually does things. A tool might query a database, call a third-party API, fetch a web page, run a shell command, or send an email. Tools are where the agent touches the world, and therefore where it does damage when it goes wrong. The third is the state: everything the agent knows about the task so far. In the simplest agents this is just the list of messages, the user's request, the model's replies, the tool calls and their results, which grows with every turn. In more serious systems it includes structured fields such as a plan, a list of completed subtasks, files written, budget spent and approvals pending. The fourth is the controller, the plain code that runs the loop. It sends the state to the model, inspects the response, executes any requested tool calls, appends the results to the state, checks whether to stop, and repeats. The controller is the part most demos treat as trivial and most production systems spend most of their effort on. The fifth is the stop condition. The obvious one is that the model returns an answer without requesting a tool. The necessary ones are everything else: a maximum number of turns, a maximum spend, a deadline, a detected repetition, an error that cannot be retried, a request for human approval. In code, a minimal controller fits in about a dozen lines of Python. It initialises a list of messages with the system prompt and the user's request. It then enters a for loop bounded by a constant, MAX_TURNS. On each pass it sends the messages and the tool schemas to the model and appends the reply to the list. If the reply contains no tool calls, the loop returns the reply's text as the answer. Otherwise, for each requested call, it runs the named tool with the supplied arguments through a function called run_tool, and appends the result as a tool message tagged with the call's identifier. If the loop runs out of turns without an answer, the controller raises a BudgetExceeded error carrying the message history, so the caller can see how far the run got. Everything else in this book is elaboration of that loop: what goes into run_tool, what messages becomes when it no longer fits, what happens when run_tool throws halfway through, what MAX_TURNS should be and what should happen when it is reached, and which calls should never be executed without a person looking first. The loop is easy to write and hard to make trustworthy. That gap is the subject. It is worth noticing what the model does not do in this picture. It does not execute anything. It cannot open a socket or write a file. Every effect in the world happens because the controller chose to carry out a request the model made. This is the most important architectural fact about agents, and it is easy to lose sight of when frameworks hide the controller. It means every safety property you want, every limit, permission, confirmation and audit record, can be enforced in ordinary code at the point where requests become actions. The model proposes; the controller disposes. Systems that forget this, and let model output flow straight into a shell or a database without a deterministic checkpoint, are the ones that make the news. How the loop was discovered The pieces of this design came together over about eighteen months, and the order in which they arrived explains a good deal about why the tooling looks the way it does. The first piece was the observation that language models reason better when they write out intermediate steps. Jason Wei and colleagues at Google showed in early 2022 that prompting a large model with worked examples containing explicit reasoning, a technique they called chain-of-thought prompting, sharply improved its performance on arithmetic and multi-step reasoning tasks. A model that writes down its reasoning is, in a sense, using its own output as working memory. The second piece was the idea of routing parts of a problem to external systems. In May 2022, researchers at AI21 Labs led by Ehud Karpas described an architecture they called MRKL (pronounced "miracle"), for Modular Reasoning, Knowledge and Language, in which a language model acts as a router that sends sub-problems to specialised modules such as a calculator, a database or a weather API, and composes the results. MRKL was a design for a system rather than a technique for prompting, but it named the essential division of labour: the model decides, the tools compute. The third piece, and the one that defined the modern loop, was ReAct. Shunyu Yao and colleagues at Princeton and Google published "ReAct: Synergizing Reasoning and Acting in Language Models" in October 2022. ReAct interleaved the two earlier ideas. The model was prompted to alternate between a Thought (free-text reasoning about what to do), an Action (a call to a tool such as a Wikipedia search), and an Observation (the tool's result, inserted by the controller), repeating until it produced an answer. On interactive decision-making benchmarks, ALFWorld, a text-based household environment, and WebShop, a simulated online store, ReAct prompting with only one or two examples outperformed imitation and reinforcement learning methods by absolute success-rate margins of 34 and 10 percentage points respectively. Just as importantly, its traces were readable. A person could look at the Thought lines and see why the agent did what it did, and where it went wrong. ReAct was a prompting technique, and early implementations had to parse the model's free text to find the Action line and its arguments. That parsing was fragile. A model might write "Action: Search[Paris population]" one time and "I will now search for the population of Paris" the next, and the controller had to cope. Meta's Toolformer paper, published by Timo Schick and colleagues in February 2023, approached the problem from training rather than prompting: it showed that a model could teach itself, from a small number of demonstrations, when to insert API calls into its own text and how to use the results. The industry answer arrived on 13 June 2023, when OpenAI added function calling to its chat API. Developers could now describe functions with JSON Schema, and the model, fine-tuned for the purpose, would return a structured call instead of prose that had to be parsed. Anthropic, Google and others followed with equivalent features. The fragile part of ReAct became a native capability of the model interface, and agents became markedly easier to build. In between, in the spring of 2023, came the public experiment. GPT-4 was released on 14 March. Within three weeks, Auto-GPT had appeared, and alongside it Yohei Nakajima's BabyAGI, a much shorter script that maintained a task list, executed the top task, and asked the model to generate new tasks from the result. Both projects bolted a ReAct-style loop to the most capable model then available and pointed it at open-ended goals. Their popularity was enormous and their practical results were thin, for reasons Chapter 7 examines in detail. But they established the public image of an agent, a system you give a goal and leave alone, and that image has shaped expectations, often unhelpfully, ever since. LangChain sits across this whole period. Harrison Chase released it as an open-source Python library in October 2022, initially as a set of abstractions for composing prompts, models and parsers into "chains", plus an implementation of ReAct-style agents. As the field moved, LangChain moved with it, accumulating integrations with hundreds of model providers, vector stores and tools. In January 2024 the team released LangGraph, a separate library for building agents as explicit graphs of steps with shared state, after concluding that the original agent abstractions hid too much of the loop for developers to control it. In October 2025 both reached 1.0, with LangChain's agent constructor rebuilt on the LangGraph runtime. That trajectory, from hiding the loop to exposing it, is one of the clearest signals in the field about where reliability comes from, and Chapter 6 follows it in detail. Degrees of autonomy Once the loop is visible, it becomes clear that "agent or not" is too coarse a question. Systems differ along several independent dimensions, and the useful design question is how much freedom to grant on each. One dimension is control of the path. At one extreme the code fixes every step. Next comes routing, where the model chooses among a few fixed branches. Then come bounded loops, where the model chooses which tool to call next but within a small, task-specific set and a fixed turn limit. At the far end the model can create its own subtasks, spawn sub-agents and decide when it is finished. Each step along this dimension makes the system more flexible and harder to test. A second dimension is reach of the tools. An agent that can only read from a product catalogue is a different object from one that can issue refunds, which is different again from one with an unrestricted shell. The same loop, the same model and the same prompt can be harmless or dangerous depending entirely on what the tools allow. A third is duration and supervision. Some agents run for a few seconds inside a user's request, with the user watching the result. Others run for hours in the background and report back. The longer an agent runs unwatched, the more the controller has to do on the user's behalf: limit spending, detect drift, save progress, and decide when to stop and ask. A fourth is reversibility of effects. Reading a web page can be repeated freely. Writing a draft file can be undone. Sending an email to a customer, executing a trade, or dropping a database table cannot. The reversibility of the most dangerous action an agent can take should govern how much of the rest of the design is devoted to preventing that action from happening by mistake. Thinking in these dimensions dissolves a lot of confused debate about whether some system "really" is an agent. It also suggests the basic discipline of the field: grant freedom along each dimension only where the task requires it, and only as far as your ability to observe and correct the system extends. A coding assistant that proposes changes in a sandbox and asks before pushing them is highly autonomous on the path dimension, modest on reach, short on duration, and fully reversible. That combination is why coding assistants became the first broadly successful agents. They sit in the region where a mistake costs a few minutes of a developer's attention rather than a customer's money. What the model contributes and what it cannot It is tempting, when an agent fails, to reach first for a better prompt or a bigger model. Sometimes that is right. A model that cannot follow a multi-step instruction, or that misreads tool schemas, will not be rescued by any amount of surrounding code. But it helps to be precise about what the model contributes to the loop, because that sets the boundary of what the loop must provide. The model contributes judgement in context. It reads an unstructured request, a page of search results, an error message or a half-finished plan, and decides what is relevant and what to do next. It can translate between the messy language of people and the strict language of APIs. It can recognise that a tool result does not answer the question and try something else. No earlier technology did these things at all, and they are the reason agents exist. The model does not contribute guarantees. It will sometimes call a tool with plausible but wrong arguments. It will sometimes report success when the tool returned an error, especially if the error message was ambiguous. It will sometimes repeat an action it has already taken, particularly when its context has grown long and the earlier action is buried. It will follow instructions it finds inside the data it reads, which, as Chapter 9 shows, is the root of the most serious security problem in the field. And its behaviour on a given input varies from run to run. A benchmark called τ-bench, published by Yao and colleagues at Sierra in June 2024, made that last point vivid. It simulated customer service conversations in retail and airline domains, where an agent had to follow written policies while using tools to look up and change bookings. The best model at the time succeeded on fewer than half the tasks, and when the same task was run eight times, the fraction of tasks solved on all eight attempts fell below a quarter in the retail domain. An agent that succeeds on a task most of the time is not the same as an agent that can be trusted with that task. Those properties define the job of everything outside the model. The tools must make wrong arguments hard to express and easy to detect. The state must keep the relevant history visible and the irrelevant history out of the way. The controller must notice repetition, bound cost, retry transient failures, refuse forbidden actions, and verify claims of success against the world rather than against the model's word. The surrounding process must measure success across many runs, not one. None of that is a criticism of the model. It is the normal relationship between a system and an unreliable component, the same relationship a database has with a disk that occasionally fails, or a web service has with a network that occasionally drops packets. Engineering has well-developed techniques for building reliable systems out of unreliable parts. The craft of agentic systems is mostly the work of applying those techniques to a new kind of unreliability. The next chapter starts where that craft should start: with the observation that many multi-step problems do not need the model to choose the path at all, and are better solved by composing calls in fixed sequences that you can test, measure and trust. CHAPTER 2 Chains Before Agents The first useful thing to know about building agents is when not to. A surprising share of the multi-step problems that teams bring to agent frameworks have a shape that is known in advance: extract these fields, look up these records, compare the two, draft a response, check the draft against a policy. When the shape is known, letting a model choose the path at runtime buys flexibility the task does not need and pays for it in cost, latency, variance and debuggability. Writing the path down in code, and using the model only to do the parts that require judgement, produces a system that is cheaper, faster, easier to test and easier to fix. This is not a temporary concession to weak models. It follows from the arithmetic of chained probabilities and the economics of testing, and it holds even when the model is excellent. It is also the natural starting point for building an agent, because the components of a well-built chain, structured outputs, validation between steps, explicit error handling, and logs of every intermediate result, are exactly the components a reliable agent needs. A team that has built good chains already has most of the machinery for a good loop. The arithmetic of composition Suppose each step in a multi-step process succeeds with probability p, independently. The whole process succeeds with probability p raised to the number of steps. At p = 0.95, five steps succeed 77 percent of the time; ten steps, 60 percent; twenty steps, 36 percent. At p = 0.99, fifty steps still succeed only about 61 percent of the time. Real steps are not independent, and errors at one step sometimes get caught and corrected at the next, so the numbers are a simplification. But the direction is right, and practitioners see it constantly: systems that look excellent on each component fall apart end to end. Fixed chains attack this arithmetic in three ways that a free-running agent cannot easily match. First, they reduce the number of model decisions. In a chain, the model never decides which step comes next, because the code already knows. Every decision you take away from the model is a decision that cannot go wrong. Second, they allow a gate after each step. Because the output of step three is expected to have a particular shape, the code can check it before step four begins: does the extracted invoice total parse as a number, does it match the sum of the line items, is the supplier one we have on file? A failed check can trigger a retry of that step alone, a fallback, or a halt with a precise error, instead of letting a bad value propagate through ten more steps and surface as a confident but wrong final answer. Gates turn the multiplication of probabilities into something closer to a sequence of independent, repairable stages. Third, chains make each step separately testable. You can assemble fifty examples of step three's input and expected output, measure its accuracy, change its prompt, and measure again, without running the whole system. An agent's behaviour emerges from the interaction of all its decisions, so it can only be tested as a whole, and whole-system tests are slower, noisier and more expensive. There is a further practical benefit. A chain's cost and latency are predictable. If it makes four model calls of known size, you know roughly what each run will cost and how long it will take, and you can provision for it. An agent that might take three turns or thirty cannot be costed in advance, which matters a great deal when it runs a million times a month. Five patterns that cover most of the ground Schluntz and Zhang's essay named five recurring workflow patterns, and they are a good map of the territory. Each is simple, and most real systems combine several. Prompt chaining is a fixed sequence of calls, each consuming the previous one's output, with optional gates between them. Generating marketing copy and then translating it is a chain; so is extracting the claims from a contract, checking each against a policy, and drafting a summary of exceptions. Chaining trades a little latency for much higher accuracy, because each call has a narrow task it can do well. Routing classifies an input and sends it down one of several specialised paths. A support system might route refund requests, technical questions and account changes to different prompts, tools and even models, using a small, fast model for the classification itself and a larger one only where needed. Routing is the first point at which a model influences control flow, but in a tightly bounded way: it picks one of a handful of labels, and the code takes it from there. Because the output is a label, the router can be evaluated like any classifier, with precision and recall on a labelled test set. Parallelisation runs several calls at once and combines the results. It comes in two forms. Sectioning splits a task into independent parts, such as reviewing each clause of a contract separately, or running a content check alongside the main response generation, and merges them. Voting runs the same task several times and aggregates, which exploits the model's variability rather than suffering from it. Xuezhi Wang and colleagues at Google showed in 2022 that sampling several chain-of-thought answers and taking the majority, a method they called self-consistency, substantially improved accuracy on reasoning benchmarks over a single sample. Voting is also a cheap way to estimate confidence: if five samples agree, the answer is more likely right than if they split three to two. Orchestrator-workers has a central model break a task into subtasks at runtime and dispatch them to worker calls, then synthesise the results. It looks like parallelisation, but the subtasks are not known in advance; the orchestrator decides them from the input. A coding assistant that must change an unknown number of files to implement a feature is the canonical example. This pattern sits on the boundary between workflow and agent, because the model now shapes the structure of the work, though usually in one planning step rather than continuously. Evaluator-optimiser pairs a generator with a critic in a loop: one call produces a draft, another evaluates it against explicit criteria and returns feedback, and the generator revises until the critic is satisfied or a limit is reached. It works when the criteria can be stated clearly and when feedback actually helps, as in literary translation or code that must pass tests. It is the first pattern with a genuine loop, and it already needs a stop condition and a turn limit. Table 1 sets these patterns beside the fully autonomous agent loop, along the dimensions that matter most for engineering. Table 1. Workflow patterns compared with an autonomous agent loop. Pattern Who chooses the path Number of model calls Best suited to Main risk Prompt chaining Code Fixed Decomposable tasks with known steps Error propagation without gates Routing Model picks a label, code acts Fixed per route Distinct input categories Misclassification Parallelisation Code Fixed, concurrent Independent subtasks, voting Inconsistent merged results Orchestrator-workers Model plans once, code dispatches Varies with plan Subtasks unknown in advance Poor decomposition Evaluator-optimiser Code loop, model judges Bounded by iterations Clear criteria, useful feedback Critic and generator agree on wrong answer Autonomous agent Model, every turn Unbounded without limits Open-ended tasks, unpredictable steps Drift, loops, cost, unsafe actions The table makes a point that the prose should state plainly. Moving down it, flexibility rises and so does every kind of risk. The decision to move a system down a row should be driven by evidence that the row above cannot do the job, not by the appeal of the row below. Making chains robust in practice The quality of a chain depends less on the cleverness of its prompts than on the discipline of its seams. Three practices do most of the work. The first is structured output at every boundary. If step two produces free text that step three must parse, you have rebuilt the fragility that function calling was invented to remove. Every major provider now supports constraining output to a JSON Schema, and frameworks wrap this in convenient forms. In LangChain, a model's with_structured_output method takes a Pydantic class and returns validated instances of it; LangChain 1.0's agent constructor accepts a response_format that does the same for an agent's final answer. A schema forces the model to commit to fields, gives the code something it can validate mechanically, and documents the interface between steps in a form other engineers can read. A typical extraction step makes the idea concrete. The developer defines a Pydantic class called InvoiceFields with five fields: the supplier name and invoice number as strings, the total as a number constrained to be zero or greater, the currency as a string that must match the pattern of a three-letter code, and a list of line-item totals. Passing that class to with_structured_output produces an extractor whose output is guaranteed to be an InvoiceFields instance or an error. The very next line of code then checks that the line-item totals sum to the stated total, within a cent, and raises a validation failure if they do not. The validation after the call is the point. The schema guarantees that total is a non-negative number; it cannot guarantee that it is the right number. A domain check, here that line items sum to the total, catches a class of extraction error that no schema can. Every gate should combine both kinds of check: shape, which the schema handles, and sense, which only your knowledge of the domain can supply. The second practice is narrow steps with explicit inputs. A step that receives only what it needs is easier to prompt, cheaper to run and less likely to be distracted. Passing an entire email thread to a step whose job is to extract a tracking number invites the model to mention something else it noticed. Narrow steps also make failures interpretable: when a step that only extracts dates gets a date wrong, there are only a few possible causes. The third practice is deterministic code wherever determinism is possible. If a step can be done with a regular expression, a SQL query, a lookup table or arithmetic, it should be. Models are excellent at reading messy input and poor at being consistent; code is the reverse. Good chains alternate between the two, using the model to turn unstructured input into structured data and code to do everything that can be done on structured data. A remarkable number of agent failures in the wild come from asking a model to do arithmetic, compare dates or count items that a few lines of Python would have handled perfectly. LangChain's original contribution was a vocabulary for composing such steps. Its LangChain Expression Language, introduced in 2023, let developers pipe prompts, models, parsers and arbitrary functions together with a | operator into "runnables" that supported batching, streaming, retries and fallbacks uniformly. A runnable could be given .with_retry() to retry transient failures or .with_fallbacks([other_model]) to try a second provider if the first failed. Those primitives are still available and still useful for linear pipelines. The broader lesson they encoded is that composition, retry and fallback are properties of the pipeline, not of the prompt, and belong in code that every step shares. A worked example: expense review Consider a concrete case that teams often propose as an agent: reviewing employee expense claims. Each claim arrives as a form with attached receipts, and a reviewer must check that the receipts match the claimed amounts, that each expense is permitted under the company's travel policy, that limits for meals and hotels are respected, and that nothing has been claimed twice. An "expense agent" with tools to read receipts, search the policy and look up past claims is easy to imagine and easy to demo. Written as a chain, the same system has six steps. The first is a model call with structured output that extracts, from each receipt image or PDF, the merchant, date, currency, amount and category, with a confidence field. The second is code: it converts currencies at the rate for the receipt date, sums the receipts, and compares them with the claimed total. The third is code again: it looks up past claims by the same employee for the same merchant and date to catch duplicates. The fourth is a routing call that classifies each line into one of the policy's categories. The fifth is code that applies the numerical limits for each category and city, which come from a table, not from a prompt. The sixth is a model call that reads the remaining flagged items together with the relevant policy paragraphs, retrieved by category rather than by semantic search, and drafts a short explanation for the reviewer. Only two of the six steps use a model in a way that requires judgement, and each has a narrow job and a structured output. Every arithmetic comparison, lookup and limit check is code, and so is exactly right every time. Each step logs its input and output, so when a reviewer disagrees with a flag, the trace shows at once whether the extraction misread a receipt, the classifier chose the wrong category, or the policy table is out of date. Low-confidence extractions are routed to a person rather than passed on. The system's cost per claim is fixed and small, and each step can be evaluated on its own labelled examples. Where does an agent belong in this design? Possibly nowhere. Possibly in one place: claims with unusual circumstances, a cancelled flight, a conference fee paid in a foreign currency through a colleague's card, may need the system to gather information it did not expect to need. A bounded agentic step, triggered only for claims the chain cannot resolve, with read-only access to booking records and the policy and a turn limit, can investigate and write up its findings for the reviewer. The chain handles the ninety-odd percent of routine claims cheaply and predictably; the agent handles the exceptions, where its flexibility is worth its cost; and a person still makes the decision on anything the system cannot clear. When to cross the line If chains are so much easier to trust, why build agents at all? Because some tasks genuinely do not have a shape known in advance. A research question may need two searches or twenty, depending on what the first one returns. A bug may be fixed by changing one line or require reading six files to understand. A customer's problem may turn out, three messages in, to be a different problem from the one they described. For these tasks, the cost of encoding every possible path in code exceeds the cost of letting a model choose, and the value of the task justifies the variance. A useful test has three questions. Can you write down the steps in advance for most inputs? If yes, write a chain, and handle the rare exceptions with a fallback to a person. Does the number or kind of steps depend on information discovered during the task? If yes, some runtime decision-making is needed, and the question becomes how little. And can success be checked at the end, by running tests, comparing a database state to a goal, or having a person review a draft? If not, think hard before building an agent at all, because you will have no way to know when it is wrong. When the answer does point to an agent, the chain still has a role. Many of the most effective production systems are hybrids: a fixed workflow with a bounded agentic step inside it. A support pipeline might classify the request, retrieve the customer's records and relevant policies deterministically, hand a bounded agent a small set of tools and a turn limit to resolve the issue, and then pass the agent's proposed action through a deterministic policy check and, for refunds above a threshold, a human approval queue. The agent does what only an agent can do, adapting to the specifics of the conversation, while everything around it stays fixed, cheap and testable. There is empirical support for this restraint. Sayash Kapoor, Arvind Narayanan and colleagues at Princeton, in a July 2024 paper titled "AI Agents That Matter", reviewed agent benchmarks and found that elaborate agent architectures often failed to beat simple baselines once cost was taken into account, such as retrying a plain model call several times or escalating to a stronger model only on failure. They argued that agent evaluations should report cost alongside accuracy, because an agent that is two points more accurate at ten times the cost is rarely the better system. Their critique was aimed at research benchmarks, but it applies with more force in production, where every unnecessary turn is paid for on every request. The practical rule that falls out of all this is simple to state and hard to follow when a demo of a free-running agent is on the table: start with the most constrained design that could possibly work, measure it, and relax constraints one at a time only where measurement shows a constraint is the thing holding the system back. Each relaxation should come with the machinery to observe and limit the new freedom it grants. The rest of this book supplies that machinery, beginning with the part of the loop through which every agent acts on the world: its tools. CHAPTER 3 Tools as Contracts An agent is only as capable as its tools and only as safe as their limits. A model that can reason brilliantly about a refund but has no way to look up the order is useless; a model with an unrestricted database connection is a hazard no matter how carefully it reasons. Between those extremes lies the main design surface of any agentic system: the set of functions the model is allowed to request, what each one accepts, what each one returns, and what each one is allowed to change. The right way to think about a tool is as a contract between two parties who cannot see each other. On one side is a model that knows only what the tool's name, description and parameter schema tell it, and what the tool returned on previous calls. On the other side is code that will do exactly what it is asked and nothing more. Every misunderstanding between them, a parameter interpreted differently, an error that reads like success, a return value too large to fit, turns into an agent failure. Good tool design is the craft of writing contracts that a model can honour and that code can enforce. Anthropic's engineers have argued that this deserves as much effort as designing a human interface. In "Building Effective Agents" they called it the agent-computer interface, and gave an example from their own work on SWE-bench, a benchmark in which an agent must resolve real GitHub issues in Python repositories. Their agent kept making mistakes with relative file paths after it had changed directory. Rather than adjusting the prompt, they changed the tool so that it required absolute paths. The model used that version without error. The lesson generalises: when an agent misuses a tool repeatedly, the first suspect is the tool, not the model. How tool calling actually works It helps to be precise about the mechanics, because several common mistakes follow from misunderstanding them. When you call a model with tools, the provider's API receives, alongside the conversation, a list of tool definitions. Each has a name, a natural-language description, and a JSON Schema describing its parameters. The provider renders these into the model's context in a format the model was trained on. The model then generates a response which may contain one or more tool-call blocks, each with a generated identifier, the tool name and a JSON object of arguments. Nothing has been executed at this point. Your code reads the tool calls, runs the corresponding functions, and sends their results back as tool-result messages tagged with the same identifiers, after which the model continues. Three consequences follow. First, tool definitions are part of the prompt. They consume context on every call, and the model reads them with the same attention, and the same failures of attention, as anything else in its context. A long, vague description is a long, vague prompt. Second, the arguments the model produces are generated text that happens to be shaped like JSON. Providers now offer strict modes that guarantee the arguments conform to the schema, and these are worth using, but conformance to a schema is not correctness. A well-formed customer_id can still be the wrong customer. Third, the tool result is just another message. The model has no special channel telling it whether a call succeeded; it infers that from whatever text you return. If your tool returns None on failure, or a stack trace the model cannot interpret, the model will guess, and it will sometimes guess wrong in the direction of reporting success. Modern models can also request several tool calls in one turn, for instance three searches at once. This is valuable for latency, and most frameworks execute parallel calls concurrently. It also means your controller must handle partial failure: two of three calls succeed and one times out. Each result goes back with its identifier, and the failed one should come back as an explicit error rather than being silently dropped, or the model will assume it has information it does not. In LangChain, the simplest way to define a tool is to decorate a typed Python function with @tool. The function's name becomes the tool name, its docstring becomes the description, and its type annotations become the parameter schema. Consider a tool called get_order that takes a single string argument, order_id. Its docstring says three things: that it looks up one order by its ID, which has the format 'ORD-' followed by eight digits; that it returns the order's status, items, total and shipping address; and that it should be used before answering any question about a specific order. In its body, if the database lookup finds nothing, the function does not raise an exception. It returns a small dictionary with an error field whose text reads, in effect, "No order found with ID ORD-12345678. Check the format or ask the customer to confirm it." Otherwise it returns a summary of the order. Every line of that docstring is doing work. It tells the model the identifier format, what the tool returns, and when to use it. The not-found path returns a message that tells the model what to do next, instead of raising an exception that would either crash the loop or arrive as an unreadable traceback. Designing the contract Several design decisions recur in every tool set, and the choices that work are now fairly well understood. Granularity. The most tempting tool is the most general one: give the agent execute_sql or run_shell and let it figure out the rest. General tools are powerful and occasionally necessary, especially in coding agents where the space of useful actions really is open-ended. But they push all the work of correctness and safety onto the model, and they make every policy the model must follow a matter of prompting rather than enforcement. For most business tasks, narrower tools work better. A refund_order(order_id, amount, reason) tool can check in code that the amount does not exceed the order total, that the order is within the refund window, and that the reason is one of the permitted values. An agent with execute_sql can be asked to do all that, and will usually comply, until the day it does not. The opposite mistake is wrapping every endpoint of an existing API as a separate tool. APIs designed for programmers are often too fine-grained for models: to schedule a meeting, a model might need to list users, fetch each calendar, compute overlaps and then create an event, each a separate call with its own chance of error. Anthropic's September 2025 guidance on writing tools for agents recommends consolidating such sequences into tools that match the task an agent is actually trying to do, a single schedule_event that finds availability and books it, so the model makes one decision instead of five. The right granularity is the one at which each tool corresponds to a meaningful step in the task, with the mechanical sub-steps handled in code. Names and descriptions. Names should be unambiguous and, when an agent has many tools, grouped by consistent prefixes so related tools sit together, crm_search_contacts and crm_update_contact rather than search and update. Descriptions should say what the tool does, when to use it, when not to, what each parameter means, and what comes back. Parameter names should carry meaning: user_id rather than user, start_date_iso rather than date. Where a parameter has a fixed set of valid values, express it as an enum in the schema so the model cannot invent a new one. Small edits to descriptions often produce large changes in behaviour, and they should be treated as code: versioned, reviewed and evaluated. Return values. A tool's output becomes part of the model's context, so it should contain what the model needs to decide its next step and nothing more. Raw API responses are usually wrong on both counts: full of internal identifiers, metadata and nested structures the model does not need, and missing the human-readable fields that would help it. Return names rather than opaque IDs where possible, keep the IDs the model will need for follow-up calls, and cap the size. When results are large, paginate or truncate with an explicit note saying more exists and how to get it. Claude Code, Anthropic's coding agent, limits tool responses to 25,000 tokens by default for exactly this reason: a single unbounded result can push everything else out of the model's attention. Errors as information. Tool errors should be returned to the model, not thrown past it, and they should be written for the model to act on. "Invalid date" is less useful than "start_date must be in YYYY-MM-DD format; you sent '03/10/2026'". "Rate limited" is less useful than "This service allows 10 requests per minute; wait before retrying or narrow the query". There is an important distinction here, though, which Chapter 8 develops. Errors the model can fix, such as malformed arguments or a record not found, should go back to the model. Errors it cannot fix, a network timeout, a provider outage or an expired credential, should be handled by the controller with retries or escalation, and the model should be told about them only if they persist. Sending every transient network blip to the model wastes turns and invites it to improvise. Side-effect classes. Every tool should be classified, in code, by what it can change. A practical scheme has three classes: read-only tools, which can be called freely and retried safely; reversible writes, such as creating a draft or adding a label, which can be undone; and irreversible or external actions, such as sending messages, moving money or deleting data, which need idempotency protection and usually human approval. The classification should drive controller behaviour automatically. Read-only tools can run in parallel and be retried; irreversible tools run one at a time, carry idempotency keys, and pass through an approval gate when the stakes warrant. Making the class an explicit attribute of the tool, rather than something a reviewer has to infer from its name, is the cheapest safety measure in agent engineering. How many tools. Every tool definition consumes context and competes for the model's attention. Agents given dozens of overlapping tools choose among them less reliably than agents given a handful of distinct ones. When a system genuinely needs many tools, two techniques help: route first, so a classifier narrows the toolset to the ones relevant to this request, or let the model search a tool catalogue and load definitions on demand. LangChain 1.0 ships middleware for both approaches, an LLM-based tool selector that picks the relevant subset before the main call, and support for providers' server-side tool search. Neither is a substitute for a well-curated toolset. Testing tools the way the model will use them Tools are usually tested as functions: given these arguments, does the code return the right result? That test is necessary and nowhere near sufficient, because the failures that matter most happen at the interface, where the model chooses which tool to call and what to pass. A tool can be perfectly correct and still be misused every third time because its description is ambiguous or its parameters invite the wrong values. The effective test puts a model in front of the tool. Assemble a set of realistic requests, give an agent the tool set, run each request several times, and read the transcripts. The patterns that emerge are specific and fixable: the model passes a customer's name where an ID was expected, so the parameter needs a clearer name and an example; it calls the search tool when it should call the lookup tool, so the descriptions need to say when each applies; it ignores the pagination note and concludes there were only ten results, so the note needs to be more prominent or the default page larger. Anthropic's tool-writing guidance recommends exactly this loop of evaluating, reading transcripts and revising descriptions, and goes further, suggesting that a model can be asked to analyse the transcripts and propose improvements to the tool definitions itself, with the changes then checked against held-out cases. Two techniques make this cheaper. The first is emulation: during early development, a model can stand in for a tool's implementation, generating plausible responses from the tool's description, so that the agent's use of the tool can be studied before the real integration exists. LangChain includes an emulator middleware for this purpose. Emulated results are no substitute for the real thing, but they surface interface problems early, when they are cheapest to fix. The second is recording: capture real tool responses during development runs and replay them in tests, so that the model's behaviour can be evaluated repeatably without calling live services. Tool definitions should also be versioned alongside the prompts that use them. A change to a description is a change to the agent's behaviour, often a larger one than a change to the system prompt, and it should go through the same evaluation before release. Teams that keep tool descriptions in code, reviewed like any other change and run against an evaluation suite in continuous integration, avoid a common failure: an engineer improves one tool's description for one case and silently degrades three others. The Model Context Protocol Until late 2024, every framework and every application defined tools in its own way. A tool written for LangChain had to be rewritten for another framework, and an integration with a company's internal systems had to be rebuilt for every agent that needed it. In November 2024, Anthropic published the Model Context Protocol, an open specification for exposing tools and data to models through a standard client-server interface. MCP is deliberately modest. An MCP server is a program that exposes three kinds of thing: tools, functions the model can call; resources, data the application can read into context; and prompts, reusable templates. Clients, which are the agent applications, connect to servers, discover what they offer, and relay the model's tool calls to them, using JSON-RPC messages over either standard input and output for local servers or HTTP for remote ones. The protocol says nothing about how an agent should reason or loop. It standardises only the boundary between agents and the systems they use. That modesty is why it spread. OpenAI, Google and Microsoft adopted it in their own products during 2025, and by the time Anthropic transferred MCP to the newly formed Agentic AI Foundation under the Linux Foundation in December 2025, alongside OpenAI's AGENTS.md convention and Block's goose agent, the company reported more than ten thousand active public MCP servers and over ninety-seven million monthly downloads of the Python and TypeScript SDKs. LangChain provides adapters that load an MCP server's tools as ordinary LangChain tools, and AutoGPT's platform can use MCP servers as blocks. For practitioners, this means that a well-built MCP server for an internal system is reusable across every agent framework a company adopts. Table 2 compares the main ways a tool reaches a model in current practice. Table 2. Four ways of giving a model a tool. Mechanism Where the tool is defined Discovery Portability Typical use Provider function calling JSON Schema in each API request Sent with every call Tied to your code Direct API integrations, small systems LangChain tool Decorated Python or TypeScript function Passed to the agent constructor Any model LangChain supports Framework-based agents MCP server Separate process or remote service Client lists tools at connection Any MCP-compatible client Shared integrations across apps and teams AutoGPT Platform block Typed block in the platform's library Visual palette in the builder Within the AutoGPT platform Low-code agent assembly The convenience of MCP brings a risk that deserves emphasis. Connecting an agent to a third-party MCP server means letting someone else's code define tools your model will read and call. Tool descriptions are prompt text, and a malicious or compromised server can put instructions in them. In April 2025, the security firm Invariant Labs demonstrated what it called tool poisoning: an MCP tool whose description contained hidden instructions that caused an agent to read sensitive local files and pass their contents to the attacker through an innocent-looking parameter. Because the description is shown to the model but rarely to the user, the attack is invisible in normal use. The defences are the ones you would apply to any third-party dependency: use servers from sources you trust, pin versions so a description cannot change silently, review tool definitions when they change, and run untrusted servers with the least privilege possible. Chapter 9 returns to this in the broader context of prompt injection. Tools as the enforcement point The deepest reason to treat tools as contracts is that they are where policy becomes enforceable. A prompt can ask a model not to refund more than the order total. A tool can make it impossible. A prompt can ask the model not to email customers outside business hours, or not to modify records belonging to another tenant, or not to touch production during a code freeze. A tool can check the clock, the tenant ID or the freeze flag and refuse, with an error message explaining why. The pattern is to move every rule that can be stated precisely out of the prompt and into the tool, leaving the prompt to carry only the judgement that cannot be codified. Policies in prompts are suggestions to a probabilistic reader. Policies in tools are guarantees. Each one you move removes a class of failure from the system entirely, and it does so without depending on any property of the model. This applies with special force to the tools through which agents read the outside world, because there the inputs are not just unpredictable but potentially hostile. The next chapter takes up that case: giving an agent access to the web. Hashtags: #AgenticWorkflows #AutonomousAISystems #AIAgents #AgenticAI #LangChain #LangGraph #AutoGPT #ArtificialIntelligence #LargeLanguageModels #LLMAgents #AIOrchestration #WorkflowAutomation #IntelligentAutomation #ToolCalling #FunctionCalling #ModelContextProtocol #MCP #ReActAgents #PromptChaining #MultiAgentSystems #AgentArchitecture #AgentMemory #StateManagement #HumanInTheLoop #DurableExecution #PromptInjectionDefense #AgentReliability #AIEvaluation #AIEngineering #ProductionAI

  • Trademark Law and Brand Protection (Dilution, Parody, and Domain Disputes)

    Download the Book (PDF): Introduction In 2014 a company that makes rubber dog toys shaped like liquor bottles put a new product on the market. It was a squeaky vinyl bottle in the unmistakable shape of a Jack Daniel's whiskey bottle, with the familiar black label and filigreed lettering. But the label read "Bad Spaniels," the bottle promised "The Old No. 2 on Your Tennessee Carpet," and the fine print noted that the contents were "43% POO BY VOL." and "100% SMELLY." Jack Daniel's was not amused. What followed was more than a decade of litigation that went to the Supreme Court of the United States, came back down, produced a finding that the toy tarnished one of the most famous brands in the world, and then, in August 2026, ended with a federal appeals court directing judgment for the dog toy company. A dispute over a chew toy is an unlikely place to find the whole of modern trademark law, but it is all there. There is the question of whether consumers would think the whiskey maker had made or approved the toy, which is the question of likelihood of confusion. There is the separate question of whether, even without any confusion, the toy harmed the famous brand by associating it with dog waste, which is the question of dilution. There is the question of whether a joke at a brand's expense deserves special constitutional solicitude, which is the question of parody and the First Amendment. And hovering behind it is the question every brand owner eventually faces: how much enforcement is wise, and when does defending a mark begin to cost more than it protects? This book is about those questions. It is written for lawyers who advise companies on their brands, for in-house counsel and brand managers who make enforcement decisions, and for anyone who wants a clear account of how American law protects commercial identity. It concentrates on the four areas where the most consequential and most contested disputes now arise: the likelihood-of-confusion standard that sits at the center of infringement law; the slow erosion of a mark into a generic word, which lawyers call genericide; the special protection that famous marks receive against dilution; and the fights over internet domain names, which have their own statute, their own global arbitration system, and their own peculiar economics. Running through all of them is the tension between protecting a brand and allowing others to talk about it, criticize it, and make fun of it. The argument of this book A single idea connects these subjects, and it is worth stating plainly at the outset because it shapes the advice in every chapter. A trademark is not a piece of property in the way a house or a patent is. It is a relationship between a sign and the public's understanding of that sign. The law protects a mark because, and only to the extent that, the public uses it to identify where goods or services come from. Every major doctrine in this book is a way of asking whether that relationship is being damaged, and by whom. Likelihood of confusion asks whether a defendant's use would lead the public to misunderstand the source of goods. Genericide asks whether the public has stopped using the mark to identify a source at all, and started using it as the ordinary name for a kind of thing. Dilution asks whether the public's association between a famous mark and a single source is being weakened or soured. Cybersquatting law asks whether someone has registered an internet address in order to exploit the public's association between a name and a business. And the parody and First Amendment cases ask when a defendant's use of a mark is really a comment on the brand rather than an attempt to borrow its source-identifying power. It follows that the best brand protection is not the most aggressive. The lawyer who understands that a mark's legal value lives in public perception will spend more energy managing that perception, gathering evidence of it, and choosing fights that strengthen it, and less energy sending demand letters to comedians. Overreaching enforcement often damages the very thing it aims to protect: it produces unfavorable precedent, fee awards, public ridicule, and in some cases a court opinion declaring that the mark means less than its owner claimed. The Bad Spaniels litigation, which began as a straightforward attempt to stop a crude joke, ended with an appellate court holding that the whiskey maker had failed to prove any harm to its reputation at all. That is the book's argument: trademark rights are measured by meaning, the doctrines are tools for detecting injury to meaning, and practical brand protection is the discipline of building, documenting, and defending meaning while leaving room for the speech the law is designed to tolerate. What the chapters cover Chapter 1 lays the foundation. It explains what makes a sign capable of functioning as a trademark, the spectrum of distinctiveness from fanciful coinages to generic words, the role of registration, and the limits that keep trademark law from becoming a tool for monopolizing useful product features. Chapter 2 takes up the likelihood-of-confusion standard, the test that decides most infringement cases. It explains the multi-factor tests the federal circuits use, the kinds of confusion courts recognize, the role of consumer surveys, and a question now before the Supreme Court about whether the strength of a mark is for a judge or a jury to decide. Chapter 3 turns to genericide: how Aspirin, Thermos, and Escalator lost their status as brands, why Google did not, and what the Supreme Court's 2020 decision about Booking.com means for owners of descriptive and hybrid names. It ends with the practical discipline of usage management that keeps a successful brand from becoming a victim of its own success. Chapter 4 addresses dilution, the doctrine that protects famous marks against uses that cause no confusion but still threaten the mark's distinctiveness or reputation. It traces the idea from a 1927 law review article to the Trademark Dilution Revision Act of 2006 and explains why dilution claims succeed far less often than brand owners expect. Chapter 5 examines parody and the First Amendment: the Rogers v. Grimaldi test for expressive works, the Supreme Court's decision in Jack Daniel's Properties, Inc. v. VIP Products LLC, the aftermath in the lower courts, and the constitutional decisions that have reshaped what the government may refuse to register. Chapters 6 and 7 cover domain disputes. The first explains litigation under the Anticybersquatting Consumer Protection Act, including its bad-faith factors, its statutory damages, and its in rem jurisdiction over domain names themselves. The second explains the Uniform Domain-Name Dispute-Resolution Policy, the fast, cheap, and global arbitration system through which most domain disputes are actually resolved, along with the rights protection mechanisms attached to the newer generic top-level domains. Chapter 8 draws the threads together into an enforcement strategy. It covers remedies, including the Supreme Court's recent decisions on profits and extraterritorial reach, and it addresses the judgment calls that separate effective brand protection from what critics call trademark bullying. The conclusion considers what follows from all of this for a practitioner advising a brand today, and what remains unsettled. A word on scope The book is principally about United States federal law: the Lanham Act of 1946, as amended, and the cases interpreting it. State law matters at the edges, particularly for dilution and unfair competition, and it is noted where it does. Because brands travel and domain names are global, there are comparative notes on European Union law where the contrast illuminates the American approach. The law described is current as of late 2026. Trademark law has moved quickly in recent years, with four Supreme Court decisions touching the field since 2023 and a fifth case granted for decision, and a reader relying on any specific rule should confirm that it has not changed. This book is for education and orientation, not legal advice on any particular matter. One last observation before the substance. Trademark law is often taught as a dry set of registration rules and factor lists. In practice it is one of the most human areas of law. It turns on what ordinary people see, assume, and remember when they walk down a supermarket aisle or type a name into a browser. The judges who decide these cases are asking what the public thinks, and the lawyers who win them are the ones who can show it. That is the practical lesson under every chapter that follows. Chapter 1: What a Trademark Protects Every trademark dispute, however exotic its facts, eventually comes back to a simple question: what does this sign mean to the people who encounter it? Before a court can decide whether a competitor's name is confusingly similar, whether a famous brand has been diluted, or whether a domain name was registered in bad faith, it has to know what rights the plaintiff actually holds. Those rights are not defined by the owner's investment, its ambitions, or the size of its legal department. They are defined by the public's understanding. This chapter sets out the foundations: what a trademark is, how the law sorts signs by their capacity to identify a source, how registration works and what it adds, and the limits that stop trademark law from being used to monopolize things that should be free for everyone. Source identification as the core function A trademark is any word, name, symbol, or device, or any combination of them, that a person uses to identify and distinguish its goods from those of others and to indicate their source, even if that source is unknown. That definition, found in section 45 of the Lanham Act, 15 U.S.C. § 1127, contains the whole logic of the field. The sign matters only because it tells the public something about origin. A consumer who picks up a box of cereal marked with a familiar name does not need to know the corporate structure of the company behind it. What the consumer knows is that goods bearing this name come from a single, consistent source, and that the experience of the last box is a fair guide to the next. The law protects that function for two reasons that point in the same direction. The first is consumer protection. A shopper who relies on a mark should not be deceived into buying something from a different source. The second is producer protection. A business that invests in consistent quality and builds a reputation should be able to capture the benefit of that reputation rather than having it taken by imitators. Courts and scholars often describe this in economic terms: trademarks lower consumers' search costs, because a trusted mark lets a shopper skip the work of investigating every product afresh, and they give producers an incentive to maintain quality, because the reputation attached to the mark is an asset worth protecting. Service marks do the same work for services, collective marks for the goods or services of members of an organization, and certification marks for goods that meet a standard set by the certifier, such as a regional origin or a safety standard. The principles in this book apply to all of them, and for convenience the book uses "trademark" and "mark" to cover the family. The range of things that can serve as a mark is broad. Words and logos are the familiar cases, but the Supreme Court held in Qualitex Co. v. Jacobson Products Co. (1995) that a color alone can function as a mark if it has acquired secondary meaning, in that case the particular green-gold of dry-cleaning press pads. Product packaging, restaurant décor, the shape of a product, a sound, and even a scent have all been recognized as capable of identifying source. What unites them is the functional test: does the relevant public see the sign as saying "this comes from a particular source," or merely as decoration, description, or a useful feature? The breadth of subject matter is matched by a fundamental limit on scope. Trademark rights protect against uses that interfere with the source-identifying function. They do not give the owner control over every appearance of a word in the English language. The owner of APPLE for computers cannot stop a grocer from selling apples, and the owner of a mark cannot generally stop a competitor from using the mark to refer truthfully to the owner's product in comparative advertising. Much of the law explored in later chapters, from nominative fair use to parody, is the working out of that limit. The spectrum of distinctiveness Not every sign is equally capable of identifying a source. Some are coined words that mean nothing except the brand. Others are ordinary words that tell consumers something about the product and only gradually come to be associated with one producer. The courts sort word marks along a spectrum first articulated in its modern form by Judge Henry Friendly in Abercrombie & Fitch Co. v. Hunting World, Inc. (2d Cir. 1976), a case about the word "safari" for clothing. The categories remain the starting point for every analysis of a mark's validity and strength, and they differ in how protection is acquired and how strong it is, as Table 1 sets out. Table 1. The spectrum of distinctiveness for word marks. Category Relationship to product Illustrations Protection Fanciful Invented word with no prior meaning KODAK, EXXON, XEROX Inherently distinctive; strongest Arbitrary Real word unrelated to the product APPLE for computers, CAMEL for cigarettes Inherently distinctive; strong Suggestive Hints at a quality; requires imagination COPPERTONE for sunscreen, GREYHOUND for buses Inherently distinctive Descriptive Directly describes a quality or feature SHARP for televisions, a surname, a place name Only with secondary meaning Generic The common name of the product itself "aspirin," "escalator," "cellophane" Never protectable Fanciful and arbitrary marks are the easiest to protect. A coined word such as KODAK has no meaning except as a brand, so any use of it by another seller for related goods is almost certain to suggest a connection. An arbitrary mark takes a real word and applies it to something unrelated; the word "apple" tells you nothing about a computer, so when it appears on one, consumers understand it as a brand. Suggestive marks require a step of imagination to connect the mark to the product. COPPERTONE suggests the result of using a suntan product without describing the product itself. Suggestive marks are treated as inherently distinctive, which means they are protected from first use without proof that the public has come to associate them with a source. Descriptive marks directly describe a characteristic, quality, function, ingredient, or purpose of the goods. They are not protected on first use, because a competitor may need the word to describe its own product, and because consumers will at first read the word as information rather than as a brand. A descriptive term becomes protectable only when it acquires what the law calls secondary meaning or acquired distinctiveness: proof that the primary significance of the term in the minds of the relevant public is to identify a producer rather than the product. Surnames and geographic terms are treated similarly. McDONALD'S and FORD began as surnames and became marks through use. Generic terms, at the bottom of the spectrum, are never protectable. They are the ordinary names of the goods, and granting one seller exclusive rights in them would prevent competitors from telling consumers what they sell. The line between descriptive and generic, and the process by which a successful mark can slide from the protected categories into the generic one, is the subject of Chapter 3. The boundaries between these categories are contested in practice, and much turns on where a mark lands. The line between suggestive and descriptive is especially fought over, because it determines whether the owner must prove secondary meaning. Courts use several tests: whether the term requires imagination to connect to the product, whether competitors need the term to describe their own goods, and whether others in the industry actually use it descriptively. None is decisive, and reasonable judges disagree. What a practitioner should take from this is that the choice of mark at the outset has lasting consequences. A client who insists on a name that describes the product is choosing a mark that will be harder to register, harder to enforce, and weaker against similar names for as long as it is used. The advice to choose a distinctive name is the cheapest brand protection there is. Trade dress and its special rules The distinctiveness spectrum was designed for words. The Supreme Court has adapted it, not always smoothly, to trade dress: the overall look of a product or its packaging. In Two Pesos, Inc. v. Taco Cabana, Inc. (1992), the Court held that the festive décor of a Mexican restaurant chain could be inherently distinctive and protected without proof of secondary meaning. Eight years later, in Wal-Mart Stores, Inc. v. Samara Brothers, Inc. (2000), it drew a sharp line. Product design, the Court held, can never be inherently distinctive. Consumers are aware that even the most unusual product shapes are usually chosen to make the product more useful or appealing, not to identify its maker, so a design is protected only on proof of secondary meaning. Packaging, by contrast, can be inherently distinctive, and where the category is doubtful, courts are to err toward classifying the dress as product design and requiring secondary meaning. The distinction matters enormously to clients in fashion, furniture, consumer electronics, and any industry where the look of the product is part of its appeal. A company that launches a distinctive product shape cannot rely on trade dress law to stop immediate copying. It needs design patent protection, copyright where available, or time and investment to build secondary meaning. Trade dress is further limited by the functionality doctrine. A feature that is essential to the use or purpose of a product, or that affects its cost or quality, cannot be protected as a trademark, however strongly consumers associate it with one source. In TrafFix Devices, Inc. v. Marketing Displays, Inc. (2001), the Supreme Court held that a dual-spring design for keeping road signs upright in the wind was functional; the fact that the design had been claimed in an expired utility patent was strong evidence of functionality. The rule prevents trademark law, whose protection can last forever, from being used to extend the limited monopoly that patent law grants. Aesthetic functionality, a related doctrine, denies protection to features whose appeal is itself the reason consumers buy, such as a color that matches other products, although the courts have applied it cautiously. The Second Circuit's decision in Christian Louboutin S.A. v. Yves Saint Laurent America Holding, Inc. (2012) illustrates the balance. The court held that Louboutin's red lacquered outsole had acquired secondary meaning and was protectable, but only where the red sole contrasted with the rest of the shoe; it did not extend to an all-red shoe. Registration, use, and priority In the United States, trademark rights arise from use, not from registration. A business that adopts a distinctive mark and uses it in commerce acquires common-law rights in the geographic area where it trades and where its reputation extends. Federal registration on the Principal Register adds valuable benefits on top of those rights, but it does not create them from nothing. The benefits of registration are substantial. A registration provides nationwide constructive notice of the owner's claim and nationwide constructive use as of the application date, which freezes the rights of later users outside the owner's actual trading area. It creates a presumption that the mark is valid and that the registrant owns it and has the exclusive right to use it for the listed goods. It allows the owner to record the registration with U.S. Customs and Border Protection to stop infringing imports. It unlocks enhanced remedies against counterfeiters. And after five years of continuous use following registration, the owner can file a declaration making the registration incontestable. In Park 'N Fly, Inc. v. Dollar Park & Fly, Inc. (1985), the Supreme Court held that an incontestable registration cannot be challenged on the ground that the mark is merely descriptive. Incontestability does not, however, protect a mark against a claim that it is or has become generic, or that it is functional, or that it has been abandoned. Registration is obtained by application to the United States Patent and Trademark Office. An applicant can file on the basis of actual use or on the basis of a bona fide intent to use the mark, in which case registration issues only after use begins. The examining attorney reviews the application for compliance with the statute's bars, the most important of which prevents registration of a mark that so resembles a registered mark as to be likely to cause confusion, and another that bars registration of merely descriptive terms without proof of acquired distinctiveness. After examination the mark is published for opposition, and third parties may challenge it before the Trademark Trial and Appeal Board. The Supreme Court held in B&B Hardware, Inc. v. Hargis Industries, Inc. (2015) that the Board's likelihood-of-confusion decisions can have preclusive effect in later infringement litigation when the usages adjudicated are materially the same, which means opposition proceedings are no longer a low-stakes skirmish. The Trademark Modernization Act of 2020 added two procedures, expungement and reexamination, that let third parties challenge registrations for marks that were never used, or not used as of the relevant date, for some or all of the listed goods. These tools matter to practitioners because the register had become cluttered with overbroad and fraudulent filings, and a cluttered register makes clearance harder and more expensive for everyone. Registration also has constitutional limits of recent vintage. The Lanham Act once barred registration of disparaging marks and of immoral or scandalous marks. The Supreme Court struck down the first in Matal v. Tam (2017) and the second in Iancu v. Brunetti (2019), holding that both discriminated on the basis of viewpoint. In Vidal v. Elster (2024), however, the Court upheld the bar on registering a mark that consists of or comprises the name of a living individual without that person's consent, rejecting a challenge from an applicant who sought to register "Trump too small" for T-shirts. The Court reasoned that the names clause was viewpoint-neutral and fit within a long tradition of restricting trademarks that contain another person's name. Chapter 5 returns to what these decisions imply for the relationship between trademark law and free speech. Why the foundations matter to enforcement The foundations covered in this chapter might seem remote from the disputes in the rest of the book, but they shape every one of them. A mark's position on the distinctiveness spectrum is a major factor in the likelihood-of-confusion analysis, and it will be an important question in the Supreme Court's review of whether mark strength is for a judge or a jury, discussed in the next chapter. The line between descriptive and generic determines whether a mark can be lost altogether. The requirement that a mark be distinctive or famous is the first element of every cybersquatting claim. And the principle that trademark law protects source identification, not words as such, is the root from which the defenses for parody, commentary, and comparative advertising grow. The practical counsel is straightforward. At the outset, choose marks that sit high on the spectrum and clear them properly. Register them early and in every class where the business operates or plans to operate. Keep evidence of use, advertising, sales, and consumer recognition, because the day will come when the owner has to prove what the mark means to the public, and that proof is far easier to assemble from contemporaneous records than to reconstruct under the pressure of litigation. The strongest trademark portfolios are built by companies that treat the meaning of their marks as an asset to be documented, not merely asserted. Chapter 2: The Likelihood of Confusion The heart of trademark infringement is a prediction. The Lanham Act makes a defendant liable for using a mark in a way that "is likely to cause confusion, or to cause mistake, or to deceive." Section 32, 15 U.S.C. § 1114, applies that standard to registered marks, and section 43(a), 15 U.S.C. § 1125(a), extends it to unregistered marks, trade dress, and false suggestions of affiliation, sponsorship, or approval. The plaintiff does not have to show that anyone was actually confused, though evidence that someone was is powerful. It has to show that an appreciable number of ordinarily prudent purchasers are likely to be confused about the source of the goods or about the defendant's connection with the plaintiff. Because the standard is a prediction about the minds of consumers, it cannot be applied by a formula. Courts instead use lists of factors that bear on the probability of confusion, weigh them in light of the facts, and reach an overall judgment. This chapter explains those factor tests, the several forms of confusion that courts recognize, the evidence that actually decides cases, and a pending Supreme Court case that may reshape how the most important factor is decided. The multi-factor tests Every federal circuit has its own list of likelihood-of-confusion factors. The lists were developed independently, mostly in the 1960s and 1970s, and they vary in length and wording. They overlap far more than they differ, and a practitioner who understands one can work with any of them. The four most cited are compared in Table 2. Table 2. Leading likelihood-of-confusion tests. Test Court and year Number of factors Distinctive features Polaroid Corp. v. Polarad Electronics Corp. 2d Cir. 1961 8 "Bridging the gap"; quality of defendant's goods AMF Inc. v. Sleekcraft Boats 9th Cir. 1979 8 Marketing channels; likelihood of expansion Interpace Corp. v. Lapp, Inc. 3d Cir. 1983 10 Designed for non-competing goods In re E. I. du Pont de Nemours & Co. C.C.P.A. 1973 13 Used by the USPTO and the Trademark Trial and Appeal Board The factors common to nearly every list are these: the strength of the plaintiff's mark; the similarity of the marks; the relatedness or proximity of the goods; the channels of trade and marketing; the degree of care purchasers exercise; the defendant's intent in adopting its mark; and evidence of actual confusion. Some tests add the likelihood that the plaintiff will expand into the defendant's market, which the Second Circuit calls "bridging the gap," and some add the quality of the defendant's goods, on the theory that a senior user's reputation is at particular risk if it is associated with shoddy products. Courts repeatedly say that the factors are not a mathematical scorecard. The weight of each depends on the case, and a single factor can dominate. In practice, a few factors carry most of the load. Similarity of the marks is usually the first and most important. Courts compare the marks in their entireties as consumers encounter them, considering sight, sound, and meaning, rather than dissecting them letter by letter. A mark that shares a dominant element with another may be confusingly similar even if the full marks differ; conversely, a shared descriptive or common element may count for little. Context matters too. The same words presented in a distinctive house style, alongside a well-known house mark, may be less likely to confuse than the words standing alone. Relatedness of the goods asks whether consumers would expect the goods to come from the same source. The goods need not compete. A consumer might reasonably expect a clothing brand to license sunglasses or a soft-drink company to sponsor a sports event. The question is whether the public would plausibly assume a connection, and it is increasingly answered with evidence of how brands in the relevant industry actually expand and license. Strength of the mark has two dimensions. Conceptual strength is the mark's place on the distinctiveness spectrum described in Chapter 1. Commercial or marketplace strength is the degree of public recognition the mark has actually achieved. A strong mark receives a broader scope of protection, because consumers who know it well are more likely to assume that a similar mark on related goods comes from the same source. A weak mark, especially one surrounded by similar third-party marks, receives a narrow scope; consumers accustomed to seeing many similar names learn to distinguish them by small differences. Intent can be decisive when the evidence shows deliberate copying. Courts reason that a defendant who set out to trade on another's goodwill probably succeeded, and in some circuits an intent to confuse raises a presumption of likely confusion. But knowledge of a plaintiff's mark is not the same as intent to confuse, and a defendant that adopts a mark intending to parody, comment on, or compare itself to the plaintiff has an intent that points away from confusion, not toward it. Actual confusion is the best evidence that confusion is likely, and its absence after a long period of side-by-side use can be persuasive evidence that it is not. Anecdotal evidence, such as misdirected emails, customer complaints, or misplaced orders, is admissible but is often discounted if it is sparse or reflects inattention rather than genuine confusion about source. The kinds of confusion The classic infringement case involves point-of-sale confusion about source: a shopper buys the defendant's product believing it to be the plaintiff's. The Lanham Act's amendments in 1962 and 1988 broadened the statute's language, and the courts have recognized several other forms of actionable confusion. Sponsorship or affiliation confusion occurs when consumers know the defendant made the product but believe the plaintiff sponsored, licensed, or approved it. This is the form most at issue in merchandising, parody, and co-branding cases, and it is where the law is most contested. A consumer who sees a university's colors on a T-shirt may or may not assume the university licensed it, and the answer depends heavily on evidence of what consumers actually believe about licensing practices. Initial interest confusion occurs when a defendant uses a plaintiff's mark to capture a consumer's initial attention, even though the consumer realizes the true source before buying. The Ninth Circuit gave the doctrine its most famous formulation in Brookfield Communications, Inc. v. West Coast Entertainment Corp. (1999), which likened the use of a competitor's mark in website metadata to posting a misleading billboard on a highway that diverts drivers to a different store. The doctrine has since been significantly narrowed. In Network Automation, Inc. v. Advanced Systems Concepts, Inc. (2011), the Ninth Circuit held that the purchase of a competitor's mark as a search-advertising keyword was not infringing where the resulting advertisements were clearly labeled and consumers were sophisticated, and in Multi Time Machine, Inc. v. Amazon.com, Inc. (2015) it held that a search-results page listing clearly labeled competing products did not create a likelihood of confusion as a matter of law. The trend across the circuits is to ask whether the consumer is genuinely confused at any point, rather than merely distracted or offered an alternative. Post-sale confusion occurs when the purchaser is not confused but observers who see the product later are. The doctrine is most often applied to luxury goods and distinctive designs, where the harm is that knock-offs seen in public erode the prestige and exclusivity of the original. The Sixth Circuit applied it in Ferrari S.p.A. Esercizio Fabbriche Automobili e Corse v. Roberts (1991) to fiberglass kits that turned ordinary cars into replicas of Ferrari designs. Reverse confusion inverts the usual story. A large junior user saturates the market with a mark, and consumers come to believe that the smaller senior user's goods come from the larger company. The senior user loses control of its identity and may even be thought an infringer of the very mark it adopted first. The Tenth Circuit's decision in Big O Tire Dealers, Inc. v. Goodyear Tire & Rubber Co. (1977), in which Goodyear's national "Bigfoot" campaign swamped a small tire dealer's prior use of the same name, remains a leading illustration, and the Third Circuit set out an adapted factor analysis for reverse-confusion claims in A&H Sportswear, Inc. v. Victoria's Secret Stores, Inc. (2000). Reverse confusion matters to large brand owners as much as to small ones, because it is the claim a large company faces when it launches a new brand without proper clearance. Evidence: what actually wins cases Although the factors are framed as legal considerations, confusion is a question about consumer perception, and cases are won and lost on evidence of that perception. Three kinds of evidence dominate. Surveys. A well-designed consumer survey is often the most persuasive evidence of likely confusion or its absence. Two formats dominate. The Eveready format, named after the Seventh Circuit's decision in Union Carbide Corp. v. Ever-Ready Inc. (1976), shows respondents the defendant's product and asks open-ended questions about who makes it and whether it is connected with any other company. It is widely regarded as the gold standard where the plaintiff's mark is strong and well known, because respondents' spontaneous identification of the plaintiff is strong evidence that the defendant's product calls it to mind. The Squirt format, from the Eighth Circuit's decision in SquirtCo v. Seven-Up Co. (1980), presents the two marks together or in close sequence and asks whether they come from the same or related sources. It is often used where the plaintiff's mark is weaker or the goods are sold side by side, and it is criticized for suggesting a connection that respondents would not otherwise draw. Surveys need a proper control, a stimulus identical to the test stimulus except for the allegedly infringing feature, so that background noise can be subtracted from the result. They need the right universe of respondents, meaning prospective purchasers of the defendant's goods in most forward-confusion cases. Courts frequently reduce the weight given to a survey because of flaws in the universe, the stimulus, the control, or the questions, and a survey that is excluded or discounted can be worse than none, since it invites the inference that the party could not produce better evidence. Marketplace evidence. Evidence of how the goods are actually sold, advertised, and encountered is increasingly central. Screenshots of online listings, photographs of retail shelves, evidence of third-party use of similar marks, and records of the plaintiff's licensing practices all bear on how consumers perceive the marks in real conditions. Third-party registrations and uses are particularly important in establishing that a mark is weak. A defendant who can show dozens of similar marks on related goods can often persuade a court that consumers are used to distinguishing among them. Documents and testimony about intent. Internal documents showing how the defendant chose its mark, what it knew about the plaintiff, and whether it considered and rejected alternatives because of the risk of conflict often carry more weight with a fact-finder than any expert. A clean clearance record is a defendant's best protection; an email proposing to "get as close as we can" to a competitor's name is a plaintiff's best exhibit. Who decides mark strength: a question before the Supreme Court The likelihood-of-confusion analysis is generally treated as a question of fact, reviewed on appeal for clear error, although some circuits treat the ultimate conclusion as a mixed question or as a matter of law when the underlying facts are undisputed. The practical significance is that a fact question must ordinarily go to the jury in a case where a jury has been demanded, while a question of law can be resolved by the judge on summary judgment. That distinction is at the center of RiseandShine Corp. v. PepsiCo, Inc., No. 24-1016, which the Supreme Court agreed to hear in the summer of 2026. RiseandShine sells canned cold-brew coffee under the RISE mark. PepsiCo launched an energy drink under the name MTN DEW RISE ENERGY. The district court granted RiseandShine a preliminary injunction in 2021, finding that its mark was conceptually strong. In 2022 the Second Circuit reversed, holding that the RISE mark was conceptually weak for a caffeinated morning beverage because of the word's obvious associations with waking up and energy. The district court then granted summary judgment to PepsiCo, and the Second Circuit affirmed in an unpublished order in December 2024. The question presented is whether the strength of a mark is a question of fact in the likelihood-of-confusion analysis. The petitioner argues that the Second Circuit stands alone in treating conceptual strength as a question of law that a court may decide for itself, and that the other circuits treat distinctiveness as a factual question about consumer perception. The case is scheduled for decision in the October 2026 Term. The stakes are practical. If conceptual strength is a question of law, defendants will more often be able to end cases at summary judgment by persuading a judge that the plaintiff's mark is merely suggestive or descriptive and therefore entitled to narrow protection. If it is a question of fact, plaintiffs with arguably weak marks will more often get to a jury, and the settlement value of their claims will rise. The case also has a conceptual dimension that connects to the argument of this book. If mark strength is a measure of what the public perceives, it is difficult to see why a judge's view of the dictionary should settle it, and a ruling that treats it as factual would push litigants further toward evidence of actual public understanding. Whatever the Court decides, a practitioner advising a client with a mark near the descriptive end of the spectrum should build the record of marketplace strength, through sales figures, advertising, unsolicited media coverage, and surveys, because it is that record, rather than argument about the word itself, that will carry the day. Defenses built into the confusion analysis Two defenses sit so close to the confusion inquiry that they belong in this chapter. The first is classic or descriptive fair use, codified in section 33(b)(4), 15 U.S.C. § 1115(b)(4), which permits the use of a term "otherwise than as a mark" to describe the defendant's own goods fairly and in good faith. In KP Permanent Make-Up, Inc. v. Lasting Impression I, Inc. (2004), the Supreme Court held that a defendant asserting this defense does not bear the burden of disproving confusion, and that some degree of confusion is compatible with fair use. A sunscreen maker may say its product protects "all day" even if another company owns ALL DAY as a mark, so long as it uses the words descriptively and in good faith. The second is nominative fair use, which permits a defendant to use the plaintiff's mark to refer to the plaintiff's own goods, as in "repairs for Volkswagen vehicles" or "compatible with iPhone." The Ninth Circuit framed the doctrine in New Kids on the Block v. News America Publishing, Inc. (1992): the product must not be readily identifiable without the mark, only so much of the mark may be used as is reasonably necessary, and the user must do nothing to suggest sponsorship or endorsement. The circuits disagree about whether nominative fair use is an affirmative defense or a modification of the confusion test, but they agree on its substance. It is the doctrine that allows resellers, repair shops, comparative advertisers, and journalists to name the brands they deal with, and it becomes important again in the domain-name chapters, because a domain name that uses a brand to identify a genuine reseller or fan site may be legitimate under the same reasoning. Both defenses rest on the same foundation as everything else in this chapter. The law protects the mark's function of identifying source. When a defendant uses the words for some other purpose, to describe its own goods or to refer to the plaintiff's, and does so honestly, there is no injury to that function, and so there is no infringement. Chapter 3: Genericide and the Defense of a Successful Name The most dangerous threat to a famous brand is often not a counterfeiter or a competitor. It is the brand's own success. A product that creates a new category, or dominates it so thoroughly that its name becomes shorthand for the category, runs the risk that the public will stop hearing the name as a brand and start hearing it as the ordinary word for the thing. When that happens, the law takes the mark away. Aspirin, cellophane, escalator, thermos, yo-yo, trampoline, and zipper were all once brands. Each became the common name of a product, and each passed into the public domain for anyone to use. This process, which lawyers call genericide, is the purest illustration of the principle that trademark rights live in public perception. The owner may have spent fortunes promoting the mark, may hold an incontestable registration, and may have policed infringers diligently. None of that matters if the relevant public now uses the word to mean the product rather than the producer. This chapter explains how the law decides whether a mark has become generic, traces the leading cases from Aspirin to Booking.com, and sets out the practical discipline that successful brands use to avoid the fate. Why the law takes generic words away The rule that generic terms cannot be trademarks is not a punishment for success. It follows from the purpose of trademark law. A trademark is protected because it tells consumers who made a product. A generic term tells consumers what the product is. If one seller could monopolize the common name of a product, its competitors would be unable to tell customers what they were selling, and consumers would be forced to learn awkward circumlocutions. A rival maker of acetylsalicylic acid tablets that could not call them aspirin, in a market where everyone asked for aspirin, would be at a disadvantage having nothing to do with the quality of its product. For that reason, genericness is a complete defense to infringement and a ground for cancelling a registration at any time, even after it has become incontestable. Section 14(3) of the Lanham Act, 15 U.S.C. § 1064(3), provides that a petition to cancel may be filed at any time if the registered mark becomes the generic name for the goods or services for which it is registered. The primary significance test The central question is how the relevant public understands the term. The standard formulation comes from Learned Hand's opinion in Bayer Co. v. United Drug Co. (S.D.N.Y. 1921): the question is what buyers understand by the word for whose use the parties are contending. Bayer had introduced acetylsalicylic acid in the United States under the name Aspirin, and for years the drug was protected by patent, so the name was the only word most people knew for it. When the patent expired and competitors entered, the public, especially ordinary retail buyers, knew the product only as aspirin. Hand held that as to those consumers the word had become generic, while noting that among manufacturers, physicians, and pharmacists, who knew the chemical name, it might still function as a brand. The split result illustrates that genericness is assessed by reference to the relevant public, which is the purchasing public for the goods in question. The Supreme Court endorsed the approach in Kellogg Co. v. National Biscuit Co. (1938), holding that "shredded wheat" had become the generic name of a cereal product formerly protected by patent, and that to establish a trademark the plaintiff had to show that the primary significance of the term in the minds of the consuming public was not the product but the producer. That phrase, primary significance, became the governing test. Congress wrote the test into the statute after a Ninth Circuit decision seemed to depart from it. In Anti-Monopoly, Inc. v. General Mills Fun Group, Inc. (1982), the court held MONOPOLY generic for a board game, relying on a survey that asked whether respondents bought the game because they wanted a Parker Brothers product or because they wanted to play Monopoly. Most said the latter, and the court treated that as proof that the word identified the game rather than the producer. Critics pointed out that the survey confused the question of what a consumer wants with the question of what the word means; most people who ask for a brand-name product want it because of what it is. The Trademark Clarification Act of 1984 amended section 14(3) to provide that the primary significance of the registered mark to the relevant public, rather than purchaser motivation, is the test, and that a mark does not become generic merely because it is also used as the name of a unique product. Cases that went each way The history of genericide is a series of lessons about how brands are lost and how they are saved. DuPont Cellophane Co. v. Waxed Products Co. (2d Cir. 1936) held that "cellophane" had become generic. DuPont had used the word as the only name for its transparent wrapping film, advertised it heavily as a product, and never offered consumers an alternative generic name. The public had no other word for the material, so the brand became the name. King-Seeley Thermos Co. v. Aladdin Industries, Inc. (2d Cir. 1963) held that "thermos" had become generic for vacuum-insulated bottles among the general public. The company had at one time actively encouraged the generic use of the word, and by the time it began to police usage, the public had adopted it. Survey evidence showed that a large majority of respondents knew the product only as a thermos. The court allowed competitors to use "thermos" in lower case but required them to avoid the capitalized form and the words "original" and "genuine," a compromise that shows how courts sometimes try to preserve some residual source significance. The Otis Elevator Company lost ESCALATOR in a 1950 decision of the Commissioner of Patents, Haughton Elevator Co. v. Seeberger, in large part because Otis itself had used the word generically in its own patents and advertisements, describing its product as "an escalator" rather than as an ESCALATOR brand moving stairway. The Seventh Circuit reached a similar result for YO-YO in Donald F. Duncan, Inc. v. Royal Tops Manufacturing Co. (1965), noting that Duncan's own advertising had used the word as the name of the toy. Against these losses stand notable survivals. DuPont, having learned from cellophane, took a different approach when it introduced TEFLON. It paired the mark with the generic term "PTFE" or "nonstick coating" and policed usage aggressively. When a competitor challenged the mark in E. I. DuPont de Nemours & Co. v. Yoshida International, Inc. (E.D.N.Y. 1975), DuPont's survey asked respondents to classify a list of terms as brand names or common names, after first explaining the difference with examples. A clear majority identified TEFLON as a brand. The format, now called the Teflon survey, became the standard method for testing genericness where a mark is well known. The most prominent modern challenge was to GOOGLE. In Elliott v. Google, Inc. (9th Cir. 2017), the plaintiffs, who had registered hundreds of domain names combining "google" with other words, argued that the mark had become generic because people use "google" as a verb meaning to search the internet. The Ninth Circuit rejected the argument. Verb use, the court held, does not by itself establish genericness, because a person can use a brand name as a verb while still understanding that it identifies a particular search engine. The question is not whether the word is used as a verb but whether the primary significance of the word to the public is as the name of a type of search engine rather than as the name of a particular one. The plaintiffs had no evidence of that, and Google's survey evidence showed that most people understood GOOGLE as a brand. The decision is important for companies whose names have become verbs. It confirms that everyday phrases such as "google it," "photoshop the picture," or "xerox the memo" are not in themselves fatal, provided the public still recognizes the underlying mark as a brand. It is not a license to ignore the problem, however. Verb use is a leading indicator that a brand is drifting toward the category name, and the companies whose marks have survived that drift have typically worked hard to arrest it. Booking.com and the generic-plus-domain problem The Supreme Court's most recent pronouncement on genericness came in United States Patent and Trademark Office v. Booking.com B.V. (2020). The USPTO had refused to register BOOKING.COM for online hotel reservation services, reasoning that "booking" was generic for those services and that adding the top-level domain ".com" to a generic term produced a term that was also generic. The Office relied on the Supreme Court's nineteenth-century decision in Goodyear's India Rubber Glove Manufacturing Co. v. Goodyear Rubber Co. (1888), which held that adding "Company" to a generic term did not make it a trademark. The Court, in an opinion by Justice Ginsburg, rejected the USPTO's per se rule. Whether a term is generic, the Court held, depends on its meaning to consumers. A compound term of the form "generic.com" is generic only if consumers perceive it as the name of a class of services, and here the lower courts had found, on the basis of survey and other evidence, that consumers perceived BOOKING.COM as a brand. Because only one entity can hold a particular domain name at a time, a "generic.com" term may convey to consumers an association with a particular website. Justice Breyer dissented, warning that the decision would allow owners of such marks to harass competitors using similar descriptive names. The majority addressed that concern by stressing that the scope of protection for such a mark would be narrow. Because BOOKING.COM is weak, close variations such as "ebooking.com" or "hotel-booking.com" would be less likely to cause confusion, and classic fair use would permit competitors to describe their services using the word "booking." The decision, in other words, makes registration of these marks possible but leaves them thin. For practitioners the lessons are twofold. First, the genericness inquiry is empirical. The Court emphasized consumer perception and accepted survey evidence, while cautioning in a footnote that surveys must be evaluated carefully and are not the only relevant evidence; dictionary definitions, usage by competitors and the media, and the applicant's own usage all matter. Second, a descriptive or quasi-generic brand is a fragile asset. A client building a business on a name like BOOKING.COM should invest early in secondary meaning and in evidence of it, and should expect to enforce the mark only against close copies. The Federal Circuit added a related point in Bullshine Distillery LLC v. Sazerac Brands, LLC (2025). A competitor sought to cancel the FIREBALL registration for cinnamon whisky, arguing that "fireball" had long been the generic name for a spicy cocktail and so could never function as a brand. The court rejected a rule of "once generic, always generic" and held that the relevant question for a registration's validity is how the public understood the term at the time of registration, not how the word was used in some earlier era. Genericness, on this view, is a matter of what a word means now to the relevant public, and meaning can change in either direction. A term that was once generic can become a brand, just as a brand can become generic. Comparative note: the European approach European Union law reaches a similar result by a somewhat different route. Under the EU Trade Mark Regulation, a registered mark may be revoked if, in consequence of the acts or inactivity of the proprietor, it has become the common name in the trade for a product or service in respect of which it is registered. The emphasis on the owner's conduct means that an owner who has taken reasonable steps to prevent generic use is better placed than under a pure consumer-perception test. The Court of Justice of the European Union held in Backaldrin Österreich The Kornspitz Company GmbH v. Pfahnl Backmittel GmbH (2014) that the relevant class for assessing whether KORNSPITZ had become a common name included end consumers, not only the bakers who bought the baking mix, and that a proprietor's failure to encourage sellers to indicate that the name was a trademark could amount to inactivity. The ruling reinforces a point that applies equally in the United States: a brand owner's obligations extend to the way intermediaries present the mark to the ultimate consumer. The discipline of usage management Genericide is not an event but a process, and it can be managed. The companies that have kept famous marks through decades of market dominance have done so by consistent, sometimes tedious, discipline. The core practices are well established. 1. Pair the mark with a generic name. A brand should always appear with a noun that names the product: VASELINE petroleum jelly, BAND-AID brand adhesive bandages, VELCRO brand fasteners, KLEENEX tissues. Giving the public a generic alternative is the single most important defense, because genericide happens most readily when consumers have no other word for the thing. Johnson & Johnson changed its long-running advertising jingle to say "I am stuck on Band-Aid brand" precisely to reinforce the distinction, and Velcro Companies released a humorous video in 2017 urging customers to say "hook and loop" instead of using the brand as a noun. 1. Use the mark as an adjective, never as a noun or verb. Internally and externally, the mark should modify the generic term. "Make a XEROX copy" is better than "make a xerox." Xerox has for many years run print advertisements reminding writers and editors that its name is a brand and should not be used as a verb. 1. Distinguish the mark typographically. Capital letters, a distinctive typeface, and the registration symbol all signal to readers that the word is a brand. 1. Police third-party usage without overreaching. Owners should monitor media, dictionaries, competitors, and online marketplaces and correct generic use, usually with polite letters rather than litigation. Dictionary publishers often respond to evidence that a term is a trademark by adding a notation, which can later be useful evidence. The aim is not to stop every casual use in conversation, which is impossible and would make the owner look foolish, but to prevent the adoption of the mark as the category name by the trade, the press, and competitors. 1. Control the owner's own usage. Aspirin, escalator, and yo-yo were lost partly through their owners' own generic use. Marketing teams, product managers, and even patent drafters must be trained to use the mark properly, because an owner's own documents are among the first exhibits a challenger will seek. 1. Gather evidence before it is needed. A brand owner with a dominant product should periodically commission genericness surveys, document its enforcement efforts, and archive examples of proper usage in the media. When a challenge comes, as it did for Google, the owner that can produce years of evidence will be in a far stronger position than one scrambling to commission a survey after the complaint is filed. The practical tension is between marketing, which wants the brand to become synonymous with the category, and law, which punishes it for doing so. The resolution is not for lawyers to stop marketers from building a dominant brand, but to ensure that the dominance is expressed as "the leading brand of X" rather than "the name for X." The public can be taught to ask for a KLEENEX tissue; it cannot easily be taught to stop asking for a kleenex once the habit is formed. Genericide is one of the few areas of trademark law where preventive discipline is far cheaper than any cure, and where a brand's owner has almost complete control over the outcome if it acts early enough. Hashtags: #TrademarkLawAndBrandProtection #TrademarkLaw #BrandProtection #IntellectualProperty #TrademarkRights #TrademarkInfringement #TrademarkDilution #TrademarkParody #DomainDisputes #Cybersquatting #TrademarkRegistration #LanhamAct #LikelihoodOfConfusion #ConsumerConfusion #TrademarkDistinctiveness #Genericide #FamousTrademarks #DilutionByBlurring #DilutionByTarnishment #TrademarkFairUse #FirstAmendment #BrandIdentity #TradeDress #TrademarkEnforcement #TrademarkLitigation #DomainNameProtection #ACPA #UDRP #TrademarkDisputes #BrandEnforcement

  • Smart Textiles (Conductive Yarns and Washable Electronics)

    Download the Book (PDF): Introduction In April 2023 a small number of denim jackets stopped being smart. They were the Levi's Commuter Trucker jackets built with Google's Jacquard technology, first sold in 2017, which let a cyclist brush or tap a woven patch on the cuff to skip a song or take a call. The fabric still worked. The conductive threads in the cuff still carried current. What ended was the companion app: Google announced that support would stop on 24 April 2023, and with it the jackets lost the only thing that made them more than jackets. A backpack made with Saint Laurent, another with Samsonite and a football insole made with Adidas went the same way. It is a strange way for a piece of clothing to fail, and it is a useful place to begin, because it shows how many separate things have to keep working for a garment to stay smart. The yarn has to conduct. The joint between yarn and electronics has to hold. The battery, radio and processor have to survive sweat, friction and being thrown in a washing machine, or else be removed every time. And above all of that sits a layer of software and business decisions that the fabric cannot control. A jacket is expected to last for years. A circuit board, a connector and an app are each on their own clock. This booklet is about the engineering that lives between those clocks. Its subject is the class of garments that sense, carry or process electrical signals: shirts that record the heart's electrical activity, compression sleeves that measure the bending of a joint, socks that track pressure under the foot, base layers that estimate breathing from the stretch of the ribcage. The field calls them smart textiles or e-textiles, and it has been promising them to the public for more than two decades. Some have reached the market and stayed there, mainly in elite sport, military research, space medicine and clinical monitoring. Many more have arrived with publicity and left quietly. The argument The argument of this booklet is simple to state and hard to act on. A smart garment succeeds or fails not on how well it conducts on the first day, but on whether its conductors, its joints and its data survive the body and the wash for the life of the garment. Conductivity is the easy part. There are dozens of ways to make a thread carry current, and laboratories publish new ones every month. The difficult part is keeping that current path intact while the fabric stretches by a third, rubs against itself thousands of times an hour, soaks in salty sweat, and then spends an hour being tumbled in hot alkaline water with a load of towels. Nearly every important design decision in the field follows from that one fact. It explains why the most interesting conductor of the past fifteen years, the silver nanowire, is valued less for its raw conductivity than for the way a network of wires can be embedded in rubber and pulled without breaking. It explains why so much of the effort in a real product goes into the few centimetres where soft fabric meets a hard electronics module, because that is where nearly everything breaks. It explains why athletes, who sweat more, move harder and wash their kit more often than anyone else, are both the most valuable early users and the most punishing test. And it explains why the washing machine deserves a chapter of its own. Why athletes The booklet leans on elite sport for its examples, for three reasons. First, sport is where smart garments have found paying customers who use them repeatedly. Professional football, rugby, basketball and endurance programmes already collect heart rate, movement and training load every day, and many have tried shirts with built-in electrodes. Second, athletes are an extreme case. A shirt that works for a sprinter in a summer training camp will usually work for an office worker. The reverse is rarely true. Third, sport forces honest questions about what a measurement is for. A coach does not want a stream of numbers; a coach wants to know whether a player should train hard today, and a medical officer wants to know whether a runner is heading towards heat illness. Measurements that do not change such decisions are a cost, not a benefit, however elegant the fabric. The same discipline applies beyond sport. A shirt that records the heart rhythm of a patient at home faces the same sweat, the same stretching and the same laundry. The clinical stakes are higher and the regulatory path longer, but the physics is identical. What the booklet covers, and what it leaves out The chapters move from the material outward. The first explains why fabric and circuitry are natural enemies, mechanically and chemically, and why the body is a harsh environment for electronics. The second surveys the conductive yarns available today, from silver-plated nylon to stainless steel staple fibre, and explains how the structure of a yarn changes its electrical behaviour. The third is devoted to silver nanowires: how they are made, why a random network of them conducts, and how embedding them in elastomers lets a conductor stretch. The fourth deals with construction: weaving, knitting, embroidery, printing and lamination, and the interconnects that join soft circuits to hard electronics. The middle of the booklet turns to the body. The fifth chapter explains how textiles sense the heart, breathing, movement and temperature, and what physical effects corrupt those signals. The sixth follows the data into elite sport, looking at validation studies, the estimation of quantities such as core body temperature, and the rules professional leagues have written about who may use athlete data and for what. The last two chapters face the laundry. The seventh treats washing as an engineering load case, describing what actually breaks in a machine and why. The eighth covers testing, the international standards that now exist for e-textile washing durability, and the design choices that follow from taking durability seriously from the first sketch. Some things are deliberately left out. Energy harvesting from body heat or motion, light-emitting fabrics, textile antennas and fashion-led interactive garments are real fields with their own literature, but they would dilute the central argument. So would a catalogue of every start-up that has made a smart shirt. Companies come and go quickly in this field, and naming them invites the same fate as the Jacquard jacket: the text ages faster than the ideas. Products appear here when they teach something. A note on evidence The field moves fast and its marketing moves faster. Claims of "washable" or "medical-grade" are often made without saying washable how many times, under what conditions, or to what failure criterion. Wherever a number appears in what follows, it comes from a published study, a standard or a manufacturer's own technical statement, and the source is named. Where good numbers do not exist, the text says so. That honesty matters, because one of the things this booklet argues is that the field's progress depends on reporting durability as rigorously as it reports conductivity. A reader who finishes should be able to look at any smart garment, whether a product on a shelf or a prototype in a lab, and ask the questions that decide whether it will still work after the fiftieth wash: where the current flows, where the stiffness changes, what happens when it gets wet, and who decides when it stops being smart. Chapter 1: Why Fabric and Circuits Disagree Put a printed circuit board and a T-shirt side by side and they look like opposites, which is because they are. A circuit board is designed to hold things still. Its copper traces are a few tens of micrometres thick, bonded to a glass-fibre laminate that barely flexes, and the components soldered to it are rigid blocks whose leads would crack if the board bent repeatedly. A T-shirt is designed to move. Its knitted loops slide over one another so that the fabric can stretch, shear and drape around a curved, changing body. Every useful property of clothing, from comfort to fit to the way a sleeve follows an elbow, comes from the freedom of fibres to shift relative to each other. Every useful property of a circuit comes from components that never shift at all. Smart textiles exist in the space between those two philosophies, and the first job of anyone working in the field is to understand exactly how wide that space is. The gap is partly mechanical and partly chemical, and both halves decide where things break. How fabric moves A fabric is not a sheet of material in the way a plastic film is. It is a structure made of fibres twisted into yarns and yarns interlaced or interlooped into cloth. Its mechanical behaviour comes far more from that structure than from the stiffness of the fibres themselves. A polyester fibre is fairly stiff along its length. A polyester knit is soft and stretchy, because when you pull it, the loops first straighten and slide, the yarns rotate at their crossing points, and only at large extensions do the fibres themselves begin to carry significant load. Woven fabrics, in which two sets of yarns cross at right angles, are stiff along the yarn directions and much softer on the diagonal, where the crossing yarns can scissor. That is why a woven shirt drapes but does not stretch much unless elastane is added. Knitted fabrics, built from interlocking loops, can extend easily in both directions. A compression garment of the kind athletes wear typically combines nylon or polyester with a substantial fraction of elastane so that it can be pulled on and then holds the body firmly while moving with it. The strains involved are large by electronic standards. Skin over the knee or elbow lengthens substantially when the joint bends, and the fabric over it must follow or the garment pulls and slips. A compression shirt worn by a rower or a basketball player is stretched across the back and shoulders every time the arms reach forward. Tens of percent of strain, applied thousands of times in a session, are normal working conditions for clothing. A copper trace on a circuit board, by contrast, will crack after a fraction of a percent of strain if it is cycled repeatedly. Bulk metals simply do not tolerate that kind of deformation for long. There is a second, subtler kind of motion. Fabric bends around very small radii. A collar folds sharply, a cuff is crumpled into a ball in a gym bag, a garment is wrung and tumbled in a washing machine. Bending a conductor puts its outer surface in tension and its inner surface in compression, and the strain at the surface depends on how thick the conductor is relative to the bend radius. A thin conductor survives tight folds that would crack a thick one. This is one reason the field has gravitated towards very fine filaments, thin coatings and nanoscale conductors: thinness buys bendability. Finally, fabric rubs. Yarns abrade against each other at every crossing point, the garment rubs against skin, against other clothing, against a backpack strap or a seat. In a washing machine, every surface is scraped against every other surface for an hour. Abrasion removes coatings, frays fibres and slowly wears through anything sitting on the surface. A conductive layer that is perfectly stable on a laboratory bench can vanish under abrasion that a normal shirt barely notices. How circuits fail Electronic engineers already know a great deal about mechanical failure. The relevant knowledge comes mostly from the reliability of solder joints, connectors and flexible circuits, and three lessons from that body of work carry over directly. The first lesson is fatigue. A metal that is bent once a little way will spring back. A metal bent repeatedly, even within its elastic range, accumulates microscopic damage and eventually cracks. The number of cycles it survives falls steeply as the strain amplitude rises. Wires in headphone cables break near the plug for exactly this reason: that is where they flex most, most often. In a garment, the equivalent flex points are everywhere. The second lesson is that failures concentrate where stiffness changes. When a soft material is joined to a hard one and the assembly is bent or stretched, the soft part deforms and the hard part does not. The strain does not fade gradually across the joint; it piles up at the boundary. A cable that enters a plug without a strain-relief boot fails at the plug. A flexible circuit fails at the edge of a stiffener. The general rule, which reviewers of e-textile washing tests have restated in their own vocabulary, is that weak points are contacts between different materials and components, especially where there is a high stiffness gradient, and transition areas within the same material. The third lesson is that moisture and ions are lethal. Electronics are designed to operate dry. Water alone is a modest threat, but water carrying dissolved salt becomes an electrolyte. It lets current leak between conductors that should be isolated, and it drives corrosion. When two conductors at different voltages sit close together in a damp, salty film, metal ions can dissolve from one and migrate towards the other, growing thin filaments that eventually short the circuit. This electrochemical migration is a well-known failure mechanism in ordinary electronics exposed to humidity. In a garment soaked with sweat, the conditions are far more aggressive. It helps to put rough numbers on the bending problem, because they explain why the field is obsessed with thinness. When a straight conductor of thickness t is bent around a radius R, its outer surface is stretched and its inner surface compressed. The surface strain is approximately t divided by twice R. The relation is simple geometry, and it is the same relation that tells a plumber how tightly a copper pipe can be bent. Consider a fold in a garment with an inner radius of one millimetre, which is gentle by the standards of a crumpled sleeve or a collar folded in a kit bag. A copper wire one tenth of a millimetre thick, roughly the thickness of a human hair, would see a surface strain of about five percent at that fold. Copper begins to yield permanently at strains of a fraction of a percent, so every such fold deforms the wire plastically, and repeated folding will break it after relatively few cycles. Reduce the wire to twenty micrometres and the surface strain falls to about one percent. That is still beyond the elastic range, but low enough that fatigue life increases dramatically. Reduce it further, to the scale of a metal coating a micrometre or so thick on a polymer filament, and the coating itself experiences whatever strain the filament underneath experiences; its thinness no longer protects it, and its survival depends on how well it is bonded and how much the filament stretches. These numbers lead to three conclusions that recur through the rest of this booklet. Thin conductors survive bending far better than thick ones. Bundles of many thin conductors combine low resistance with bendability, which is why multifilament and litz constructions dominate. And coatings are only as durable as the substrate they sit on and the bond that holds them, which is why so much textile failure is really interface failure. An obvious objection is that the electronics industry already makes flexible circuits. Phones, cameras and laptops contain thin polyimide films printed with copper traces that fold around hinges and through tight spaces. Why not simply sew those into clothing? The answer is that flexible is not the same as stretchable. A polyimide flexible circuit bends easily but does not lengthen. It behaves like a sheet of paper: you can roll it into a tube, but you cannot wrap it smoothly around a sphere, because that would require the sheet to stretch. The human body is full of surfaces that change shape in two directions at once, such as the shoulder, the hip and the knee. A flexible circuit placed there either restricts movement, rides up and wrinkles, or tears. Flexible circuits still have a place in smart garments. They are excellent as small rigid-ish islands carrying components, placed where the body is relatively flat and still, and connected to each other by genuinely stretchable conductors. This island-and-bridge architecture, borrowed from research on stretchable electronics, is one of the most practical ways to combine conventional components with fabric. But it relocates rather than removes the central problem: every island has an edge, and every edge is a stiffness step. The body as an operating environment It is worth being concrete about what the skin does to a garment, because most electronic design guidelines assume nothing like it. Sweat is mostly water, but it carries sodium chloride along with smaller amounts of potassium, lactate, urea and other compounds. Its exact composition varies between people and changes with acclimatisation, diet and exercise intensity. For the purposes of a conductor, the key facts are that it is wet, salty and slightly acidic to neutral, and that it is delivered continuously to the inner surface of the garment during exercise. An athlete training hard in heat can lose a litre or more of sweat an hour, and much of it passes through or dries in the base layer. Salt crystals left behind as sweat evaporates are abrasive and hygroscopic: they draw moisture back from the air. Skin also sheds oils and dead cells, and supports a community of bacteria that thrive in warm, damp fabric. Hygiene, rather than aesthetics, is the reason athletic and medical garments must be laundered after almost every use. A garment that cannot be washed cannot be worn against the skin for long. Temperature is less extreme. Skin sits a few degrees above or below 33 degrees Celsius in most conditions, which is gentle for electronics. The danger from heat comes later, in the washing machine and the tumble dryer, where temperatures can be considerably higher and are combined with mechanical action and chemistry. And the body moves in ways that matter for sensing as well as durability. A sensor that relies on contact with the skin, such as an electrode measuring the heart's electrical activity, depends on the garment staying put. When it slides, the signal is corrupted. When it lifts, the signal disappears. The very looseness that makes clothing comfortable is the enemy of a stable measurement. Much of the chapter on sensing is about managing that conflict. The final element of the operating environment arrives once a week, or once a day for an athlete. A domestic wash cycle combines four factors that German chemist Herbert Sinner, working for the detergent company Henkel, described in 1959 as the four contributors to cleaning: chemistry, temperature, mechanical action and time. Detergents are alkaline and contain surfactants that strip oils and penetrate fine gaps; many contain enzymes and oxidising bleaches. Water temperatures range from cold to 60 degrees Celsius or more for hygienic washing. The drum lifts and drops the load, the garments rub and fold, and the spin cycle presses everything against the drum wall at high acceleration. A full cycle lasts an hour or more, and drying in a tumble dryer then adds heat and further tumbling. From a textile engineer's point of view, this is a deliberate, controlled assault on the surface of fabric, designed to remove anything loosely attached. From an electronics engineer's point of view, it is an immersion test combined with a fatigue test combined with a chemical attack, repeated for the life of the product. It would be hard to design a more effective way to find the weak points in a smart garment. That is why washability, more than any other single property, separates working products from demonstrations. Where the electronics go Given this environment, designers have a limited number of strategies, and every commercial smart garment adopts one of them or a blend. The most common is the removable module. The sensing elements, such as electrodes, conductive traces and stretch sensors, are built into the fabric and made as robust as possible. The rigid electronics, meaning battery, processor, memory and radio, live in a small sealed pod that clips or snaps onto the garment and is taken off before washing. The Polar Team Pro Shirt, announced at the Consumer Electronics Show in January 2017, followed this model, with heart rate electrodes embedded in the fabric and a sensor pod with satellite positioning and motion sensors at the back of the collar. Ralph Lauren's PoloTech shirt, made with the Canadian company OMsignal and launched in August 2015, used silver fibres in the fabric with a detachable black box containing the electronics. Google's Jacquard tag, the small module that sat in the cuff of the Levi's jacket, came off for washing too. The removable module dodges the hardest problem, which is waterproofing a battery and circuit board well enough to survive repeated washes. But it does not remove the hard–soft boundary. It moves it to the connector, the snap or clip where the pod meets the fabric. That connector must make reliable electrical contact through sweat and movement, must survive being washed without the pod attached, and must keep doing so for hundreds of attach and detach cycles. A large share of real-world failures happen there. The second strategy is full integration. The electronics are sealed in the garment and the whole thing goes into the wash. This is attractive for users, who often forget to remove modules, and essential for applications where the garment must be worn continuously. It is also much harder. It demands encapsulation that keeps water out of every component for hundreds of hours of washing, flexible interconnects that survive constant bending, and some way to charge a battery without exposed contacts. Wireless charging and very thin, flexible batteries help, but the encapsulation problem remains. The third strategy avoids local electronics altogether, or nearly so. A passive sensing garment carries only conductors and sensing structures, and is read by a separate device, which may be a wristwatch, a pod or a reader worn nearby. Many research garments take this approach because it makes washing simpler. Its cost is the need to route signals over long textile paths, which pick up noise and add resistance, and to make contact with the external device somewhere. None of these strategies escapes the core problem of joining a conductor that moves with the fabric to one that does not. They only choose where that join sits and how it is protected. Put together, these considerations define the problem the rest of this booklet addresses. A useful smart garment needs current paths that conduct well enough for the signal they carry, that stretch and bend with the fabric for thousands of cycles without cracking, that resist abrasion and corrosion in sweat, and that come out of hundreds of wash cycles with their resistance close to where it started. It needs joints between those soft paths and hard electronics that spread strain rather than concentrating it and that keep water away from metal. It needs sensing structures that stay in good contact with a moving body. And it needs all of this at a cost and comfort level that make someone want to wear it. The obvious first question is what to make the conductors from. The answer depends on which of those demands matters most, and on an honest reckoning of the trade-offs between conductivity, flexibility, durability, comfort and cost. That is the subject of the next chapter. Chapter 2: The Conductive Yarn Palette Ask a textile engineer how to make a conductive thread and you will get a list rather than an answer. Metal can be drawn into fine wire and twisted with ordinary fibres. Polymer filaments can be plated with silver or copper. Short stainless steel fibres can be blended into a spun yarn like wool into cotton. Carbon can be made into fibre directly. Conductive polymers can be coated onto fabric or spun into filaments. Nanomaterials, from carbon nanotubes to the silver nanowires of the next chapter, can be dipped, printed or sprayed. Each route gives a different balance of conductivity, flexibility, comfort, durability and cost, and each fails in its own way. Choosing among them is not a matter of picking the most conductive option. It starts with a question that is easy to skip: what does this particular current path have to do? What the conductor is for Electrical paths in a garment do one of three jobs, and the requirements differ by orders of magnitude. Signal paths carry information from a sensor to an amplifier. The textile electrodes that pick up the heart's electrical activity, for example, deliver signals of around a millivolt, and the amplifier they feed is designed to draw almost no current. In that situation the resistance of the path between electrode and amplifier hardly matters if it is stable. Tens or even hundreds of ohms are acceptable, because almost no current flows and so almost no voltage is lost along the way. What matters is that the resistance does not change abruptly when the wearer moves, because a sudden change can appear as a spike in the signal, and that the path is shielded or routed so that it does not pick up interference. Power paths carry current to run electronics, light sources or heaters. Here resistance matters directly. A path with resistance R carrying current I dissipates power equal to I squared times R, which is lost as heat and drops the voltage available at the far end. For a heated garment, which is deliberately resistive, the designer chooses a resistance to give the desired warmth at the battery voltage. For a path that must supply a processor or a radio, the designer wants as little resistance as possible. Data paths carry digital communication between components, for example between sensors distributed around a garment and a central module. These need modest resistance, but also consistent electrical behaviour along their length so that fast signals are not distorted. Long textile paths with variable spacing between conductors are not good at this, which is why many designs avoid running high-speed data through fabric at all. Sensing structures form a fourth category. Some conductive yarns are chosen precisely because their resistance changes with strain or pressure. These are the materials of stretch and pressure sensors, and for them a stable resistance would be a defect. The challenge is to make the change repeatable, so that the same stretch gives the same reading every time. Once the job is clear, the choice of material narrows considerably. Metals: wire, plating and steel The most conductive option is metal wire. Copper and silver are the best common conductors, with bulk resistivities of about 1.7 and 1.6 hundred-millionths of an ohm-metre respectively. A fine copper wire can carry real power with negligible losses. But solid metal wire behaves badly in fabric. It is stiff compared with fibres, it work-hardens and fatigues when bent repeatedly, and once it kinks it stays kinked. A single thick wire sewn into a shirt feels like what it is. Two ideas make wire more textile-friendly. The first is to make it very thin. The strain at the surface of a bent wire is proportional to its thickness divided by the bend radius, so halving the thickness halves the strain. Wires a few tens of micrometres across can be bent into tight folds without exceeding their fatigue limits. The second idea is to use many thin wires instead of one thick one, each individually insulated with an enamel coating and twisted together. This construction, called litz wire, has long been used in high-frequency electronics, and textile versions combine enamelled copper or silver-coated copper filaments with polyester or other carrier fibres. The enamel insulation is important in garments, because conductors that touch when the fabric folds would otherwise short-circuit. Wire can also be made stretchable by geometry rather than material. When a fine wire is wrapped helically around an elastic core, such as an elastane filament, stretching the yarn mostly unwinds the helix rather than lengthening the wire. The wire bends but barely stretches. The same principle appears at every scale in stretchable electronics, from wavy metal films to serpentine traces printed on rubber: let the conductor change shape so that it does not have to change length. Its cost is that the yarn can only stretch as far as the helix allows before the wire goes taut, and that repeated straightening and recoiling still fatigues the metal over time. Copper's main weakness in a garment is corrosion. It oxidises in air and is attacked by sweat, turning green and losing conductivity. Insulation helps, but any breach in the enamel, such as at a joint or after abrasion, becomes a corrosion point. Silver is more resistant in many respects, though it reacts with sulphur compounds and tarnishes. Gold and platinum do not corrode, but are used only in tiny quantities, for example as plating on contact points. The second major family takes an ordinary polymer filament, usually polyamide (nylon), and coats it with a thin layer of metal, most often silver. The result looks and handles almost like a normal synthetic yarn and can be knitted, woven, sewn and embroidered on standard machinery. Silver-plated polyamide yarns, sold under trade names such as Shieldex, have become one of the workhorse materials of e-textile research and products, and the silver fibres in many smart shirts and textile electrodes are of this type. The silver layer is thin, far thinner than the filament it coats, so the yarn's conductivity is much lower than that of solid silver wire of the same diameter. It is still good enough for signal paths and electrodes, and for short power paths. Because the conductor is spread over many fine filaments, each with its own coating, the yarn is soft and flexible, and a break in one filament does not interrupt the path. The weakness is that the conductor sits on the surface. Abrasion wears the silver off. Repeated flexing can crack the coating where the filament bends most. Washing combines both, and reviews of e-textile washing studies consistently report gradual loss of metal from metallised textiles, with the greatest loss in the first few cycles. Silver also tarnishes when exposed to sulphur compounds in the air or in some detergents, forming silver sulphide, which conducts far worse than silver. There is an environmental dimension too: silver released from textiles during washing enters wastewater, a question explored in the chapter on laundering. Silver has one property that makes it especially attractive for skin contact. A silver electrode in contact with chloride-containing sweat slowly forms a thin layer of silver chloride, and the silver–silver chloride interface is the same electrochemical system used in the gel electrodes of hospital electrocardiographs. It gives a stable electrical interface between the ionic currents of the body and the electronic currents of the circuit. This is part of the reason silver-based fabrics dominate textile electrodes. A third approach uses stainless steel. Steel can be drawn into extremely fine fibres, a few micrometres in diameter, either as continuous filaments or cut into short staple lengths. The Belgian company Bekaert, under the Bekinox name, is one long-established producer. Staple steel fibres can be blended with polyester, cotton or other fibres and spun into yarn on conventional spinning equipment, so that the conductor is distributed through the yarn rather than coated on its surface. Stainless steel is much less conductive than silver or copper, with a bulk resistivity roughly forty times higher. But it does not corrode in sweat, it does not lose a coating because there is no coating, and it survives abrasion and washing far better than plated yarns. Its main drawbacks are that it is harder on knitting needles and sewing machines, it can feel slightly coarse in high concentrations, and it cannot easily be soldered. In spun yarns, current flows from fibre to fibre through contact points rather than along continuous filaments, so the yarn's resistance depends on how tightly the fibres are pressed together and can drift as the yarn relaxes or is compressed. For many signal paths and heating applications, steel's robustness outweighs its modest conductivity. Carbon, polymers and coatings Carbon fibre, made by heating polymer precursors until only a graphitic carbon structure remains, conducts electricity but with resistivity hundreds to thousands of times higher than metals. It is too brittle in bending to be comfortable in most garments, but carbon-loaded polymer fibres and carbon-coated fabrics are widely used for heating elements, antistatic textiles and some electrodes, where a moderate, stable resistance is exactly what is wanted. The study of textile electrodes discussed in the chapter on sensing found that pure carbon coatings showed significant impedance degradation over a month, while coatings that combined carbon nanotubes with ionic liquids were much more stable, which is a reminder that the same element can behave very differently depending on formulation. Intrinsically conductive polymers offer a different route. The most widely used in e-textiles is PEDOT:PSS, a blend of a conductive polythiophene with a polymeric acid that makes it dispersible in water. It can be dyed, printed or coated onto fabrics almost like an ordinary finish. Its conductivity varies enormously with processing, from barely conductive to high enough for many signal applications after suitable treatment. PEDOT:PSS is soft and flexible, and because it conducts both electrons and ions, it forms a low-impedance interface with skin. Its weaknesses are sensitivity to water, since the PSS component swells and can wash out, and a tendency for conductivity to drift with humidity. Beyond these established families lies a long tail of newer materials: carbon nanotubes and graphene inks, two-dimensional metal carbides known as MXenes, liquid metal alloys of gallium and indium that remain fluid at room temperature and can be sealed in elastic tubes or fibres, and the silver nanowires that are the subject of the next chapter. Each has impressive laboratory results. Few have yet demonstrated the combination of durability, safety, cost and manufacturability needed for mass-market garments. Table 1 sets out the main families, comparing the conductivity of their underlying materials with their principal strengths and failure modes. The resistivity figures are standard bulk values for the conductor itself; a finished yarn conducts less well because only part of its cross-section is conductive and because current must cross contacts between fibres. Table 1. Main families of conductive yarn and their trade-offs. Family Conductor bulk resistivity (ohm-metre) Main strength Main failure mode Fine or litz metal wire Copper about 1.7 × 10⁻⁸ Highest conductivity, carries power Fatigue cracking, corrosion where insulation breaks Silver-plated polyamide Silver about 1.6 × 10⁻⁸ (thin layer) Textile handling, skin-friendly electrodes Coating loss by abrasion and washing, tarnish Stainless steel staple or filament About 7 × 10⁻⁷ Corrosion and wash resistance Lower conductivity, fibre-contact drift, hard to solder Carbon fibre or carbon coating About 10⁻⁵ for carbon fibre Stable moderate resistance for heating Brittleness, high resistance PEDOT:PSS coating Varies widely with treatment Soft, low skin impedance Water sensitivity, drift Sources: resistivities are standard handbook values for bulk materials; failure modes summarise the reviews of Rotzler and Schneider-Ramelow (2021) and the electrode study of Alizadeh-Meghrazi and colleagues (2021). Why the structure of the yarn matters A conductive yarn is not a wire, and treating it as one leads to surprises. Three structural effects matter most. The first is contact resistance. In any yarn made of many filaments or short fibres, current does not flow along a single continuous path. It flows along a filament until that filament ends or loses contact, then crosses to a neighbour through a point contact. Each of these crossings adds resistance, and the total depends on how many contacts there are and how firmly the fibres press on each other. Twisting a yarn tighter presses the fibres together and generally lowers resistance. Stretching it can either tighten contacts, lowering resistance, or pull fibres apart, raising it, depending on the yarn's construction. This is why the same yarn can behave as a near-constant conductor in one fabric and as a strain sensor in another. It is also why comparing yarns on paper is treacherous. Manufacturers quote resistance per metre, but the figure depends on the tension applied during measurement, the distance between contacts and how the contacts grip the yarn, and a value measured on a straight, taut length says little about the same yarn relaxed inside a knit. Standardised measurement methods for conductive yarns, discussed in Chapter 8, exist partly to bring order to this, and a careful designer measures candidate yarns in the actual fabric structure before choosing. The second is the fabric structure around the yarn. When a conductive yarn is knitted, the loops of the knit touch each other at many points. Current can short-cut through these contacts instead of following the full length of yarn. When the fabric is stretched, the contact pattern changes and the resistance changes with it. Knitted conductive fabrics therefore tend to be strain sensitive, which is useful for a stretch sensor and a nuisance for a signal path. Woven structures, in which the conductive yarn runs straight, are usually more stable. Embroidered paths, stitched onto the surface of a base fabric, can be laid in carefully controlled patterns, including zigzags that stretch without straining the yarn. The third is insulation. Clothing folds, and when it folds, conductive paths that were centimetres apart can touch. A garment with uninsulated traces carrying different signals, or a power line next to a ground line, is a short circuit waiting to happen, especially when wet. Insulation can come from coating individual yarns, from laminating a thin polymer film over printed or stitched traces, or from building the conductor into the inner layer of a multilayer fabric. Every insulation choice adds stiffness and every one becomes, in the washing machine, another layer that can crack or peel. A designer choosing conductive yarns works through a short sequence of questions. What current does the path carry, and how much resistance can it tolerate? How much will the fabric stretch and bend at this location, and how often? Will the conductor touch skin, and if so, does it need to make good electrical contact or should it be isolated? How will the garment be made, and can the yarn run on the machines that will make it? And how many wash cycles must it survive, at what temperature, with what detergent, before its resistance drifts beyond what the electronics can tolerate? That last question is the one most often left until too late. A yarn that looks ideal on a reel can lose most of its conductivity after a few dozen washes, and a yarn that seems unpromising because of its modest conductivity may still be working after hundreds. The practical answer in many products is a mix: silver-based yarns where skin contact is needed, steel or insulated metal where robustness matters, and careful design to keep the most delicate conductors away from the places where the fabric works hardest. The material that has done most to change those trade-offs in the last fifteen years is not a yarn at all but a nanoscale filler that can be built into almost any textile or elastomer. Silver nanowires deserve close attention, not because they solve every problem but because they show clearly how geometry, rather than raw material, decides whether a conductor can stretch. Chapter 3: Silver Nanowires and the Art of the Stretchable Network A silver nanowire is a rod of crystalline silver a few tens of nanometres across and tens of micrometres long. The wires used in a widely cited study of conductive threads from the University of Waterloo, for example, were about 35 nanometres in diameter and 15 micrometres long, which means each one was roughly four hundred times longer than it was wide. Scattered on a surface, they look under an electron microscope like a heap of uncooked spaghetti. Individually, each is an excellent conductor, because it is essentially a single crystal of the most conductive metal there is. Collectively, they form something more interesting: a network that can conduct across a surface while remaining mostly empty space, and that can change shape without breaking. That combination is why silver nanowires became one of the most studied materials in flexible and stretchable electronics. They were first pursued as a replacement for indium tin oxide, the brittle transparent conductor used in touchscreens and displays. A sparse network of wires lets light through the gaps while carrying current along the wires, and unlike a ceramic film it does not crack when bent. The same properties make them attractive for textiles, with transparency replaced by a more important virtue: the network can follow a fibre, a knit loop or a stretched elastomer without losing its connectedness. Making and connecting the wires Most silver nanowires are made by a solution method known as the polyol process, developed into a reliable route for wires largely by the group of Younan Xia in the early 2000s. A silver salt, usually silver nitrate, is dissolved in ethylene glycol and heated. The glycol acts as both solvent and reducing agent, converting silver ions into metallic silver. A polymer, polyvinylpyrrolidone, commonly abbreviated PVP, is added to the mixture. PVP binds more strongly to the side faces of the growing silver crystals than to their ends, so new silver atoms preferentially attach at the ends and the crystals grow into long wires rather than spheres or cubes. Small amounts of chloride or other ions are added to control the early stages of crystal formation. Two features of this process matter downstream. First, it produces wires coated with a thin layer of PVP. That coating keeps the wires dispersed in liquid, which is useful for coating and printing, but it is an insulator. Where two wires cross, the PVP layer sits between them and adds resistance. Second, the process can be tuned to give longer or thinner wires, and the dimensions of the wires strongly affect how well the network conducts, how transparent it is, how it responds to strain and how quickly it degrades. Once made, nanowires are typically supplied as a dispersion in water or alcohol and applied like an ink. They can be dip-coated onto threads, sprayed or printed onto fabrics, filtered into films, or mixed into a liquid polymer that is then cured. A single nanowire is too short to carry current across a garment. Current travels through the network by passing from wire to wire at the points where they cross. Whether a continuous path exists from one side of a coated area to the other depends on how many wires there are per unit area. At low densities the wires form isolated clusters and the coating does not conduct at all. As the density rises, clusters grow and merge, and at a certain critical density a cluster suddenly spans the whole area. This threshold is called the percolation threshold, borrowing a term from the physics of fluids flowing through porous rock, and the behaviour around it is one of the classic problems of statistical physics. Above the threshold, conductivity rises steeply as more wires are added, because more parallel paths become available. Longer wires percolate at lower densities, simply because each wire reaches farther and touches more neighbours. This is why manufacturers push for high aspect ratios: the longer the wires relative to their width, the less silver is needed to make a conductive network. In a well-made network, the resistance of the wires themselves is a small part of the total. Most of the resistance sits at the junctions, where current must cross from one wire to another through a small contact area and, initially, through the PVP coating. A great deal of research effort has gone into lowering junction resistance. Heating the network moderately softens and partially removes the PVP and lets the silver at crossing points fuse slightly; the Waterloo threads were annealed at 150 degrees Celsius for this reason. Pressing the network mechanically, exposing it to intense light pulses that heat the junctions selectively, or treating it chemically can achieve similar welding at lower bulk temperatures, which matters when the substrate is a polymer fabric that would melt under heat. The Waterloo study, published by Yahya Atwa, Nupur Maheshwari and Irene Goldthorpe in 2015, shows what this approach can do on ordinary threads. By dip-coating cotton, polyester and nylon threads in a nanowire dispersion, with simple surface pre-treatments for the synthetic fibres, they achieved resistances as low as 0.8 ohms per centimetre, adjustable by changing the concentration of the dispersion and the number of dips. A nylon thread immersed repeatedly in a stirred detergent solution at 25 degrees Celsius showed no change in resistance over five washings. That is an encouraging laboratory result, and also a modest one by the standards of real laundry, which is far longer, hotter and more mechanically violent. The gap between such bench tests and genuine washing is a theme of the later chapters. Why a network can stretch Here is the central idea of the chapter. A bulk metal film cracks when stretched by more than a few percent, because the metal itself must lengthen and it cannot do so elastically. A nanowire network does not have to lengthen any individual wire to accommodate stretching. When the surface under it extends, wires can slide past one another, rotate towards the direction of stretch, and lose some contacts while making others. The network reorganises rather than breaking. Its resistance rises, because some junctions separate and paths become longer and fewer, but as long as enough paths remain, it keeps conducting. On its own, a loose network would be fragile. The wires would shift permanently, and repeated stretching would progressively disconnect it. The decisive step is to embed the network in an elastomer, a rubbery polymer that stores the deformation elastically and pushes the wires back towards their original positions when released. A well-known demonstration came from the group of Yong Zhu at North Carolina State University, published by Feng Xu and Yong Zhu in Advanced Materials in 2012. They deposited silver nanowires on a silicon substrate, poured liquid polydimethylsiloxane, the silicone rubber known as PDMS, over them and cured it. When the cured rubber was peeled away, the nanowires came with it, embedded just beneath the surface. The resulting conductors could be stretched to 50 percent strain while remaining conductive, and they were robust under repeated mechanical loading. The researchers also exploited a geometric trick. When the conductor was stretched and released for the first time, the surface buckled into a wavy pattern. Later stretching first flattened these waves before straining the network itself, giving a range of extension over which conductivity stayed relatively stable. The embedding also prevented the delamination that plagues coatings simply laid on top of rubber. This is the same principle as wrapping a wire around an elastic core, applied at the nanoscale. The conductor survives large deformation because geometry, not material, absorbs most of the strain. There is a flip side. If stretching a nanowire network raises its resistance, then measuring its resistance tells you how much it has been stretched. The property that a designer of interconnects wants to minimise is exactly what a designer of strain sensors wants to maximise. Morteza Amjadi and colleagues at the Korea Advanced Institute of Science and Technology made this explicit in a study published in ACS Nano in 2014. They sandwiched a silver nanowire network between layers of PDMS and showed that the resulting sensor could be stretched up to 70 percent while its resistance rose in a controlled way. The sensitivity of a strain sensor is usually expressed as a gauge factor, the fractional change in resistance divided by the strain. Theirs could be tuned between about 2 and 14 by adjusting the construction. To show the idea in use, they built a glove with five sensors, one over each finger, that tracked finger bending well enough to control a hand in a virtual environment. For a garment, the dual nature of the network is both an opportunity and a hazard. A compression sleeve with a nanowire sensor over the elbow can measure joint angle. But a nanowire interconnect running across the same elbow, carrying a signal from a chest electrode to a sleeve-mounted module, will change its resistance every time the arm bends. Whether that matters depends on the circuit, as the previous chapter explained. For a high-impedance signal path, small resistance changes are tolerable. For a strain sensor read by measuring resistance, any extra variable resistance in the leads is an error. Good designs keep sensing and interconnecting functions separate, making sensors deliberately strain sensitive and interconnects deliberately insensitive, through choice of geometry, wire density and encapsulation. Building nanowires into fabric There are three broad ways to put silver nanowires into a garment, and they reflect different views about which component should provide the stretch. The first is to coat the textile directly. Threads or finished fabrics are dipped in or sprayed with a nanowire dispersion, so that the wires wrap around individual fibres. The fabric's own structure supplies stretch: as a knit is pulled, the fibres slide and the loops reshape, and the network on each fibre bends but does not need to extend much. This approach is simple and keeps the textile breathable and soft. Its weakness is exposure. The wires sit on the outside of fibres, where they meet abrasion, sweat and detergent directly. The second is to coat the textile and then overcoat it with a thin elastomer or polyurethane layer that locks the wires in place and shields them. This sacrifices some breathability and softness in the coated area, but it greatly improves resistance to abrasion and washing. The overcoat must be thin and flexible enough not to turn the fabric into a stiff patch, because a stiff patch creates exactly the stiffness gradient that concentrates strain at its edges. The third is to build the conductor separately, as a nanowire network embedded in a thin stretchable film, typically thermoplastic polyurethane, and then laminate that film onto the fabric with heat and pressure. This is closer to how printed stretchable electronics are made and allows precise patterning of traces and electrodes. The film carries the conductor and provides the elastic restoring force; the fabric carries the load and gives comfort. The challenge is the bond between film and fabric, which must survive washing without peeling. Table 2 summarises the main techniques that researchers and manufacturers use to keep a nanowire network conductive under repeated strain, with their benefits and costs. Table 2. Techniques for keeping a silver nanowire network conductive under strain. Technique How it works Benefit Cost Embedding below an elastomer surface Wires locked in rubber that restores their positions Large reversible stretch, no delamination Less breathable, adds stiffness Pre-strain and buckling Surface waves flatten before network strains Stable resistance over a working range Range limited to the buckle amplitude Junction welding Heat, light, pressure or chemistry fuses crossings Lower and more stable resistance Process heat can damage textile substrates Higher aspect ratio wires Longer wires keep more contacts while sliding Conducts at lower density and higher strain Longer wires are harder to make and disperse Protective overcoat Polymer layer shields wires from abrasion and chemistry Better wash and sweat survival Thicker, stiffer, can crack or peel Sources: Xu and Zhu (2012); Amjadi and colleagues (2014); Atwa, Maheshwari and Goldthorpe (2015); Guan and colleagues (2022). How nanowire networks degrade Nanowires are not invulnerable, and their weaknesses follow from their size. A wire 35 nanometres across has an enormous surface area relative to its volume. Any process that attacks the surface, removing even a few nanometres of silver, threatens to sever the wire completely. A bulk silver conductor would shrug off the same attack. A 2022 review in Critical Reviews in Solid State and Materials Sciences by Guan and colleagues surveyed the main degradation routes for nanowire networks, drawing largely on their use in transparent electrodes. Four matter for garments. Heat is the first. Thin metal wires become unstable at temperatures far below the melting point of bulk silver. Above a critical temperature, surface atoms become mobile enough that a wire breaks up into a chain of droplets, a phenomenon called Rayleigh instability after the same physics that breaks a thin stream of water into drops. Garments are rarely hot enough for this, but processing steps such as heat lamination and the hotter settings of a tumble dryer or iron deserve attention. Current is the second. High current densities can cause electromigration, in which flowing electrons push silver atoms along the wire, thinning it at weak points until it breaks. Junctions, where current concentrates, are especially vulnerable. This rarely limits signal paths but matters for any nanowire trace that carries power or heats. Light is the third. Ultraviolet light in particular can accelerate the breakdown of networks, partly by driving chemical reactions at the wire surface. Outdoor athletes wear their garments in strong sunlight, so this is not a laboratory curiosity. Chemistry is the fourth and, for textiles, the most important. Silver reacts with sulphur compounds to form silver sulphide, the familiar black tarnish, which conducts poorly. It reacts with chloride, which sweat supplies in abundance. It can be oxidised by bleaching agents in detergents. On a bulk silver surface these reactions form a thin surface layer. On a nanowire they can consume a significant fraction of the conductor, and at junctions they can open the contacts on which the network depends. The mitigation strategies discussed in that review and elsewhere converge on a common answer: protect the wires. Coatings of other metals, oxides, polymers or graphene can shield the silver surface. Embedding the network in an elastomer keeps reactive species away. Welding the junctions makes them less vulnerable to being opened. In practice, the more completely a nanowire network is sealed, the longer it lasts, and the less silver it releases into skin contact and wastewater. Silver nanowires have earned their prominence. They demonstrate that conductivity close to that of metal can coexist with large, repeated stretching, if the conductor is a network embedded in an elastic matrix rather than a continuous film. They can be applied to existing textiles with processes not far removed from dyeing and finishing. They can serve as both interconnect and sensor, depending on how the network is built. And they have helped make wavy, buckled, helical and network geometries the common language of stretchable electronics. What they do not do is remove the need for protection. A bare nanowire network on a fabric surface is more vulnerable to sweat, bleach and abrasion than a silver-plated yarn, not less, because its conductor is so thin. Every practical nanowire textile is therefore a composite: wires plus an elastomer or overcoat plus a textile. And composites fail at their boundaries. The interface between coated and uncoated fabric, between laminated film and base cloth, between soft network and hard connector, is where the next chapter goes. Hashtags: #SmartTextiles #ConductiveYarns #WashableElectronics #ElectronicTextiles #ETextiles #WearableTechnology #WearableElectronics #SmartClothing #IntelligentFabrics #TextileEngineering #ConductiveFibers #SilverNanowires #StretchableElectronics #FlexibleElectronics #FunctionalTextiles #SmartGarments #TextileSensors #FabricSensors #BiomedicalWearables #SportsTechnology #AthleteMonitoring #PhysiologicalMonitoring #TextileElectrodes #PrintedElectronics #ConductivePolymers #PEDOTPSS #Nanotechnology #WashabilityTesting #ElectronicDurability #WearableInnovation

  • Healthy Boundaries with Parents (Emotional Independence and Communication for Young Adults)

    Download the Book (PDF): Introduction Somewhere in the first year after leaving home, most young adults have a version of the same small, disorienting moment. The phone lights up with a parent's name for the fourth time that day. Or a text arrives asking why a grade dropped, and you realize your mother has been checking the portal. Or you come home for winter break, having spent four months deciding for yourself when to eat, sleep, study and see friends, and within an hour someone asks where you are going and when you will be back. None of these moments is a crisis. Each is a small collision between two versions of the family: the one that existed when you were a child living under your parents' roof, and the one that has not been built yet. This book is about building the second one. It is written for college students and young adults roughly between eighteen and the late twenties who are working out how to be close to their parents without being run by them, and how to be independent without cutting themselves off. It is also written, in part, for the parents, advisers, resident assistants and counselors who stand beside those young adults and want to help without taking over. The central argument is simple to state and harder to live: emotional independence is not distance. It is the capacity to remain yourself while staying in relationship with the people who raised you. A young adult who never calls home is not necessarily independent, and one who calls every day is not necessarily dependent. What matters is whether you can think your own thoughts, make your own decisions, tolerate your parents' disagreement, and still stay connected to them. Why this transition is harder now than it looks Families have always had to renegotiate the relationship when children grow up. What has changed is the shape of the path. The psychologist Jeffrey Jensen Arnett argued in 2000 that the years from the late teens through the twenties had become a distinct developmental period in industrialized societies, which he called emerging adulthood. Marriage, parenthood and stable careers now arrive later than they did for earlier generations, and the years in between are marked by exploration, instability and the peculiar sense of being neither an adolescent nor fully an adult. That in-between status is not only a feeling. It is written into money, housing and paperwork. A 2023 Pew Research Center survey of more than 3,000 parents of young adults found that 59 percent had helped their 18- to 34-year-old children financially in the past year, while only 45 percent of young adults in a companion survey said they were completely financially independent. Among 18- to 24-year-olds, 57 percent were living in a parent's home. The same research found something that should reassure anyone who worries that closeness is a problem in itself: most parents and young adults described their relationship positively, and large majorities of parents said they text their young adult children at least a few times a week. Constant contact is now the ordinary condition of family life, not a sign that something has gone wrong. That is the setting in which boundaries have to be worked out. A student may be legally an adult, with the right under federal law to control access to her own education records, while her parents pay her tuition, carry her on their health insurance until she turns 26, and appear as her emergency contact. She may be making her own decisions about coursework and relationships while her parents can see her location on their phones. The formal markers of adulthood and the practical realities of dependence rarely line up neatly, and much of the friction between young adults and their parents comes from the gap between them. What this book means by a boundary The word "boundary" has become popular enough to be misused. In casual speech it sometimes means a demand: "My boundary is that you stop criticizing my girlfriend." Understood that way, a boundary becomes a way of controlling another person's behavior, and it tends to fail, because no one can make another adult stop having opinions. In this book, a boundary is a decision about what you will do. It describes where you end and another person begins: what information you share, what decisions you make yourself, how you respond when someone pushes, and what you will and will not take part in. "I'm not going to discuss my relationship over dinner; if it comes up, I'll change the subject or step away" is a boundary. It does not require your father to agree. It requires you to act on it calmly and consistently. Good boundaries are usually quieter than people expect. They are less about dramatic announcements than about hundreds of small moments in which you choose not to over-explain, not to lie, not to explode and not to cave. A boundary is also not the same as a wall. Walls keep people out entirely. Boundaries create a shape for the relationship, and the shape can include a great deal of closeness. Many young adults who set boundaries well end up closer to their parents, because they no longer have to hide, placate or brace for conflict every time they talk. A few commitments This book tries not to pathologize parents. The research on overparenting, which later chapters examine in detail, finds real associations between highly controlling parenting and poorer outcomes for young adults, but the effects are modest, the studies are mostly correlational, and much of what gets called helicopter parenting grows out of love, fear and a changing economy rather than any wish to dominate. Most parents who hover are anxious, not malicious. Understanding that does not oblige you to accept every intrusion, but it changes how you respond, and it makes you far more likely to be heard. It also tries not to treat one culture's model of adulthood as universal. In many families, especially those with roots in collectivist cultures and many families of first-generation college students, obligation to parents and siblings is not a failure of independence but a core value, one that research links to positive well-being. Healthy boundaries in those families look different from boundaries in a family that expects children to leave at eighteen and call on Sundays. Both can be healthy. And it recognizes that not every student is dealing with parents who are too close. Some are dealing with parents who are distant, unreliable, hurtful or absent. Some have cut contact, and some have had contact cut with them. Those students need the same core skills, but they also need practical information about money, paperwork and support that a book aimed only at over-involved families would leave out. How the book is organized The first two chapters lay out the developmental ground: what emerging adulthood asks of families, and the idea of differentiation of self, which offers the most useful single framework for thinking about emotional independence. Chapter 3 examines over-involved parenting, what the research actually shows and why it happens. Chapter 4 turns to the practical question of information: what parents can and cannot see under FERPA and health privacy law, and how location sharing, passwords and portals complicate things. Chapter 5 takes up money, which is often where the most important boundaries are negotiated and where the leverage is least equal. Chapter 6 considers culture, family obligation and the particular position of first-generation students. Chapter 7 is the most hands-on: it provides preparation methods and scripts for difficult conversations, along with ways to handle the reactions that usually follow. Chapter 8 addresses distant and estranged families. Chapter 9 explains when and how to use counseling, and when a family situation calls for more urgent help. A brief note before starting: this book offers general information and practical guidance, not individual psychological, medical, legal or financial advice. Laws and institutional policies differ and change, and a counselor, financial aid officer or other professional who knows your situation can tell you things a book cannot. If you are ever in danger, or thinking about harming yourself, contact emergency services or, in the United States, call or text 988 to reach the 988 Suicide & Crisis Lifeline. That resource and others appear again in the final chapter. The scenarios in these pages are illustrative composites, not real individuals. They are drawn to be recognizable, because the problems they describe are common. If you see yourself in one of them, that is the point: you are not the first person to find this transition difficult, and the difficulty is not a sign that your family is broken. It is a sign that your family is changing. Chapter 1: The Renegotiation Consider a first-year student who moves three hundred miles from home in August. She has been, by every account, a responsible teenager: good grades, a part-time job, a driver's license, a history of making sensible choices. Within six weeks she finds herself in an argument with her father about whether she should drop a chemistry class. He thinks dropping it is a mistake that will close off a pre-medical path. She is not sure she wants that path. The argument is not really about chemistry. It is about who gets to decide, and neither of them has a clear answer, because the rules that governed decisions in their family were written for a child living at home and have not been rewritten for a young adult living somewhere else. Every family eventually has to renegotiate the relationship between parents and children. What is unusual about the present moment is how long the renegotiation takes, how many practical ties remain in place while it happens, and how little guidance families get. This chapter lays out the developmental ground: what the period between adolescence and settled adulthood looks like, what it asks of young adults and parents, and why the renegotiation so often feels like conflict even in loving families. The in-between years In 2000, the developmental psychologist Jeffrey Jensen Arnett published an article in American Psychologist proposing that the years from roughly eighteen to twenty-five had become a distinct stage of life in industrialized societies. He called it emerging adulthood. The argument rested on a demographic shift that had been building for decades: the median ages of marriage and first childbirth had risen sharply, a much larger share of young people were entering higher education, and the path into stable work had become longer and less predictable. Young people were no longer moving directly from adolescence into the roles that had traditionally defined adulthood. Instead they spent years in a period of exploration. Arnett later described five features that characterize this period. It is the age of identity explorations, when young people try out possibilities in love, work and worldview. It is the age of instability, with frequent changes of residence, relationships and jobs. It is the most self-focused age of life, not in the sense of selfishness but because obligations to others are at a low point and young people are working out what they themselves want. It is the age of feeling in-between: asked whether they have reached adulthood, many young people in this period answer "in some ways yes, in some ways no." And it is the age of possibilities, when optimism about the future tends to run high and when people have an unusual chance to change direction. Arnett's framework has critics. Some researchers have argued that it describes a relatively privileged slice of young people, those with the resources to explore rather than those who must work full-time at eighteen or care for relatives. That criticism is fair, and Chapter 6 returns to it. But the framework captures something real about how the transition feels to many students. The same young person may be managing her own schedule, bank account and romantic life while her parents hold the purse strings, carry the insurance card and expect a weekly report. She is an adult in some rooms and a child in others. One of the more illuminating findings in Arnett's research concerns how young people themselves define adulthood. Across many studies, they tend not to name the traditional markers such as marriage, finishing school or buying a home. The criteria they rate most highly are individualistic and psychological: accepting responsibility for yourself, making independent decisions, and becoming financially independent. Adulthood, in their view, is something you become on the inside before it is confirmed by the outside world. That definition places the relationship with parents at the center of the transition, because parents are the people from whom young adults are learning to take responsibility, make decisions and support themselves. From hierarchy toward mutuality It helps to name what is actually changing. In childhood, the parent-child relationship is necessarily hierarchical. Parents make decisions on children's behalf, set rules, enforce consequences, and hold information that children do not. This hierarchy is not a flaw; it is how children are kept safe and taught to function. Adolescence loosens it. Teenagers push for more say, parents grant autonomy in stages, and the negotiation over curfews and phone use is part of how both sides practice the change. Emerging adulthood asks the family to move further, toward something closer to a relationship between adults. That does not mean parents and grown children become equals in every respect. Parents often continue to hold more resources, more experience and, in many cultures, a position of respect that does not disappear. But the basic currency of the relationship changes. Decisions that were once the parent's to make become the young adult's. Rules give way to requests. Information that was once owed becomes information that is offered. Advice replaces instruction. This shift is not a single event. It happens domain by domain, and often unevenly. A family may reach an easy understanding that a daughter's choice of friends is her own business while still treating her choice of major as a joint decision. A son may be fully trusted with money but still reminded to wear a coat. Most of the friction in these years comes from mismatches about which domains have shifted and which have not. The student who dropped chemistry assumed that course choices had become hers. Her father assumed that decisions with large financial and career consequences were still shared. Neither was being unreasonable; they simply had different maps. Part of the work of this period, then, is making the maps explicit. Many families never discuss which decisions belong to whom. They find out only when they collide. One of the most useful things a young adult can do, usually during a calm moment rather than a heated one, is to ask directly: "Which decisions do you see as mine now, and which do you still want a say in?" The answer is often revealing for both sides, and it turns an unspoken struggle into a conversation. Young adults often experience their parents' resistance to the renegotiation as a refusal to accept that they have grown up. Sometimes it is. More often it reflects the fact that parents are going through their own transition, with its own losses and anxieties, and have had even less preparation for it. For many parents, the child's departure removes a role that has organized daily life for eighteen years. The daily logistics of parenting, which could be exhausting, also provided purpose, structure and a steady flow of information about the child's well-being. When a child leaves, much of that information stops arriving. A parent who once knew what their child ate for dinner, who their friends were and how they were sleeping now knows only what the child chooses to report. For an anxious parent, that silence can fill with worst-case scenarios. Parents also carry knowledge that young adults sometimes discount: they have seen how small decisions can have large consequences. The father who argued about chemistry may have watched his own plans narrow because of a choice he made at nineteen. His intensity may reflect his own history more than his daughter's situation. That does not make him right, but it makes his behavior intelligible. There is also an economic backdrop. The stakes of the transition to adulthood feel higher than they did a generation ago. College is expensive, many students borrow heavily, and early career paths are less certain. Parents who have invested significant money, and who see their child's future as fragile, are understandably reluctant to step back from decisions that could affect whether that investment pays off. Technology has made stepping back harder still. It is easy to check a location, read a grade portal or send a text, and each of those actions feels small. Together they can add up to a level of monitoring no earlier generation of parents could have managed. Finally, parents are often navigating their own life transitions at the same moment. A parent in her late forties or fifties may be caring for aging parents of her own, facing changes at work, managing health problems, or discovering what her marriage looks like without children in the house. The empty nest is not uniformly sad; many parents report relief and new freedom. But it is a transition, and people in transition tend to cling to what is familiar. A mother who calls her son every evening may be responding partly to her own loneliness, and the most helpful response may be less a boundary against her than a quiet recognition that she, too, is working out who she is now. Recognizing these pressures helps young adults respond to their parents with more generosity and less defensiveness. It does not mean accepting every intrusion. A parent's anxiety is real, but it is the parent's to manage, and a young adult who organizes her whole life around keeping her parents calm has not become independent. She has simply moved the parental hierarchy inside her own head. It would be unfair to put the whole burden of the renegotiation on parents. Young adults contribute to the confusion too, often without noticing. The most common contribution is inconsistency. A student who wants her parents to stay out of her decisions about classes may also call them in a panic when a registration deadline looms and ask them to sort it out. A son who resents his mother's questions about his social life may also depend on her to schedule his doctor's appointments and remind him about his car insurance. From the parent's side, these signals are mixed. The young adult seems to want autonomy in some moments and rescue in others, and the parent has no way of knowing which is which until the moment arrives. This inconsistency is not hypocrisy. It is what learning looks like. Young adults are acquiring new capacities at different rates, and it is natural to reach for familiar support when the stakes feel high. But it is worth being honest about. If you want your parents to step back in a particular domain, the most persuasive argument is not a speech about your rights. It is a track record of handling that domain yourself, including handling it when it goes badly. Parents tend to extend trust in the places where they see competence. A second common contribution is secrecy used as a substitute for boundaries. Many young adults, rather than telling their parents that some areas of life are now private, simply stop reporting and hope no one notices. This works until it does not. When the concealed information surfaces, as it often does, the parent experiences it as deception rather than privacy, and the result is more monitoring, not less. There is a real difference between saying "I'm not going to share the details of my relationship, but I'm doing fine" and pretending the relationship does not exist. The first is a boundary. The second is a secret, and secrets tend to invite suspicion. A third contribution is reactivity. Young adults, like everyone, sometimes respond to their parents with more heat than the situation calls for. A question about grades becomes a fight about control. A suggestion becomes an insult. Much of this reactivity comes from the fact that parents know exactly where their children are most sensitive, and young adults are still learning to respond to those sensitivities without being governed by them. The next chapter takes up this problem in depth, because the ability to stay calm in the presence of a parent's anxiety is, in many ways, the core skill of emotional independence. Contact is not the problem It is tempting to measure independence by frequency of contact, as if the student who calls home once a month were more grown up than the one who talks to her mother every day. The research does not support that shortcut. In the late 2000s, the psychologist Barbara Hofer and her colleagues studied communication between college students and their parents at Middlebury College and the University of Michigan. They found that students were in contact with their parents an average of 13.4 times a week, across phone calls, texts, email and other channels, with parents and students each initiating roughly half. More interesting than the frequency was what it predicted. Students in the most frequent contact tended to be less autonomous, and students whose parents continued to monitor them closely were the least satisfied with the relationship, describing it as controlling. But students who regulated their own academic lives, whatever their level of contact, were happier in college, happier with their parents and had higher grades. It is worth pausing on the direction of that association. A study like Hofer's cannot say whether frequent contact made students less autonomous or whether less autonomous students sought out more contact. Both are plausible, and both probably happen. A student who is struggling may call home more, and a parent who is called often may find it harder to step back. What the finding does show is that frequency by itself is a poor guide. Two students with identical phone records can have entirely different relationships with their parents. The implication is that what matters is not how often a young adult talks to her parents but what the contact is doing. A daily call in which a student shares news, asks for an opinion she then weighs for herself, and hangs up feeling supported is very different from a daily call in which a parent checks whether assignments were completed and approves plans for the evening. The first is closeness. The second is supervision conducted by phone. The Pew research cited in the introduction points in the same direction. Most young adults in its 2023 survey said their parents were about as involved in their day-to-day lives as they wanted them to be, and large majorities described the relationship in positive terms. Frequent contact is simply the ordinary texture of family life for this generation. Healthy boundaries do not require reducing it. They require making sure that the contact serves the relationship as it is now, rather than preserving the relationship as it was. What success looks like If independence is not measured by distance, how would a family know the renegotiation was going well? A few signs are worth watching for. Decisions are made by the person who will live with their consequences, with others offering input rather than approval. A young adult can tell her parents about a choice they will dislike without lying, apologizing excessively or picking a fight. Parents can express worry or disagreement without trying to override the decision, and the young adult can hear that disagreement without abandoning her position or feeling that the relationship is at stake. Help, including financial help, is offered and received with clear understandings about what it does and does not buy. Both sides can say no to requests from the other without the refusal becoming a crisis. And the relationship has room for the parents to be people rather than only parents, and for the young adult to be a person rather than only a child. None of these conditions arrives all at once, and few families achieve all of them. The renegotiation is uneven, with setbacks and relapses. A family can move forward for months and then fall back into old patterns during a holiday visit, a health scare or a financial crunch. That is normal. The goal is not a perfect adult relationship by graduation but a direction of travel, with each side learning to trust the other a little more. The chapters that follow give that direction of travel more structure. The next one introduces an idea from family systems theory that explains why some young adults can hold their ground with their parents calmly while others either fold or explode, and why the answer is not to care less about your family but to be more fully yourself within it. Chapter 2: Connected Without Being Fused Picture two sophomores who have both decided to switch their majors from engineering to history, and who both know their parents will be unhappy. The first student avoids telling her parents for most of a semester. When she finally does, over the phone, her mother's voice tightens and her father asks what she plans to do for a living. Within five minutes the student is shouting that they have never supported anything she wanted, then crying, then promising to think it over. She hangs up, spends the evening looking at engineering requirements again, and does not sleep. The second student tells his parents at the start of the semester. His father is also displeased and asks the same question about making a living. The student says that he has thought about it, that he understands the worry, and that he is going to try history for at least a year and see how it goes. His father argues for a while. The son listens, answers some of the questions, declines to argue about others, and says he has to go to class. The next week he calls as usual and talks about something else. The two students care equally about their parents. They face the same disapproval. What differs is how much of their parents' anxiety they absorb, and whether they can hold a position without either abandoning it or going to war over it. That capacity has a name in family systems theory: differentiation of self. It is the single most useful idea in this book, and this chapter explains what it is, why it matters and how it can be developed. Bowen's idea Differentiation of self is the central concept in the family systems theory developed by the psychiatrist Murray Bowen from the 1950s onward. Bowen observed that families function as emotional units: anxiety in one member spreads to others, and families develop patterns for managing that anxiety that shape how each member thinks and behaves. Within any family, individuals vary in how well they can maintain a sense of self while remaining emotionally connected to the others. Bowen described differentiation on two levels. Internally, it is the ability to distinguish between thinking and feeling, so that a person can experience strong emotion without being driven entirely by it. Interpersonally, it is the ability to remain yourself in close relationships: to hold your own beliefs and make your own choices while staying in contact with people who think and choose differently. A well-differentiated person can be deeply attached to her family and still disagree with them calmly. A poorly differentiated person tends toward one of two patterns. Either she fuses with the family, taking on its anxieties and expectations as her own and struggling to know what she herself wants, or she cuts herself off, managing the intensity of family relationships by distance, silence or rupture. The crucial insight is that fusion and cutoff are two versions of the same problem. The young adult who does everything her parents ask and the young adult who refuses to speak to them are both being governed by the family's emotional field. One is obeying it; the other is fleeing it. Neither has found a way to be both connected and separate. Bowen argued that cutoff, although it can feel like independence, often leaves the underlying patterns intact. People who cut off from their families frequently reproduce the same dynamics in their new relationships, because they never learned to stay in contact with intense feelings without being overwhelmed by them. This does not mean that cutting contact is always wrong. Chapter 8 addresses situations in which distance is necessary for safety or well-being, and Bowen's framework should not be used to shame people who have made that choice. But for most young adults dealing with ordinarily difficult families, the framework offers a clear goal: not to get away from your parents, and not to do what they want, but to become someone who can be fully yourself in their presence. Bowen's theory was developed clinically, through observation of families in treatment, and for a long time it was criticized for lacking empirical grounding. In 1998, the psychologists Elizabeth Skowron and Myrna Friedlander published a measure called the Differentiation of Self Inventory, which broke the concept into four related dimensions. The instrument is widely used in research and is worth knowing about because its four dimensions give a practical vocabulary for self-observation. The first dimension is emotional reactivity: the tendency to respond to others with automatic emotional intensity, to be flooded by feelings or thrown by other people's moods. The second is what Bowen called the "I-position": the ability to state clearly what you think and believe, and to hold that position under pressure. The third is emotional cutoff: the tendency to manage anxiety in relationships by withdrawing, avoiding intimacy or distancing. The fourth is fusion with others: over-involvement in other people's emotional lives, difficulty separating your own views from those of important people, and a need for their approval to feel settled. Research using this and related measures has generally found that higher differentiation is associated with lower anxiety, fewer psychological symptoms and better relationship functioning, although as with much correlational research, the direction of influence is not always clear. For practical purposes, the four dimensions work as a self-check. After a difficult conversation with a parent, a young adult can ask: Did I react more strongly than the situation called for? Did I say what I actually think? Did I want to disappear? Did I lose track of my own view because I needed them to approve of it? Autonomy is not the same as independence A second body of research sharpens the picture in a way that matters especially for families from cultures that value interdependence. Self-determination theory, developed by the psychologists Edward Deci and Richard Ryan, proposes that people have basic psychological needs for autonomy, competence and relatedness, and that well-being depends on those needs being met. In this theory, autonomy does not mean independence from others. It means acting from motives you endorse, experiencing your choices as your own rather than as imposed from outside. A person can be autonomous while depending heavily on others, as long as the dependence is one she chooses and values. Conversely, a person can be highly independent, living alone and asking for nothing, while acting out of pressure, fear or defiance rather than genuine choice. In 2007, the researcher Bart Soenens and colleagues tested this distinction in the context of parenting. They separated two things parents might do: promote independence, by encouraging children to decide and act on their own, and promote volitional functioning, by encouraging children to act on their own values and interests, whatever those turned out to be. The second form of autonomy support, they found, was the one more consistently related to adolescents' well-being. What seemed to matter was not whether young people were making decisions alone but whether the decisions felt like their own. This distinction is liberating for young adults who feel torn between their families and an idea of independence they have absorbed from the surrounding culture. A student who chooses to live at home, call her mother every day and consult her parents on major decisions is not necessarily less autonomous than one who moves across the country and consults no one. What matters is whether she is doing those things because she values them or because she cannot imagine doing otherwise. Differentiation, understood this way, is not about how much you depend on your family. It is about whether you can think clearly about that dependence and choose it. Reactivity and the I-position Most young adults do not need a theory to recognize reactivity. They know the tightening in the chest when a parent's name appears on the phone at an unusual hour, the flash of irritation when a question lands on a sore spot, and the way certain phrases from a parent can make them feel twelve years old. Reactivity is fast. It happens before thought, and it is often out of proportion to the triggering event because it is responding not to this particular question but to hundreds of similar questions over many years. Understanding reactivity does not make it disappear, but it does create a small space between the trigger and the response, and that space is where differentiation happens. Several practices widen it. The first is noticing the physical signs. Reactivity usually shows up in the body before it shows up in words: a racing heart, a hot face, clenched hands. Learning to catch those signals gives you a moment to slow down. Some people find it useful simply to name the reaction silently, "I'm getting defensive," which tends to reduce its grip. The second is buying time. A young adult is almost never obliged to respond to a parent immediately. "Let me think about that and get back to you" is a legitimate response to almost any question. So is ending a call that is going badly: "I don't want to keep talking about this right now. Can we pick it up tomorrow?" Taking time is not avoidance if you actually return to the conversation. It is simply a refusal to make important statements while flooded. The third is getting curious. Reactivity narrows attention to threat. Curiosity widens it. Asking a parent a genuine question, such as "What worries you most about this?", often lowers the temperature on both sides, because it shifts the conversation from a contest to an exchange of information. It also gives you better information about what is actually driving the parent's behavior, which is often different from what it appears to be. The fourth is practicing outside the moment. Many young adults find it helpful to rehearse difficult conversations in advance, with a friend, in writing or in their heads, precisely so that when the familiar trigger arrives they have a response ready that is not simply the old reaction. Chapter 7 offers specific methods for doing this. If managing reactivity is the defensive half of differentiation, the positive side is the ability to say clearly what you think, want and intend to do. Bowen called this taking an "I-position," and it differs in important ways from both compliance and attack. An I-position is a statement about yourself, not about the other person. "I've decided to switch to history" is an I-position. "You never let me choose anything" is an accusation. "Maybe I should think about it more" said in order to end the discomfort is a retreat. The I-position is calm, specific and not dependent on the other person's agreement. It does not demand that parents approve; it simply informs them of where you stand. A good I-position usually includes some acknowledgment of the other person's view. "I know you're worried about job prospects, and I've thought about that. I've decided to try history for a year." The acknowledgment is not a concession. It signals that you have heard the concern and are not dismissing it, which makes the statement easier to receive. It also demonstrates the very maturity the parent may be doubting. Taking an I-position also means being prepared for the reaction. Bowen observed that when one member of a family changes position, the rest of the family typically responds with pressure to change back. He called these "change back" reactions, and they are entirely predictable: arguments, guilt, anger, withdrawal of warmth, appeals to other family members. They are not evidence that the new position is wrong. They are evidence that the family system is adjusting. A young adult who expects the pushback and does not interpret it as catastrophe is much more likely to hold steady long enough for the family to adapt. The psychologist Harriet Lerner, whose book The Dance of Anger translated many of Bowen's ideas for general readers, made the same point: when you change your part in a familiar pattern, others will almost always push you to resume it, and the task is to stay the course without counterattacking. Triangles and the long work Bowen's theory contains one more idea that young adults find immediately recognizable: triangles. When tension between two people rises, Bowen observed, they tend to pull in a third person to relieve it. A mother who is frustrated with her son may complain to his sister rather than speaking to him. A student who is angry with her father may vent to her mother, who then carries the message. Parents in conflict with each other may each confide in a child. Triangles are not always harmful, and venting to a trusted sibling can be a healthy way to process frustration. But they tend to keep the real conflict from being addressed, and they place the third person in a difficult position. Young adults often find themselves in triangles that were set up long before they left home: acting as the go-between for divorced parents, serving as a parent's confidant about marital problems, or being the "easy" child against whom a sibling is compared. Stepping out of a triangle does not require a confrontation. It usually means gently redirecting communication to where it belongs. "It sounds like you're upset with Dad about this. Have you told him?" Or: "I'd rather not carry messages between you and Mom. If there's something you want her to know, it would be better coming from you." These statements are small, but they can change the shape of a family's communication over time, and they relieve the young adult of a role that often generates quiet resentment. Bowen believed that differentiation levels are largely shaped in childhood and change slowly. Later clinicians have been more optimistic, and the experience of many people who work at it suggests that meaningful change is possible, especially in early adulthood, when the family's patterns are being renegotiated anyway. Leaving home offers a natural opportunity: a young adult sees her family from a new distance, encounters other families with different patterns, and has room to try new responses. The work is rarely dramatic. It consists mostly of repeated small moments: noticing a reaction and not acting on it, stating a view and not retracting it, staying on the phone through a difficult conversation rather than hanging up or collapsing. Each such moment builds a little more capacity for the next. Over time, many young adults find that conversations that once felt impossible become merely uncomfortable, and then routine. Consider how this plays out for the second student in the opening example, the one who switched to history. His father's first reaction was argument. Over the next month there were further attempts: forwarded articles about unemployment among humanities graduates, a pointed comment from an uncle at a birthday dinner, a stretch of cooler phone calls. The student did not treat any of these as an emergency. He read the articles and said he found one of them useful. He told his uncle he appreciated the concern. He kept calling. By the end of the semester his father was asking which history courses he liked best. Nothing dramatic happened; the family simply adjusted to a new fact, because the student had stayed both steady and present long enough for the adjustment to occur. Had he either caved in the first week or stopped calling home, the family would have learned something very different. It is also worth saying what differentiation is not. It is not coldness, detachment or a refusal to be affected by family members. A well-differentiated person can feel her mother's disappointment keenly and still hold her position. She can be moved by her father's worry and still decide that the decision is hers. The goal is not to stop caring but to care without losing yourself. The next chapter turns to a pattern that tests differentiation more than almost any other: the highly involved parent. Understanding what drives that involvement, and what the research does and does not say about its effects, is the first step toward responding to it without either surrender or war. Chapter 3: Understanding the Over-Involved Parent A junior receives an email from her academic adviser asking her to schedule a meeting. Before she has opened it, her father has texted to ask whether she has seen it, because the university's parent portal sent him a notice too. By the end of the day he has suggested three times for the meeting, drafted some questions she might ask, and wondered aloud whether he should call the adviser himself. She is annoyed, then guilty about being annoyed, because he is plainly trying to help and because on at least two past occasions his help got her out of real trouble. This is what most people mean by helicopter parenting: a parent who remains closely involved in the details of a young adult's life, especially in areas where the young adult could manage alone. The term is often used as an insult, and popular writing about it tends toward caricature, with parents calling professors to dispute grades or attending job interviews. The reality is more ordinary and more sympathetic. This chapter looks at what over-involvement is, what the research does and does not show about its effects, why parents do it, and how young adults can respond in ways that protect their autonomy without wounding the relationship. Naming the pattern The image of a parent hovering like a helicopter predates the modern debate. It appears in the psychologist Haim Ginott's 1969 book Between Parent and Teenager, in which a teenager complains that his mother hovers over him like a helicopter. The phrase spread through parenting literature in the following decades and became a staple of commentary about college students in the 2000s, when cell phones made constant contact cheap and easy and when administrators began reporting more parents intervening directly with universities. For a long time the concept was loose, used to describe everything from mild anxiety to outright control. In 2012, the developmental psychologists Laura Padilla-Walker and Larry Nelson tried to pin it down. Surveying 438 undergraduates from four American universities, along with their parents, they developed a measure of helicopter parenting and tested whether it was distinct from other forms of parental control that researchers had long studied. Behavioral control refers to monitoring and rule-setting; psychological control refers to manipulating a child's emotions, for example through guilt or withdrawal of love. Helicopter parenting, they found, was statistically distinct from both. It captured something specific: a parent's tendency to intervene in and solve problems for a young adult, make important decisions on the young adult's behalf, and step in to prevent difficulties before they arise. The same study turned up a finding that complicates the caricature. Helicopter parenting was positively associated with parental involvement, guidance and emotional support, and with warm relationships between parents and young adults. It was negatively associated with parents granting autonomy and with the young adults' engagement in school. In other words, the parents who hovered were often the same parents who were warm and engaged. Their involvement was not coldness disguised as help. It was care that had not adjusted to the child's age. That distinction matters because it suggests the problem is not the love behind the involvement but its form. A parent who asks about a job interview is involved. A parent who writes the cover letter is over-involved. The difference is whether the involvement supports the young adult in doing something or does the thing for them. Table 1 sets out that difference across several domains of student life, along with the sort of boundary a young adult might set in each. The examples are illustrative rather than exhaustive, and the line between the columns will fall in different places for different families. A parent who helps a student with a learning disability navigate accommodations, for example, may be doing something appropriate that would be over-involvement for another student. Table 1. Supportive involvement versus over-involvement in common areas of student life. Area Supportive involvement Over-involvement A boundary might sound like Academics Asks how classes are going; listens to worries Checks grades daily; contacts professors "I'll tell you about grades at the end of term." Course and major choices Shares views when asked; asks questions Chooses the major; ties support to a field "I want your input, and I'll make the call." Health Encourages care; helps with insurance questions Books appointments; demands details of visits "I'll handle appointments and tell you if it's serious." Social life Takes an interest in friends and partners Vets friends; monitors location to track plans "I'm happy to tell you about people, not to get approval." Problems and conflicts Offers advice, then lets the student act Intervenes directly with roommates or staff "Thanks. I'm going to try handling it myself first." What the research shows, and what it does not Over the past fifteen years, research on helicopter parenting and overparenting has grown substantially. Most of it relies on surveys of college students, sometimes paired with surveys of their parents, and most of it finds that higher levels of parental over-involvement are associated with somewhat worse outcomes for young adults. A representative example is a 2014 study by Holly Schiffrin and colleagues at the University of Mary Washington, which surveyed 297 college students. Students who reported having over-controlling parents reported higher levels of depression and lower satisfaction with life. The researchers traced the link through self-determination theory, introduced in the previous chapter: the effects of helicopter parenting on well-being were largely explained by students' sense that their needs for autonomy and competence were being frustrated. In plain terms, students whose parents did things for them felt less in charge of their lives and less capable, and those feelings accounted for much of the lower well-being. In 2024, the psychologists Shelly McCoy, Laura Dimler and Luiza Rodrigues published a meta-analysis in the Journal of Adult Development that pooled 53 studies involving more than 46,000 emerging adults. They found consistent associations between helicopter parenting and a range of outcomes: more anxiety and depressive symptoms, lower academic adjustment, lower self-efficacy and weaker self-regulation. The associations were similar for mothers and fathers. As meta-analyses go, the findings were robust in direction. It is important to read these results carefully, for three reasons. First, the associations are modest in size. The correlations in the meta-analysis ranged roughly from 0.13 to 0.21. Correlations of that magnitude are meaningful in psychology, but they mean that helicopter parenting explains only a small share of the differences among young adults in anxiety, self-efficacy or academic adjustment. Plenty of students with highly involved parents are doing well, and plenty with hands-off parents are struggling. Second, nearly all the studies are correlational, and many measure both parenting and outcomes at the same moment through the student's own report. That makes it hard to know which way the influence runs. Over-involved parenting may undermine a young adult's confidence. But a young adult who is anxious or struggling may also draw more intervention from parents, who see that their child is having trouble and respond by stepping in. Both processes are plausible, and the likeliest truth is that they feed each other in a loop. Third, some research finds benefits from intensive support. In 2012, the gerontologist Karen Fingerman and colleagues studied 592 grown children with a mean age of about 24, along with 399 of their parents. They examined "intense support," meaning parents providing several kinds of help, such as money, advice and emotional support, several times a week. Grown children who received intense support reported better psychological adjustment and greater life satisfaction than those who did not, even though both parents and children tended to regard that level of help as more than normal. The parents, interestingly, were the ones who seemed to pay a cost: those who believed their grown children needed too much support reported poorer life satisfaction themselves. Put together, the research supports a balanced conclusion. Parental support in young adulthood is, on the whole, good for young adults. What seems to go wrong is support that takes over rather than supports: help that bypasses the young adult's own decisions and efforts, and so deprives her of the chance to develop competence and a sense that her life is her own. The line runs not between involved and uninvolved parents but between involvement that respects autonomy and involvement that overrides it. This is the reason this book avoids treating over-involved parents as a clinical problem. They are, for the most part, loving parents doing too much of a good thing. The goal is not to push them away but to help them shift the form of their involvement. Why parents hover If over-involvement is usually driven by love, it is also usually driven by fear. Understanding the specific fears helps a young adult respond to them rather than only to the behavior they produce. The most common driver is anxiety about the stakes. Parents who believe that a single bad semester, a wrong major or a missed internship could derail their child's future will find it very hard to stand back and watch. That belief is not entirely irrational. College costs are high, many families borrow, and early career paths can feel unforgiving. A parent who watched peers struggle after college, or who struggled themselves, may see danger everywhere. A second driver is the loss of information that comes with a child leaving home. Parents who were used to seeing their child every day now depend on whatever the child chooses to report. Where information is scarce, anxiety fills the gap. Monitoring tools, from grade portals to location-sharing apps, offer a way to restore some of the lost information, and each use can feel harmless. The combined effect can be a level of surveillance the parent never consciously chose. A third driver is cultural. Sociologists have described a shift, particularly among middle-class families in the United States, toward what is sometimes called intensive parenting: a model in which good parents are expected to devote large amounts of time, money and attention to cultivating their children's development. Parents raised in that model, or who absorbed it from other parents around them, may experience stepping back as negligence. Neighborhood and peer norms reinforce it; a parent who does not monitor the grade portal may feel she is the only one. A fourth driver is the parent's own history and temperament. A parent with an anxiety disorder, a history of loss, or an experience of a child's past crisis may have good reasons for heightened vigilance. A parent whose own parents were distant may be determined not to repeat that pattern and overcorrect. A parent whose own identity became wrapped up in the child's achievements may find it hard to separate the two. Finally, over-involvement is sometimes a response to real events. If a young adult has had a serious health problem, a mental health crisis or a period of academic trouble, parents may have stepped in for good reasons and simply not stepped out again. In these cases the young adult's task is partly to demonstrate that the circumstances have changed, and partly to negotiate a plan for how the parent will know if they change back. None of these drivers is the young adult's fault, and none obliges the young adult to accept every intervention. But each suggests a different response. A parent driven by anxiety about stakes may respond to evidence that the student has a plan. A parent starved of information may relax if given a regular, predictable flow of it. A parent operating from cultural norms may need to hear that stepping back is itself a form of good parenting. A parent reacting to a past crisis may need a clear agreement about what warning signs would bring them back in. Responding without rejecting The most effective responses to over-involvement share a common structure: they meet the underlying need while changing the behavior. A few approaches are worth knowing. The first is to feed the information need on your own terms. Many young adults find that proactive sharing reduces monitoring. A regular weekly call in which a student offers news about classes, friends and health, before being asked, often lowers a parent's anxiety enough that the daily checking stops. The key is that the student decides what to share and when, which shifts the flow of information from extraction to offering. Parents who trust that they will hear about important things are less likely to go looking. The second is to give the parent a new role. Parents who are asked to stop doing something often need something to do instead. A father who has been managing his son's course registration might be asked to serve as a sounding board for the final schedule, reviewing it after the son has built it. A mother who has been drafting emails to professors might be asked to read one her daughter has written and offer feedback. These roles keep the parent involved while putting the young adult in charge, and they allow the parent to see the young adult's competence directly. The third is to hand over responsibility in stages. Few parents can move from full involvement to none overnight. A graduated plan, with specific responsibilities transferring to the young adult over a semester or a year, gives both sides time to adjust. "This semester I'll handle my own registration and my own doctor's appointments. Next semester I'd like to take over the insurance paperwork." Stated plans also make it easier to notice progress, which builds trust. The fourth is to decline help warmly and specifically. Many young adults find it hard to turn down a parent's offer without feeling rude. A simple formula helps: thank the parent for the offer, state that you are going to handle it yourself, and, if appropriate, say when you will let them know how it went. "Thanks for offering to call the housing office. I'm going to call them myself tomorrow. I'll text you afterward." The warmth matters; it signals that the refusal is about the task, not the relationship. The fifth is to let some things go badly. Parents intervene to prevent failure, and the most persuasive evidence that a young adult can cope with failure is watching her cope with it. A student who misses a deadline, deals with the consequences and learns from it teaches her parents something that no conversation can. This requires a certain tolerance, on the student's part, for having parents see her struggle without rushing to fix it, and for saying, "I know it didn't go well. I'm dealing with it." Finally, it helps to notice where you are inviting the involvement. The junior in the opening example was annoyed at her father's intervention, but she had also, in earlier semesters, forwarded him emails and asked him what to do. Part of changing the pattern is changing her own half of it: handling the next adviser email herself, and telling her father afterward rather than before. Parents and staff reading this chapter can apply the same logic from the other side. A parent who notices herself drafting her child's emails, checking the grade portal or calling an adviser might ask a simple question before acting: will this help my child do this, or will it do it for her? The first kind of help builds the young adult's competence. The second, however well meant, tends to postpone it. Most over-involved parents do step back eventually, especially when they see their young adult managing well. The process is usually slower than the young adult would like, and it rarely happens without some friction. But it happens far more reliably through patient demonstration than through argument. The next chapter turns to one of the areas where the friction is sharpest: information, and the legal and practical rules that govern what parents can see. Hashtags: #HealthyBoundariesWithParents #HealthyBoundaries #EmotionalIndependence #YoungAdults #ParentChildRelationships #FamilyCommunication #SettingBoundaries #EmotionalAutonomy #EmergingAdulthood #PersonalBoundaries #FamilyRelationships #HealthyCommunication #SelfDifferentiation #FamilySystemsTheory #EmotionalMaturity #PersonalGrowth #IndependenceAndConnection #ParentalSupport #HelicopterParenting #Overparenting #AutonomySupport #SelfDetermination #AssertiveCommunication #FamilyDynamics #MutualRespect #EmotionalWellbeing #ConflictResolution #IntergenerationalRelationships #FamilyObligations #HealthyRelationships

  • Deep Learning for Audio (Speech Recognition and Sound Event Detection)

    Download the Book (PDF): Introduction Say a short phrase to a smart speaker across a kitchen while the tap is running, a pan is sizzling and a radio is playing in the next room. Within a fraction of a second, a chip that draws a few milliwatts has decided that the phrase was its name and not the radio's, woken a larger processor, and handed it a buffer of audio from which a speech recogniser will extract your words. Somewhere else, a microphone on a lamp post is listening for breaking glass, a hospital monitor is flagging an unusual cough, and a wildlife recorder in a rainforest is sorting birdsong from insect noise. All of these systems are built from the same small set of ideas. This booklet is about those ideas. The argument of the book is simple to state and surprisingly easy to forget in practice: in audio, the model is rarely the hard part. What decides whether a system works is how faithfully its input representation respects the physics of sound and the human ear, and how honestly its training and evaluation reflect the acoustic conditions it will meet when deployed. Architectures matter, and the field has produced some genuinely brilliant ones. But a state-of-the-art network trained on clean, close-talking recordings will fail in a reverberant kitchen, and a modest network trained on the right representation with the right data will often succeed there. The engineers who build robust audio systems spend most of their time on front ends, data, augmentation and metrics, and comparatively little on the network in the middle. Why audio is its own discipline Deep learning for audio borrows heavily from computer vision and natural language processing. Convolutional networks designed for photographs are routinely applied to spectrograms; transformers designed for text now dominate speech recognition. It is tempting to conclude that audio is just another input modality, a matrix of numbers to be fed into whatever architecture is currently winning benchmarks. That conclusion misses three things that make sound different. First, sound is a one-dimensional signal sampled very fast. A single second of telephone-quality speech contains 8,000 samples; a second of studio audio contains 48,000. The structure that matters to a listener, such as the pitch of a voice, the identity of a vowel, or the onset of a door slam, is spread across hundreds or thousands of those samples. A model has to integrate over long stretches of signal to see anything meaningful at all, and the choice of how to do that integration is the first and most consequential design decision. Second, the mapping from physical signal to perceived sound is strongly non-linear. Humans hear pitch roughly logarithmically, are far more sensitive to some frequencies than others, and perceive loudness on a compressed scale. A decade of research in psychoacoustics, condensed into tools like the mel scale and the cepstrum, tells us which distinctions in the signal carry information and which do not. Representations that encode this knowledge, such as mel-frequency cepstral coefficients and log-mel spectrograms, make learning easier and more robust. Third, sounds overlap and are smeared by the room. In an image, a cat in front of a sofa occludes part of the sofa. In audio, a voice in front of a television adds to the television, sample by sample, and both are then convolved with the reflections of every wall in the room. Separating what you want from what you do not is not an occasional edge case; it is the normal condition of almost every real recording. What this booklet covers The booklet moves from the signal to the system. Chapter 1 explains what a digital audio signal actually is and how the short-time Fourier transform turns it into a picture of frequency content over time, with the trade-offs that choice involves. Chapter 2 builds mel-frequency cepstral coefficients step by step, explains why they dominated speech technology for thirty years, and explains why deep learning has largely, though not entirely, replaced them with log-mel spectrograms. Chapter 3 turns to WaveNet, the 2016 architecture from DeepMind that showed a neural network could model raw audio one sample at a time. WaveNet matters both for what it did, producing synthetic speech of unprecedented naturalness, and for the ideas it introduced, especially dilated causal convolutions, which reappear throughout audio modelling, including in keyword spotting. Chapters 4 and 5 cover the two great recognition problems. Chapter 4 traces automatic speech recognition from hybrid hidden-Markov systems through connectionist temporal classification, attention-based encoder-decoders and the transducer, to the self-supervised and weakly supervised models that define the field today. Chapter 5 covers sound event detection: recognising and locating non-speech sounds, a problem shaped by weak labels, overlapping events and the difficulty of deciding what it even means to be correct. Chapters 6 and 7 form the practical core. Chapter 6 treats wake-word detection, the always-on, low-power keyword spotting that sits in front of almost every voice interface, as an engineering problem with an unusually harsh set of constraints. Chapter 7 is about robustness: noise, reverberation, distance and device variation, and the toolkit of augmentation, normalisation and multi-microphone processing that lets a model survive them. Chapter 8 closes the loop with evaluation and deployment, because a model is only as good as the measurements used to judge it and the hardware it runs on. What this booklet leaves out Some exclusions are deliberate. Music information retrieval, with its rich traditions of beat tracking, chord recognition and source separation for songs, is mentioned only where its techniques transfer. Speaker recognition and diarisation appear only in passing. Text-to-speech is covered through WaveNet as a vocoder, not as a full topic. The booklet also assumes a working familiarity with the basic vocabulary of neural networks: layers, convolutions, gradient descent, and the idea of a training and test set. It does not assume any background in signal processing; everything needed is built from the ground up. There is one short block of code in the book, in Chapter 2, because the computation of MFCCs is clearest when you can see the steps in sequence. Everything else is explained in prose. Who this is for The intended reader is an engineer, researcher or technically minded product person who has trained a few neural networks and now needs to make one work on sound. Perhaps you have been asked to add voice control to a device, to detect alarms in a factory, or to evaluate a speech recognition vendor. Perhaps you have already tried an off-the-shelf model and found that it works beautifully in the demo and poorly in the field. The aim is to give you a mental model of the whole pipeline, from air pressure to decision, sharp enough that you can diagnose where things are going wrong and make sound choices about what to change. The field moves fast. Models released in the last few years, trained on hundreds of thousands of hours of audio, have reset expectations for what speech recognition can do out of the box. But the questions those models raise for a practitioner are the old ones in new form. What does the model actually hear? What conditions was it trained on? How will it be measured, and does that measurement reflect what users experience? Answering those questions well is the subject of the chapters that follow. Chapter 1: From Air Pressure to Spectrogram Every audio model begins with a microphone, and every microphone does the same humble thing: it converts small fluctuations in air pressure into a fluctuating voltage. Everything a neural network will ever know about a sound arrives through that conversion and the digital processing that follows it. Engineers who skip this layer tend to discover its importance later, usually in the form of a model that works on one device and fails on another for no obvious reason. This chapter builds the foundation: what a digital audio signal is, why the time-frequency representation is the natural way to look at it, and what is gained and lost when we compute one. Sampling, quantisation and what they preserve A sound wave is a continuous variation in pressure. To store it, an analogue-to-digital converter measures the microphone's voltage at regular intervals, the sampling rate, and rounds each measurement to one of a finite number of levels, the bit depth. The sampling rate determines the highest frequency that can be represented. The Nyquist-Shannon sampling theorem says that a signal sampled at rate f can faithfully represent components up to f/2, the Nyquist frequency. Anything above that frequency, if it reaches the converter, does not simply vanish. It folds back and appears as a spurious lower frequency, a distortion called aliasing. Real converters therefore apply an analogue low-pass filter before sampling, and digital resampling routines apply a digital one before reducing the rate. The rates you meet in practice reflect history as much as physics. Telephone networks have long used 8 kHz, which captures speech up to 4 kHz: enough for intelligibility, though it loses the high-frequency energy of fricatives like "s" and "f" that makes speech sound natural. Wideband speech systems, and most speech recognition research, use 16 kHz. Compact discs use 44.1 kHz, and video and professional audio use 48 kHz, comfortably above the roughly 20 kHz upper limit of young human hearing. For machine learning, the practical lesson is that sampling rate is part of the data distribution. A model trained on 16 kHz audio and fed 8 kHz telephone audio that has been upsampled will see a spectrum that is empty above 4 kHz, a condition it has never encountered. A model trained on 48 kHz audio from studio microphones will see energy at frequencies that a cheap embedded microphone simply does not capture. Matching rates and bandwidths between training and deployment is the first of many acts of honesty this booklet will ask for. Bit depth governs the precision of each sample. Sixteen-bit audio, the CD standard and the default for most speech corpora, offers 65,536 levels and a theoretical dynamic range of about 96 decibels. That is plenty for most recognition tasks. What matters more in the field is how the available range is used: a recording made with the gain set too low wastes most of its levels and buries quiet speech in quantisation noise; one with the gain too high clips, flattening the peaks of the waveform and adding harsh distortion that no later processing can undo. Clipping in particular is common in consumer devices when a user speaks close to the microphone, and it is worth simulating in training if your users will do it. Why the raw waveform is hard to learn from Once sampled, a sound is a long sequence of numbers. One second of 16 kHz audio is 16,000 of them. The sequence has some awkward properties for a learning algorithm. It is long relative to the structures of interest. A spoken syllable lasts roughly 150 to 300 milliseconds, which is several thousand samples. A pitch period of a male voice is around 8 to 10 milliseconds; a female voice, around 4 to 5. A network that operates directly on samples must build receptive fields spanning thousands of time steps before it can perceive a phoneme. It is phase-sensitive in ways that perception mostly is not. Two waveforms can look completely different sample by sample yet sound identical to a listener, because they contain the same frequencies at the same strengths with different relative phase. Conversely, a small time shift changes every sample value while changing nothing a listener cares about. A model forced to learn these invariances from data must spend capacity and training examples on them. And it mixes everything together. A voice, a fan and a passing car all add into the same sequence of samples. Separating them in the time domain is possible, but the components are far easier to distinguish when you look at which frequencies are active and when. None of this makes raw-waveform learning impossible. Networks such as WaveNet, discussed in Chapter 3, and front ends such as SincNet and learnable filterbanks, which learn their first layer of filters from data, show that it can be done, and self-supervised speech models like wav2vec 2.0 consume raw audio through a stack of convolutions. But in nearly every case, what those first layers learn turns out to resemble a bank of bandpass filters spread across frequency: they rediscover a time-frequency representation. Starting with one is usually the more efficient path. The short-time Fourier transform The Fourier transform expresses a signal as a sum of sinusoids, each with its own frequency, amplitude and phase. Applied to a whole recording, it tells you which frequencies are present but not when. That is useless for speech, whose frequency content changes every few tens of milliseconds as the mouth moves. The short-time Fourier transform (STFT) solves this by analysing the signal in short overlapping chunks. The procedure is straightforward. Choose a frame length, typically 20 to 32 milliseconds for speech, which is 320 to 512 samples at 16 kHz. Choose a hop, the distance between the starts of successive frames, typically 10 milliseconds. Multiply each frame by a window function that tapers smoothly to zero at both ends, most often a Hann or Hamming window. Compute the discrete Fourier transform of each windowed frame using the fast Fourier transform algorithm. The result is a matrix with one column per frame and one row per frequency bin. Taking the magnitude of each complex value, or its square to get power, gives the spectrogram: a picture of energy as a function of time and frequency. In a spectrogram of speech, voiced sounds show as stacks of horizontal stripes, the harmonics of the speaker's pitch, shaped by broad bands of energy called formants that correspond to resonances of the vocal tract. Fricatives appear as diffuse energy at high frequencies. Plosives like "p" and "t" appear as brief silences followed by vertical bursts. Non-speech sounds have their own signatures: a siren is a curve sweeping up and down, a dog bark is a short harmonic smear, a door slam is a sharp vertical line with a decaying tail. Why the window matters The window function exists because the discrete Fourier transform implicitly treats each frame as one period of an infinitely repeating signal. If the frame is cut off abruptly, the jump between its end and its beginning introduces spurious frequencies, energy that leaks from the true frequency into neighbouring bins. Tapering the frame to zero at the edges reduces this spectral leakage at the cost of slightly blurring each frequency peak. The Hann window, a raised cosine, is a sensible default; the Hamming window, which does not quite reach zero, was the traditional choice in speech recognition and remains common in MFCC implementations. The uncertainty trade-off The frame length embodies a fundamental trade-off. A longer frame contains more cycles of each frequency and so resolves frequency more finely: a 64-millisecond frame separates frequencies about 16 Hz apart, while a 16-millisecond frame separates only those about 62 Hz apart. But a longer frame blurs events in time, smearing a sharp onset across its whole length. This is a version of the time-frequency uncertainty principle, and no choice of frame length escapes it. Speech recognition settled on frames of around 25 milliseconds because that is short enough for the vocal tract to be roughly stationary within a frame, yet long enough to resolve the formants that distinguish vowels. Music analysis often uses longer frames, because separating closely spaced notes matters more than timing to the millisecond. Sound event detection sits between the two and sometimes benefits from computing representations at more than one resolution. Hop length and the frame rate The hop determines the frame rate of the spectrogram, and hence the time resolution of everything downstream. A 10-millisecond hop gives 100 frames per second, which has become close to universal in speech. Some modern recognisers subsample further inside the network, down to 25 or even 12.5 frames per second, because the information rate of speech, at roughly ten to fifteen phonemes per second, does not require more. For event detection, a finer hop may matter if precise onset times are needed, while keyword spotting on a microcontroller may use a coarser one to save computation. Magnitude, phase and the logarithm The STFT produces complex numbers, which encode both magnitude and phase. Most recognition systems discard the phase and keep only the magnitude or power. This is partly a matter of convenience and partly a judgement about perception: for recognising what was said or what happened, magnitude carries most of the information. Phase does matter for some tasks, especially for reconstructing audio from a spectrogram and for localising sound sources with multiple microphones, which compare phases between channels. Chapter 7 returns to that second use. Having kept the magnitude, almost every system then takes its logarithm. There are three good reasons. The dynamic range of audio is enormous: the power of a loud sound can be a million times that of a quiet one in the same recording, and a network fed linear power will be dominated by the loudest bins. The logarithm compresses that range into something a network can handle. Human loudness perception is itself roughly logarithmic, which is why we measure sound in decibels. And the logarithm turns multiplication into addition, which, as the next chapter shows, is the key to separating the source of a sound from the filter that shaped it. A small constant is usually added before taking the logarithm, to avoid the logarithm of zero in silent bins. Its value is not as innocent as it looks. Too small, and silent or digitally zeroed regions produce extreme negative values that dominate normalisation statistics; too large, and quiet but meaningful detail is flattened. A constant around 10 to the power of minus 6 relative to full-scale power is a common compromise, but the right answer depends on your input levels. Thinking about the spectrogram as an image Once computed, a log-magnitude spectrogram looks like a greyscale image, and it is tempting to treat it as one. Much of the success of deep learning for audio has come from doing exactly that: convolutional networks pioneered on photographs work remarkably well on spectrograms, and the audio spectrogram transformer adapts the vision transformer almost unchanged. But the analogy has limits, and knowing them prevents mistakes. In a photograph, the two axes are equivalent; a cat shifted upward is still a cat. In a spectrogram, the axes mean different things. Shifting a pattern along the time axis does not change what it is: a word said a second later is the same word. Shifting it along the frequency axis can change it entirely: raising every frequency of a vowel turns it into a different vowel or a different speaker. Convolution's translation equivariance is therefore well matched to time and only partly matched to frequency, which is one reason many audio architectures use filters that are tall in frequency and narrow in time, or that pool differently along the two axes. Sounds in a spectrogram also do not occlude one another; they add, approximately, in the power domain. A cat in front of a sofa hides part of the sofa, but a voice over a fan leaves the fan's energy fully present in the bins where the voice is quiet. Augmentations designed for images, such as rotations or colour shifts, have no sensible meaning for spectrograms. Augmentations designed for audio, like adding noise or masking frequency bands, which Chapter 7 discusses, do. Finally, the linear-frequency spectrogram wastes resolution. Its bins are evenly spaced, so it devotes as many rows to the band between 7 and 8 kHz as to the band between 100 Hz and 1 kHz, where most of the information in speech lives. Correcting that imbalance, in a way informed by how human hearing works, is the subject of the next chapter. Alternatives to the STFT The STFT is not the only way to obtain a time-frequency picture, and two alternatives appear often enough to be worth knowing. The constant-Q transform uses analysis windows whose length varies with frequency: long windows for low frequencies, short ones for high. Its frequency bins are spaced geometrically, so each octave receives the same number of bins, which matches the structure of musical scales. It is widely used in music analysis, where resolving adjacent semitones in the bass matters, and occasionally in speech anti-spoofing work, where its fine low-frequency resolution helps expose artefacts of synthetic speech. Its uneven time resolution and higher cost make it less common elsewhere. Gammatone filterbanks model the frequency selectivity of the human cochlea more directly than the mel filterbank does, using filters whose shapes approximate measured auditory responses and whose bandwidths follow the equivalent rectangular bandwidth scale derived from psychoacoustic experiments by Brian Glasberg and Brian Moore. Features built on them, such as gammatone-frequency cepstral coefficients and the power-normalised cepstral coefficients of Chanwoo Kim and Richard Stern, were proposed partly for their robustness to noise. In deep learning practice, the differences between gammatone and mel front ends are usually small compared with the differences made by data and augmentation, but auditory-inspired front ends retain a following in hearing research and in hearing-aid and cochlear-implant processing. Wavelet transforms, which decompose a signal into scaled and shifted versions of a short prototype waveform, offer another multi-resolution view. They have found niches in detecting transients, such as clicks and impacts in machine monitoring, but have not displaced the STFT for speech or general sound recognition. Preprocessing pitfalls A handful of mundane preprocessing errors account for a surprising share of the problems seen in applied audio projects, and they are worth listing because none of them produces an error message. Channel handling is the first. Stereo or multi-channel files may be averaged to mono, have one channel taken, or be passed through unchanged, depending on the loading library and its defaults. If training data were averaged and deployment audio uses one channel of a stereo pair, or vice versa, level and phase differences change what the model sees. Resampling quality is the second. Libraries differ in the quality of their anti-aliasing filters, and a cheap resampler can introduce aliasing or roll off high frequencies. Resampling the training data with one library and the deployment audio with another is a small but real source of mismatch. Integer and floating-point scaling is the third. Sixteen-bit audio is often loaded either as integers between −32,768 and 32,767 or as floating-point values between −1 and 1. A model trained on one and fed the other sees inputs scaled by a factor of 32,768, which after the logarithm becomes a constant offset of about 90 dB in every bin. Mean normalisation may hide much of this; a fixed logarithm constant will not. Leading and trailing silence is the fourth. Datasets differ in how tightly utterances are trimmed. A keyword model trained on clips in which the word always starts within the first 100 milliseconds may learn that position as a cue, and then behave poorly when the word appears anywhere in a streaming window. Randomly shifting the content within each training window prevents this. DC offset is the fifth. Some cheap microphones and converters add a constant bias to every sample. It shows up as energy in the lowest frequency bin and can distort level-based normalisation. A high-pass filter at a few tens of hertz, or simple mean removal, deals with it. Practical defaults For readers who want a starting point, the following settings are widely used for 16 kHz speech and are a reasonable baseline for many other tasks: a 25-millisecond Hann or Hamming window, a 10-millisecond hop, a 512-point FFT (padding the 400-sample frame with zeros), magnitude or power spectrum, followed by the mel-scale filterbank and logarithm described in Chapter 2. For general sound event detection, widely used open models trained on AudioSet operate on audio resampled to 16 or 32 kHz with similar 10-millisecond hops; adopting the same front end as a pretrained model you intend to fine-tune is far more important than the particular values. That last point deserves emphasis, because it causes more silent failures than almost anything else in applied audio work. A pretrained model has learned to interpret a particular representation: a particular sampling rate, window, hop, number of mel bands, frequency range, logarithm constant and normalisation. Feed it anything else and it will still produce outputs, confidently, and they will be worse in ways that are hard to diagnose. Before blaming the model, check the front end. Chapter 2: Mel-Frequency Cepstral Coefficients For three decades, from the early 1980s until the deep learning wave of the 2010s, almost every speech recogniser in the world began the same way. It cut the audio into 25-millisecond frames, computed a spectrum for each, warped that spectrum onto a perceptual frequency scale, took a logarithm, applied a discrete cosine transform, and kept the first dozen or so numbers. Those numbers, mel-frequency cepstral coefficients or MFCCs, were the lingua franca of speech technology. They remain in use today in embedded keyword spotting, speaker recognition, and countless classical and teaching pipelines. Understanding MFCCs properly is worthwhile even if you never use them, because each step encodes a specific idea about speech and hearing. Some of those ideas are still built into the log-mel spectrograms that modern networks consume. Others, it turns out, are steps a neural network would rather do for itself. Knowing which is which explains a good deal about how audio front ends have evolved. The source-filter model of speech MFCCs were designed around a particular theory of how speech is produced. In the source-filter model, the voice has two largely independent parts. The source is the excitation: for voiced sounds, the periodic buzzing of the vocal folds, which produces a fundamental frequency and a series of harmonics at integer multiples of it; for unvoiced sounds like "s" or "sh", turbulent noise produced by air forced through a narrow constriction. The filter is the vocal tract, the throat, mouth and nasal cavities, whose shape determines which frequencies are amplified, creating the broad resonant peaks called formants. For recognising words, the filter is what matters. The difference between "beet" and "boot" is the shape of the mouth, which shows up as the positions of the first two or three formants. The source mostly carries information about who is speaking and how: pitch, intonation and emotion. In a language like English, a word means the same thing whether it is spoken in a high or low voice. So a front end for word recognition would ideally keep the shape of the filter and discard the fine detail of the source. In the spectrum, the two are multiplied together. The harmonics of the source appear as a comb of closely spaced peaks; the filter imposes a smooth envelope over them. Separating a product is awkward. Separating a sum is easy. That observation leads directly to the cepstrum. The mel scale The first step particular to MFCCs is warping frequency onto the mel scale. The scale originates in psychoacoustic experiments by Stanley Smith Stevens, John Volkmann and Edwin Newman, published in 1937, in which listeners were asked to adjust tones until they sounded half or twice as high as a reference. The resulting scale of perceived pitch is roughly linear below about 1 kHz and roughly logarithmic above it. Equal steps in mels correspond to equal perceived steps in pitch. Several formulas approximate the scale. The most common in software is mel = 2595 × log10(1 + f / 700), where f is frequency in hertz. By construction, 1,000 Hz maps to about 1,000 mels. At 8 kHz, the Nyquist frequency of 16 kHz audio, the scale reaches about 2,840 mels, which means that the whole upper half of the speech band, 4 to 8 kHz, occupies only around a quarter of the mel range. Different libraries use slightly different formulas, notably the Slaney formula used by default in librosa, which is linear below 1 kHz and logarithmic above. The differences are small but real, and another reason pretrained models must be fed exactly the front end they were trained with. The mel scale is applied through a filterbank. Choose a number of filters, traditionally 20 to 40 for MFCCs and 40 to 128 for modern log-mel spectrograms. Space their centre frequencies evenly on the mel scale between a lower and upper frequency limit. Give each filter a triangular shape in linear frequency that rises from zero at the previous filter's centre to one at its own centre and falls back to zero at the next filter's centre. Multiply each frame's power spectrum by each triangle and sum, giving one energy value per filter per frame. The effect is to summarise the 257 linear frequency bins of a 512-point FFT into a few dozen bands that are narrow at low frequencies, where pitch perception and formant positions demand precision, and wide at high frequencies, where they do not. The filterbank also smooths across individual harmonics, partially removing the fine structure of the source before the cepstral step even begins. The cepstrum Take the logarithm of the filterbank energies. Because the spectrum was the product of a source and a filter, its logarithm is their sum: log of source plus log of filter. Now apply a transform that separates components by how rapidly they vary across frequency. The smooth vocal tract envelope varies slowly from one band to the next; the residual harmonic ripple of the source varies quickly. A Fourier-type transform across the frequency axis puts the slowly varying part into its first few coefficients and the rapidly varying part into later ones. This is the cepstrum, a name coined by Bruce Bogert, Michael Healy and John Tukey in a 1963 paper on detecting echoes in seismic signals. They reversed the first syllable of "spectrum" to signal that this was a spectrum of a spectrum, and introduced a whole vocabulary of similar inversions, of which "quefrency", for the cepstral domain's equivalent of frequency, and "liftering", for filtering in that domain, survive. The joke has outlasted most of the paper. For MFCCs, the transform applied to the log mel energies is the discrete cosine transform (DCT), usually the type-II variant. The DCT is used rather than a full Fourier transform because the log energies are real-valued and the DCT produces real outputs, and because it has a second valuable property: its outputs are largely decorrelated. Adjacent mel filters overlap and their energies are strongly correlated; the cepstral coefficients that emerge from the DCT are much less so. The final step is truncation. Keep only the first 12 or 13 coefficients and throw the rest away. Those low-quefrency coefficients describe the smooth spectral envelope, the filter, which is what speech recognition wants. The discarded high-quefrency coefficients carry pitch harmonics and fine detail. The zeroth coefficient is proportional to the overall log energy of the frame and is often replaced by an explicit energy measure. Putting it together The full pipeline, in the form popularised by Steven Davis and Paul Mermelstein's 1980 comparison of parametric representations for word recognition, which showed MFCCs outperforming alternatives of the time, can be written in a few lines. The following Python sketch uses NumPy and the librosa library's mel filterbank helper; production implementations in toolkits such as Kaldi and torchaudio differ in details but follow the same steps. import numpy as np import librosa from scipy.fftpack import dct def mfcc(signal, sr=16000, n_fft=512, win=400, hop=160, n_mels=40, n_mfcc=13, preemph=0.97): # 1. Pre-emphasis: boost high frequencies x = np.append(signal[0], signal[1:] - preemph * signal[:-1]) # 2. Frame, window and FFT (power spectrum) frames = librosa.util.frame(x, frame_length=win, hop_length=hop).T frames = frames * np.hamming(win) power = np.abs(np.fft.rfft(frames, n=n_fft)) ** 2 / n_fft # 3. Mel filterbank energies mel_fb = librosa.filters.mel(sr=sr, n_fft=n_fft, n_mels=n_mels) mel_energy = power @ mel_fb.T # 4. Logarithm log_mel = np.log(mel_energy + 1e-10) # 5. DCT and truncation return dct(log_mel, type=2, axis=1, norm='ortho')[:, :n_mfcc] Two steps here have not yet been explained. Pre-emphasis applies a simple first-order high-pass filter, subtracting 0.97 times the previous sample from each sample. Voiced speech has a spectrum that falls by roughly 6 decibels per octave, so without pre-emphasis the high-frequency formants would be numerically tiny; boosting them balances the spectrum. In modern pipelines with per-band normalisation, pre-emphasis matters less and is often omitted. The second step is implicit: the 25-millisecond window and 10-millisecond hop described in Chapter 1 determine the frame rate, giving 100 vectors of 13 coefficients per second of audio. Deltas and normalisation Classical systems augmented the static MFCCs with their time derivatives. The delta coefficients estimate the slope of each coefficient across a few neighbouring frames; the delta-delta, or acceleration, coefficients estimate the slope of the slope. Thirteen statics plus thirteen deltas plus thirteen delta-deltas gave the famous 39-dimensional feature vector that fed generations of Gaussian mixture model recognisers. The derivatives mattered because those models treated each frame independently, given the hidden state, and so had no other way to see how the spectrum was changing. Cepstral mean normalisation subtracts, from each coefficient, its mean over an utterance or a sliding window. The rationale is elegant. A fixed linear channel, such as a particular microphone or telephone line, multiplies the spectrum by a fixed frequency response. In the log domain, that becomes an added constant; after the DCT, still an added constant in each cepstral coefficient. Subtracting the mean removes it. A simple subtraction thus provides a large part of the robustness to microphone and channel differences, which is why some form of mean normalisation survives in nearly every modern front end, including those for neural networks. It does nothing, however, for additive noise or for reverberation with a long tail, which are not fixed multiplicative channels and are discussed in Chapter 7. What the coefficients look like It helps to have an intuition for the individual coefficients. The first coefficient after the energy term, often called C1, measures the overall tilt of the log spectrum: whether energy is concentrated at low or at high frequencies. Voiced vowels, with most of their energy below 1 kHz, have large positive values; fricatives like "s", with energy concentrated at high frequencies, have negative values. C2 measures, roughly, whether energy is concentrated in the middle of the band or at its edges, and so on, each successive coefficient describing a finer ripple across the mel bands. By about C12 the ripple is fine enough that it begins to describe harmonic detail rather than formant structure, which is why truncation at around that point works. This intuition also explains a well-known weakness. Because each coefficient summarises the whole spectrum, a narrowband noise, say a hum at 1 kHz, perturbs every coefficient a little. Robustness to noise that affects only part of the spectrum is therefore harder to achieve with MFCCs than with features that keep bands separate, and this was one of the motivations for robust alternatives in the classical era, such as perceptual linear prediction (PLP), proposed by Hynek Hermansky in 1990, and RASTA filtering, which suppresses spectral components that change too slowly or too quickly to be speech. Speaker normalisation The vocal tract of an adult man is typically longer than that of an adult woman, and a child's is shorter still. A longer tract lowers all formant frequencies roughly proportionally, so the same vowel spoken by different people appears at different positions on the frequency axis. Classical systems countered this with vocal tract length normalisation, which warps the frequency axis of each speaker's features by a factor chosen to maximise the likelihood of a reference model. The warp was usually applied by stretching or compressing the mel filterbank itself. Deep networks trained on diverse speakers learn much of this invariance implicitly, but random frequency warping remains a useful augmentation, particularly for recognising children, whose speech is underrepresented in most training corpora. Why deep learning moved to log-mel spectrograms When deep neural networks began replacing Gaussian mixture models in speech recognition around 2010 to 2012, researchers found that the networks often did better if the last steps of the MFCC pipeline were removed. Work from groups at Toronto, Microsoft and elsewhere in that period reported that log mel filterbank energies, the representation just before the DCT, gave lower error rates than MFCCs for deep networks. Within a few years, log-mel features, usually with 40 to 80 bands for speech and 64 to 128 for general audio, became the default. The reasons follow from what each MFCC step was for. The DCT decorrelates the features. Decorrelation was essential for Gaussian mixture models with diagonal covariance matrices, which assumed that feature dimensions were independent and modelled them badly when they were not. A neural network has no such assumption; it can learn correlations directly, and indeed benefits from them. The DCT also destroys locality in frequency. In a log-mel spectrogram, adjacent rows are adjacent bands, so a convolutional filter can learn a local pattern, like the shape of a formant, and recognise it wherever it appears. After the DCT, each coefficient mixes information from every band, and a pattern local in frequency becomes spread across all coefficients. Convolutions over MFCCs make much less sense than convolutions over log-mel spectrograms. Truncation throws away information. The high-quefrency coefficients do carry pitch and fine spectral detail, which is useless noise for a Gaussian model of phonemes but potentially useful for a network deciding, for instance, whether a sound is a voice or a musical instrument, or for tonal languages where pitch distinguishes words. A network with enough data can learn which details to ignore. In short, MFCCs are a hand-engineered compression designed for models that could not learn their own. Deep networks can, and they prefer the richer input. The step that survives intact is the mel filterbank followed by the logarithm: the part that encodes how human hearing allocates resolution, which remains a good inductive bias even for a network with plenty of data. Where MFCCs still win It would be wrong to conclude that MFCCs are obsolete. Their compactness is a real virtue in three settings. The first is tiny devices. A keyword spotter on a microcontroller with a few hundred kilobytes of memory, discussed in Chapter 6, benefits from an input of 10 numbers per frame instead of 40. Much of the published work on keyword spotting for microcontrollers, including the widely cited 2017 study from Arm researchers Yundong Zhang, Naveen Suda, Liangzhen Lai and Vikas Chandra, "Hello Edge", used MFCCs or similarly compact features for exactly this reason. Smaller inputs mean smaller first layers, fewer multiply-accumulate operations and less memory traffic. The second is small data. When you have only a few hours of labelled audio, the inductive bias built into MFCCs, that the spectral envelope matters and pitch harmonics do not, can substitute for training data. Classical speaker verification systems built on i-vectors used MFCCs, and many bioacoustic and medical audio studies with limited recordings still find them competitive. The third is interpretability and compatibility. MFCC pipelines are standardised, fast and understood. When an engineer needs a quick baseline, or a system must interoperate with existing tools, they remain a sensible choice. As Table 1 summarises, the three representations discussed so far trade compactness against fidelity, and the right choice depends on the model and the constraints. Table 1. Common audio input representations compared. Representation Values per 10 ms frame Keeps frequency locality Typical use today Raw waveform 160 samples at 16 kHz Not applicable Self-supervised encoders, vocoders Log-mel spectrogram 40 to 128 bands Yes Most ASR and sound event models MFCC (with deltas) 13 (or 39) No Embedded keyword spotting, small-data tasks Learnable front ends Between fixed MFCCs and raw waveforms lies a family of learnable front ends. SincNet, introduced by Mirco Ravanelli and Yoshua Bengio in 2018, constrains the first convolutional layer of a network to consist of bandpass filters parameterised only by their low and high cutoff frequencies, which are learned. LEAF, a learnable front end published by researchers at Google in 2021, learns the filter shapes, a per-channel compression that replaces the fixed logarithm, and the pooling, while keeping the overall structure of a filterbank. These methods sometimes outperform fixed mel features, particularly on non-speech tasks where the mel scale's assumptions about human hearing are less obviously appropriate: bird calls, machinery, ultrasonic bat echolocation. But the gains are typically modest, and in large-scale speech recognition, fixed log-mel features remain dominant. The lesson is that the mel filterbank is a strong prior, not an arbitrary choice; learning a replacement helps mostly where that prior is wrong. A final caution applies to all of these choices. The representation determines what the model can hear, and also what it cannot. If a sound you care about lives above the upper limit of your filterbank, or below its lower limit, the model will never detect it, however large it is. Industrial monitoring tasks involving high-frequency bearing wear, or infrasound, need front ends designed for them. Defaults inherited from speech are a starting point, not a law of nature. Chapter 3: WaveNet and the Raw Waveform In September 2016, researchers at DeepMind published a paper with an unassuming title, "WaveNet: A Generative Model for Raw Audio", by Aäron van den Oord and colleagues. It described a neural network that generated audio one sample at a time, sixteen thousand times per second, each sample predicted from all the samples before it. The idea seemed computationally absurd. The results were startling. In listening tests reported in the paper, WaveNet's synthetic English and Mandarin speech was rated substantially more natural than the best existing concatenative and parametric systems, closing a large part of the gap between machine and human speech. WaveNet belongs in a booklet about recognition for two reasons. The first is that its central architectural idea, the stack of dilated causal convolutions, turned out to be one of the most useful general tools for processing audio sequences, and reappears in keyword spotting, source separation and speech enhancement. The second is that WaveNet answered a question this book keeps returning to: can a neural network learn directly from the raw waveform, without any hand-designed front end? It can, at a price. Understanding both the achievement and the price clarifies when raw-waveform modelling is worth it. Autoregressive modelling of audio WaveNet is an autoregressive model. It factorises the probability of a whole waveform into a product of conditional probabilities: the probability of the first sample, times the probability of the second given the first, times the probability of the third given the first two, and so on. The network's job is to output, at each time step, a probability distribution over the next sample's value given all previous values. To make this tractable, the original WaveNet quantised each sample to one of 256 values and treated prediction as a 256-way classification. Linear 16-bit audio would have required 65,536 classes, so the authors first applied mu-law companding, a non-linear transformation long used in telephony that allocates finer quantisation steps to quiet sample values and coarser ones to loud values. This matches the way small amplitude differences matter more when the signal is quiet, and it reduced the output to 8 bits without audible degradation of quality for speech. The network ends in a softmax over the 256 levels, trained with ordinary cross-entropy loss. At training time, because the whole waveform is known, the predictions for every time step can be computed in parallel: each output depends only on the true preceding samples, which are all available. At generation time, the network must produce one sample, feed it back as input, produce the next, and so on. That sequential loop is what made the original WaveNet so slow, and it is the price referred to above. Dilated causal convolutions The core difficulty for any raw-audio model is receptive field. To predict a speech sample well, the network needs context spanning at least a pitch period and ideally a syllable or more: hundreds to thousands of samples. A recurrent network can in principle carry such context, but in practice struggles to train over sequences that long. An ordinary convolutional network needs either enormous filters or an impractically deep stack to see that far back. WaveNet's solution combines two ideas. A causal convolution is a one-dimensional convolution in which the output at time t depends only on inputs at time t and earlier, never later. In practice this is achieved by padding the input on the left and shifting the output, so that no information from the future leaks into the prediction. Causality is essential for an autoregressive generator, and also for any streaming recogniser that must produce outputs before the audio has finished. A dilated convolution applies its filter to inputs that are spaced apart, skipping a fixed number of positions between taps. A filter of width two with dilation one looks at positions t and t−1. With dilation two, it looks at t and t−2. With dilation four, t and t−4. Stacking layers whose dilations double at each layer, 1, 2, 4, 8 and so on up to 512, produces a receptive field that grows exponentially with depth while the number of parameters and computations grows only linearly. Ten such layers with filter width two see 1,024 samples, about 64 milliseconds at 16 kHz. WaveNet repeated this block of ten layers several times, extending the receptive field further and adding capacity at each scale. It helps to picture the result in words. The bottom layer combines each sample with its immediate neighbour. The next layer combines pairs that are two samples apart, so each of its outputs summarises four consecutive samples. The next summarises eight, then sixteen. By the top of a block, each output summarises a thousand samples, but because each layer only ever combines two inputs, the computation stays cheap. It is the convolutional equivalent of a tree of pairwise merges. Gated activations and residual structure Each WaveNet layer uses a gated activation unit borrowed from earlier work on the PixelCNN image model by van den Oord and colleagues. The dilated convolution produces two sets of outputs; one passes through a hyperbolic tangent, the other through a sigmoid, and the two are multiplied elementwise. The sigmoid acts as a learned gate controlling how much of the tangent's signal passes through. The authors reported that this worked significantly better than rectified linear units for modelling audio. The output of each layer then passes through a one-by-one convolution and splits two ways. One branch is added back to the layer's input, forming a residual connection that lets gradients flow through deep stacks. The other branch is a skip connection that goes directly to the output. All the skip outputs are summed, passed through a couple of further non-linear layers, and fed into the final softmax. Residual and skip connections are what allowed WaveNet to be trained with dozens of layers. Conditioning: telling WaveNet what to say An unconditioned WaveNet trained on speech produces babble: realistic-sounding voices uttering plausible syllables that form no words. To be useful for text-to-speech, the model must be conditioned on what to say. WaveNet supported two kinds of conditioning. Global conditioning adds a single vector, such as a speaker identity embedding, to every layer, so one model can produce many voices. Local conditioning supplies a time-varying input, such as linguistic features or a mel spectrogram, which is upsampled to the audio sample rate and added inside every gated unit. The second form proved enormously influential. In the Tacotron 2 system described by Jonathan Shen and colleagues at Google in 2017, a sequence-to-sequence network converts text into a mel spectrogram, and a WaveNet conditioned on that spectrogram converts it into a waveform. In this role, WaveNet is a vocoder: a model that turns a spectral representation back into sound. Tacotron 2's reported mean opinion score was close to that of professionally recorded speech. The division of labour, with an acoustic model predicting a spectrogram and a separate neural vocoder rendering it, remains the dominant architecture for high-quality speech synthesis. The vocoder role also illustrates something about the representations discussed in Chapters 1 and 2. A mel spectrogram discards phase and smooths frequency detail. Classical methods for recovering a waveform from such a representation, such as the Griffin-Lim algorithm, which iteratively estimates a consistent phase, produce audibly metallic results. WaveNet showed that a network trained on enough real speech could fill in the missing detail convincingly, because it had learned what speech waveforms consistent with a given spectrogram actually sound like. The speed problem and its solutions The original WaveNet was far too slow to deploy; generating one second of audio required sixteen thousand sequential passes through a deep network. The response to this problem produced a decade of fruitful research. Parallel WaveNet, published by DeepMind in 2017 and deployed in Google Assistant, used a technique called probability density distillation. A fast "student" network, based on an inverse autoregressive flow that can generate all samples in parallel, was trained to match the output distribution of a slow, already trained "teacher" WaveNet. The student generated audio many times faster than real time. WaveRNN, from Nal Kalchbrenner and colleagues in 2018, took the opposite approach: keep autoregression but make each step extremely cheap, with a single small recurrent layer, weight sparsification and clever splitting of each 16-bit sample into coarse and fine halves. It could run in real time on a mobile phone processor. LPCNet, from Jean-Marc Valin and Jan Skoglund at Mozilla and Google in 2019, went further by combining a small recurrent network with classical linear prediction, letting a signal-processing model handle the predictable part of each sample so that the network only had to model the residual. Generative adversarial networks then removed autoregression entirely. MelGAN in 2019 and HiFi-GAN in 2020, the latter by Jungil Kong, Jaehyeon Kim and Jaekyoung Bae, generate entire waveforms in parallel from mel spectrograms, trained with discriminators that judge realism at multiple time scales and periodic structures. HiFi-GAN in particular combined high quality with speed far beyond real time even on a CPU, and became a standard choice. More recent work has explored diffusion-based vocoders and neural audio codecs that compress speech into discrete tokens which language-model-style networks can generate; those codec-based approaches have become central to the newest generation of speech synthesis and spoken dialogue systems. Table 2 lays out how these vocoder families trade quality against generation speed. Table 2. Neural vocoder families and their principal trade-offs. Family Example Generation Main strength Main cost Autoregressive CNN WaveNet (2016) Sample by sample Very high quality Very slow Distilled flow Parallel WaveNet (2017) Parallel Fast inference Complex two-stage training Lightweight RNN WaveRNN, LPCNet Sample by sample Runs on phones Still sequential GAN HiFi-GAN (2020) Parallel Fast and high quality Adversarial training can be unstable Working out a receptive field Because the receptive field matters so much, both for WaveNet and for the recognition models that borrowed its design, it is worth seeing how to compute one. For a stack of causal convolutions with stride one, each layer adds (filter width minus one) multiplied by its dilation to the receptive field, and the total is that sum plus one. A block of ten layers with filter width two and dilations 1, 2, 4 and so on up to 512 therefore has a receptive field of 1 + (1 + 2 + 4 + ... + 512) = 1,024 samples. Repeating the block three times adds 1,023 samples for each extra block, giving 3,070 samples, a little under 200 milliseconds at 16 kHz. The same arithmetic applies when the input is a sequence of spectrogram frames rather than samples. Suppose a keyword spotter operates on 10-millisecond frames and uses six causal layers with filter width three and dilations 1, 2, 4, 8, 16 and 32. Each layer contributes twice its dilation, so the receptive field is 1 + 2 × (1 + 2 + 4 + 8 + 16 + 32) = 127 frames, about 1.27 seconds: enough for most two- or three-syllable wake phrases spoken at a normal rate. Halve the number of layers and the receptive field drops to 15 frames, 150 milliseconds, which is less than a single syllable. A model of that size could still learn to fire on a fragment of the wake phrase, but it would be guessing from part of the evidence, and its false-accept rate would show it. Two caveats apply. The theoretical receptive field is an upper bound; in practice a network's effective receptive field, the region that substantially influences its output, is often much smaller and concentrated near the centre, as Wenjie Luo and colleagues showed for convolutional networks in 2016. And strided or pooled layers multiply the contribution of every subsequent layer, which is why aggressive downsampling early in a network extends its reach cheaply at the cost of time resolution. Designers trade these effects against one another constantly. What WaveNet means for recognition WaveNet is a generator, but the ideas it introduced apply equally to recognition, and they bear directly on the later chapters of this booklet. The first is the dilated causal convolution as a general sequence encoder. A temporal convolutional network built from stacked dilated convolutions can process a stream of audio features with a long receptive field, low latency and fully parallel training. Many keyword spotting architectures, including models in Chapter 6, use dilated or depthwise-separable temporal convolutions for exactly these reasons. The original WaveNet paper itself included a brief experiment applying the architecture to speech recognition on the TIMIT corpus, reporting a phone error rate that was strong for a model operating on raw audio at the time. The second is the demonstration that raw waveforms are learnable. WaveNet's success encouraged work on recognition directly from samples, culminating in self-supervised encoders such as wav2vec 2.0, which begin with a stack of strided convolutions over raw audio, discussed in Chapter 4. Those convolutions, notably, learn something functionally similar to a filterbank, which is a reminder that the network is not abolishing the time-frequency representation so much as learning its own. The third is a lesson about cost. Modelling every sample is expensive. For generation, where every sample must be produced, there is no way around it, only ways to make it cheaper. For recognition, where the output is a handful of words or labels per second, it is usually unnecessary to operate at the sample rate after the first few layers. Almost every practical recogniser therefore reduces the time resolution early, to 100 frames per second or fewer, and does its heavy lifting there. The fourth is causality as a design constraint. A wake-word detector or streaming recogniser must make decisions as audio arrives, with no access to the future. WaveNet's causal padding is the simplest way to enforce that in a convolutional network, and the receptive field of a causal stack tells you exactly how much past context each decision uses. When designing a streaming model, it is worth computing that receptive field explicitly. A model whose receptive field is shorter than the longest wake phrase it must detect cannot possibly detect it reliably, however well it is trained. A short note on what was not solved WaveNet's synthetic speech was natural, but naturalness of a waveform is not the same as correctness of content. The model could not decide what to say, or how to stress and phrase it; that job falls to whatever produces its conditioning input. In recognition, the analogous point is that a powerful acoustic encoder still depends on its training targets and data to know what distinctions matter. Most of the problems that make audio systems fail in the field, such as mismatch between training and deployment conditions, label noise and poor evaluation, are untouched by better architectures. The chapters that follow therefore spend as much time on data and measurement as on networks. Hashtags: #DeepLearningForAudio #DeepLearning #AudioDeepLearning #SpeechRecognition #SoundEventDetection #AudioProcessing #ArtificialIntelligence #MachineLearning #AudioAI #AutomaticSpeechRecognition #ASR #SpeechProcessing #DigitalSignalProcessing #AudioClassification #AcousticModeling #Spectrograms #MelSpectrogram #MFCC #WaveNet #NeuralNetworks #AudioTransformers #ConvolutionalNeuralNetworks #SelfSupervisedLearning #KeywordSpotting #WakeWordDetection #SoundRecognition #SpeechToText #AudioFeatureExtraction #NoiseRobustness #EdgeAI

  • AI in Cybersecurity (Automated Threat Detection and Response)

    Download the Book (PDF): Introduction At three in the morning, somewhere in a security operations center, an analyst is looking at an alert that says a user account in the finance department has just logged in from an unfamiliar country. It is the forty-third alert of the shift. Most of the previous forty-two were nothing: a backup job that touched more files than usual, a developer running a scanning tool against their own test server, a salesperson connecting through a hotel network. The analyst has perhaps ten minutes to decide whether this one is different. If it is a stolen credential, the next few hours matter enormously. If it is a traveling employee, chasing it costs time that the next alert, possibly the real one, will need. That scene, repeated across thousands of organizations every night, is the right place to begin a book about artificial intelligence in cybersecurity. Not with a futuristic picture of autonomous machines battling each other at network speed, and not with a vendor's promise that a model will "stop every attack," but with a tired person, a queue, and a decision under uncertainty. Almost everything that machine learning can genuinely do for network defense comes down to changing what happens in that scene: which alerts reach the analyst, in what order, with what context attached, and which ones never need a human at all. The argument of this book The controlling claim of this book is simple to state and surprisingly easy to forget. Machine learning in cyber defense is best understood not as a replacement for human judgment, nor as a detector that catches what rules miss, but as a mechanism for rationing scarce human attention under adversarial pressure. Its value is set less by how accurate a model looks in a laboratory than by four realities of the operational world: attacks are rare relative to normal activity, the environment drifts constantly, the adversary adapts to whatever the defender deploys, and every output eventually lands on a person who must decide what to do with it. Systems designed around those four realities work. Systems designed around a headline accuracy number tend to fail in ways that are expensive and, worse, quiet. This framing matters because the field has been through several cycles of overpromise. Anomaly detection was proposed as the answer to unknown attacks in the 1980s, and a generation of research systems produced impressive results on benchmark datasets that did not survive contact with real networks. Machine-learning antivirus engines were marketed in the mid-2010s as making signatures obsolete, and while they did transform malware detection, they also introduced new failure modes that attackers learned to exploit. Since 2023, large language models have been folded into security tooling at remarkable speed, and by 2026 vendors routinely describe "agentic" security operations centers in which software agents investigate and close alerts on their own. Some of those claims are well founded and some are not. A reader who understands why earlier waves succeeded or disappointed is far better placed to judge the current one. What the book covers, and what it leaves out The description of this book names three applications, and they form its spine. The first is behavioral anomaly detection: learning what normal looks like for users, hosts and network flows, and flagging departures from it. The second is the identification of previously unseen malicious software through static analysis, meaning the examination of a file's structure and content without running it, so that a program nobody has catalogued before can still be judged likely to be hostile. The third is the automation of incident response triage, the work of sorting, enriching and prioritizing alerts so that the people in a security operations center spend their time where it counts. Around that spine sit the chapters that make the applications intelligible. The book begins with the attention problem itself, because without understanding why defenders drown in alerts, it is impossible to judge whether any tool helps. It then explains, without mathematics, what learning systems actually learn and where their training data in security comes from, since most failures trace back to data rather than algorithms. After the three core applications, it turns to the adversary, who studies defensive models as carefully as the defender studies attacks, and to the problem of measurement: how to tell whether a detection or triage system is genuinely helping. It closes with the organizational question of how to divide work between people and machines in a way that holds up over years rather than quarters. Several things are deliberately left out. This is a defensive book written for professionals who need to understand, buy, deploy, govern or work alongside these systems. It describes attack techniques only at the level needed to understand why a defense works or fails, and it contains no working exploit or malicious code. It does not attempt to survey every product on the market, which would be out of date within months. It does not teach the mathematics of particular algorithms, because the decisive questions in this field are rarely about which algorithm to use. And it does not cover the separate, large topic of securing AI systems themselves, such as protecting a company's own chatbot from manipulation, except where the same ideas illuminate the security of defensive models. Who this book is for The intended reader is an intelligent professional who is not necessarily a data scientist or a security engineer: a chief information security officer weighing a procurement decision, an IT leader whose team is about to inherit a new detection platform, a risk manager or auditor who must judge whether automated controls are trustworthy, a policy specialist, or an analyst early in a security career who wants to understand the tools reshaping the job. Specialists will find the arguments familiar in places, but may find the synthesis useful when explaining their work to others. Technical terms are defined where they first appear. A short glossary at the end collects the ones that recur most often, and the notes point to the real research on which the argument rests. Where precise figures are uncertain or vary widely between organizations, the book says so rather than inventing a number. One of the recurring lessons of this field is that confident-looking statistics are cheap and frequently misleading, and a book about measurement should not add to the pile. A word on optimism It would be easy to read what follows as skeptical, because so much of it concerns failure: false alarms, drifting models, evasion, automation that removes the very human checks it was meant to support. That reading would be mistaken. Machine learning has already changed network defense for the better in concrete ways. Static classifiers catch large volumes of new malicious files that no signature would have matched. Behavioral analytics find compromised accounts that no rule anticipated. Well-designed triage automation has turned unmanageable queues into workable ones, and early controlled evidence suggests that language-model assistants can make analysts both faster and more accurate on specific, well-bounded tasks. The point is that these successes share a pattern. They come from teams that knew what problem they were solving, measured the right things, expected the adversary to respond, and kept a clear line between what the machine decides and what a person decides. The aim of this book is to make that pattern visible, so that the reader can recognize it, insist on it, and build it. Chapter 1: The Attention Problem Security failures are usually described as failures of detection. The attacker was "undetected," the breach went "unnoticed for months," the tools "missed" the intrusion. The phrasing suggests that the defenders lacked a sensor, a signature or a clever enough algorithm. Sometimes that is true. But a striking number of serious incidents show a different pattern: the evidence was collected, an alert was raised, and nobody acted on it in time. The best-known case is the breach of the American retailer Target in late 2013, in which attackers stole payment card data from tens of millions of customers. A report prepared for the United States Senate Commerce Committee in 2014 laid out the sequence in detail. Target had invested in a commercial malware detection system, and that system generated alerts as the attackers installed their tools. The alerts were reviewed by a monitoring team and passed along, but they did not trigger a decisive response, and the theft continued. The lesson most commentators drew was not that Target lacked technology. It was that the technology produced a signal which the organization could not distinguish, in the moment, from the many other signals competing for attention. That is the problem this book is about. Modern defenders are not short of data. They are short of attention, and the central question for any automated system is what it does to the allocation of that attention. Where the alerts come from A medium-sized organization today collects security telemetry from a remarkable range of sources. Endpoint detection and response agents on laptops and servers record process launches, file writes, registry changes and network connections. Firewalls and network sensors summarize traffic flows. Identity providers log every sign-in, with its location, device and outcome. Email gateways record messages, attachments and links. Cloud platforms emit audit logs for every administrative action. Web proxies, DNS resolvers, VPN concentrators and software-as-a-service applications add their own streams. All of this typically flows into a security information and event management platform, usually abbreviated SIEM, which stores it, correlates it and applies detection logic. Each source comes with its own detections, and each detection is written to err on the side of caution, because the cost of missing an attack is visible and the cost of an extra alert is diffuse. The vendor of an endpoint product does not want to be the one whose tool stayed silent during a ransomware outbreak. The engineer who writes a rule for suspicious PowerShell usage would rather it fire on some administrators' legitimate scripts than miss an attacker using the same commands. Every one of those decisions is locally reasonable. Summed across dozens of tools and hundreds of rules, they produce a queue that no team can clear. Analysts have a name for the result: alert fatigue. In a 2022 study presented at the USENIX Security Symposium, researchers from the University of Oxford interviewed security operations center analysts about how they experience alarms. The paper's title, "99% False Positives," came from the analysts themselves, and it captured a view that ran through the interviews: most alerts were not worth the time it took to dismiss them, analysts developed shortcuts and heuristics to cope, and trust in particular tools eroded when they cried wolf too often. The study did not claim that exactly ninety-nine percent of all alerts everywhere are false. Its point was the lived experience of people whose working day is spent mostly confirming that nothing is wrong. Alert fatigue is not merely unpleasant. It changes behavior in ways that make detection worse. When most alerts of a given type are benign, analysts learn to close them quickly, and the occasional true one gets closed along with the rest. When a tool has a reputation for noise, its alerts are deprioritized as a category. When queues back up, alerts age past the point where the evidence they point to is still available. An organization can own excellent sensors and still be, in practice, blind. The arithmetic of rarity To see why the queue fills with false alarms even when each detector seems accurate, it helps to work through the arithmetic once. The argument was set out formally for intrusion detection by Stefan Axelsson in a paper published in 2000, "The Base-Rate Fallacy and the Difficulty of Intrusion Detection," and it remains the single most important idea for anyone evaluating a detection system. Imagine, purely for illustration, an organization that generates ten million events a day that a particular detector examines: sign-ins, process launches, connections. Suppose that on a typical day ten of those events are genuinely malicious. Now suppose the detector is very good by most standards. It catches ninety-nine percent of malicious events, and it wrongly flags only one benign event in a thousand, a false positive rate of 0.1 percent. Run the numbers. Of the ten malicious events, the detector flags about ten. Of the nearly ten million benign events, it flags one in a thousand, which is about ten thousand. The analyst therefore faces roughly ten thousand and ten alerts, of which ten are real. The probability that any given alert is a real attack is about one in a thousand. A detector that sounds excellent when described by its detection rate and its false positive rate produces a queue that is 99.9 percent noise. This is the base-rate fallacy: the mistake of judging an alert by the detector's accuracy while ignoring how rare the thing being detected is. The same arithmetic explains why medical screening tests for rare diseases produce many false positives, and it applies with special force in security, where the ratio of benign to malicious activity is often millions to one. Two consequences follow, and both shape everything later in this book. First, the quantity that matters operationally is not the detection rate or the false positive rate in isolation but the precision of the alerts that reach a human, the fraction of them that are worth acting on. Precision depends on the base rate, which means a detector's usefulness depends on where it is deployed, not just on how it was built. Second, small improvements in the false positive rate are worth far more than they appear. Cutting the false positive rate from one in a thousand to one in a hundred thousand, in the example above, shrinks the noise from ten thousand alerts to about a hundred, and transforms an unusable detector into a valuable one. Much of the practical engineering of machine learning in security is a fight over the far right-hand digits of the false positive rate. Queues that never empty The base-rate argument explains why alerts are mostly noise. A second, equally simple idea explains why noise is so damaging: the behavior of queues. Any system in which work arrives and is processed, whether a supermarket checkout, a hospital emergency department or a SOC, obeys the same basic logic. If work arrives, on average, more slowly than it can be handled, the queue stays short and waiting times stay low. If it arrives faster than it can be handled, the queue grows without limit, and the waiting time for each new item grows with it. The consequence is counterintuitive. A SOC that can handle a hundred alerts a day and receives ninety is in a very different position from one that receives a hundred and ten, even though the difference is only twenty percent. The first clears its queue every day, with some slack for complicated cases. The second falls further behind every day. In practice, no team lets the queue grow forever. Instead, something gives: analysts spend less time on each alert, certain categories are closed in bulk, older alerts are abandoned. These adaptations keep the queue under control, but they do so by lowering the quality of each decision, and they do it invisibly. A dashboard may show that every alert was closed, while revealing nothing about how many were closed without real examination. Queues also interact with time in a way that matters for security specifically. Evidence decays. Logs roll over, memory contents vanish when machines restart, and attackers clean up after themselves. An alert examined within minutes can be investigated thoroughly; the same alert examined three days later may point to evidence that no longer exists. The longer the queue, the less each alert is worth by the time someone reaches it. This is why the language of attention, rather than detection, is the right one. An organization that adds a new detector without considering its effect on the queue may be making itself less safe, if the new alerts push the queue past the point where it can be cleared and the quality of every decision falls. Conversely, an organization that removes a noisy detection, or automates the handling of a high-volume, low-risk category, may become safer without detecting anything new, simply by giving its analysts time to look properly at what remains. Incident responders track dwell time, the interval between an attacker's arrival and their discovery, as one of the most telling measures of a defensive program, and post-incident reviews regularly find that the evidence needed to shorten it was already sitting in the victim's own logs. Why rules alone cannot keep up Before machine learning, and still today for most organizations, the bulk of detection is written by people. Signatures match known malicious files or byte patterns. Rules match known patterns of behavior: a process spawned by a word processor that then launches a command shell, a sign-in followed within minutes by a sign-in from another continent, a server suddenly sending large volumes of data to an address it has never contacted. Rule languages such as Sigma for log data and YARA for file content have made it easier to share these detections across organizations. Rules have real strengths. They are transparent: anyone can read a rule and understand why it fired. They are precise when written well, because they encode an expert's specific knowledge of an attack technique. They are cheap to run. And they connect cleanly to frameworks like MITRE ATT&CK, the widely used catalog of adversary tactics and techniques, which lets a team map what it can and cannot see. Their weaknesses are equally clear. A rule only catches what someone anticipated. Attackers who change a detail, such as renaming a tool, encoding a command differently or moving more slowly, can step around it. Rules also struggle with context. Whether a burst of file encryption is ransomware or a legitimate backup depends on who is running it, on which machine, at what time, with what history, and encoding all of that in hand-written logic quickly becomes unmanageable. And each rule must be tuned to each environment; a rule that is quiet in one company may fire thousands of times a day in another with different software and habits. Machine learning enters at exactly these weak points. It can generalize from examples rather than requiring every pattern to be spelled out, which offers a chance of catching variations nobody wrote down. It can weigh many weak signals at once, which offers a way to bring context into a decision. And it can learn what is normal for a particular environment, which offers a route around the tuning problem. Each of these is a genuine capability. Each also carries a cost, and later chapters examine those costs carefully. The real objective If the scarce resource is attention, then the objective of a detection and response program can be restated. It is not "detect all attacks," which is impossible, nor "minimize alerts," which is trivially achieved by turning the tools off. It is closer to this: given a fixed and expensive amount of skilled human time, arrange the system so that the time is spent on the events most likely to matter, with enough context to decide quickly, and so that the events which can be handled without human judgment are handled reliably without it. Stated that way, machine learning has three distinct jobs, which correspond to the three applications at the center of this book. The first job is to surface things that would otherwise go unseen. Behavioral anomaly detection, covered in Chapter 3, tries to find compromised accounts, insider misuse and stealthy intrusions that match no known pattern. Static malware classification, covered in Chapter 4, tries to recognize hostile software that no signature yet describes. These are the jobs most people mean when they talk about "AI detection," and they are the ones most vulnerable to the base-rate trap, because they operate on enormous volumes of mostly benign data. The second job is to filter and rank what has been surfaced. Of all the alerts generated by rules, models and third-party tools, which deserve attention first? This is the core of triage automation, covered in Chapter 6, and it is often where machine learning delivers the most value for the least risk, because it works on a much smaller, already-filtered population where the base rate of real incidents is far higher. The third job is to do the routine work around each alert: gathering the user's recent activity, checking a file's reputation, looking up whether an address appears in threat intelligence, assembling a timeline, and, for well-understood cases, taking a containment action. Much of this is ordinary automation rather than learning, but language models have recently extended what can be automated, because they can read unstructured evidence and write summaries that previously required an analyst. Keeping these three jobs separate is one of the most useful habits a reader can take from this book. Vendors and headlines tend to blur them into a single claim about "AI-powered security." But they have different data, different failure modes, different appropriate levels of autonomy and different ways of being measured. A model that is excellent at ranking alerts may be useless at finding new attacks, and vice versa. The defender's dilemma, revisited A common saying in security holds that the defender must be right every time while the attacker need be right only once. It is meant to explain why defense is hard, and it often appears in arguments for automation: since humans cannot be right every time, machines must help. The saying is only half true, and the half that is false is important. Real intrusions are not single events. An attacker who gains an initial foothold must still establish persistence, escalate privileges, move laterally to other systems, locate valuable data and get it out. Each step generates evidence, and each is an opportunity for detection. Security practitioners sometimes invert the saying: the attacker must stay hidden at every step, while the defender needs to notice only once. Under that view, the defender's task is not perfection at any single point but sufficient coverage across the chain and, critically, the ability to act when one of many weak signals turns out to be the thread worth pulling. That inversion only holds if signals are noticed and acted upon, which brings the argument back to attention. An organization whose analysts are overwhelmed does not benefit from the attacker's need to take many steps, because the evidence of those steps sits unexamined in a queue. An organization whose attention is well allocated can exploit every one of them. Machine learning, used well, is a way of turning the attacker's long chain into the defender's advantage. Used badly, it adds more unexamined evidence to the pile. The next chapter takes a step back to explain what learning systems actually do with security data, because the rest of the argument depends on a clear picture of what a model can and cannot know. Chapter 2: What Learning Machines Actually Learn Most discussions of machine learning in security begin with algorithms: neural networks, random forests, gradient boosting, transformers. Practitioners who have built these systems tend to begin somewhere else, with data. What was collected, how it was labeled, what period it covers, what environment it came from and what it leaves out determine most of what a model will do in production. The algorithm matters, but it matters in the way that the choice of engine matters to a car with no fuel. This chapter explains, in plain terms, what a learning system does, and why security data makes the job unusually hard. Learning from examples At its simplest, a machine learning model is a function built from examples rather than written by hand. A rule-writer looks at an attack and writes down a condition that matches it. A learning system is shown many examples, each described by a set of measurable properties called features, and adjusts its internal parameters until its outputs match the examples as closely as possible. The resulting function can then be applied to new cases it has not seen. The features are the bridge between raw security data and the model. A model cannot look at a sign-in event the way an analyst does. It needs numbers or categories: the hour of day, whether the device has been seen before, the distance from the user's last location, the number of failed attempts in the previous hour, whether the sign-in used multi-factor authentication, how many other users signed in from the same address. For a file, the features might be its size, the number of sections it contains, the libraries it imports, statistical measures of how random its contents are, and the presence of particular strings. Choosing and computing these features, a task called feature engineering, has historically been where most of the domain expertise in security machine learning lives. Deep learning methods can learn some features directly from raw data, as Chapter 4 explains, but even they depend on decisions about how the raw data is presented. There are three broad families of learning, and the distinction between them runs through the rest of this book. In supervised learning, every training example comes with a label: this file is malicious, that one is benign; this alert was a real incident, that one was a false positive. The model learns to predict the label from the features. Supervised learning is powerful when labels are plentiful and trustworthy, and static malware classification is its great success story in security, because large collections of labeled files exist. In unsupervised learning, there are no labels. The model is asked to find structure in the data: clusters of similar items, or a description of what typical data looks like so that atypical items stand out. Most behavioral anomaly detection is unsupervised, because labeled examples of attacks within a particular organization's own environment are scarce. In semi-supervised and weakly supervised learning, a small number of labels is combined with a large amount of unlabeled data, or labels come from imperfect sources such as the verdicts of other tools. Much practical security work lives here, including most triage models, which learn from the dispositions analysts record when they close alerts. A fourth approach has become prominent since 2023: large pretrained models, especially language models, that were trained on vast general-purpose data and are then applied to security tasks with little or no task-specific training. These models do not fit neatly into the older categories. They bring broad knowledge, such as what a suspicious command line tends to look like or how a phishing email tends to read, but they also bring their own failure modes, discussed in Chapter 6. A worked example: scoring a sign-in It helps to follow a single, simplified model from beginning to end. Suppose a security team wants to score every sign-in to its cloud applications for the likelihood that it is being made by someone other than the account's owner. The team starts with data. The identity provider logs each sign-in with the user, the time, the source network address, an approximate location derived from that address, the device and browser, whether multi-factor authentication was used and whether the attempt succeeded. From these raw fields, the team computes features designed to capture what an analyst would notice: whether this device has been seen for this user before, how far the location is from the user's usual locations, whether the source address belongs to a residential provider, a corporate network, a cloud hosting company or an anonymizing service, how many distinct users have signed in from the same address recently, how many failed attempts preceded the success, and whether the time of day is typical for this user. Next, the team needs labels. It has a few hundred sign-ins from past incidents that were confirmed as account takeovers, and many millions that were never investigated and are presumably legitimate. The confirmed cases are precious but few, and they are skewed toward the kinds of takeover the team has previously caught. The unlabeled millions almost certainly include some takeovers nobody noticed. This is the normal situation in security, and it is already a warning: the model will learn what past detected takeovers looked like, which is not the same as what takeovers look like. The team trains a model, perhaps a gradient-boosted tree ensemble, a reliable choice for this kind of tabular data, and evaluates it on sign-ins from a later period than those it trained on. It chooses a threshold not by maximizing some abstract score but by asking how many sign-ins per day the team can afford to review, and setting the threshold so that roughly that many exceed it. It then examines the highest-scoring sign-ins by hand, and discovers, as nearly every team does, that many of them share an innocent explanation: an employee using a new phone, a partner organization whose staff sign in through a cloud proxy, a sales team at a conference abroad. Each discovery leads to a new feature or a piece of context that the model lacked. This cycle of building, deploying, examining and refining is what applied machine learning in security actually consists of. The algorithm is chosen in an afternoon. The features, labels, thresholds and context take months, and they are never finished. The label problem Supervised learning needs labels, and in security, good labels are both scarce and treacherous. Consider malware. A common way to label a large set of files is to submit them to a multi-engine scanning service and count how many antivirus products flag each one. A file flagged by many engines is labeled malicious; one flagged by none is labeled benign. This is practical and widely used, but it has two problems. First, it is circular. A model trained on labels produced by existing detectors learns, to a significant degree, to imitate those detectors, including their blind spots. The files that matter most, the ones no existing product recognizes, are precisely the ones whose labels are wrong at the time of collection. Second, labels change over time. A file that no engine flags on the day it appears may be flagged by dozens a month later, once researchers have examined it. Training data labeled too early contains mislabeled malware; data labeled long after the fact gives an unrealistically rosy view of what was knowable at the time. Consider alerts. A triage model learns from past analyst decisions: this alert was escalated, that one was closed as benign. But those decisions were made by tired people under time pressure, and some were wrong. Worse, the errors are not random. If analysts habitually closed a certain type of alert without investigation, the model learns that this type is benign, and it will deprioritize future instances even more aggressively, which makes it less likely that anyone ever discovers the habit was mistaken. A model trained on human decisions inherits human biases and can harden them. Consider network attacks. Public datasets for network intrusion detection have existed since the late 1990s, most famously the KDD Cup 1999 dataset derived from a DARPA evaluation, and later collections such as those produced by the Canadian Institute for Cybersecurity. These datasets have been invaluable for teaching and for early research. But they were generated in laboratory conditions, with attacks injected into synthetic or semi-synthetic background traffic, and models trained on them have repeatedly been shown to exploit artifacts of the data collection rather than genuine properties of attacks. A model can achieve near-perfect scores on such a dataset by learning, for instance, that malicious traffic in the dataset happens to come from particular address ranges or to have particular timing quirks. None of that transfers to a real network. Common ways to fool yourself In 2022, a group of researchers led by Daniel Arp published a paper at the USENIX Security Symposium titled "Dos and Don'ts of Machine Learning in Computer Security." They reviewed a large sample of published security research using machine learning and found that subtle methodological pitfalls were widespread, often in combination. The pitfalls they identified are worth knowing, because they appear in vendor claims and internal evaluations just as often as in academic papers. Sampling bias occurs when the training data does not represent the conditions the model will face. A malware classifier trained mostly on one family of threats, or on files collected from one region or industry, may perform poorly elsewhere. Label inaccuracy is the problem already described: labels that are wrong, unstable or derived from the very detectors the model is meant to improve upon. Data snooping is the use of information during training that would not be available in practice. The most common form in security is temporal: mixing old and new samples randomly between training and test sets, so that the model is effectively trained on the future and tested on the past. Because malware and attack techniques evolve, this makes a model look far better than it will be when deployed, where it will always be facing samples newer than anything it trained on. Spurious correlations arise when a model learns an artifact that happens to separate the classes in the data but has nothing to do with maliciousness: a compiler version, a timestamp pattern, the network that a test lab used. Biased parameter selection and inappropriate baselines occur when a model's settings are tuned on the test data, or when it is compared only against weak alternatives. A complex deep learning model that beats a poorly configured older method is less impressive than one that beats a well-tuned simple model. Inappropriate performance measures and base-rate neglect, the subject of the previous chapter, occur when a model is evaluated on a balanced dataset with equal numbers of malicious and benign samples, and its accuracy is then quoted as though it applied to a real environment where benign activity outnumbers malicious by many orders of magnitude. Lab-only evaluation is the failure to test the system in anything resembling production conditions, with real data volumes, real latency constraints and real analyst workflows. The practical value of this list is that it turns vague skepticism into specific questions. When someone reports that a model achieves ninety-eight percent accuracy, the reader can ask: on what data, labeled how, split by time or at random, at what base rate, compared to what, and measured in what environment? The answers usually reveal far more than the number. What the data cannot show A further limit on every security model is visibility. Models can learn only from what sensors record, and modern environments hide a great deal from them. Most network traffic is now encrypted, which protects users but also means that a network sensor sees who is talking to whom, when, and how much, but not what is said. Detection has adapted by learning from metadata: the timing and size of packets, the destinations contacted, and characteristics of the encryption handshake itself. One widely used technique, published by researchers at Salesforce in 2017 under the name JA3, fingerprints the way a piece of client software sets up an encrypted connection, so that a particular malware family's traffic may be recognizable even when its contents are not. Such methods work, but they work on indirect evidence, and they can be defeated by attackers who make their software's handshake mimic a common browser. Endpoint telemetry has its own gaps. Agents record a selection of events rather than everything, because recording everything would overwhelm storage and slow the machine. The selection reflects the vendor's judgment about what matters, and an attacker who knows which events are recorded can favor actions that are not. Cloud platforms log administrative actions in detail but may log data access only if specifically configured to do so, and many organizations leave such logging switched off for cost reasons. Software-as-a-service applications vary widely in what they expose. The consequence is that a model's view of the world is shaped not only by what happened but by what was recorded, and the boundaries of the record are often invisible to the people using the model's output. A behavioral system that reports no anomalies on a server may mean that nothing unusual happened, or that the server's agent stopped reporting two weeks ago. Good systems make the absence of data as visible as its presence. How the approaches compare It helps at this point to set the main detection approaches side by side. Signatures, hand-written behavioral rules, supervised models and anomaly detection each make a different trade between precision, coverage of the unknown, transparency and the effort needed to maintain them, as Table 1 summarizes. None dominates the others, which is why mature programs use all four. Table 1. Main approaches to automated threat detection compared. Approach Basis Strength Main weakness Upkeep Signatures Known threat patterns Very few false alarms Blind to the new Feed updates Behavioral rules Expert-written logic Transparent Misses variants Local tuning Supervised models Labeled examples Generalizes to variants Label quality, drift Retraining Anomaly detection Learned normal activity Can surface the novel Unusual is not malicious Baselines, triage The table hides an important subtlety. The approaches are not independent layers stacked on top of each other; they interact. A supervised model may use the output of rules as features. An anomaly score may be passed to a supervised model that has learned which anomalies analysts care about. Signatures may be generated automatically from clusters found by unsupervised methods. The most effective systems are pipelines in which each method compensates for the weaknesses of the others, and much of the craft lies in how they are wired together. What a model cannot know One more idea completes the picture, and it is the most important limit of all. A learning system knows only what is in its data. It has no independent understanding of why an action is malicious. A model that has learned to flag sign-ins from unfamiliar countries does not know that the concern is credential theft; it knows only that such sign-ins were labeled suspicious in training, or that they are rare. If attackers begin routing their access through infrastructure in the victim's own country, which many sophisticated groups now do as a matter of routine, the model has no way to reason that the same underlying threat has changed its surface appearance. Analysts, by contrast, reason about intent and capability. They know that an attacker who has stolen a password will try to use it, will look for more privileged accounts, and will want to move data out. That knowledge lets them recognize an attack expressed in unfamiliar ways. This is the deep reason that machine learning works best as an instrument for directing human attention rather than replacing human judgment: the model is very good at noticing statistical regularities and departures from them across volumes no person could scan, while the person is good at asking whether those departures mean what an adversary would mean by them. Large language models blur this line somewhat, because they carry a great deal of general knowledge about attacker behavior absorbed from public writing about security. A language model asked to explain a suspicious command line can often describe what it does and why an attacker might use it. But that knowledge is general rather than specific to the organization, and it is retrieved by pattern rather than by verified reasoning. Chapter 6 returns to what this means for automated triage. For now, the key point is that every learning system is bounded by the world its data describes, and in security, the adversary is constantly trying to move to a world the data does not describe. With that foundation in place, the next chapter turns to the first of the three core applications: learning what normal looks like, and noticing when something departs from it. Chapter 3: Learning What Normal Looks Like The idea behind behavioral anomaly detection is older than most of the people who now practice it. In 1987, Dorothy Denning published "An Intrusion-Detection Model" in the IEEE Transactions on Software Engineering, proposing that intrusions could be detected by building statistical profiles of how users and systems normally behave and flagging significant departures. Her argument was that attackers, whether outsiders using stolen credentials or insiders abusing their access, would inevitably do things the legitimate owner of an account would not. Nearly four decades later, that remains the founding intuition of the field, and it remains both correct and incomplete in roughly the same proportions. This chapter explains how behavioral anomaly detection works in practice, why it has a reputation for noise, and what distinguishes the deployments that earn their keep from those that are quietly switched off after a few months. The promise and the closed world The appeal of anomaly detection is that it does not require anyone to have seen the attack before. A signature needs a sample; a rule needs an expert who anticipated the technique; a supervised model needs labeled examples. An anomaly detector needs only a description of normal behavior, and the description can be learned automatically from the organization's own data. In principle, then, it offers a defense against the novel: new tools, new techniques and the patient attacker who uses only legitimate administrative software. In 2010, Robin Sommer and Vern Paxson published a paper at the IEEE Symposium on Security and Privacy that became the standard reference for why this promise had largely failed to materialize in network intrusion detection. Titled "Outside the Closed World: On Using Machine Learning for Network Intrusion Detection," it observed that despite many years of academic research reporting excellent results, anomaly-based systems were rarely deployed in operational networks. The authors traced the gap to several features of the security problem that distinguish it from the domains where machine learning had succeeded. The first was that machine learning is far better at finding similarities than at identifying activity that has never been seen. A spam filter or a product recommender works by recognizing things like what it has seen before. Anomaly detection asks the reverse, and the space of things not seen before is vast and mostly harmless. The second was the very high cost of errors, both false positives, which consume analyst time, and false negatives, which may be catastrophic. The third was what they called the semantic gap: an anomaly detector reports that something is statistically unusual, but an operator needs to know whether it is a security problem and what to do about it, and the detector usually cannot say. The fourth was the enormous natural variability of real network traffic, in which unusual events happen constantly for benign reasons. The fifth was the difficulty of sound evaluation, given the lack of realistic data. The paper did not argue that anomaly detection was useless. It argued that it had to be scoped narrowly, with a clear idea of what kind of attack it was meant to catch, and that operators needed results they could interpret. The most successful modern deployments follow exactly that advice, even when they do not cite it. Baselines for people, machines and traffic In current practice, behavioral anomaly detection takes three main forms, differing by the entity whose behavior is modeled. User and entity behavior analytics, usually shortened to UEBA, builds profiles of individual accounts and devices. For a user, the profile might cover typical sign-in times, locations, devices and applications; the systems and file shares normally accessed; the volume of data normally downloaded; and the administrative actions normally performed. For a server, it might cover the processes that normally run, the accounts that normally log in and the destinations it normally contacts. New activity is compared against the profile, and also against peer groups: other members of the same team, other servers with the same role. Peer comparison matters because individual baselines are thin for new employees and rarely used accounts, and because an action that is unusual for one person may be normal for their role. Network behavior analysis models traffic. Its raw material is usually flow records, summaries that say which address talked to which, over which port and protocol, for how long and with how much data, without recording the content. From flows, a system can learn which internal hosts normally talk to which others, what volumes are typical, and which external destinations are routinely contacted. It can then flag hosts that begin scanning internal ranges, connections between segments that never normally communicate, or unusual outbound volumes. Process and host behavior modeling, increasingly built into endpoint detection products, examines sequences of actions on a single machine: which programs launch which others, what files and registry keys they touch, which network connections they make. The question is whether a sequence is typical for that software on that kind of machine. The statistical techniques used range from simple to sophisticated. At the simple end are per-entity statistics with thresholds, such as flagging a user whose daily download volume exceeds their own historical average by a large margin. Clustering methods group similar entities or events and flag those that fit no cluster well. Isolation-based methods, such as the isolation forest algorithm, exploit the fact that unusual points can be separated from the rest of the data with fewer random partitions than typical points. Autoencoders, a type of neural network, learn to compress and reconstruct normal data and flag inputs they reconstruct poorly. Sequence models learn the typical order of events and flag improbable sequences. The choice among these matters less than is often claimed. What matters far more is what is being modeled, at what granularity and for which threat. Detections that work The behavioral detections with the best operational track records share a property: each is anchored to a specific attacker need. They do not ask "is anything unusual?" but "is the thing an attacker would have to do happening?" Consider beaconing. Malicious implants on a compromised machine typically need to contact their operators for instructions, and they often do so at regular intervals, sometimes with deliberate random variation, a property called jitter. A network model that looks for connections to rarely contacted external destinations with suspiciously regular timing is asking a narrow question tied to a real attacker requirement. It still produces false positives, because plenty of legitimate software also checks in on schedules, but the population of candidates is small enough to review, and the legitimate check-ins are stable enough to allow-list. Consider credential misuse. An attacker who has stolen a password, a session token or a key must use it, and the use will usually differ in some way from the owner's: a new device, a new location, a new time, a new set of resources accessed, or a combination. The famous "impossible travel" detection, which flags sign-ins from two places too far apart for the user to have traveled between them, is a crude version. Better versions combine many such signals into a risk score that reflects how many independent things are unusual at once. Consider unusual administrative actions. Attackers who reach a privileged account tend to perform a recognizable set of actions: creating new accounts, adding themselves to groups, registering new authentication devices, changing logging settings, exporting mailboxes. Modeling which administrators normally perform which actions makes deviations stand out. A widely reported example came in December 2020, when the security company FireEye disclosed that it had been breached as part of the campaign that compromised the SolarWinds Orion software supply chain. Press accounts at the time reported that the intrusion first came to light when the company's security staff noticed that a new device had been registered for multi-factor authentication on an employee's account, and contacted the employee, who had not registered it. Whatever the full internal story, the detection pattern is instructive: a narrow, attacker-necessary action, checked against the expected behavior of a specific person, followed by a human confirming with that person. The same campaign also illustrates the limits. Researchers who analyzed the implant described an adversary who went to considerable lengths to look normal: blending command traffic with the legitimate protocol of the compromised product, choosing infrastructure close to victims and giving machines names consistent with the victim's environment. Against an adversary who studies what normal looks like, generic anomaly detection is at a disadvantage. The defender's advantage lies in the narrow places where the attacker cannot avoid doing something abnormal, such as registering a device, touching a sensitive system for the first time or moving data off the network. Consider, finally, the domain name system, which translates names into network addresses and which nearly all software uses constantly. Two attacker needs show up in DNS. Some malware families, rather than contacting a fixed address that defenders could block, use an algorithm to generate large numbers of pseudo-random domain names each day, of which the operators register only a few; the implant tries them in turn until one answers. Such names tend to look statistically unlike names chosen by people, with unusual distributions of letters, lengths and syllables, and classifiers trained on these properties have proved effective at flagging them. Other attackers hide data inside DNS queries themselves, encoding stolen information in long, high-entropy subdomains sent to a server they control. A model that learns the normal length, character mix and volume of DNS queries per host can flag such tunneling. Both are again narrow questions anchored to something the attacker needs to do. A worked case: the departing employee Insider data theft illustrates how these ideas come together, and why it is one of the harder problems behavioral analytics addresses. Imagine an engineer who has accepted a job at a competitor and, in their final weeks, decides to take design documents with them. They have legitimate access to the documents. They will use their own account, their own laptop and familiar tools. No signature or rule describes what they are doing, because everything they do is individually permitted. A well-designed behavioral system might notice several things. The engineer begins accessing project folders they have not opened in months, including some belonging to projects they were never assigned to, which is unusual for them and for their peers. Their download volume rises well above their historical range. Files are compressed into archives, which the engineer rarely did before. An archive is copied to a removable drive, or uploaded to a personal cloud storage account. Separately, none of these is alarming; engineers revisit old projects, download large files and use cloud storage. Together, within a short window, and coinciding with a signal from the human resources system that the employee has resigned, they form a pattern worth a careful look. This example also shows the limits of what the system should do on its own. It should not block the employee or accuse them; there may be an innocent explanation, such as an approved handover of documentation, and the consequences of a wrong accusation are serious for the individual and the organization. It should assemble the evidence, explain it clearly, and route it to people who have the authority and context to judge it, including, in many organizations, human resources and legal colleagues as well as security staff. Behavioral detection of insiders also raises privacy questions that must be settled in policy before any model is switched on, a theme Chapter 8 returns to. Turning anomalies into decisions Even well-designed behavioral detections generate far more anomalies than incidents, for the base-rate reasons laid out in Chapter 1. Organizations that make anomaly detection work tend to use four techniques to convert the raw stream into something an analyst can act on. The first is aggregation by entity. Rather than raising an alert for each unusual event, the system accumulates evidence on each user or host over a period of time, often as a risk score, and raises a single case when the accumulated evidence crosses a threshold. A user who signs in from a new device is unremarkable. A user who signs in from a new device, then accesses a file share they have never touched, then compresses a large volume of data and uploads it to an external storage service, is a story. Aggregation converts many low-precision signals into fewer, higher-precision cases. The second is context enrichment. An anomaly is far easier to judge when it arrives with the information an analyst would otherwise have to fetch: who the user is, what their role is, whether they are on leave or traveling, whether the device is managed, whether the destination is known to threat intelligence. Some of that context can be fed back into the model itself, so that, for example, a sign-in from a new country is scored lower when the human resources system records an approved business trip. The third is explanation. An alert that says only "anomaly score 0.94" is close to useless, because the analyst cannot tell what was unusual. An alert that says "first access to this database by this account in ninety days; volume is twelve times this account's typical maximum; no peer in the same team has accessed it" can be judged in a minute. Explanation is not a luxury added on top of anomaly detection; it is what makes the semantic gap that Sommer and Paxson described crossable in practice. The fourth is feedback. Every time an analyst marks an anomaly as benign and records why, that information can be used to suppress similar anomalies in future, or to adjust baselines. Without feedback, an anomaly system keeps rediscovering the same harmless oddities, and analysts lose faith in it. With it, the system gradually learns the shape of the organization's legitimate irregularity. The risk, flagged in Chapter 2, is that feedback can also teach the system to ignore a real attack that analysts habitually dismissed, so suppression should be specific and periodically reviewed rather than broad and permanent. Drift, poisoning and the slow attacker A baseline is a picture of the past, and the past is a moving target. Organizations reorganize, adopt new software, move workloads to the cloud, and change working patterns, as the sudden shift to remote work in 2020 demonstrated dramatically: overnight, the normal location, device and network for most office workers changed, and many behavioral systems spent weeks flagging what had become routine. Baselines must therefore be relearned continually, and that creates a vulnerability. If a baseline is continuously updated from recent activity, a patient attacker can shift it. Activity that begins slowly and increases gradually may be absorbed into the definition of normal before it ever looks anomalous. An attacker who has compromised an account and accesses one new file share a week, instead of ten in an afternoon, may never stand out. This is a form of what the machine learning literature calls poisoning, the deliberate manipulation of training data, and Chapter 5 examines it in more general terms. The practical defenses are to keep long-term reference baselines alongside short-term ones, so that slow drift is visible when compared against a period months earlier; to treat certain changes, such as first-ever access to particularly sensitive systems, as notable regardless of the baseline; and to periodically review which behaviors have been newly absorbed into normal. What behavioral detection is for The fair verdict on behavioral anomaly detection, after nearly forty years, is that Denning's intuition was right but needed to be narrowed. Attackers do have to do things the legitimate owner of an account would not. But the space of things legitimate users do that are also unusual is so large that a general search for anomalies drowns in them. The successful approach starts from the attacker's unavoidable needs, models normal behavior specifically around those needs, aggregates weak signals into entity-level stories, explains itself, and learns from the people who judge its output. Used that way, behavioral detection is one of the few tools capable of finding an intruder who uses only legitimate credentials and legitimate software. Used as a generic "find anything unusual" engine, it becomes the noisiest component in the security stack. The difference lies almost entirely in design choices that have little to do with the choice of algorithm. The next chapter turns from behavior to artifacts: the files an attacker brings, and the problem of recognizing hostile software that nobody has seen before. Hashtags: #AIInCybersecurity #ArtificialIntelligence #Cybersecurity #MachineLearning #ThreatDetection #AutomatedThreatDetection #IncidentResponse #SecurityAutomation #CyberThreatIntelligence #BehavioralAnalytics #AnomalyDetection #MalwareDetection #MalwareClassification #SecurityOperationsCenter #SOC #SecurityInformationAndEventManagement #SIEM #EndpointDetectionAndResponse #EDR #UserAndEntityBehaviorAnalytics #UEBA #ThreatHunting #AlertTriage #AutomatedIncidentResponse #CyberDefense #NetworkSecurity #AdversarialMachineLearning #ZeroDayThreats #FalsePositiveReduction #SecurityOrchestration #AIThreatIntelligence

  • 3D Bioprinting Technologies (Scaffolds, Bioinks, and Tissue Engineering)

    Download the Book (PDF): Introduction On any given day in the United States, roughly 110,000 people are registered on the national transplant waiting list. In 2025 surgeons performed more than 49,000 transplants, a record, and yet the federal organ donation program still estimates that twelve people die each day waiting, and that someone new joins the list every seven minutes [1]. Kidneys account for most of that list. Behind each number is a person on dialysis three times a week, or a person with a failing liver who will be too sick for surgery by the time an organ arrives. The shortage is not a scandal of logistics that better allocation could fix. It is a structural gap between the number of organs that become available when people die and the number of people whose organs fail while they live. Bioprinting is one of several attempts to close that gap by manufacturing, rather than harvesting, the tissue a patient needs. The idea is easy to state and remarkably hard to execute. A bioprinter deposits living cells, suspended in a gel that can hold a shape, layer by layer according to a digital design. In principle the design can come from the patient's own scans, the cells from the patient's own body, and the result can be a piece of tissue that fits, functions, and is never rejected. In January 2026 the US Advanced Research Projects Agency for Health committed up to $176.8 million over five years to five teams trying to do exactly this for the liver and the kidney, with the stated aim of producing immune-matched organs on demand [2]. That a federal agency would write such a check tells you the field has matured. That the target is five years for the first clinical-grade liver tissue, and not for a finished, transplantable liver, tells you how far it still has to go. Why now? Three developments of the past fifteen years have converged to make the ambition credible. The first is the ability to reprogram adult cells into stem cells that can become almost any tissue, which removed the old ceiling on where specialised human cells could come from. The second is a family of printing methods, using light, supporting baths and sacrificial materials, that can build soft, intricate structures including networks of hollow channels at scales that were impossible a decade ago. The third is money and institutional commitment: large pharmaceutical partnerships, dedicated government programmes, and a US regulatory shift since 2022 that has begun to accept human tissue models in place of some animal tests. None of these, alone or together, solves the hard problems. But they have turned bioprinting from a promise into an engineering programme with measurable milestones. The argument of this book The thesis of this book is simple, and it runs against the way bioprinting is usually presented. The hard part of bioprinting is not printing. Machines that place material in three dimensions with micrometre precision are a solved problem; you can buy one for the price of a good car. The hard part is biology at density and scale: keeping enormous numbers of cells alive and doing their jobs inside a printed object, from the moment they leave the nozzle until the day the tissue is integrated into a body. Every important problem in the field is a version of that one. Bioinks are a compromise between what a printer needs and what a cell needs. Vascular networks matter because without them cells more than a fraction of a millimetre from a nutrient supply suffocate. Regulation is hard because a living, changing product cannot be specified and tested the way a hip implant can. If you hold onto that idea, much of the noise around bioprinting resolves. You will understand why the first bioprinted products to reach patients have been thin, avascular, or structurally simple tissues such as cartilage and skin, and why a printed heart that beats in a dish is a different thing from a printed heart that can sustain a person. You will understand why the most commercially durable use of bioprinting so far has been in drug testing, where a small piece of human tissue that lives for a few weeks is already valuable. And you will be able to read the next breathless headline with a working sense of what was actually achieved. What the book covers The chapters move from the physical to the biological to the institutional. Chapter 1 establishes what bioprinting is, how it grew out of tissue engineering, and why the organ shortage frames its ambitions. Chapter 2 explains the printing methods themselves: extrusion, droplet-based, laser-assisted, light-based and embedded printing, with attention to what each does to the cells passing through it. Chapter 3 is about bioinks, the hydrogels and other materials that carry cells, and the tension between printability and biocompatibility that shapes every formulation. Chapter 4 turns to the cells: where they come from, how many are needed, how they survive the printing process, and how a printed object becomes a working tissue in the days and weeks afterwards. Chapter 5 deals with scaffolds and architecture, the question of how much structure must be supplied from outside and how much the cells can build for themselves. Chapter 6 confronts the central obstacle, vascularisation, in detail: the physics of oxygen diffusion, the techniques for printing channels that blood or culture medium can flow through, and the newer computational approaches to designing vascular trees. Chapter 7 surveys what has actually left the laboratory, from an ear implant made of a patient's own cartilage cells to printed liver tissue used by pharmaceutical companies to bioprinted insulin-producing tissue in animal studies. Chapter 8 traces the regulatory path that any printed tissue must travel in the United States and Europe, and explains why the rules for cell therapies, not the rules for 3D-printed devices, are the ones that govern. The conclusion considers what follows from all this: what kinds of printed organs are plausible, on what timescale, and how bioprinting fits alongside its competitors, including genetically engineered pig organs that entered formal clinical trials in 2025. A note on scope This book concentrates on bioprinting for human tissue replacement and on the closely related use of printed tissue as a model for testing drugs. It does not cover the large and mature business of 3D-printing non-living medical devices such as titanium spinal cages or dental aligners, except where those devices serve as scaffolds for cells. It also says little about food printing or cultivated meat, which use some of the same tools but face entirely different economics. Where the evidence comes from animal studies or cell cultures rather than human patients, the text says so, because that distinction is the single most common casualty of popular reporting on the field. Technical vocabulary is introduced as it is needed and collected in a short glossary at the back. No background in biology or engineering is assumed beyond what an attentive reader of a good newspaper science section would have. What is assumed is a willingness to follow a mechanism step by step, because in this field the mechanisms are the story. A cell does not care how impressive a printer looks. It cares how much force it felt in the nozzle, how far it sits from the nearest supply of oxygen, and whether the gel around it gives it something to hold onto. The rest of this book is about those three questions and what engineers, biologists and regulators have learned in trying to answer them. Chapter 1: From Tissue Engineering to Bioprinting In 1993 the chemical engineer Robert Langer and the surgeon Joseph Vacanti published a short article in Science that gave a name and a programme to a field that barely existed. They called it tissue engineering, and they defined it as the application of engineering and the life sciences to building biological substitutes that restore, maintain or improve the function of tissues [3]. The recipe they described has three ingredients that are still the vocabulary of the field: cells, a scaffold for the cells to live on, and signals, chemical or mechanical, that tell the cells what to become. Four years later a photograph made the programme famous. It showed a hairless laboratory mouse with what looked like a human ear growing on its back. The "ear" was a biodegradable polymer scaffold in the shape of an ear, seeded with cartilage cells from a cow and implanted under the mouse's skin. It was not a human ear and it was not grown from human cells, but it made an argument visible: give cells the right shape to occupy and they will fill it. Bioprinting is best understood as the attempt to put that argument under digital control. The classical tissue engineering approach made a porous scaffold first and then poured or pipetted cells onto it, hoping they would migrate inside and distribute themselves evenly. They often did not. Cells settled at the surface, the interior stayed empty or died, and there was no way to place one cell type here and another there. Bioprinting reverses the order of operations. Cells and their supporting material are deposited together, at defined positions, so that the architecture of the tissue is set at the moment of fabrication rather than left to chance. Three lines of descent The technology has three ancestors, and each still shows in how the field works today. The first is additive manufacturing. Charles Hull's stereolithography patent in the mid-1980s described building solid objects by curing a liquid resin with ultraviolet light, one thin layer at a time, guided by a computer model. Fused deposition modelling, in which a heated nozzle extrudes a plastic filament, followed soon after. By the 2000s these methods were routine in engineering and were beginning to be used in medicine for anatomical models and custom implants. They brought with them a workflow that bioprinting inherited almost unchanged: a three-dimensional digital model, software that slices the model into layers, and a machine that turns each layer into a set of toolpath instructions. The second ancestor is the inkjet printer. In the early 2000s Thomas Boland and colleagues, then at Clemson University, modified commercial desktop inkjet printers to dispense proteins and living cells instead of ink [4]. The cartridges were cleaned, refilled with cell suspensions, and the paper feed was replaced with a stage that held a dish of gel. The early results were crude, but they established two important facts: mammalian cells could survive passage through a printhead in large proportions, and droplets of cells could be placed in patterns with a resolution measured in tens of micrometres. The researchers who followed, including Vladimir Mironov and Gabor Forgacs, began to talk about "organ printing" as a coherent goal. The third ancestor is developmental biology. Forgacs, a physicist by training, was interested in how embryonic tissues fuse and sort themselves. He observed that small spheres of cells, placed next to one another, would merge in a matter of days, much as droplets of liquid coalesce. This suggested a different philosophy of printing: rather than building every microscopic detail, place cell aggregates in roughly the right arrangement and let the cells' own tendency to self-organise do the fine work. Forgacs co-founded the company Organovo in 2007 on this premise. It remains an influential idea, because it recognises that cells are not inert pixels. They move, divide, pull on their surroundings, remodel them, and talk to their neighbours. These three lines produce a definition. Bioprinting is the computer-controlled, layer-by-layer deposition of living cells, alone or together with biomaterials and biological molecules, to create three-dimensional structures that are intended to function as tissue. The word "intended" matters. Most printed constructs in the scientific literature are not yet tissue in the full sense. They are arrangements of cells that will, if conditions are right, mature into something tissue-like over days or weeks. What an organ actually is The phrase "printing an organ" suggests that an organ is a shape. It is not. An organ is a hierarchy of structures, each of which has a job, organised across a range of sizes from the molecular to the macroscopic. Consider the kidney. Each human kidney contains roughly a million nephrons, the microscopic filtering units. Each nephron begins with a glomerulus, a tuft of capillaries a fraction of a millimetre across, whose walls are specialised to let water and small molecules through while holding back blood cells and most proteins. The filtrate then passes through a long tubule lined with at least a dozen distinct cell types, which reabsorb glucose, salts and water in carefully regulated amounts. Every nephron is wrapped in its own capillary network, and the whole organ is served by an arterial tree that branches from a vessel the width of a pencil down to capillaries narrower than a red blood cell. The kidney also produces hormones, responds to signals from the brain and the heart, and adjusts its function minute by minute. No printer places a million nephrons. The question for bioprinting is therefore never just whether a shape can be reproduced. It is which levels of the hierarchy must be built by the machine, and which can be left to the cells. A printed kidney does not need to have every capillary drawn into the design file, if the cells can be persuaded to sprout their own capillaries. But it does need the large vessels, because cells cannot grow a pencil-width artery fast enough to keep themselves alive, and it needs the right cell types in roughly the right places, because a mixed soup of kidney cells will not sort itself into a million nephrons. This is why the useful way to classify tissues for bioprinting is by complexity, a ladder that has been described in similar terms by many researchers including Anthony Atala at the Wake Forest Institute for Regenerative Medicine. The lowest rung is flat tissue such as skin, which is a few cell layers thick and can be nourished from below. Next come tubular structures such as blood vessels, the windpipe and the urethra, which are hollow and carry fluid or air but have relatively simple walls. Next come hollow non-tubular organs such as the bladder or stomach, which have more complex walls and must stretch and contract. At the top are solid organs such as the liver, kidney, heart and lung, which are dense with cells, packed with blood vessels, and perform many functions at once. Every step up the ladder multiplies the difficulty, and the steps are not evenly spaced. The jump from hollow organs to solid ones is far larger than all the others combined, because solid organs are where the vascular problem becomes overwhelming. Atala's group showed in 2006 that the lower rungs were reachable even before bioprinting. They built bladders for seven young patients by seeding a bladder-shaped scaffold of collagen and synthetic polymer with the patients' own bladder muscle and lining cells, growing the construct in the laboratory for several weeks, and then implanting it [5]. The engineered bladders functioned for years in follow-up. That work was hand-seeded rather than printed, but it set the template for what bioprinting promises to do faster, more reproducibly, and for more complex tissues. Why print, and what printing cannot do A sceptic could reasonably ask why tissue needs to be printed. Cells can be grown on scaffolds; scaffolds can be moulded or spun into fibres. The answer lies in four capabilities that printing provides and other methods do not. The first is spatial control of composition. A printer can lay down cartilage cells in one region and bone-forming cells in the adjacent region, which matters for an interface such as the end of a long bone where the two tissues meet. It can place liver cells next to the support cells that keep them functioning, in a repeating pattern that resembles the liver's own microscopic architecture. A moulded or seeded scaffold cannot do this. The second is internal architecture. A printer can create channels, pores and voids inside an object, with sizes and positions specified in advance. That matters most for vascularisation, the subject of Chapter 6, but it also matters for allowing nutrients to reach cells and for controlling how the construct degrades. The third is patient specificity. Because the design is a digital file, it can be generated from a CT or MRI scan of the individual patient. A child with microtia, a congenital malformation of the outer ear, can receive an ear shaped like a mirror image of the healthy ear on the other side. A patient with a defect in the jaw after cancer surgery can receive a graft that fits the exact contour of the bone that was removed. This is the most mature advantage of the technology and it is the one that 3D printing of non-living implants has already proved in clinical practice. The fourth is automation and reproducibility. Hand-seeding scaffolds is an artisanal craft. Two technicians, or the same technician on two days, produce different results. A printer running a validated protocol produces the same object every time, within its tolerances. For a laboratory this is a convenience. For a regulator deciding whether to approve a product made from living cells, it is close to a precondition, for reasons Chapter 8 will make clear. The same honest accounting requires naming what printing does not provide. A printer does not make cells; they must be obtained, expanded and kept healthy beforehand, which is often the most expensive and time-consuming part of the whole process. A printer does not make tissue mature; a freshly printed construct is closer to a scaffold dotted with cells than to a functioning organ, and it must spend days to weeks in a bioreactor or in the body before it behaves like tissue. And a printer does not guarantee survival. Every printing method imposes some stress on cells, and every printed object above a certain thickness faces a nutrient supply problem that the printer itself does nothing to solve. The field's history is partly a history of learning these limits. In 2011 Atala gave a widely viewed public talk in which a printer on stage built a kidney-shaped object. It was a demonstration of shape, not of function, and Atala said as much, but the image travelled further than the caveat. A decade and a half later, no printed kidney has filtered blood in a human being. What has happened instead is slower and more instructive: the gradual mapping of what cells need in a printed environment, and the invention of materials and methods to provide it. The organ shortage as context, not deadline The organ shortage gives bioprinting its moral urgency and much of its funding. It also distorts expectations. Because the need is so stark, it is tempting to measure progress by asking how close the field is to a transplantable printed kidney or liver. That is the wrong measure for most of the work being done. A more useful measure asks which clinical problems can be solved by tissues that are already within reach. There are many. Children born with microtia currently undergo reconstruction using cartilage carved from their own ribs, a painful operation that leaves a chest scar and depends heavily on the surgeon's artistry. Burn patients need skin cover faster than donor sites can regenerate. Patients with osteoarthritis need cartilage repair. People with type 1 diabetes need insulin-producing cells that can be implanted without lifelong immune suppression. Patients with failing livers sometimes need only temporary support to survive until their own liver regenerates. Each of these is a problem that a partial, simpler printed tissue could address, and each provides a stepping stone of regulatory precedent, manufacturing experience and clinical data toward the harder goals. Pharmaceutical development provides another context in which printed tissues are valuable long before they are transplantable. Most experimental drugs fail in human trials, and a substantial share of those failures come from toxicity that animal studies did not predict, liver toxicity in particular. A small piece of human liver tissue that survives for a few weeks in a dish and metabolises drugs the way a human liver does can catch some of those failures early. Organovo built its first commercial business around exactly such a product in the mid-2010s. The economics proved difficult, as Chapter 7 describes, but the scientific logic was sound, and US regulatory reforms since 2022 that loosen the requirement for animal testing have strengthened it. By the end of this chapter the outline of the field should be clear. Bioprinting is additive manufacturing applied to living material. Its tools come from engineering, its materials from polymer chemistry and biology, its ambitions from medicine. It can control where cells go, what they sit in, and what shape the result takes. It cannot, by itself, keep cells alive at the densities found in real organs or make them behave like a mature tissue. Those are biological problems, and they set the real pace of progress. The chapters that follow take the problem apart in the order a bioprinted tissue meets it. First comes the machine and how it handles cells. Then comes the material the cells are suspended in, then the cells themselves, then the structure that holds everything together, then the blood supply that keeps it alive, then the evidence from patients and laboratories, and finally the regulatory path from a laboratory construct to an approved therapy. At each step the same question recurs: what does the cell need, and how much of that can a manufacturing process provide? Chapter 2: How Bioprinters Place Living Cells Every bioprinter solves the same physical problem. It must move a material containing living cells from a reservoir to a precise position in space, and then make that material stay where it was put. The methods differ in how they move the material, how they fix it in place, and, crucially, what they do to the cells along the way. A printing method that produces beautiful shapes but kills half the cells is not a bioprinting method in any useful sense. Nor is one that keeps every cell alive but can only make structures a few hundred micrometres thick. This chapter walks through the five families of technique that matter today, and judges each by the three criteria that actually determine its usefulness: resolution, the density of cells it can handle, and the fraction of those cells that survive. Extrusion: the workhorse The great majority of bioprinting work in academic laboratories and in early commercial products uses extrusion. The principle is the same as squeezing icing from a piping bag. A cartridge, usually a plastic syringe, is filled with a cell-laden gel. Pressure is applied, by compressed air, by a mechanical piston, or by a rotating screw, and the gel emerges from a fine nozzle as a continuous filament. The nozzle moves over the build platform, tracing each layer of the design, and the platform drops or the nozzle rises before the next layer is drawn on top. Extrusion has three great virtues. It handles very viscous materials, which means it can print gels thick enough to hold their own shape. It can print at high cell densities, including dense pastes of cells with little or no added material, and even pre-formed clusters of cells called spheroids. And it is mechanically simple and cheap, so that commercial extrusion bioprinters from companies such as CELLINK, part of the Swedish group BICO, and 3D Systems, which acquired the bioprinter maker Allevi in 2021, are found in hundreds of university laboratories. Many machines carry several printheads, each loaded with a different material or cell type, so that one object can contain several compositions. The weaknesses of extrusion follow from the same physics. Filaments are rarely finer than about 100 micrometres, and more often 200 to 400 micrometres, which is coarse compared with the scale of capillaries or individual cells. And extrusion exposes cells to mechanical stress. As gel flows through a narrow nozzle, the layers of fluid near the wall move more slowly than those in the centre, and the resulting shear stretches and tears cells caught in the gradient. The stress rises steeply as the nozzle narrows and as pressure increases. A study by Andreas Blaeser and colleagues in 2016 quantified the effect directly, showing that cell viability stayed high at modest shear stresses but fell sharply once stresses rose above roughly 5 to 10 kilopascals, and that even cells that survived suffered reduced ability to multiply [6]. This sets up a trade-off that runs through all extrusion printing: a finer nozzle gives better resolution but harsher shear; a stiffer gel holds its shape better but needs more pressure to push. Designers mitigate the problem with tapered conical nozzles, which reduce the length of the high-shear region, and with gels that thin under shear and recover afterwards, a property discussed in Chapter 3. A refinement worth knowing about is coaxial and microfluidic extrusion. Instead of a single channel, the printhead contains concentric or merging channels, so that, for instance, a cell-laden alginate solution flows in the core while a calcium chloride solution flows around it. The two meet at the tip and the alginate solidifies instantly into a fibre or a hollow tube. The Vancouver company Aspect Biosystems built its platform around microfluidic printheads of this kind, which allow rapid switching between materials within a single filament. Droplets and lasers Droplet-based printing places material as a sequence of tiny discrete drops rather than a continuous filament. The original form, as noted in Chapter 1, borrowed directly from office inkjet printers. In a thermal inkjet head, a tiny resistor heats a thin film of liquid for a few microseconds, vaporising it and creating a bubble that expels a droplet through a nozzle. The temperatures at the resistor surface are high, but the heating is so brief and so localised that the bulk of the liquid, and the cells in it, warm by only a few degrees. In a piezoelectric head, a crystal that changes shape when voltage is applied squeezes the chamber mechanically instead. In both cases droplets are measured in picolitres, and positions can be controlled to tens of micrometres. A related approach uses microvalves, which open briefly to release a drop from a pressurised reservoir and tolerate somewhat thicker fluids. The strength of droplet printing is precision and speed of placement for low-viscosity materials. It is well suited to depositing patterns of cells, growth factors or drugs onto a surface, and to building thin layered tissues such as skin, where one can deposit successive layers of different cell types. Its fundamental limitation is that it works only with thin, watery fluids; a thick gel will not form clean droplets. Thin fluids hold little shape, so droplet-printed structures must be solidified immediately, by a chemical crosslinker in the receiving bath or by light, and tall constructs are difficult. Dense cell suspensions also cause trouble: cells settle in the reservoir, clump, and clog nozzles a few tens of micrometres wide. In practice, droplet methods work best at cell densities well below those of real tissue. Laser-assisted bioprinting, also called laser-induced forward transfer, takes a different approach. A transparent glass slide, the "ribbon", is coated on its underside with a thin layer of laser-absorbing metal such as gold or titanium, and below that a layer of cell-laden gel. A pulsed laser is focused through the glass onto the metal. Each pulse vaporises a tiny spot of the absorbing layer, generating a high-pressure bubble that propels a jet of gel and cells downward onto a receiving surface a short distance below. Because there is no nozzle, nothing clogs, and because the energy is absorbed by the metal layer rather than the cells, survival is typically very high, often above 95 percent in published work. The technique can place cells with a resolution approaching that of a single cell, and it handles a range of viscosities. Its drawbacks are cost, complexity, and throughput: laser systems are expensive, each ribbon must be prepared with cells in advance, and building a large object drop by drop is slow. The French company Poietis, based near Bordeaux, has developed laser-assisted printing toward clinical use, with a focus on skin, and installed a printing platform in a Marseille public hospital system in collaboration with Assistance Publique–Hôpitaux de Marseille to prepare a clinical trial of bioprinted skin. Light and supporting baths Light-based methods descend from stereolithography. A vat contains a liquid that solidifies when exposed to light because it contains photoreactive polymers and a photoinitiator, a molecule that absorbs light and starts the chemical reaction that links polymer chains together. In digital light processing, a projector of the kind used in conference rooms displays an entire cross-sectional image of the object at once, solidifying a whole layer in a few seconds. The platform then moves by one layer thickness and the next image is projected. Resolution is set by the pixel size of the projector and the depth to which light penetrates, and is typically in the range of tens of micrometres, considerably finer than extrusion. Because there is no nozzle, there is no shear stress. Early photocrosslinking used ultraviolet light and photoinitiators such as Irgacure 2959, which raised concerns about damage to cell DNA. The field has largely moved toward visible blue light at around 405 nanometres and more efficient initiators such as lithium phenyl-2,4,6-trimethylbenzoylphosphinate, universally called LAP, which allow shorter exposures at lower intensity. The remaining concerns are the reactive molecules generated during crosslinking, which can harm cells if their concentration is too high, and the scattering of light by cells themselves, which blurs the image when cell densities are high. The most striking development in light-based printing came in 2019, when Paulina Núñez Bernal, Riccardo Levato and colleagues at Utrecht, working with the EPFL group that developed the underlying optics, published volumetric bioprinting [7]. Instead of building layer by layer, the method builds the whole object at once. A transparent vial of cell-laden gel rotates while a projector shines a carefully computed sequence of images through it from the side, much as a CT scanner reconstructs an image from many angles but in reverse. Each image deposits a small dose of light; only where the accumulated dose from all angles crosses a threshold does the gel solidify. The result was centimetre-scale, anatomically shaped constructs, including a model of a meniscus and structures with internal channels, printed in seconds to tens of seconds with cell viability above 85 percent. The Swiss company Readily3D now sells instruments based on the method. Speed matters here for biological reasons as much as convenience: cells sitting in a cartridge for hours lose viability, so a process that finishes in under a minute removes an entire source of damage. At the opposite extreme, two-photon polymerisation uses a tightly focused femtosecond laser in which crosslinking occurs only at the tiny focal point where two photons are absorbed simultaneously. It can write features smaller than a micrometre, finer than a single cell, but only very slowly, which restricts it to microscopic scaffolds and research questions rather than tissue-scale objects. A different line of innovation attacked a problem that limited every method above. Soft gels, the kind cells like best, cannot support their own weight. Print a tall structure from a gel as soft as brain tissue and it slumps into a puddle before it can be solidified. One answer, explored in Chapter 3, is to make the gel stiffer. Another is to print the soft gel inside a supporting medium that holds every part of the object in place until it sets. Embedded printing places the nozzle inside a bath of a granular material, a slurry of microscopic gel particles packed together. At rest, the packed particles behave like a soft solid and hold whatever is deposited within them. When the nozzle moves through, the particles locally yield and flow like a liquid, letting the nozzle pass, then immediately re-pack behind it. The printed filament is trapped exactly where it was laid. Two groups described versions of the idea in 2015, Thomas Angelini's group at the University of Florida using a granular microgel, and Adam Feinberg's group at Carnegie Mellon University using a slurry of gelatin microparticles in a method they named Freeform Reversible Embedding of Suspended Hydrogels, or FRESH [8]. The gelatin bath has a convenient property: it melts at body temperature, so once printing is complete the whole block can be warmed and the support simply flows away, leaving the printed object behind. The significance of FRESH became clear in 2019, when Feinberg's group used it to print structures from pure collagen, the most abundant protein in the human body and the main structural material of most tissues [9]. Collagen is extremely difficult to print on its own because it is runny until it gels, and it gels slowly. In the gelatin support bath, the team used a pH change to trigger collagen gelling and printed components of the human heart, including a tri-leaflet valve and a model of a neonatal heart's anatomy derived from an MRI scan, with features reported at around 20 micrometres. They also printed small ventricles containing heart muscle cells that contracted in synchrony. A Pittsburgh spinout, FluidForm Bio, is now developing FRESH-printed tissues toward therapy. Embedded printing also enables a related strategy used in vascularisation, in which a sacrificial ink is printed inside a living bath of cells and later removed to leave hollow channels. Chapter 6 returns to it. Comparing the methods, and the problem of speed No single method dominates. Table 1 summarises the families discussed in this chapter. Ranges are representative values drawn from review literature, notably the overview by Sean Murphy and Anthony Atala in Nature Biotechnology [10], and from the primary studies cited in this chapter; individual systems vary widely. Table 1. The main bioprinting methods compared. Method Typical resolution Cell density tolerated Main stress on cells Best suited to Extrusion 100–400 µm filaments High, including spheroids Shear in the nozzle Thick, multi-material constructs Inkjet and microvalve 20–100 µm droplets Low to moderate Brief heat or pressure pulses; nozzle clogging Thin layers, patterning on surfaces Laser-assisted transfer Near single-cell Moderate Minimal; jet impact High-precision placement, skin Projection and volumetric light Roughly 20–80 µm Moderate; cells scatter light Light exposure and reactive species Fine architecture, rapid builds Embedded (FRESH and similar) Down to about 20 µm in collagen Moderate to high Shear, as in extrusion Very soft materials, complex anatomy Resolution and viability dominate most discussions of printing methods. Speed deserves equal attention, because it becomes decisive as constructs grow toward the size of real organs. A simple calculation makes the point. Suppose an extrusion printer builds a solid cube 10 centimetres on a side, roughly the scale of a large piece of liver, with filaments 200 micrometres wide stacked in 200-micrometre layers. Each layer needs 500 parallel lines, each 10 centimetres long, which is 50 metres of filament. At a typical bioprinting speed of 10 millimetres per second, one layer takes about 5,000 seconds, nearly an hour and a half. The cube needs 500 layers, so the total is around 2.5 million seconds, or roughly a month. Cells sitting in a cartridge, or in the lower layers of a construct that is not yet perfused, will not survive a month. The practical consequences are threefold. First, organ-scale printing will need methods that are orders of magnitude faster than single-nozzle extrusion, which is why volumetric light-based printing and multi-nozzle arrays attract so much interest. Second, it pushes designers toward strategies in which the printer builds only the architecture that matters, such as large vessels and compartment boundaries, while densely packed cells or cell aggregates fill the rest in bulk. Third, it means that keeping cells alive during printing, not just after it, is a design requirement. The Stanford group led by Mark Skylar-Scott, which is developing methods to print heart tissue, has made exactly this point in describing its efforts to scale up both cell production and printing speed for a human-sized organ. Choosing a printing method is never a neutral technical decision. It constrains which materials can be used, how many cells can be included, how fine the architecture can be, and how large the final object can become. An extrusion system commits the designer to materials that thin under shear and recover quickly. A light-based system commits the designer to photocrosslinkable materials and to managing light scattering. An embedded system commits the designer to a compatible support bath and a gentle way of removing it. In every case the cells come second to the physics of the process, and the art of bioprinting lies in finding a process whose physics the cells can tolerate. That art is concentrated, above all, in the material the cells are suspended in. The next chapter turns to the bioink, the substance that must satisfy the printer and the cell at once. Chapter 3: Bioinks and the Biofabrication Window A bioink is the material that carries cells through a printer and holds them in place afterwards. It is the single most consequential choice in any bioprinting project, and it is a compromise from the start. The printer wants a material that flows easily under pressure, solidifies instantly and completely once deposited, and is stiff enough to support the layers above it. The cell wants something quite different: a soft, wet, porous environment that resembles the natural matrix of the tissue it came from, that it can grip, migrate through, remodel and eventually replace with material of its own. Most materials that satisfy the printer are hostile to cells, and most materials cells love are nearly impossible to print. In 2013 Jos Malda and colleagues gave this tension a name that the field has used ever since: the biofabrication window [11]. Picture a chart with printability rising along one axis and cell compatibility along the other. Stiff, densely crosslinked polymers sit high on printability and low on cell compatibility; they print crisp shapes but trap cells in a mesh too tight to move or divide. Very dilute, soft gels sit at the other end; cells thrive in them but they spread into puddles. The traditional practice was to choose a point somewhere in the middle and accept mediocrity on both counts. Much of the progress of the past decade has come from finding ways to widen the window, so that a material can be printable during fabrication and cell-friendly afterwards. What makes a material printable Three physical properties determine whether a gel will print well, and understanding them explains most bioink design decisions. The first is viscosity, a measure of resistance to flow. Honey is more viscous than water. A bioink must be viscous enough that it does not drip from the nozzle or spread once deposited, but not so viscous that pushing it through a nozzle requires pressures that tear cells apart. The second, and the most important, is shear thinning. Many gels become runnier when they are forced to flow and thicken again when the flow stops. Ketchup is a familiar example: it sits in the bottle until shaken, then pours. For bioprinting this behaviour is close to ideal. In the nozzle, where the material is sheared, it thins and flows at modest pressure, reducing the stress on cells. Once deposited, it thickens and holds its filament shape. Polymers with long, entangled chains, such as alginate and hyaluronic acid at sufficient concentrations, shear thin naturally, and additives such as nanocellulose fibres or Laponite clay nanoparticles are used to strengthen the effect. The third is yield stress and recovery. A material with a yield stress behaves as a solid until a threshold force is applied, then flows. Toothpaste is the textbook example. A bioink with a modest yield stress will not slump under its own weight after printing, and the speed with which it recovers its solid-like behaviour after leaving the nozzle determines how sharp the printed shape will be. These properties get the material onto the build platform in the right shape. But a shear-thinning gel is still a gel that can be pulled apart, and the printed object must survive handling, culture and implantation. So nearly every bioink also undergoes a second, more permanent solidification called crosslinking, in which chemical or physical bonds tie the polymer chains together into a network. There are four main crosslinking strategies, and each carries its own implications for the cells. Ionic crosslinking is the simplest and most widely used. Alginate, a sugar polymer extracted from brown seaweed, consists of chains carrying negative charges. When a solution containing doubly charged calcium ions meets it, each calcium ion bridges two chains, and the solution sets into a gel within seconds. This is the same chemistry used in molecular gastronomy to make fruit-juice "caviar". In bioprinting, calcium may be added to the bath, sprayed onto each layer, or delivered through the outer channel of a coaxial nozzle. The reaction is mild and fast, which is why alginate became the default material of early bioprinting. Its weakness is that the bonds are reversible: in the body, calcium gradually exchanges with sodium and the gel slowly loses strength in an uncontrolled way. Thermal gelation exploits materials that change state with temperature. Gelatin, which is collagen that has been partly broken down by heat, dissolves when warm and sets when cooled below roughly room temperature, which is why jelly sets in the refrigerator. Collagen itself does the opposite in a sense: acidic collagen solutions gel when neutralised and warmed toward body temperature. A synthetic material, Pluronic F-127, is liquid when cold and gels when warmed, and is useful precisely because the process reverses, as Chapter 6 will show. Thermal gelation is gentle, but it is slow compared with ionic crosslinking, and gelatin on its own melts at body temperature, which means it cannot hold a shape inside an incubator or a patient without additional crosslinking. Photocrosslinking uses light, as described in Chapter 2. A polymer is chemically modified with reactive groups, most often methacrylate groups, and mixed with a photoinitiator. Exposure to light of the right wavelength links the groups into a permanent network. The most important example is gelatin methacryloyl, universally known as GelMA. First described in 2000 by a group in Ghent and developed extensively in the following decade, notably by Ali Khademhosseini's laboratory, GelMA has become the most widely used bioink in academic research [12]. It combines the cell-friendliness of gelatin with the ability to be fixed permanently by light. Crucially, its stiffness can be tuned by changing the polymer concentration, the degree of methacrylation, or the light dose. Enzymatic crosslinking borrows the body's own chemistry. Fibrinogen, a blood protein, is converted to fibrin, the structural material of a blood clot, by the enzyme thrombin. Mixing the two produces a soft, natural gel that cells readily invade and remodel. Other enzymes, such as transglutaminase, can crosslink gelatin. These reactions are very gentle but harder to time precisely during printing, so fibrin is often used in combination with other materials that provide printability while it provides biology. The main materials Bioink materials fall broadly into natural polymers, which come from living organisms, and synthetic polymers, which are made in a chemical plant. Natural materials tend to offer the biochemical cues cells recognise; synthetic materials tend to offer control and consistency. Collagen is the gold standard of biological relevance. It is the main protein of the extracellular matrix, the material between cells that gives most tissues their strength. Cells bind to collagen through surface receptors called integrins, and collagen can be degraded and remodelled by enzymes that cells secrete, which is how cells move through tissue and replace old matrix with new. The obstacle to printing collagen is its slow gelation and low viscosity at the concentrations cells tolerate, which is why the embedded FRESH method, which held liquid collagen in place long enough to gel, was such a significant advance. Gelatin and GelMA keep much of collagen's biological activity. Gelatin retains the short amino-acid sequences, the best known being the three-letter sequence arginine-glycine-aspartic acid abbreviated RGD, that integrins bind to, as well as the sites at which cell enzymes cut the matrix. That is why cells spread and migrate in soft GelMA when they would sit as isolated spheres in alginate. Alginate is cheap, gentle and easy to print, but it is biologically inert: mammalian cells have no receptors for it and no enzymes to break it down. Cells embedded in plain alginate remain rounded and isolated. To overcome this, chemists graft RGD peptides onto the alginate chains, or mix alginate with gelatin or collagen. Alginate's inertness can also be an advantage, for example in encapsulating insulin-producing cells, where the goal is to shield transplanted cells from the immune system rather than invite cells in. Hyaluronic acid is a large sugar polymer abundant in cartilage, skin and the fluid that lubricates joints. It is biologically active, influencing cell behaviour through specific receptors, and like gelatin it can be chemically modified for photocrosslinking. Jason Burdick's group, first at the University of Pennsylvania, has made extensive use of modified hyaluronic acid, including versions that crosslink through reversible "guest–host" interactions, which make it shear thinning and self-healing. Decellularised extracellular matrix offers the most complete biological signal. Tissue from an animal, often a pig, is washed with detergents and enzymes until the cells are removed, leaving the protein and sugar framework behind. The matrix is then dried, ground and digested into a solution that can be printed and gelled. Falguni Pati, Dong-Woo Cho and colleagues showed in 2014 that bioinks made from decellularised heart, cartilage and fat tissue supported cell behaviour specific to each tissue of origin [13]. The drawback is variability: matrix from different animals, or different batches of the same process, differs in composition, and the gels are mechanically weak. Synthetic polymers, chief among them polyethylene glycol (PEG), are the opposite case. PEG is chemically defined, reproducible, and almost completely inert to cells. That inertness is a blank canvas: chemists can attach exactly the adhesion sequences, degradable links and growth factors they want, at controlled densities, and study how each affects cells. Synthetic gels are valuable when reproducibility and regulatory clarity matter most, and they are often used as the base for "designer" matrices. Matrigel, a protein mixture secreted by a mouse tumour cell line, deserves a brief mention because it is so widely used in biology for growing organoids. It is biologically rich and cells love it, but its composition varies from batch to batch and its tumour origin makes it unsuitable for clinical products. Its prominence in laboratory work is a reminder that the bioinks that produce the best research results are not always the ones that can be used in patients. Table 2 summarises the materials most often used, comparing how each sets, whether cells can bind to it, and its principal limitations. The characterisations are qualitative summaries from the review literature cited in this chapter. Table 2. Common bioink materials and their trade-offs. Material Source How it sets Cell adhesion Main limitation Alginate Brown seaweed Calcium ions, seconds None unless modified Inert; slow, uncontrolled loss of strength Gelatin / GelMA Animal collagen, processed Cooling; light for GelMA Yes (RGD sites) Animal-derived; batch variation Collagen type I Animal or recombinant Warming and neutral pH Yes, native Runny and slow to gel Fibrin Blood proteins Thrombin enzyme Yes Soft; degrades quickly Hyaluronic acid (modified) Bacterial fermentation Light or guest–host bonds Partial, via receptors Requires chemical modification Decellularised matrix Animal tissue Warming and neutral pH Yes, tissue-specific Weak; variable composition PEG-based Synthetic Light or click chemistry None unless modified Must be engineered for biology What cells feel, and how to widen the window Once a gel is set, three further properties determine what the cells experience. Stiffness is perhaps the most influential. In a landmark 2006 study, Adam Engler, Dennis Discher and colleagues showed that mesenchymal stem cells grown on gels of different stiffness tended toward different fates: soft gels resembling brain tissue favoured nerve-like cells, intermediate stiffness resembling muscle favoured muscle-like cells, and stiff gels resembling the matrix of developing bone favoured bone-like cells [14]. Cells sense stiffness by pulling on their surroundings through their integrin attachments and gauging the resistance. A bioink for cartilage or bone therefore needs to be stiffer than one for liver or brain. Native soft tissues range from well under one kilopascal for brain to tens of kilopascals for muscle, while cartilage is far stiffer still. The difficulty is that many bioinks that are stiff enough to print well are stiffer than the tissue they are supposed to mimic. Porosity, at the scale of the polymer network, determines how readily oxygen, nutrients and waste diffuse through the gel and whether cells can extend processes or migrate. A dense network with a mesh size of a few nanometres lets small molecules through but traps cells in place. A cell embedded in such a gel can only move by digesting the gel, which brings in the third property. Degradation must be matched to the pace at which cells build their own matrix. If a gel degrades too fast, the construct loses its shape before the cells have replaced it. If it degrades too slowly, the cells remain imprisoned and the tissue never matures. Natural materials such as collagen, gelatin and fibrin are degraded by enzymes that cells produce, so degradation tracks cell activity. Synthetic gels can be built with peptide links that the same enzymes cut, giving them the same responsive behaviour. Alginate, by contrast, degrades on its own timetable, with no connection to what the cells are doing. The most interesting bioink research of the past decade has not been the search for a single perfect material, which probably does not exist, but strategies that decouple printability from the final environment. One strategy is to print in one state and use in another. GelMA, for example, can be printed cool, when the gelatin component has partly set and gives the ink body, and then fixed permanently by light, after which it is warmed to body temperature without melting. Printability is supplied by the temporary thermal gel; stability by the permanent photocrosslinks. A second strategy uses sacrificial components. A bioink may contain a thickener that makes it printable and is then washed out. Gelatin, which melts at 37 degrees Celsius, is commonly blended into other inks for this purpose, so that after printing and crosslinking the gelatin dissolves away, leaving a softer, more porous network for the cells. A third strategy is to change the material's structure from a continuous gel to a packed bed of microscopic gel particles, a so-called granular or microgel bioink. Packed particles flow under shear and jam when stationary, giving excellent printability, while the spaces between particles provide room for cells to migrate and for nutrients to flow. Once printed, the particles can be bonded to one another to stabilise the structure. A fourth strategy is to print into a supporting bath, as described for FRESH in Chapter 2, which removes the need for the ink to support itself at all. With the bath doing the structural work, the bioink can be as soft as the cells require. A fifth strategy reduces the bioink to a minimum. If cells are packed so densely that they behave as a paste, the material between them can be a thin film. This is the logic of printing cell spheroids or dense cell slurries, and it brings bioprinting closer to the cell densities found in real organs, a question taken up in Chapter 4. A worked example: formulating a cartilage bioink To see how these considerations combine, consider a laboratory designing a bioink for printing cartilage to repair a defect in a knee. The cells are chondrocytes, cartilage cells, obtained from a small biopsy of the patient's own cartilage and expanded in culture. The team first chooses a base material. Cartilage matrix is rich in collagen type II and in hyaluronic acid and related sugars, so a hyaluronic acid derivative or GelMA, or a blend of the two, is a natural starting point. GelMA provides attachment sites; hyaluronic acid provides tissue-specific signals that help chondrocytes keep making cartilage matrix rather than drifting toward the scar-like fibrous tissue that expanded chondrocytes tend to produce. Next the team sets the concentration. Too dilute and the construct will be too soft to survive in a load-bearing joint and will not print cleanly; too concentrated and the dense network will restrict the cells from depositing new matrix. Published formulations commonly use GelMA somewhere in the range of 5 to 10 percent by weight, with the exact choice found by experiment. The photoinitiator, typically LAP, is added at a fraction of a percent, and the light dose is set to the minimum that gives a stable gel, to limit exposure of cells to reactive molecules. The team then checks printability. It measures the ink's viscosity across a range of shear rates to confirm shear thinning, prints test lattices to see whether filaments keep their width and whether pores between them stay open, and adjusts the printing temperature to use gelatin's thermal setting as a temporary support. It counts living and dead cells immediately after printing and at intervals afterwards, because good survival on the first day does not guarantee survival after a week. Finally, because even a stiff hydrogel is far softer than native cartilage, which must withstand forces several times body weight, the team may print the bioink together with a reinforcing frame of a stronger, slowly degrading polymer such as polycaprolactone. That hybrid approach, combining a structural scaffold with a biological bioink, is the subject of Chapter 5. A final consideration moves bioinks from the laboratory toward the clinic. Most natural bioink materials come from animals, typically cows and pigs. For research this is unproblematic. For a product implanted in patients, animal origin raises concerns about immune reactions, transmission of infectious agents, and batch-to-batch variability that regulators expect manufacturers to control. One response has been recombinant production. The Israeli company CollPlant, for example, produces human collagen in genetically engineered tobacco plants, and has used it to make bioinks; it has worked with United Therapeutics on printed lung scaffolds. Synthetic and recombinant materials trade some biological richness for reproducibility and traceability, and as products approach regulatory review, that trade usually looks better. The bioink, in short, is where the printer and the cell negotiate. The next chapter turns to the other party in that negotiation: the cells themselves, how many are needed, where they come from, and what happens to them after printing. Hashtags: #3DBioprintingTechnologies #3DBioprinting #Bioprinting #TissueEngineering #RegenerativeMedicine #Bioinks #BiomaterialScaffolds #Hydrogels #Biofabrication #AdditiveManufacturing #CellBiology #StemCellResearch #Biocompatibility #CellViability #Vascularization #ExtrusionBioprinting #InkjetBioprinting #LaserAssistedBioprinting #VolumetricBioprinting #EmbeddedBioprinting #FRESHBioprinting #GelMA #ExtracellularMatrix #BiomaterialsScience #OrganBioprinting #ArtificialOrgans #TissueRegeneration #BiomedicalEngineering #OrganOnAChip #FutureOfMedicine

  • Web3 Infrastructure (IPFS, Arweave, and Decentralized Storage)

    Download the Book (PDF): Introduction Every link on the web is a small promise. When a writer cites a page, a court quotes a document, or a developer points a token at an image, the link says: go to this place and you will find this thing. The promise is made by one party and kept, or broken, by another. The person who publishes the link has no control over whether the server at the other end will still be running next year, whether its owner will move the file, change it, or delete it, or whether someone with power over that server will decide the file should no longer be seen. The promise is broken constantly. In 2014 a team at Harvard Law School led by Jonathan Zittrain examined the links cited in legal scholarship and in opinions of the United States Supreme Court and found that a large share of them no longer led to the material originally cited, a finding that prompted the creation of the Perma.cc archiving service. A decade later, in 2024, the Pew Research Center reported that 38 percent of the web pages it sampled from 2013 were no longer accessible. These are not exotic failures. They are what happens, by default, to information whose existence depends on a particular machine at a particular address being kept alive by someone with a reason to keep it. The decentralized storage systems that are the subject of this book begin from a simple observation about that problem. The trouble with a web link is that it names a location, and locations are owned. A different kind of name is possible: one that identifies a piece of content by what it is rather than by where it is. Compute a cryptographic hash of a file and you have a short string that, for practical purposes, could only have come from that exact sequence of bytes. Use that string as the address and two things change at once. Anyone who has a copy of the file can serve it, because the name no longer belongs to one server. And anyone who receives the file can check, without trusting the sender, that it is the file they asked for. That idea, content addressing, is the foundation of the InterPlanetary File System, IPFS, which Juan Benet described in a 2014 paper and which Protocol Labs has developed since. It underlies Filecoin, a blockchain designed to pay people to store data, and in a different form it underlies Arweave, a network that sells storage meant to last for centuries in exchange for a single payment. Around these protocols has grown an infrastructure of gateways, pinning services, naming systems and developer tools that now hosts the front ends of financial applications, the metadata of millions of non-fungible tokens, archives of public records, and mirrors of websites that governments have tried to block. The argument of this book This book makes one argument and follows it through the whole stack. Content addressing solves the problem of integrity completely and the problem of availability not at all. A content identifier tells you exactly what a file is. It tells you nothing about whether anyone, anywhere, still has a copy. Those are two different properties, and almost every misunderstanding about decentralized storage, and almost every failure of a project built on it, comes from confusing them. The confusion is understandable. "Stored on IPFS" sounds like a statement about where data lives and how long it will stay there. It is actually a statement about how the data is named. An IPFS address can point to a file that has existed on thousands of machines for years, or to one that sat briefly on a laptop that has since been wiped. The name looks the same in both cases. The difference lies entirely in who has chosen to keep a copy, and why. Once the two properties are separated, the landscape becomes legible. IPFS is a protocol for naming, finding and moving content; it makes no promise about keeping it. Pinning services turn availability back into an ordinary commercial relationship, with the advantage that the customer can switch providers without breaking a single link. Filecoin attempts to make storage a verifiable market, in which providers prove cryptographically, on a schedule, that they still hold what they were paid to hold. Arweave makes a bolder bet: that a one-time payment, invested in an endowment and spent down as storage gets cheaper, can fund persistence indefinitely. Each of these is an answer to the question that content addressing leaves open, and each answer has a particular shape of risk. The same distinction governs the two applications the book treats at length. A censorship-resistant website is not one that cannot be blocked, but one that can be re-served, verifiably, by anyone who holds a copy, so that blocking any single route does not remove the content. And an NFT whose metadata points to an IPFS address is not thereby permanent; it is tamper-evident, which is valuable and different. Builders who understand the difference design accordingly. Those who do not discover it when an image stops loading. What the book covers and what it leaves out The chapters move from the foundations upward. The first explains why location-based addressing fails and what content addressing actually guarantees, down to the bytes of a content identifier. The second follows a file through IPFS: how it is split into blocks and arranged into a Merkle graph, how peers find each other and the data they want, and what gateways do. The third confronts persistence directly, through pinning, garbage collection and the services that have grown up to keep data alive. The fourth and fifth examine the two main economic answers: Filecoin's market of proofs, with a glance at erasure-coded networks such as Storj and Sia, and Arweave's endowment model of permanent storage. The sixth turns to hosting websites, including the naming systems that let a stable address point to changing content and the gateway problem that shadows all of it. The seventh deals with NFT metadata, where the gap between integrity and availability has been most publicly exposed. The eighth draws the threads together into a way of deciding, for a given piece of data, what combination of these tools will actually keep it safe, and examines the legal and moral complications of storage that is hard to delete. The book does not attempt a survey of every decentralized storage project, nor does it offer investment views on the tokens that some of these networks issue. Token prices matter here only where they shape the incentives of the people storing data. It also does not assume that decentralization is always the right answer. A recurring theme is that the most robust arrangements combine decentralized naming and verification with quite ordinary operational discipline, and that a centralized cloud bucket with good backups will outlast a careless decentralized deployment. The reader this book has in mind is technically curious but not necessarily a protocol engineer: a developer deciding where to put an application's assets, a product manager inheriting an NFT project, an archivist or journalist thinking about how to keep material available under pressure, or anyone who has heard that the decentralized web is "permanent" and wants to know what that claim really means. Where a short snippet of configuration or code makes a mechanism clearer, it appears; otherwise the explanations are in prose. The decentralized web has been described in grand terms for more than a decade. Its real achievements are more specific and, in some ways, more interesting than the slogans. It has given the internet a way to name information that does not depend on anyone's continued goodwill, and a way to verify information that does not depend on trusting whoever delivers it. What it has not done, and cannot do by protocol alone, is make anyone care enough to keep the bytes. That part remains a matter of incentives, institutions and choices, and it is the part this book spends most of its time on. Chapter 1: Names and Places A URL is an instruction for finding something. Take https://example.org/reports/2023/annual.pdf. Read from left to right, it says: use the HTTPS protocol, ask the domain name system which machine currently answers for example.org, connect to that machine, and request whatever it chooses to return for the path /reports/2023/annual.pdf. Every step in that chain depends on a party other than the person who wrote the link. A registrar must keep renewing the domain. A DNS provider must keep resolving it. A hosting company must keep the server running. The site's owner must keep the file at that path and resist the temptation to replace it with something else. A certificate authority must keep vouching for the server's identity. None of this is a design flaw in the ordinary sense. The web was built to let anyone publish without asking permission, and location-based addressing was the natural way to do that in 1990: you put a file on your machine and told people where your machine was. The flaw is that the address and the content are bound together only by the continued behaviour of the publisher. The address does not describe the content. It describes a place where, at the time of writing, the content could be found. How location fails There are three distinct ways a location-based link stops doing its job, and it helps to keep them apart because decentralized storage addresses them differently. The first is disappearance. The server goes offline, the company folds, the domain lapses, or the file is deleted during a site redesign. This is link rot in its plainest form, and it is overwhelmingly the most common failure. Most lost web content was not suppressed by anyone; it simply stopped being paid for. When a hosting bill goes unpaid, there is no notice to the thousands of pages elsewhere that linked to the site. The links remain, pointing at nothing. The second is drift. The link still resolves, but what it returns has changed. A news organisation quietly edits an article. A company replaces the terms of service at the same URL. A file named logo.png is overwritten with a new logo, and every page that embedded the old one now shows the new one. Drift is in some ways worse than disappearance, because nothing signals that it has happened. A reader who follows a citation and finds a page has no way to know whether it is the page the author saw. Researchers who study the problem call this content drift, and it is common in academic and legal citation, where the integrity of what was cited matters as much as its existence. The third is control. Because a location is owned, whoever controls it can decide what it returns and to whom. A government can order a domain seized or require internet providers to block an IP address. A platform can remove a file in one country and leave it up in another. A hosting company can terminate a customer under pressure. In each case the content may still exist somewhere, on the publisher's own disk perhaps, but the address everyone has been using no longer leads to it, and there is no general way to tell readers where else to look. Notice that the three failures share a root. In each, the reader is relying on a particular party to keep a particular address associated with particular bytes. Disappearance is that party giving up. Drift is that party changing its mind. Control is a third party overriding it. The reader has no independent way to check what they receive, and no general way to get it from anywhere else. Naming by content The alternative is to make the name a function of the content itself. The tool for this is the cryptographic hash function, a procedure that takes an input of any length and produces a fixed-length output, called a digest, with two crucial properties. It is deterministic: the same input always produces the same digest. And it is, for practical purposes, impossible to find two different inputs that produce the same digest, or to construct an input that produces a digest chosen in advance. SHA-256, the most widely used such function, produces a 256-bit digest. Change a single bit of a multi-gigabyte file and its SHA-256 digest changes completely and unpredictably. If the address of a file is its hash, the three failures look different. Drift becomes impossible to conceal: a modified file has a different hash, and therefore a different address. Anyone holding the old address will either receive the old bytes or, if they receive anything else, will detect the substitution by hashing what arrived and comparing. The name has become a commitment that the content cannot violate. Control is weakened, though not eliminated. Because the address does not refer to any particular machine, any machine that holds the bytes can serve them, and the recipient can verify them regardless of who the sender is. Blocking one server does not invalidate the address; it removes one source. A censor would have to find and block every source, or block the protocols used to reach them, which is a harder and more visible undertaking. Disappearance is not solved at all. If nobody holds the bytes, the address points to nothing, exactly as a dead URL does. A content address is a perfect description of a file and no guarantee of its existence. This asymmetry is the central fact of the subject, and it will recur in every chapter. The idea is not new. Version control systems have used content addressing for decades; Git identifies every file, directory and commit by a hash of its contents, which is why two developers can compare repositories by exchanging a single commit identifier. Package managers record hashes of the archives they download so that a tampered mirror is detected. BitTorrent identifies a torrent by an infohash derived from its contents. Research into what came to be called information-centric or named-data networking, associated with Van Jacobson and others in the late 2000s, proposed rebuilding the internet's routing around named content rather than host addresses. What IPFS added was a general, extensible format for content identifiers and a working network for finding and moving the content they name. Anatomy of a content identifier A raw SHA-256 digest is not quite enough to serve as a long-lived address. Hash functions age; SHA-1, once standard, is now considered broken for collision resistance, and a format that assumed one function forever would be stranded when that function failed. A bare digest also says nothing about how to interpret the bytes it identifies: is this a file, a directory, a fragment of a larger file, a structured data record? IPFS addresses both problems with the content identifier, or CID, built from a family of small self-describing formats that Protocol Labs grouped under the name Multiformats. A CID is a sequence of fields, each announcing what the next part means. The four components are set out in Table 1. Table 1. The parts of a version 1 content identifier. Component What it says Common values Multibase prefix How the binary CID is written as text b for base32, z for base58btc Version Which CID format follows 1 (version 0 is implicit) Content codec How to interpret the identified bytes dag-pb, raw, dag-cbor, dag-json Multihash Which hash function, digest length, and the digest sha2-256, 32-byte digest The multihash is the heart of it. Rather than storing a bare digest, it prefixes the digest with a code identifying the hash function and a number giving the digest's length. A system that encounters a CID made with a function it has never heard of can at least recognise that fact, rather than misinterpreting the bytes. If SHA-256 is ever weakened, new CIDs can use a different function without any change to the format, and old CIDs remain parseable. The codec tells the reader how to decode the block. raw means the bytes are opaque data, typically a chunk of a file. dag-pb means the bytes are a Protocol Buffers–encoded node in the UnixFS format that IPFS uses to represent files and directories, containing links to other blocks. dag-cbor and dag-json are encodings for arbitrary structured data that can link to other content by CID, which is what makes it possible to build linked data structures, not just file trees, on top of the same addressing scheme. The multibase prefix exists because CIDs are binary but frequently need to appear in text: in URLs, in JSON, in DNS records. The single leading character announces which text encoding follows. Base32, signalled by a lowercase b, is the default for version 1 CIDs because it is case-insensitive, which matters when a CID is placed in a domain name, since DNS ignores case. This explains the two visual families of CID that a newcomer encounters. Older identifiers, version 0, begin with Qm and are 46 characters long. They have no explicit version, codec or multibase field; they are always base58-encoded SHA-256 multihashes of dag-pb nodes, and the Qm is simply what the multihash prefix for SHA-256 with a 32-byte length looks like in base58. Version 1 identifiers in the default encoding typically begin with bafy for dag-pb content or bafk for raw blocks. The two can identify exactly the same data; a version 0 CID can be converted losslessly into version 1. They are different spellings, not different content. The same file, different names One consequence of this design surprises nearly everyone who works with IPFS for long: the same file does not always have the same CID. A CID identifies a block, or more precisely the root block of a graph of blocks. When a large file is added to IPFS it is not hashed as a single unit. It is split into chunks, each chunk becomes a block with its own CID, and a tree of link nodes is built above them, with the CID of the top node standing for the whole file. The next chapter explains this process in detail. What matters here is that the shape of that tree depends on choices: how large each chunk is, whether chunks are stored as raw blocks or wrapped in UnixFS nodes, how many links each internal node holds, whether the tree is balanced or skewed, and which CID version and hash function are used. Change any of these and the root CID changes, even though the file's bytes are identical. In practice this means that two tools, or two versions of the same tool with different defaults, can produce different CIDs for the same file. Kubo, the reference IPFS implementation, historically defaulted to version 0 CIDs with 256 KiB chunks wrapped in UnixFS nodes; other tools default to version 1 with raw leaves. Someone who adds a file with one tool and then checks it with another may conclude, wrongly, that the file has changed. The IPFS community has worked on standard profiles of import settings so that tools can agree, but the general lesson stands: a CID is a hash of a particular encoding of content, not of the content in the abstract. This is not a reason to distrust content addressing. Within a given encoding, the guarantee is absolute: if you hold a CID and receive blocks that hash to it, you have exactly what the creator of that CID had. It is a reason to record, alongside any CID that matters, how it was produced, and to be careful about assuming that "the same file" will always yield the same address. A project that publishes the plain SHA-256 of a file alongside its CID gives future readers a second, encoding-independent check. What verification buys The value of content addressing is easy to underestimate because, when it works, nothing visible happens. Consider what it removes. On the location-based web, a reader who downloads a file has to trust every party between them and the publisher: the DNS resolver, the network, the certificate authority, the hosting company, any content delivery network in front of it, and the publisher's own security. HTTPS protects the connection, but it only proves that you are talking to the server the certificate names, not that the server is returning what the publisher originally intended. A compromised server serves compromised files over a perfectly valid encrypted connection. With content addressing, the trust question collapses to a single point: did I get the right CID? Once the reader has a CID from a source they trust, perhaps from a signed message, a blockchain record, a printed paper, or a friend, the bytes can come from anywhere. A stranger's laptop, a public gateway run by an unknown party, a cache on the local network, a USB stick passed hand to hand: each is as good as the original publisher, provided the reader checks the hash. The transport becomes untrusted by design. This changes the economics of distribution. Caching becomes safe without coordination, because no cache can lie undetected. Popular content can be served by whoever happens to be nearby and have it, rather than by a single origin bearing all the bandwidth cost. Archives can be audited, because the identifier recorded years ago can still be checked against the bytes held today. And intermediaries lose a particular kind of power: the power to alter content in transit without anyone noticing. It also creates a new and important discipline. Because content-addressed data is immutable, anything that needs to change must be handled by a separate layer: a mutable pointer that can be updated to reference a new CID. A website that publishes a new version produces a new root CID; a naming system, discussed in Chapter 6, is needed to let readers find the latest one. This separation of immutable content from mutable references is a feature. It makes every change explicit, and it means the history of a thing can be preserved simply by remembering old CIDs. But it is also the source of a great deal of operational complexity, and a common point at which systems that look decentralized turn out to depend on a single party after all. The open question Content addressing turns a link from a promise about a place into a precise description of a thing. It eliminates undetected drift. It weakens control by letting any holder serve the content. It makes verification cheap and the transport untrustworthy by design. All of this follows directly from naming content by its hash, and none of it depends on any particular network, company or token. What remains is the question content addressing cannot answer from within itself: who is holding the bytes? A CID written into a smart contract or printed in a footnote is as durable as the paper or the blockchain it is written on, which may be very durable indeed. The data it names is exactly as durable as the willingness of someone, somewhere, to keep a copy and to answer when asked for it. The rest of this book is about the systems that have been built to find those copies, to reward the people who keep them, and to make their persistence something more reliable than goodwill. Before that, it is worth understanding in some detail how IPFS actually finds and moves content once it has a name, because the mechanics of retrieval shape everything that follows. Chapter 2: How IPFS Moves Data IPFS is often described as a distributed file system, which is accurate in spirit and misleading in detail. It is better understood as three things layered together: a way of representing data as a graph of content-addressed blocks, a way of discovering which peers hold which blocks, and a way of transferring blocks between peers. Each layer can be replaced independently, and in the decade since the protocol was introduced each has been reworked several times. Following a single file through all three is the clearest way to see what IPFS does and, just as importantly, what it leaves to someone else. From file to graph Suppose a user adds a 10-megabyte PDF to an IPFS node. The node does not store the file as one object. It first passes the bytes through a chunker, which divides them into pieces. The default in Kubo has long been fixed-size chunks of 256 KiB, so a 10-megabyte file becomes about forty chunks. Alternative chunkers exist, including content-defined chunking based on a rolling hash, which places chunk boundaries according to patterns in the data rather than at fixed offsets. Content-defined chunking has the advantage that inserting a few bytes near the start of a file shifts only one or two chunk boundaries rather than every one after the insertion, so a lightly edited file shares most of its blocks with the original. Each chunk becomes a leaf block. Its CID is computed from its bytes. The node then builds a tree above the leaves: an internal node lists the CIDs of its children, along with the size of the data each child represents, and that internal node is itself encoded as a block with its own CID. If there are more leaves than one internal node can reference, another level is added. The CID of the single node at the top, the root, is the CID of the file. Kubo's default arrangement is a balanced tree with up to 174 links per node, a number chosen so that internal nodes stay below a quarter of a megabyte; an alternative "trickle" layout favours streaming, placing early parts of the file close to the root. This structure is a Merkle DAG, a directed acyclic graph in which every node is identified by a hash that covers its own content and, through the CIDs it contains, the content of everything beneath it. The name comes from Ralph Merkle, whose hash trees, published in the late 1980s, showed how a single root hash could commit to an arbitrarily large collection of data while allowing any piece to be verified independently. The consequence for IPFS is that a reader who knows only the root CID can verify every block as it arrives. Fetch the root, check it hashes correctly, read the CIDs of its children, fetch those, check each, and so on down. No block need be trusted before it is checked, and no block can be substituted without changing a hash somewhere above it. Directories work the same way. A UnixFS directory node maps names to CIDs: this directory contains index.html with CID such-and-such, style.css with another, and a subdirectory images whose CID points to a further directory node. Very large directories, with many thousands of entries, are sharded across a hash array mapped trie so that no single node grows too large. The CID of the top-level directory commits to the entire tree, every file in it and every byte of every file. This is what makes it possible to publish a whole website, or an archive of millions of documents, under one identifier. Two properties fall out of the graph structure that matter later. The first is deduplication. If two files share a chunk, or two versions of a website share most of their files, the shared blocks have the same CIDs and need be stored and transferred only once. Publishing a new version of a large site that changes one page creates only the handful of new blocks along the path from that page to the root. The second is partial retrieval. A reader who wants only one file from a large directory, or only a byte range from a large file, can walk the graph to the relevant blocks without fetching the rest. Finding who has it Having a CID is not the same as knowing where to get the blocks. IPFS needs a way to answer the question: which peers on the network are able to provide this CID? This is content routing, and it has proven to be the hardest part of the system to make fast at scale. The main public mechanism is a distributed hash table based on Kademlia, a design published by Petar Maymounkov and David Mazières in 2002. Every peer has an identifier derived from its public key. Identifiers and CIDs are mapped into the same numerical space, and the "distance" between two identifiers is defined by the bitwise exclusive-or of their values. Each peer keeps a routing table of other peers, organised so that it knows many peers close to itself and progressively fewer at greater distances. To find something, a peer asks the closest peers it knows for anyone closer still, and repeats. Because each step roughly halves the remaining distance, a lookup in a network of many thousands of peers completes in a small number of hops. When a node holds content and wishes to make it available, it publishes a provider record: a small statement that this peer can provide this CID. The record is stored on the peers whose identifiers are closest to the CID, typically twenty of them. A peer looking for the content does a DHT lookup for the CID, reaches those peers, obtains the provider records, and then connects directly to a provider. Provider records expire, after about two days in Kubo's defaults, and must be republished periodically while the node still has the content. This expiry is deliberate. A network in which records lived forever would accumulate pointers to peers long gone. The DHT has well-known weaknesses. Lookups can be slow, often taking more than a second, because they involve several network round trips to peers spread across the world, some of which are unreachable. Publishing provider records for every block of a large dataset is expensive; a node holding millions of blocks may struggle to reprovide them all within the expiry window. For this reason Kubo offers strategies to announce only root CIDs, or only pinned content, trading discoverability of individual blocks for lower overhead. Measurement work by Dennis Trautwein and colleagues, published at the ACM SIGCOMM conference in 2022 and the most thorough public study of the deployed network, found that the DHT functioned at substantial scale but that a large fraction of nodes were behind network address translation or otherwise hard to reach, and that retrieval latency varied widely. Because of these limits, real deployments rarely rely on the DHT alone. Network indexers, which aggregate provider records from large storage providers and answer queries over HTTP, have become an important complement, particularly for content held by Filecoin storage providers who may announce enormous numbers of CIDs. The IPFS specifications define a generic "delegated routing" interface over HTTP, so that a client can ask a routing service which peers have a CID without running a DHT node itself. This is a pragmatic concession. It makes lookups faster and makes IPFS usable from browsers and mobile devices, at the cost of reintroducing services that someone has to run. Moving the blocks Once a peer knows who has the content, it needs to fetch the blocks. The original IPFS exchange protocol is Bitswap. A peer that wants blocks sends a want-list to the peers it is connected to. In its modern form Bitswap distinguishes between asking whether a peer has a block, a "want-have", and asking for the block itself, a "want-block", which lets a client discover which of several peers hold content before committing bandwidth to any of them. Peers that have requested blocks send them; the receiver verifies each against its CID and, as it learns the children of each node, adds them to its want-list. Bitswap has an interesting property: it often works without the DHT at all. A node that is already connected to peers will broadcast its wants to them, and if any of them happens to have the content, it arrives without any lookup. Nodes in the same office, or a client connected to a large well-provisioned peer, often find content this way. The weakness is that Bitswap is block by block. Walking a deep graph means waiting for each level before requesting the next, and the per-block overhead adds up for content made of many small pieces. For this reason a second transfer method has become prominent: fetching over plain HTTP from a "trustless gateway". Instead of exchanging blocks over IPFS's own protocols, the client requests a CID from an HTTP endpoint and asks for either a single raw block or a CAR file, a Content Addressable aRchive, which packs a whole graph or a selected part of it into one stream. The client verifies every block it receives against the requested root, so the server need not be trusted. Large storage providers, content delivery networks and ordinary web servers can all serve content this way without running a full IPFS node. Many current IPFS clients, including Helia, the JavaScript implementation, combine both: they try Bitswap with connected peers and HTTP retrieval from known trustless gateways in parallel and take whichever answers first. Underneath all of this sits libp2p, the networking library that grew out of IPFS and is now used by other systems, including Ethereum's consensus clients. Libp2p handles the plumbing of peer-to-peer connections: multiple transports such as TCP, QUIC and WebTransport; encryption and authentication of peers by their public keys; multiplexing many logical streams over one connection; and, crucially, getting through the network address translation devices that sit in front of most home and mobile connections. It includes relays, through which two peers that cannot reach each other directly can communicate, and a hole-punching protocol that uses a relay to coordinate a direct connection between two peers behind NAT. These features are what allow ordinary laptops to participate as providers, though in practice the bulk of reliably reachable IPFS content sits on servers with public addresses. Gateways: the bridge and the bottleneck Most people who have ever loaded content from IPFS did not run an IPFS node. They clicked an HTTP link to a gateway: a server that runs an IPFS node and translates ordinary web requests into IPFS retrievals. A request for https://ipfs.io/ipfs//index.html causes the gateway to find and fetch the blocks for that CID, verify them, reassemble the file, and return it to the browser as a normal web response. Gateways were essential to adoption. They let IPFS content appear in web pages, in wallet interfaces and in NFT marketplaces without asking users to install anything. They also reintroduce, at the point of delivery, the very properties content addressing was meant to remove. A browser fetching from a gateway receives an HTTP response and cannot itself verify that the bytes match the CID; it trusts the gateway, just as it would trust any web server. The gateway's operator can block content, log requests, be overloaded or go offline. A popular public gateway becomes a single point of failure for every application that hard-codes its domain. The history of public gateways illustrates this. Protocol Labs has long run ipfs.io and dweb.link; Cloudflare operated a widely used public gateway for several years before announcing in 2024 that it would wind it down and redirect traffic to gateways operated by Interplanetary Shipyard, the team that took over maintenance of core IPFS implementations from Protocol Labs. Applications that had written Cloudflare's gateway domain into their content, rather than the underlying CID or an ipfs:// URI, found themselves dependent on a redirect they did not control. The CIDs remained valid throughout; what broke, or threatened to break, were the HTTP wrappers around them. Gateways also come in two styles with different security properties. A path gateway serves all content under a single origin, so that gateway.example/ipfs/ and gateway.example/ipfs/ share cookies, storage and other browser privileges. That is harmless for static images and dangerous for web applications, since a malicious page at one CID could interfere with another. A subdomain gateway puts the CID in the hostname, as in .ipfs.dweb.link, giving each piece of content its own browser origin and isolating applications from each other. This is why version 1 CIDs in case-insensitive base32 matter: a version 0 CID, with its mixed-case base58, cannot survive being placed in a hostname. The direction of travel is to move verification back to the user. Browser-based IPFS clients, and service-worker gateways that run inside the browser tab, fetch blocks from trustless HTTP endpoints and verify them locally before rendering, so that the gateway becomes a mere source of bytes rather than an authority. Native IPFS support in browsers has had a more halting history. Brave shipped an embedded IPFS node in 2021 and removed it in 2024, citing low usage and maintenance cost; Opera experimented with IPFS support in its crypto-focused browser. The protocol works, but the default path for most readers remains an HTTP gateway, and anyone building on IPFS should design on the assumption that most users will arrive that way. Beyond files The block-and-link model is not limited to files and directories, and seeing it applied elsewhere clarifies what is general about it. The data model underneath IPFS, called IPLD, treats any structured record that contains CIDs as a node in a graph that can be linked, traversed and verified in the same way as a UnixFS tree. A record encoded in dag-cbor might describe a social media post, with a CID linking to an attached image, another to the previous post in the author's history, and a signature over the whole. Anyone holding the root of such a structure can verify everything beneath it. The most prominent recent use of this model outside the IPFS network itself is Bluesky's AT Protocol. Each user's data is held in a repository whose records are encoded as dag-cbor and identified by CIDs, arranged in a Merkle tree whose signed root commits to the whole repository. When a user moves their account from one hosting provider to another, the new host can verify that it has received exactly the repository the user signed. The protocol does not use IPFS's DHT or Bitswap to move data; it uses its own HTTP-based synchronisation. But it relies on the same insight: that naming data by its hash lets it move between hosts without anyone having to trust the host in between. That separation, between the data model and the network that moves it, is the most durable part of the design. Routing systems have been replaced, exchange protocols rewritten, and gateways redesigned, but a CID created in 2016 still identifies the same content today, and will continue to do so in any system that understands the format, whether or not it is called IPFS. What IPFS is and is not Following the PDF through the system clarifies what IPFS actually provides. It gives the file a verifiable name that commits to every byte. It provides a structure that deduplicates and allows partial retrieval. It offers several mechanisms by which a reader can discover a peer holding the content and fetch it, verifying as they go. It allows anyone who holds the blocks to serve them, and anyone who wants them to accept them from anyone. What it does not do is keep the file. When the user who added the PDF shuts down their node, the provider records it published will expire within days, and unless some other peer has fetched the blocks and chosen to keep and announce them, the CID will resolve to nothing. IPFS nodes cache content they retrieve, but they also discard cached content to free space. There is no global replication, no redundancy target, and no mechanism by which the network as a whole decides that a file is important and should be preserved. Those are not omissions in the protocol so much as deliberate boundaries. IPFS is a way to name and move data. Keeping it is a separate problem, with its own tools and its own economics, and it is to that problem that the next chapter turns. Chapter 3: The Persistence Problem There is a sentence that has appeared, in one form or another, in countless project announcements, pitch decks and NFT listings: the data is stored on IPFS, so it will be there forever. The sentence is wrong in a specific and instructive way. IPFS does not store data. Nodes store data, and each node decides for itself what to keep and for how long. A CID is a name that anyone can use to ask for content; whether the request succeeds depends on whether some reachable node has chosen to hold that content and announce it. This chapter is about the machinery of that choice. It covers how an individual IPFS node decides what to keep, how the practice of pinning emerged to make that decision explicit, how a market of pinning services grew up to sell persistence as a service, and why the resulting arrangement, though it reintroduces commercial dependence, is still a real improvement over the location-based web. Caches, garbage, and pins An IPFS node keeps blocks in a local store called the blockstore. Blocks arrive there in two ways. Some are added deliberately, when the node's operator imports a file. Others arrive incidentally, when the node retrieves content on someone's behalf, whether its own user browsing or, in the case of a gateway, any visitor making a request. Incidental blocks are a cache. Keeping them makes repeat requests faster and lets the node serve those blocks to other peers, which is part of how popular content becomes widely available. Caches grow without limit unless something prunes them. IPFS nodes therefore run garbage collection, which deletes blocks that are not marked as needed. In Kubo, garbage collection can be triggered manually or set to run automatically when the blockstore passes a size threshold. Anything not protected is eligible for deletion. Protection is called pinning. A pinned CID is one the node has been instructed to keep. Pins come in kinds. A recursive pin on a root CID protects that block and every block reachable from it, so pinning the root of a directory protects the whole tree. A direct pin protects only the single block. Files added through the normal import command are pinned recursively by default, which is why a user who adds a file and leaves their node running will find that it persists across garbage collection. The pin, not the act of adding or retrieving, is what keeps content alive on a node. The logic is simple, and it has a direct implication for anyone who publishes content. If you want a CID to remain retrievable, at least one node must pin it, that node must stay online, it must be reachable by the people who will request the content, and it must keep announcing the content to the routing system. Each of those is an operational commitment. A laptop that sleeps, a server behind a restrictive firewall, a node whose provider records lapse, or a disk that fills up will each make content unavailable, even though no one has deleted anything. There is a further subtlety. Incidental caching gives popular content a natural tendency to spread, since every gateway and every user who fetches it holds a copy for a while. But that spread is temporary and uneven. Caches are cleared; gateways are configured to keep content for hours or days, not years. The long tail of content that is rarely requested, which is most content, benefits from almost none of it. A CID that nobody has asked for in six months is likely to be held only by the nodes that pinned it. Pinning as a service Running an always-on, well-connected IPFS node with enough storage and bandwidth is not hard for an engineering team, but it is a real cost and a real responsibility. For most publishers, especially the many NFT projects and small applications that adopted IPFS from 2020 onward, it was easier to pay someone else. Pinning services emerged to meet that need: companies that run fleets of IPFS nodes and, for a fee or under a free tier, pin whatever CIDs their customers ask them to. Pinata, Infura's IPFS service, Filebase, Fleek and the service now called Storacha, which grew out of web3.storage, are among the names that have dominated this market at various times. Some have exited it. Infura restricted its public IPFS gateway in 2022. NFT.Storage, launched by Protocol Labs in 2021 as a free service that stored NFT data on IPFS and in Filecoin storage deals, stopped accepting uploads to its original free service in 2024, and its users were encouraged to migrate their data to other providers. These changes were not failures of IPFS. They were the ordinary churn of service businesses. But they show plainly that a pinning service is a vendor relationship like any other, with prices, terms, and a business model that may change. To reduce the cost of switching, the IPFS community defined a common Pinning Service API, a simple HTTP interface for asking a remote service to pin a CID, check its status, and remove a pin. A client that supports the API can be pointed at any compliant service, and Kubo can manage remote pins alongside local ones. Many services also offer S3-compatible interfaces, so that existing tools designed for Amazon's storage API can upload to IPFS with minimal change. Why this is still better than a bucket At first glance this arrangement looks like the cloud with extra steps. A project pays a company to keep files on its servers and serve them over HTTP. If the company goes away, so do the files. In what sense is that decentralized? The answer lies in what happens at the moment of failure. Suppose a project has hosted its images in an ordinary cloud bucket and linked to them by URL. The cloud provider terminates the account. The project still has copies on a developer's laptop. To restore service it must upload them somewhere new, and then update every reference to point at the new location. Where the references are in a database the project controls, this is tedious but possible. Where they are in other people's websites, in archived social media posts, in printed materials, or in an immutable smart contract, it is impossible. The old URLs are permanently broken. Now suppose the same images were added to IPFS, the project recorded their CIDs, and those CIDs were written into all the places that refer to the images. The pinning service shuts down. The project re-pins the same files with a different service, or on its own node. Because the CIDs are derived from content, they are identical. Every reference that used the CID, or an ipfs:// URI, resumes working as soon as the new provider announces the content. No reference anywhere needs to change. The vendor was replaceable because the name did not belong to the vendor. This is the practical meaning of decentralization for most users of IPFS: not that no company is involved, but that no company owns the address. It converts vendor failure from a catastrophe into an inconvenience, provided someone kept the original bytes and acts before every copy is gone. The protection is only as good as its weakest assumption, however. It fails if the project linked to a specific gateway URL rather than the CID itself, since then the references embed a location after all. It fails if no one kept a copy of the original data and every pinning service holding it has deleted it. And it fails, subtly, if the data cannot be reproduced into the same CID. A project that kept the source images but not the exact import settings may re-add them and find that, because of a different chunk size or CID version, the new root CID is different from the one written into its contract. The bytes are safe; the name is orphaned. The cure is to keep the content in its content-addressed form, most simply as a CAR file, which preserves the exact blocks and therefore the exact CIDs. Who else pins A healthier pattern is redundancy across independent parties. Because the CID is the same wherever the content lives, there is no coordination cost in having several organisations pin it. A project can pin with two commercial services on different infrastructure and run its own node. Collectors who care about a set of NFTs can pin the metadata and images themselves. Archives, libraries and community groups can pin material they consider important. Each additional pinner is an independent bet on persistence, and the content survives as long as any one of them does. Tools exist to make this cooperative pinning easier. IPFS Cluster, maintained alongside the core implementations, lets a group of nodes share a pin set and replicate content among themselves according to a policy, such as keeping at least three copies. Collaborative clusters have been used to let volunteers donate disk space to pin public datasets. Some projects publish their pin sets openly and invite holders to mirror them. This is the closest IPFS comes to the folk idea that "the network" keeps data: not as a protocol guarantee, but as a social practice that the protocol makes cheap. Redundancy has to be checked, not assumed. Pins can silently fail. A service might accept a pin request and never manage to fetch the content because the original provider was unreachable at the time. A node's disk might be corrupted. A routing announcement might lapse. The only reliable test of availability is to try retrieving the content, from outside the infrastructure holding it, on a schedule. Several services now offer retrieval checks that query the network for providers of a CID and attempt to fetch it, and a project that cares about its data should run them, or write its own, and treat a failure as an incident. A worked audit It helps to make the abstractions concrete. Imagine inheriting a project that launched two years ago. Its smart contract, documentation and marketing all refer to a single root CID for a directory of several thousand image files. The original team has moved on. Nobody is sure which pinning service was used, or whether the account is still paid. The task is to find out whether the data is safe and, if not, to make it so. The first step is to ask the network who claims to have it. With a Kubo node running, the command ipfs routing findprovs performs a content-routing lookup and lists the peer identifiers that have published provider records for the root. Public tools offer the same check through a web interface, querying both the DHT and the large network indexers. Three outcomes are possible. If several providers appear, belonging to recognisably different operators, the data is probably held in more than one place, though that still needs confirming. If one provider appears, the data's survival depends on a single party, and that party's identity should be established. If none appears, the data may already be gone, or may sit on nodes that have stopped announcing it. A provider record is a claim, not a proof. The second step is to fetch the content. Retrieving the root alone proves little; a provider might hold the top of the graph and have lost the leaves. A full check walks the whole DAG. The command ipfs dag export > collection.car does exactly this, retrieving every block reachable from the root and writing them into a single CAR file. If it completes, every byte is available somewhere, and the project now holds a complete local copy in exact content-addressed form. If it stalls, the blocks it cannot find are missing from every reachable provider, and the audit has located the damage. The third step is to secure what has been recovered. The CAR file is the canonical artefact: it can be imported into any IPFS node with ipfs dag import, or uploaded to any pinning service that accepts CAR files, and the resulting root CID will match the original exactly, because the blocks are byte-for-byte the same. This sidesteps the import-settings problem described earlier. Nothing is re-chunked; nothing is re-encoded. The CAR file should be kept in at least one place the project controls, and pinned with at least two independent services. The fourth step, too often skipped, is to repeat the retrieval check from somewhere else after the new pins are in place, ideally from a machine that does not share a network with any of the pinning providers, and then to schedule it. A weekly automated job that exports the DAG, or at least samples blocks from it, and alerts someone when it fails, is cheap insurance. The audit also clarifies what running one's own node involves, for projects deciding whether to do so. An IPFS node that reliably serves content needs a public IP address or working NAT traversal, enough bandwidth for expected demand, storage with backups, and an operator who notices when it goes down. It must keep reproviding its content to the routing system, which for a large pin set means tuning the reprovider strategy. None of this is exotic. It is the ordinary discipline of running any server. But it is a reminder that "self-hosting on IPFS" is self-hosting, with all the responsibility that implies, and that the protocol's contribution is to make that hosting interchangeable with anyone else's, not to make it unnecessary. The limits of goodwill and invoices Pinning, whether by a paid service or a volunteer, rests on one of two things: a contract or a commitment. A pinning service keeps data while it is paid and while it remains in business. A volunteer keeps data while they care. Neither offers any way for an outsider to verify, short of fetching the content, that the data is actually being held, nor any consequence beyond the commercial or social for failing to hold it. For many purposes that is enough. Most of the internet's important data is kept by organisations with contracts and commitments, and the content-addressed version is more robust than the location-based one because the vendor is replaceable. But two harder questions remain. First, can storage be made into a market where providers prove that they hold the data, on an ongoing basis, and are penalised automatically if they do not? Second, can the payment problem be solved once, so that storage does not depend on someone continuing to pay an invoice decades from now? Filecoin is the most developed attempt at the first question. Arweave is the most developed attempt at the second. Both are answers to the gap that pinning leaves, and both are examined in the next two chapters. It is worth closing this chapter with the arrangement that serves most real projects best, because it is less glamorous than either. Keep the original data, in CAR form, in at least one location you control. Pin it with at least two independent providers. Refer to it everywhere by CID or ipfs:// URI, never by a particular gateway's URL. Check retrieval regularly from outside your own systems. This is not permanence. It is something more modest and more achievable: availability that does not depend on any single company, and that can be restored, without breaking a single reference, by anyone who still has the bytes. Hashtags: #Web3Infrastructure #Web3 #DecentralizedStorage #IPFS #Arweave #Filecoin #BlockchainTechnology #DecentralizedWeb #DistributedStorage #ContentAddressing #ContentIdentifiers #CID #MerkleDAG #PeerToPeerNetworks #DistributedFileSystems #DataIntegrity #DataAvailability #PermanentStorage #IPFSPinning #PinningServices #CryptographicHashing #ContentVerification #CensorshipResistance #DecentralizedHosting #NFTMetadata #SmartContracts #DataPersistence #Web3Development #DecentralizedApplications #BlockchainInfrastructure

Latest Book Releases:

WELCOME TO THE INTERNATIONAL STUDENTS LIBRARY

bottom of page