Transpose-Tied Relation Heads for Reversible Biomedical Fact Learning

A language model that reads "tamoxifen induces endometrial hyperplasia" during training can usually complete that sentence afterwards. It usually cannot answer "what induces endometrial hyperplasia?" This failure is called the reversal curse. Models trained to predict the next word learn the probability of the object given the subject, and nothing in that objective teaches the reverse (An Analysis and Mitigation of the Reversal Curse). In biomedical literature this is costly, because most useful questions run backwards: which drugs cause this adverse event, which genes are implicated in this disease. The entities involved are long, multi-token names, and that is exactly the regime where current text-level fixes break down.

We propose to attach a small auxiliary head to a model's middle layers during continued pretraining on biomedical abstracts. The head pools each multi-token entity into a single node in a document graph. It then scores entity pairs with a relation matrix $M_r$, and it scores the inverse relation with the transpose $M_r^\top$. Because forward and inverse share one parameter matrix, every forward sentence also trains the reverse direction. No reversed text is ever generated, so no upstream extractor or syntactic parser has to decide which entity is the subject. The question we test is whether this constraint on internal geometry transfers to the model's own closed-book answers to reverse questions, and whether it stays robust as entity names get longer and upstream parses get noisier.

Core Claim

Bilinear representation mitigates reversal curse and enables consistent model editing showed on synthetic family trees that reversal succeeds when a model's middle layers store relations bilinearly. In that form a fact is a score $s^\top M o$ between a subject vector $s$ and an object vector $o$, and inversion is just transposing $M$. In that work the structure appeared only under weight decay, on clean data with single-token names. We claim this structure can be imposed directly on real, noisy text with an explicit tied auxiliary objective.

For entity nodes $i$ and $j$, whose vectors $h_i$ and $h_j$ are mean-pooled over all their mention tokens at layer $\ell$, and a relation type $r$, the head computes

$$ f_r(i,j) = h_i^\top M_r h_j, \qquad f_{r^{-1}}(j,i) = h_j^\top M_r^\top h_i = f_r(i,j), $$

so the forward and inverse scores are identical by construction. The auxiliary loss is a contrastive ranking loss on $f_r$ over entity pairs that co-occur in a document. It is added to the ordinary next-token loss with weight $\lambda$. Pooling over mention tokens is the ingredient aimed at the multi-token collapse reported for Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge, where accuracy fell from about 100% on single-token entities to about 10% on three-token entities. The head never sees an entity as a sequence of fragments.

What is new is the pairing of three things. The first is a transpose-tied bilinear objective that acts on the language model's own hidden states rather than on a separate classifier. The second is a heterogeneous graph over words, sentences, mentions and entities, used only to supply the head's inputs. The third is an evaluation that measures reversal as a function of how corrupted the upstream syntactic information is.

Research Program

The graph follows the dual-tier design of Document-level Relation Extraction with Dual-tier Heterogeneous Graph. That system links word and sentence nodes through adjacency and dependency edges, links mentions and entities through co-occurrence and coreference, and weights each edge type with a learned scalar. We reuse this layout for a different purpose. DHG builds the graph to classify relations. We build it so that the pooled entity vectors fed to the bilinear head carry document context.

We replace DHG's per-edge-type scalars with content-dependent neighbor weights in the style of Graph Attention Networks, which scores each edge from the features of its two endpoints. Dependency edges enter only as soft, gated evidence, following the edge-wise gates of Encoding Sentences with Graph Convolutional Networks for Semantic Role Labeling and the full-tree soft pruning of Attention Guided Graph Convolutional Networks for Relation Extraction. Both of those works motivate soft use of parses. AGGCN also warns that hard pruning to the shortest dependency path discards modifiers such as "partial response", so we never hard-prune.

The syntactic-error direction serves as the evaluation lens. Any reversal fix that writes reversed sentences, such as "endometrial hyperplasia is induced by tamoxifen", must first decide which entity is the agent. That decision comes from a parser or extractor whose mistakes, including voice errors and subject/object swaps, are then trained into the model as false reversed facts. The tied head needs only the unordered pair and the relation type. The direction of the forward score is learned from the next-token signal.

We will run on two models. The first is Llama-3.2-1B, the model used for the Identity Bridge result. The second is a 12-layer model trained from scratch, used to probe geometry layer by layer. The layer $\ell$ where the head attaches is chosen by a linear probe on a development split, starting from the middle-layer band that the bilinear-representation paper identified. After training we probe whether $M_r^\top$, applied to the model's own hidden states, predicts reverse facts, and whether the LM head's reverse answers agree with the auxiliary head's rankings. A head that learns a reversible scorer while the decoder stays one-directional is a real failure mode. These checks detect it.

Baselines

The naive reference is plain continued pretraining with next-token prediction on the same corpus, token budget and learning-rate schedule. On fictitious name-to-description facts this setup scores 0% on reversed queries, as reported in An Analysis and Mitigation of the Reversal Curse. Our method has to clear it by a wide margin on reverse recall without losing forward recall or held-out perplexity.

