{"id":"N-Q-LM-TRANSPLANT","url":"https://chrishayuk.com/notebook/can-you-transplant-a-relationship-inside-a-transformer","currentVersion":"1.1","publication":"published","scientificStatus":"OPEN","versions":[{"version":"1.0","title":"Can you transplant a relationship inside a transformer?","abstract":"A third note on Q-LM, a modern experiment. Two small transformers, a custom model and a Llama-shaped one, were trained with three seeds on worlds of invented facts: 24 countries, their capitals and continents, and 48 people with a home city, most of them with a birth city too. Both carry a fact to a phrasing they never saw it in; Llama composes two relations; neither reverses one. Inside them, the first transplants of whole states moved the answer, not the fact: a donor with the same answer through another relation worked as well. Before the answer forms, the custom model holds the entity at its own position, and a few attention heads carry it to the answer position, by the plan’s criterion in 8 of 9 Llama models and 4 of 9 custom ones. In Llama, after block 1, a relation component can be moved on its own. Taken from “P was born in” into “P lives in” for the same person, it makes the birth city win for 70% of held-out people, passing the plan’s criterion in 8 of 9 models. Taken from person B and added to person A’s “A lives in”, it gives A’s birth city in 51% of pairs and B’s in none, passing in 4 of 9. The custom model passes neither in any model. The fact is not looked up at the entity’s position, as an account from larger models has it: that test failed every criterion. It is written at the answer position, where a city vector chosen by an external table makes Llama state an edited capital in 90% of prompts, and 92% on three fresh worlds, with no weight changed.","authors":["Chris Hay"],"url":"https://chrishayuk.com/records/N-Q-LM-TRANSPLANT/1.0","published":"2026-11-27","publication":"published","scientificStatus":"OPEN","supersededBy":[],"hash":"f65141ee3f87505c724c9d6ab0549f25397ea19aef68904cea10ae0eb3ce1d86","algorithm":"sha256","revision":{"kind":"initial","summary":"First publication, after an independent fact-check against the repository's results documents and plans"},"display":{"kind":"initial","summary":"First publication, after an independent fact-check against the repository's results documents and plans"},"next":"https://chrishayuk.com/records/N-Q-LM-TRANSPLANT/1.1","sources":[{"title":"chrishayuk/q-lm, docs/results-qlm-semantic-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-semantic-001.md","note":"The semantic worlds, and what the learners do on them."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-sem-001-v2.md and docs/results-larql-qlm-sem-001-v3.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-sem-001-v3.md","note":"Answer states, the entity at its own position, the relation swap and the recombined query, against docs/larql-qlm-sem-001-plan.md and its three amendments."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-transport-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-transport-001.md","note":"The attention steps and heads that carry the entity, with heads chosen on held-out pairs."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-enrich-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-enrich-001.md","note":"The enrichment test that failed, and the follow-up at the answer position."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-resolve-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-resolve-001.md","note":"Where the answer forms, and the fact edited from an external table, confirmed on worlds 4 to 6."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-external-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-external-001.md","note":"A provider that reads the entity and relation from activations, against its plan, confirmed on worlds 4 to 6."},{"title":"chrishayuk/larql","url":"https://github.com/chrishayuk/larql","note":"The series these experiments are named for; for Llama, its per-layer states were checked against PyTorch’s in GROUP-001."},{"title":"M. Geva et al., “Dissecting recall of factual associations”, 2023","note":"The subject-enrichment account tested by ENRICH-001, as the repository cites it."}],"manuscript":"https://chrishayuk.com/api/record/N-Q-LM-TRANSPLANT?version=1.0","citations":"https://chrishayuk.com/api/citations/N-Q-LM-TRANSPLANT?version=1.0"},{"version":"1.1","title":"Can you transplant a relationship inside a transformer?","abstract":"A third note on Q-LM, a modern experiment. Two small transformers, a custom model and a Llama-shaped one, were trained with three seeds on worlds of invented facts: 24 countries, their capitals and continents, and 48 people with a home city, most of them with a birth city too. Both carry a fact to a phrasing they never saw it in; Llama composes two relations; neither reverses one. Inside them, the first transplants of whole states moved the answer, not the fact: a donor with the same answer through another relation worked as well. Before the answer forms, the custom model holds the entity at its own position, and a few attention heads carry it to the answer position, by the plan’s criterion in 8 of 9 Llama models and 4 of 9 custom ones. In Llama, after block 1, a relation component can be moved on its own. Taken from “P was born in” into “P lives in” for the same person, it makes the birth city win for 70% of held-out people, passing the plan’s criterion in 8 of 9 models. Taken from person B and added to person A’s “A lives in”, it gives A’s birth city in 51% of pairs and B’s in none, passing in 4 of 9. The custom model passes neither in any model. The fact is not looked up at the entity’s position, as an account from larger models has it: that test failed every criterion. It is written at the answer position, where a city vector chosen by an external table makes Llama state an edited capital in 90% of prompts, and 92% on three fresh worlds, with no weight changed.","authors":["Chris Hay"],"url":"https://chrishayuk.com/records/N-Q-LM-TRANSPLANT/1.1","published":"2026-11-27","revised":"2026-12-03","publication":"published","scientificStatus":"OPEN","supersededBy":[],"hash":"1197e2e44a01528f09ba2857f708ce29ff6c005a5143610e38064e8c68a91352","algorithm":"sha256","revision":{"kind":"clarification","summary":"A capital letter restored at the start of a sentence in act 07; no other change","previous":"1.0"},"display":{"kind":"clarification","summary":"A capital letter restored at the start of a sentence in act 07; no other change"},"previous":"https://chrishayuk.com/records/N-Q-LM-TRANSPLANT/1.0","sources":[{"title":"chrishayuk/q-lm, docs/results-qlm-semantic-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-semantic-001.md","note":"The semantic worlds, and what the learners do on them."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-sem-001-v2.md and docs/results-larql-qlm-sem-001-v3.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-sem-001-v3.md","note":"Answer states, the entity at its own position, the relation swap and the recombined query, against docs/larql-qlm-sem-001-plan.md and its three amendments."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-transport-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-transport-001.md","note":"The attention steps and heads that carry the entity, with heads chosen on held-out pairs."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-enrich-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-enrich-001.md","note":"The enrichment test that failed, and the follow-up at the answer position."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-resolve-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-resolve-001.md","note":"Where the answer forms, and the fact edited from an external table, confirmed on worlds 4 to 6."},{"title":"chrishayuk/q-lm, docs/results-larql-qlm-external-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-larql-qlm-external-001.md","note":"A provider that reads the entity and relation from activations, against its plan, confirmed on worlds 4 to 6."},{"title":"chrishayuk/larql","url":"https://github.com/chrishayuk/larql","note":"The series these experiments are named for; for Llama, its per-layer states were checked against PyTorch’s in GROUP-001."},{"title":"M. Geva et al., “Dissecting recall of factual associations”, 2023","note":"The subject-enrichment account tested by ENRICH-001, as the repository cites it."}],"manuscript":"https://chrishayuk.com/api/record/N-Q-LM-TRANSPLANT?version=1.1","citations":"https://chrishayuk.com/api/citations/N-Q-LM-TRANSPLANT?version=1.1"}]}