View as Markdown

Trace · Concept

Patterns

A pattern is a saved, named filter over a run's canary readings and activation-profile neurons that finds the runs in your history showing a signal you care about.

When to use it

Use a pattern to filter your prompt history to the runs that tripped a canary family, lit up neurons labeled like "credential", or crossed an activation threshold in late layers. In CI, test each run of a suite against a pattern and fail the build on an unexpected match.

How it works

  1. Pick one from the library or save your own with POST /v1/trace/patterns. The library has one curated pattern per canary family, pat_curated_<family>.
  2. A pattern is evaluated when you read, never when a run is recorded, so a new pattern covers your whole history at once. Pass pattern to the prompt history, a prompt's runs, a profile, a comparison or an attribution trace.
  3. Each result says whether it matched, which visible neurons made it match, and one line per rule saying why.
  1. Run
    readings + profile
  2. Pattern
    rules, any or all
  3. Result
    matched, neurons, reasons

The definition

A definition is match (any or all) and one to 16 rules:

Rule kindFieldsMatches when
familyfamily, optional min_scoreThe family's reading tripped, or reached min_score
neuronsrefs, optional min_activation, min_countAt least min_count of the refs are among the run's visible active neurons
labelquery, optional min_activation, min_countVisible active neurons have a registry label containing query
activationmin, optional layers, pole, min_countVisible neurons reach min, within the layer range and pole
{
  "name": "Wire instructions in late layers",
  "definition": {
    "match": "all",
    "rules": [
      { "kind": "family", "family": "prompt_injection" },
      { "kind": "activation", "min": 1.5, "layers": [12, 23] }
    ]
  }
}

Neuron rules read the run's activation profile; a run without one can still match a family rule. A masked neuron never matches any rule and never appears in the result, so a pattern can't be used to learn which neurons a curated family guards on.

A match means the run activated neurons associated with the pattern. A family rule's reason quotes the family's measured precision and recall.