The strongest existing method is BICO from the same paper. It fine-tunes a decoder with autoregressive blank infilling (predicting masked spans using context on both sides) and changes the rotary position encoding so the model can attend to future tokens. The paper reports roughly 70% reverse accuracy on its fictitious N2D task. BICO is the strongest competitor because it attacks the same cause, one-directional training, with no graph at all. We will run it on our corpus with the same base model, token budget, and an equal hyperparameter search of about twenty trials per method. Beating it means higher reverse exact-match on our benchmark at three-token and longer entity lengths, with forward accuracy within one point.

The second strong baseline is Identity Bridge, which reports a 50% reversal success rate on Llama-3.2-1B-Instruct. We generate its identity statements from the same entity pairs our head sees.

The third baseline is reverse-sentence augmentation. We run it twice. One variant builds reversed sentences from gold CDR/GDA triples, which is an upper bound for that family. The other builds them from triples extracted with an automatic dependency parser, which is the realistic version.

We also include weight decay alone, swept over the same range, because the bilinear-representation paper says it catalyzes bilinear storage. That paper gives no numeric reversal score, and no reported reversal result was found on Lacuna for CDR or GDA under any method.

Three ablations isolate the key ingredients. The first unties $M_{r^{-1}}$ from $M_r^\top$ and trains it separately, which tests whether the tie matters. The second removes the graph and pools mention tokens directly, which tests whether the heterogeneous graph adds anything beyond span pooling. The third swaps the bilinear score for a translational score $\|h_i + v_r - h_j\|$. The bilinear-representation paper found translational storage cannot support symmetry, so this variant should fail.

Why not just…?

Why not just augment the corpus with reversed sentences? This is the most serious threat. With gold triples, reverse augmentation may match or beat our method, and we will report that outcome if it happens. The Identity Bridge authors note that reversing a whole dataset is expensive and hurts general performance. Our real argument, though, is that realistic augmentation depends on an extractor. The parser-noise sweep described below measures how much augmentation loses when triples come from automatic parses instead of gold. If parser-derived augmentation holds up as well as the gold version, our advantage reduces to cost and multi-token robustness, and we will say so.

Why not just train bidirectionally with BICO or a blank-infilling model? BICO is the strongest baseline and is run under equal budget. Its reported roughly 70% was measured on fictitious biographies, not on multi-token biomedical names. It also requires changing the attention mechanism. It may still win. The length-stratified comparison settles whether pooled entity nodes give something that bidirectional token context does not.

Why not just retrieve from the extracted knowledge graph at inference time? Retrieval sidesteps the reversal curse because a graph lookup works in both directions. We include it as a non-parametric reference. It does not answer the question here, which is whether the knowledge stored in the weights is reversible. RSF-GLLM, which reaches 90.45% Hit@1 on WebQSP with external graph traversal, notes that the reader model's built-in popularity biases still cause errors. Retrieval also inherits every extraction error.

Why not drop the graph, given that MLPs over language-model features often match graph networks? Do We Really Need GNNs with Explicit Structural Modeling? MLPs Suffice for Language Model Representations makes exactly this case. The no-graph ablation tests it directly. If span pooling plus the tied head performs as well without the graph, we will drop the graph, and the contribution becomes the tied objective alone.

Proposed Experiments

We build a closed-book reversal benchmark from the CDR (chemical-disease) and GDA (gene-disease) corpora. For each annotated pair we keep, in the training abstracts, only sentences that state the fact in chemical-first (or gene-first) order. Reverse questions go to a held-out query set. To rule out leakage from pretraining, we also produce a copy in which entity names are replaced by fictitious names of 1, 2, 3 and 5 tokens, in the spirit of the N2D dataset. Metrics are reverse and forward exact-match and Hits@10 among candidate entities, reported by name length and by whether the pair is linked within one sentence or across sentences. Extraction quality is a secondary check against DHG-BERT's reported 65.9% F1 on CDR, since our graph reuses DHG's layout.

The first decisive check is the length curve. Our method's reverse accuracy should stay roughly flat from 1 to 5 tokens, while Identity Bridge's should fall the way it did in the original paper.

The second decisive check is a parser-noise sweep. We corrupt 0%, 10%, 20% and 40% of dependency arcs, and of subject/object assignments, before building both the graph and the augmented corpora. We then plot reverse accuracy against corruption rate. The prediction is that parser-derived augmentation degrades steeply and the tied head degrades gently. Any method whose accuracy is flat in this sweep would show that syntactic noise is not a real factor in this setting.

The third check is mechanistic. Transposed-matrix probes at layer $\ell$ should predict the LM head's reverse answers item by item. If the head scores reverse pairs well but decoded reverse accuracy stays near the next-token baseline, the geometry did not transfer to generation and the core claim fails.

A final editing test asks whether the new structure makes edits propagate. We apply ROME and MEMIT edits to forward facts and check whether the reverse query changes consistently, which the bilinear-representation paper achieved only on synthetic data.