ANRL : a representation
language built for how
transformers actually think

json, yaml, markdown or source code, all treat every token as equally important. anrl does not. attention weight and epistemic trust are first-class fields on every node. every relationship is a typed edge.

$ cargo install anrlhow it worksread the spec
rustmdjsonyamlmarkdownpythontypescriptgocsqlc++ocamlhaskellswiftkotlin
!1.0critical saliency
?0.9epistemic trust
--→typed edges
0.08mscompile time

data formats were built
for humans and parsers, not transformers

transformers are probabilistic, attention-based, and prone to drift in long contexts. json, yaml, and markdown give them no guidance at all.

lost in the middle

in long contexts, the model cannot distinguish structurally important tokens from noise. everything is weighted equally.

epistemic flattening

when sources disagree, json encodes contradictory values identically. the model has no way to know which source to trust.

relational blindness

nesting implies containment but cannot express typed, directed relationships. multi-hop reasoning collapses.

column slippage

without stable entity anchors, models misattribute facts to wrong entities in multi-entity contexts.

three operators.
structural, not annotation.

not comments on top of json. first-class ast fields that every node carries. the compiler treats attention and trust as data types.

!weight
saliency

directs the model's attention priority. five discrete tiers from critical (!1.0) to suppress (!0.0). set by depth, graph distance from query anchors, or user annotation.

!1.0 @Query_Target :: Service
?confidence
epistemic clarity

encodes how certain a statement is. when conflicting values exist, the model resolves to the highest-confidence source. +60% accuracy improvement over plain json.

*temperature: 40°C ?0.9
--rel-->
relational anchoring

typed, directed edges between named entities form an explicit graph in text. prevents column slippage and enables multi-hop traversal.

!0.8 @Service --depends_on--> @Database

what the compiler produces

feed anrl a json file, a python module, a markdown doc, or a yaml config. it outputs a graph-native anrl stream optimized for injection into llm context windows.

input — service.json
{
  "name": "payment-gateway",
  "version": "2.4.1",
  "status": null,
  "db": {
    "host": "10.0.0.1",
    "port": 5432
  },
  "depends_on": ["database", "cache"]
}
output — anrl graph
compiled in 0.08ms
!1.0 @Payment_Gateway :: Service
*name: payment-gateway
*version: 2.4.1
# null pruned

!0.8 @DB :: Object
*db.host: 10.0.0.1
*db.port: 5432

!0.8 @Payment_Gateway --depends_on--> @Database
!0.8 @Payment_Gateway --depends_on--> @Cache

built to be measured

anrl was evaluated against plain json and format-stripped baselines across multiple tasks. here is what the data shows.

+60%
accuracy in multi-source conflict resolution
0.08ms
median compile time under 5 KB
277
tests passing, zero build warnings
16+
supported input formats

go deeper

the three operators are a small surface. the ideas behind them take a little longer to explain.