# Why it works

> The grammar does not change how a model behaves; it changes what the model is completing.

Page: PAG · Introduction
Canonical: https://banes-lab.com/pag#why-pag-works

This section is stop 13 of 102 in the learning route. Previous: [01 - What PAG is](https://banes-lab.com/pag/introduction/what-is-pag.md). Next: [03 - PAG and the method](https://banes-lab.com/pag/introduction/pag-and-the-method.md). It builds on [01 - What PAG is](https://banes-lab.com/pag/introduction/what-is-pag.md).

The grammar does not change how a model behaves; it changes what the model is completing. A large language model predicts the next token from the patterns it was trained on, and a large share of that training is code, configuration and structured documentation. [B1·a three sources](https://banes-lab.com/pag#why-pag-works-panel-a) writes those three sources into one line, and [B1·b vocabulary origin](https://banes-lab.com/pag#why-pag-works-panel-b) shows how they combine. What that gains is limited, and [B1·c the honest claim](https://banes-lab.com/pag#why-pag-works-panel-c) states the limit.

### Pattern completion

Careful prose is not answered with a more careful result. A page of careful prose gets a confident result that answers a slightly different question, and the difference stays invisible until the result is run. The model completes what it has seen most often, and uppercase verbs with explicit prepositions are what it has seen in code, configuration and documentation.

For this reason I use explicit, high-frequency tokens, which reduce interpretive variance while the output stays probabilistic. Ambiguity is reduced at the input and the output is verified, rather than the input being asked to guarantee anything. In practice, every operative word comes from the [keyword](https://banes-lab.com/pag/keywords/keyword-ontology.md) vocabulary, and its operands are bound with a preposition, so the model completes a recognised structure instead of interpreting a sentence. The intent is stated as an English verb the reader can review.

To check this, rewrite one prose instruction as a directive and run both several times against the same gates. The directive should pass more often, and where it does not, the gate that fails is the one whose condition was still a judgement. Structure helps where the model has seen the structure. A vocabulary invented for one project is prose with capital letters, and the model interprets it as it would interpret a sentence.

The vocabulary combines code syntax for structure with English verbs for intent and prepositions for the relations between operands. A line that carries all three is one the model can complete and a reviewer can read without a legend.

Token frequency is the reason the vocabulary is uppercase and closed. A word that appears in the same slot across many structured contexts carries a stable meaning into the completion, while a word that appears with many meanings carries all of them. So the grammar keeps its verbs few and capitalised, and gives each one a [semantic contract](https://banes-lab.com/records/arch/semantic-contracts.md), stated under [instruction patterns](https://banes-lab.com/pag/patterns/instruction-patterns.md). One term for one operation is the [ubiquitous language](https://banes-lab.com/records/arch/ubiquitous-language.md) the model and the reviewer share.

Reducing ambiguity works at the derive stage of [the loop](https://banes-lab.com/disciplined-methodology/start/the-loop.md). There the model works out what a line means, and a line drawn from the vocabulary leaves it one reading where prose leaves several.

B1·a three sources

```pag
# code syntax · a structural pattern the model has completed many times
FOR EACH <item> IN <collection>:

# an english verb · the intent, readable by a reviewer
ANALYZE <held> AGAINST <schema>

# a preposition · the relation between the operands
READ <config> FROM <file> INTO <settings>

# together · one line the model completes and a reviewer can read
EXTRACT <field> FROM <record> INTO <value>
```

B1·b vocabulary origin

```mermaid
flowchart TB
code["Code syntax · loops, conditions, assignment"]
verbs["English verbs · analyze, validate, report"]
preps["Prepositions · FROM, INTO, AGAINST, USING"]
token["An uppercase token in a fixed slot"]
completion["A completion drawn from structured contexts"]
code --> token
verbs --> token
preps --> token
token --> completion
```

B1·c the honest claim

```mermaid
flowchart LR
input["Input ambiguity · reduced"]
load["Interpretation load · reduced"]
variance["Output variance · narrowed, never removed"]
claim["The honest claim · tends toward consistency"]
input --> load --> variance --> claim
```

## Links to

- [Keywords](https://banes-lab.com/pag/keywords/keyword-ontology.md)
- [Semantic Contracts](https://banes-lab.com/records/arch/semantic-contracts.md)
- [Instruction patterns](https://banes-lab.com/pag/patterns/instruction-patterns.md)
- [Ubiquitous Language](https://banes-lab.com/records/arch/ubiquitous-language.md)
- [The loop](https://banes-lab.com/disciplined-methodology/start/the-loop.md)

## Linked from

- [What PAG is](https://banes-lab.com/pag/introduction/what-is-pag.md)
