LAWS.kv_of_group: law of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/LAWS.bend as LAWS Lines 231-237 of bendtorch@1.3.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/LAWS.bend&start_line=231&end_line=237 import Base import bendtorch@1.3.0.0/main.bend as T # LAW (kv_of_group): T.kv_of, the function both passes of T.Attention use to pick the key/value head of query head hi, # gives j for every head of group j: query heads j·g + 0 .. j·g + g - 1 (g = 1 + i + k, i < g) all read key/value head j. law kv_of_group: for +j: Nat for +i: Nat for +k: Nat {T.kv_of(Nat.add(Nat.mul(j, 1n+Nat.add(i, k)), i), 1n+Nat.add(i, k)) == j : Nat} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/LAWS.bend&name=gqa_head https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=kv_of