Skip to content

Papers

Technical papers on measuring, building and running performance-critical financial systems, and on keeping AI agents that work for hours to their rules. Each one teaches a method we use in our own work, and each is free to read here or download as a PDF or Markdown.

  1. · Version 2.2.1 · 48 minutes

    Corpus Engineering, Part 2: Vetted-Corpus Models

    What was this AI model trained on, and how toxic was that text? For most models in use, a user can see little of either. This paper, the second in the Corpus Engineering series, sets out a standard for answering both, and five figures every trainer should publish. A vetted-corpus model is one whose training data is known and screened. Known means every document is registered and searchable. Screened means every document is filtered against a published content standard. Its figures are published. The standard asks trainers to disclose where text came from. It excludes no kind of publisher and no way of collecting text, and a trainer publishes how much text came from pages the public can write to. We judge that every model, vetted or not, should be treated as unsafe until an independent body accepts a safety case for its use and that case holds in use. As far as we know, no body accepts such cases for general-purpose models today, so for now they should do only what controls outside them can bound. We believe a vetted-corpus model is safer than a model trained on an unscreened corpus. That belief is untested. In our reading the nearest evidence, on removal, the one way of shaping a corpus the standard requires, leans against it, though no study tests that removal. We set out what the standard gives, what it costs, what would prove it wrong, and five questions to ask of any model.

  2. · Version 1.2.1 · 40 minutes

    Corpus Engineering, Part 1: What an AI Is Trained On, and Why It Matters

    What pre-training puts into an AI model shapes what it can do and, in the studies we cite, some of how it behaves. Later tuning has not been shown to take it out reliably. This paper, the first in the Corpus Engineering series, sets out corpus engineering: shaping what a model is trained on, on purpose, by adding, removing or changing documents. The studies we cite show it can work, but not always as intended. Removing text made models resist later fine-tuning, though two attacks still worked. In another study it lowered toxic output at a cost, and in a third it raised attack success. In that third, rewriting unsafe pages lowered attack success. In a fourth, adding text moved a misalignment score in both directions. Studies also show ways that others could plant text in a corpus. We believe text that teaches deceit lets a model deceive and makes it more likely to choose to. A study of reward cheating is the closest test so far. In our judgement it leans against the second half of this belief, that such text makes a model more likely to choose deceit, and does not settle it. Separately, in our reasoning, users of most models can see little of what they were trained on. We set out the case against our claim, what would prove it wrong, and Part 2's standard for making a corpus known and screened.

  3. · Version 1.1.0 · 18 minutes

    Training Domain-Specific Agents

    This paper argues that, where a domain-specific agent is trained, it should learn its way of working from records (trajectories) of the domain's work done well. The agent should read the facts it needs as it works. The paper uses domain-driven design and UML to define the domain and check each record. That method is the paper's own reasoning. The paper sets out what a record is, where records come from, what makes a good set and how to train on them. It describes where training on records fails and how to tell whether it worked. It ends with a practical sequence. Its first step, before any training, is to measure the best no-training alternative that a firm's data-residency and control limits allow. The language-model training studies it cites use benchmarks or narrow exam sets, on models from 2023 to 2025. Where one tested a trained model against a strong general model on the same test, the trained model won some comparisons and lost others. Its wins came mostly on tasks of the kind it was trained on, against general models that were simply prompted or older than the trained model. Each comparison used the same benchmark for both models. None of those studies ran the strongest general model of its time in a purpose-built agent framework on the same test. The paper believes the cited evidence on training is thin, and mixed on whether training gives a better agent. The studies' results may not hold outside the benchmarks' environments. In the paper's reasoning, training's case may rest on cost or speed, not on a better agent. It may also rest on data-residency and control limits that exclude a stronger model. Few cited results measure that cost or speed. The paper does not review other agent-training work or later general models. Nor does it review methods that learn from past runs without training, beyond those it cites.

  4. · Version 1.0.0 · 55 minutes

    Context Engineering, Part 6: A Threat Model and a Reference Specification

    What must an agent runtime do for each promise made of an agent to rest on a named mechanism? This part answers with a specification of context management for an agent runtime, written against a stated adversary. It is the last of six parts. It builds on the five before it: the model of context as the output of code; the hypothesis that, within a model's stated context length, a rule kept by reading whose breaches can be observed decays; the criterion for held and counted properties; the three promises; and the cost of the levers. The adversary controls any text the model reads other than the rules and the agent's instructions, and none of the code that decides. The specification lets a model work in turns within the handling of one message. On each turn the model asks for one read, proposes one action or says it is done. The runtime sends it nothing to make it go on. Every read passes a check, and every action a gate, both plain code. Each result is recorded before the next turn. Twenty-eight obligations state what a runtime built to the specification must do. A table sets each promise beside the mechanism and the assumptions it rests on. The specification is analysed, and a TLA+ fragment of its loop is model-checked with TLC at a small scale, within stated limits. It is not evaluated in use.

  5. · Version 1.0.1 · 16 minutes

    Context Engineering, Part 5: The Levers and What They Cost

    This is the fifth of six papers on why an AI agent stops following its rules over a long session, and on what can be relied on instead. Part 1 said what in an agent's context can be set. Part 2 stated a hypothesis: within a model's stated context length, a rule kept by reading, and whose breaches can be observed, decays with the session. Part 3 said which properties code outside the model can hold. Part 4 said what can then be promised. This part asks what each design choice buys and what it costs. It runs no experiment: its models are parameterised, not fitted. We argue that constraining the act to one named action with typed arguments is the strongest lever. Its cost to a model's reasoning is disputed. We argue that a design can keep that cost, if there is one, away from the model's reasoning by constraining only the act. Sampling a decision several times and acting on the majority can signal uncertainty, and never establishes correctness. If there are inputs on which the model usually gives the same wrong answer, more samples do not remove a simple majority's error on them. A loop that returns a failed proposal to the model can be turned against the defender, who, by assumption, pays for a long context each time an adversary sends a short message. A limit on attempts bounds the defender's cost for each message. A budget for each sender over a period bounds the defender's spend charged to that sender, at each agent, at about the budget. By our reasoning, text planted in a tool's result or a retrieved document can spend the budget of a sender who did not send it. The part also models when a cached prefix pays, weighs the repetition of a rule at the point of action, and closes with five tests a buyer can put to any agent runtime.

  6. · Version 1.0.1 · 19 minutes

    Context Engineering, Part 4: What Can Be Promised

    If an AI agent cannot be relied on to act the same way twice, what can be promised of its behaviour as a whole? This part of the Context Engineering series answers with three properties, each stated with the assumptions it needs. The first is confinement: every action the agent performs, other than a read, lies in a set its rules allow. Confinement has two limits: the person who approves, and the trusted computing base. The argument for it does not mention the model, so it stands whatever the model proposes. It does not say the allowed act was the right one. Confinement is a property of one message handled, not of a chain of agents. The second is replay and reproducible assembly. The context the model was given, and the decision made on its proposal, can be read back from the record. The proposal, where it is recorded, is replayed as a recorded value and is never produced again. The third is measured compliance. A counted property, in Part 3's term, is one no outside mechanism holds. Unless a stricter property is held in its place, or a mechanism Part 3 leaves aside keeps it, the rate at which it is broken can only be estimated. An act-level property is a property of an act-level rule, Part 1's term for a rule about one kind of act. For each counted act-level property that a script can check, the rate at which it is broken is estimated on a fixed suite, at a pinned model version, with a confidence interval. The series measures none of these rates; it gives the procedure. The part closes by comparing three classes of runtime by what their operator can set.

  7. · Version 1.0.0 · 18 minutes

    Context Engineering, Part 3: Held and Counted

    An organisation gives its AI agents rules. This part asks which of them code outside the model can enforce, and which can only be estimated. A property of an agent's proposed action is held if two things are true. First, in every state in which its inputs are what they say they are, it equals a function of the proposal's declared form and of inputs whose values no proposal chooses. Second, an outside mechanism enforces that function. It refuses the act, before it is performed, whenever the function is false. It lets the act be performed only on inputs unchanged since it read them. Every other property is counted: the rate at which acts that violate it are performed depends on the model, the configuration and the session, and can only be estimated. That holds unless a stricter property is held in its place, or a mechanism this part leaves aside keeps it. A property is held only as far as its mechanism is correct and nothing reaches the act around it. The criterion assumes the tool does what its declared form says. Properties of an act's target and text stay counted unless a gate or validator checks them. No change only to what the model reads moves a property between the two. To every rule on what agents may do, the criterion applies conditions from classical work on what a monitor can enforce. That application is this part's own reasoning. The part runs no experiment and measures no rate.

  8. · Version 1.0.1 · 19 minutes

    Context Engineering, Part 2: Why Do Long-Running Agents Drift?

    The studies this part cites keep an instruction or task fixed and change the conditions around it: context length, where needed evidence sits, and the number of turns. Behaviour moved with length. Not every model or task showed this. Over turns the evidence was confounded. Evidence on position was mixed. Outside recent work on compaction, many cited studies measure task accuracy, not whether a rule was kept. The part states a hypothesis about a rule the model must keep by reading it, and whose breaches can be observed, within a model's stated context length. On the hypothesis, such a rule would become more likely to be broken as the context lengthens. It would also do so as the rule falls further behind the model's proposal. The hypothesis makes no distance claim for a rule given once at the start. Each compaction since the rule was last present word for word would raise the risk, other things equal. Some evidence runs against the hypothesis. On two models, one rule-keeping test attributed most of a fall to content, not length. Where a model judge found a summary carried the rule, one preprint found no violations. Its sample was small. The hypothesis is unfitted and untested. It says what would show it wrong. Long work can run as a chain of short contexts built from a written record. One account shows it in use. One confounded measurement bears on its effect. Where a context must stay alive, the part argues for summarising last.

  9. · Version 1.1.0 · 54 minutes

    Context Engineering, Part 1: Context Is Configured

    Over a long session, the context an AI agent reads changes as the agent works. This first part of the Context Engineering series models that context as the output of code. In this part's model, the runtime (the software that runs the agent) assembles a context for each call to the model. A model proposes an action from it. The action takes effect only if mechanisms outside the model allow it. This part writes the assembly of the context as a function. The function's output, the context, can be recorded item by item. Ten settings, named in this part, configure that function and the harness (all other code around the model). The list is not claimed to be complete. Six are context settings, which decide what the model reads. Each of them can at most raise the chance of a desired behaviour. Withholding (leaving material out) is the one exception: what the context lacks cannot be found in it, though a model may still generate it from its training. The other four are harness settings. One of these, the outside (the mechanisms that decide on an act before it happens), can make an undesired act impossible, under conditions this part leaves open. The part ranks the kinds of material that instruct, to settle conflict. It sets the order in which kinds of material sit in the context. It also says what wording still adds. This part runs no experiment and makes no measurement. Its scope is agents whose models are transformer-based. It states the thesis that later parts argue.

  10. · Version 1.0.0 · 58 minutes

    Tick-to-Trade, Part 1: Three Questions to Ask of Any Latency Figure

    Latency figures for trading systems are quoted freely and defended rarely. This paper, the first of a series, puts three questions to any such figure: which two events it runs between and which clocks stamped them; which samples were taken, and when; and how it was summarised. Each is a test, and a figure that fails any of them can mislead, however carefully the rest was done. We define tick-to-trade so that it can be measured rather than asserted, lay out the milestones and stages of a market-making path, and say what a cloud host, a co-located one and a path built in hardware can each observe of them. We then argue that latency is a distribution, not a number, and that its most valuable property is often how tightly its tail is bounded, which the series calls deterministic latency. The paper also sets out what an honest tick-to-trade measurement requires, why percentiles cannot be averaged, and what coordinated omission hides. The series is planned in nine parts. Together they will answer each question for Darkwave's Rust engine, built to make markets in crypto perpetual futures from a cloud instance; show how the method carries over to a co-located host and to a path built in hardware; and measure what a microsecond is worth.

Subscribe to papers

One email when we publish a new paper, and nothing else. We send it only once you confirm from the first email we send, and every email has a one-click unsubscribe. Your address is kept in HubSpot, in Australia. Privacy

Or follow the RSS feed.

Tell us about your system

We reply within two New Zealand business days.

Request a call