Labeled Incidence Structures for Native Transformer Modeling of Text, Knowledge Graphs, and Hypergraphs
Organizations: A Carrot, Inc
Abstract
Current Transformer interfaces index tokens by one or more integer coordinates, which determine their addresses inside attention. In RoPE and its multi-axis or hierarchical variants, the resulting address has the form , where the exponents are integer coordinates assigned after choosing a serialized token layout. When Transformers process new or large collections of data, this addressing scheme can produce unseen offsets or coordinate combinations, push repositories toward retrieve-and-serialize pipelines, and force new entities, records, or repository items to be represented by long token strings or identifier embeddings not seen in training. We introduce labeled incidence structures (LIS), in which each participating token or value is an endpoint with content and a structural index . The index can include local position, relation role, relation instance, text unit, field, or content-derived identity. The model maps this index to a structural address , so adding new tokens, facts, text units, or repository items applies the same learned address rule to structural and content coordinates rather than requiring larger integer coordinates, unseen coordinate combinations, or new identifier embeddings. Attention scores endpoints using , where journey consistency forces . When has several coordinates, such as position, role, and instance, coordinate independence is equivalent to factoring into one address factor per coordinate. This recovers RoPE, RoPE-2D, and HiRoPE as special cases. This allows knowledge-graph (KG) roles, fact instances, and text units to enter the attention score directly. In controlled shallow diagnostics, the LIS address interface is implemented inside ordinary Transformer attention and yields promising results across text, KG, and -ary settings.
Figures & tables
| Diagnostic | Condition | Flat/Serialized | LIS | What is tested |
|---|---|---|---|---|
| Tiny Shakespeare | PPL, 256 4096 chars | 4.70 13.36 | 4.81 4.86 | text units as LIS instances |
| Independent KG/text | text eval, main tiers | .248–.269 | .401–.445 | KG-only facts to text queries |
| Independent KG/text | KG eval, main tiers | .280–.296 | .475–.510 | text-only facts to KG queries |
| Template-diverse KG text | single-fact test, chain2/3 | .126–.359 | .923–.972 | unseen names with one KG fact |
| Template-diverse KG text | same-entities test, chain2/3 | .030–.411 | .835–.952 | relation choice among distractor facts |
| Template-diverse KG text | same-relation test, chain2/3 | .000–.109 | .038–.182 | hardest entity-binding stress test |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Occurrence | Instance | Slot | Address | |
|---|---|---|---|---|
| (“Aspirin”, text) | Aspirin | (sentence) | ||
| (“COX-2”, text) | COX-2 | (sentence) | ||
| (“inflammation”, text) | Inflammation | (sentence) | ||
| (“Aspirin”, drug) | Aspirin | (hyperedge) | drug | |
| (“COX-2”, target) | COX-2 | (hyperedge) | target | |
| (“Inflammation”, disease) | Inflammation | (hyperedge) | disease |
| Model | 256 chars | 512 chars | 1024 chars | 2048 chars | 4096 chars |
|---|---|---|---|---|---|
| Continuous RoPE | 4.70 | 5.99 | 8.23 | 10.71 | 13.36 |
| ALiBi | 4.96 | 4.94 | 4.96 | 4.93 | 4.93 |
| Random line address | 4.89 | 4.79 | 4.90 | 4.87 | 4.91 |
| LISformer (content address) | 4.81 | 4.74 | 4.85 | 4.83 | 4.86 |
| Scale | Layers | Heads | Batch | B step (ms) | J overhead | |
|---|---|---|---|---|---|---|
| 0.8M | 128 | 4 | 4 | 8 | 42 | +10.3% |
| 85M | 768 | 12 | 12 | 4 | 702 | +4.4% |
| 302M | 1024 | 24 | 16 | 2 | 1215 | +3.5% |
| 680M | 1536 | 24 | 16 | 1 | 1428 | +2.0% |
| Tier | Serialized h@5 | LIS h@5 | Serialized PPL | LIS PPL |
|---|---|---|---|---|
| memorization | .259 | .445 | 3.59 | 3.10 |
| transfer | .269 | .440 | 3.47 | 3.08 |
| generalization | .248 | .401 | 3.83 | 3.48 |
| kg_excl_mem | .184 | .329 | 4.68 | 3.97 |
| kg_excl_gen | .189 | .323 | 4.92 | 4.18 |
| txt_excl_mem | .119 | .202 | 5.10 | 4.62 |
| Fact type | Name set | Serialized h@1 | Serialized h@5 | Serialized PPL | LIS h@1 | LIS h@5 | LIS PPL |
|---|---|---|---|---|---|---|---|
| base_2ary | train | .002 | .130 | 5.38 | .951 | 1.000 | 1.08 |
| base_2ary | test | .000 | .000 | 577 | .182 | .397 | 6.44 |
| base_3ary | train | .001 | .107 | 5.39 | .970 | 1.000 | 1.06 |
| base_3ary | test | .000 | .000 | 515 | .185 | .413 | 6.44 |
| derived | train | .003 | .140 | 5.29 | .912 | 1.000 | 1.10 |
| derived | test | .000 | .000 | 544 | .165 | .385 | 6.80 |
| Fact type | Name set | Serialized h@1 | Serialized h@5 | Serialized PPL | LIS h@1 | LIS h@5 | LIS PPL |
|---|---|---|---|---|---|---|---|
| base_2ary | train | .000 | .097 | 5.50 | .927 | 1.000 | 1.14 |
| base_2ary | test | .000 | .000 | 516 | .148 | .310 | 10.37 |
| base_3ary | train | .000 | .090 | 5.46 | .928 | .999 | 1.14 |
| base_3ary | test | .000 | .000 | 517 | .143 | .307 | 10.34 |
| derived | train | .000 | .080 | 5.33 | .919 | .999 | 1.16 |
| derived | test | .000 | .000 | 506 | .115 | .287 | 12.97 |
| Fact type | Set | Serialized h@1 | Serialized h@5 | Serialized PPL | LIS h@1 | LIS h@5 | LIS PPL |
|---|---|---|---|---|---|---|---|
| chain2 | train | .224 | .907 | 2.28 | .507 | 1.000 | 1.30 |
| chain2 | test | .095 | .359 | 6.22 | .463 | .972 | 1.37 |
| chain3 | train | .011 | .743 | 2.75 | .063 | .995 | 1.46 |
| chain3 | test | .002 | .126 | 8.64 | .050 | .923 | 1.57 |
| Fact type | Set | Serialized h@1 | Serialized h@5 | Serialized PPL | LIS h@1 | LIS h@5 | LIS PPL |
|---|---|---|---|---|---|---|---|
| chain2 | train | .215 | .853 | 2.58 | .483 | 1.000 | 1.39 |
| chain2 | test | .133 | .411 | 6.23 | .388 | .952 | 1.57 |
| chain3 | train | .000 | .126 | 15.37 | .044 | .962 | 1.64 |
| chain3 | test | .000 | .030 | 29.83 | .016 | .835 | 1.98 |
| Fact type | Set | Serialized h@1 | Serialized h@5 | Serialized PPL | LIS h@1 | LIS h@5 | LIS PPL |
|---|---|---|---|---|---|---|---|
| chain2 | train | .025 | .368 | 6.72 | .050 | .342 | 8.29 |
| chain2 | test | .009 | .109 | 20.49 | .023 | .182 | 17.19 |
| chain3 | train | .000 | .005 | 51.44 | .001 | .112 | 8.58 |
| chain3 | test | .000 | .000 | 101.94 | .001 | .038 | 18.24 |
| Setting | Fact type | Set | h@5 | h@5 | h@5 | PPL | PPL | PPL |
|---|---|---|---|---|---|---|---|---|
| single-fact | chain2 | train | .907 | .970 | 1.000 | 2.28 | 1.42 | 1.30 |
| single-fact | chain2 | test | .359 | .925 | .972 | 6.22 | 1.58 | 1.37 |
| single-fact | chain3 | train | .743 | .994 | .995 | 2.75 | 1.50 | 1.46 |
| single-fact | chain3 | test | .126 | .912 | .923 | 8.64 | 1.66 | 1.57 |
| same-entities | chain2 | train | .853 | .973 | 1.000 | 2.58 | 1.91 | 1.39 |
| same-entities | chain2 | test | .411 | .872 | .952 | 6.23 | 2.35 | 1.57 |