Inside every attention head, tokens become queries and keys, and a compatibility rule, usually a scaled dot product, decides how strongly each query attends to each key. So a pretrained model has learned two things: representations, and a rule for comparing them.
Parameter-efficient fine-tuning such as LoRA adapts the maps that produce queries and keys. The rule that compares them is inherited unchanged. GeoAFT asks what happens if we adapt that rule instead.
Explainer (draft). About two and a half minutes, silent for now: narration is still to be recorded.
Our working hypothesis is that relations matter most when representations are constrained: frozen or compressed features, small adaptation budgets, or similarity-critical tasks. Where representations are flexible, ordinary fine-tuning may absorb the same change. Either outcome is informative.
Figure 1. Two places to adapt attention. Conventional PEFT edits the projections that produce and . GeoAFT adds a trainable term to the compatibility function and leaves and as they are.
2Same points, different relations
Changing the geometry changes what counts as similar. Hold one query and seven keys fixed. The dot product prefers the key furthest along the query’s direction. Euclidean distance prefers the nearest key. Taxicab (L1) distance prefers neighbours along the axes. An anisotropic Mahalanobis metric prefers neighbours along a direction it treats as cheap. The winner changes every time, and no point has moved.
Figure 2. Try it. Each panel scores the same query against the same keys A–G with a different rule. Drag the query, press Animate query, or focus the figure and use the arrow keys.Illustrative toy example, not trained-model behaviour.
3The method in one picture
GeoAFT keeps the pretrained score and adds a small, trainable geometry term on top of it:
Figure 3. The GeoAFT score. A structured geometry branch is centred over valid keys, scaled by a gate that starts at zero, and added before a single softmax.
Starts from the pretrained model. Each gate is initialized at zero, so training begins from exactly the pretrained attention.
Small and structured. What is trained is the geometry itself, a metric, an exponent or a projection, not a generic learned scorer.
Leaves representations alone. and are not modified, so GeoAFT can be compared directly with matched Q/K adaptation.
Part 2 · The evidence
Tested so far synthetic
Recovery of three known target relations: learned , Mahalanobis and a structured nonlinear compatibility
Head-to-head against Q/K-LoRA, a fixed geometry bank, generic pair-MLP scorers, projected-dot and exact structural controls
The fixed geometry bank on its own: it nearly closes the gap
The Mahalanobis equivalence, shown analytically and consistent with the exact control
Implementation checks: zero gate reproduces the pretrained attention; masked keys stay out of centring
In progress Not yet reported
Real benchmarks: the current method on natural tasks
How strongly a score difference is transmitted to the task
Compatible measurements of time, throughput and memory
Whether geometry offers adaptation capacity that restricted Q/K updates lack
4Synthetic experiments controlled
We first test GeoAFT where the right answer is known. A synthetic teacher generates attention from a known compatibility function over fixed representations, and every method adapts the same frozen dot-product base toward it. The score is oracle-gap recovery : 0% means no improvement over the base, 100% means matching the oracle. It is not classification accuracy.
Learned
Target: an distance
99.983%
Result. Near-oracle recovery.
Caveat. A fixed geometry bank nearly closed the gap on its own, which left little room to show superiority.
Mahalanobis
Target: a Mahalanobis metric
99.991%
Result. Near-oracle recovery.
Caveat. An exact quadratic control did better. This geometry rewrites a known score family rather than adding capacity.
Structured nonlinear
Target: a nonlinear compatibility
99.934%
Result. 46 trainable parameters fit about as well as a 8,705-parameter PairMLP (99.539%).
Caveat. 15/15 paired wins, but the difference is below the preregistered materiality threshold: economy, not superiority.
On the and Mahalanobis targets, Q/K-LoRA stays 39.9–41.7 points behind GeoAFT at the tested budgets, and the tested pair-MLP scorers 6.4–12.2 points; each range spans both targets.
Figure 4. Every tested method on the three synthetic targets. Each point is one method: its trainable parameters against its oracle-gap recovery . The vertical axis is logarithmic in the remaining gap, so 99%, 99.9% and 99.99% are evenly spaced. Diamonds are GeoAFT variants; the solid ring marks the selected one and the dotted ring the best other method. The dashed line is the Pareto frontier. Hover a point for its details, or a legend entry to isolate that family. Counts are trainable parameters, not inference cost.
Scope. These are controlled synthetic results. Not every registered superiority comparison passed, and recovering a target is not the same as adding capacity. Protocol, controls and full table →
5What the results mean
A geometry update can look different from a weight update and still compute the same function. So before asking whether geometry adaptation helps, we ask which kind of change it is.
Exact reparameterization
✓ Established analytically
The geometry describes a function a conventional scorer already represents. Mahalanobis is the example.
Economical parameterization
◐ Supported in controlled experiments
The same useful interaction, or a close approximation, with far fewer trained parameters.
Distinct adaptation capacity
○ Under investigation
Changes a restricted conventional family cannot reach. Whether this survives downstream is the open question.
6In progress and future directions
Real benchmarks are in progress. Evaluation of the current method on natural tasks is ongoing, and no results from it are reported here. The programme ahead is organised around three research questions.
When is geometry adaptation actually different?
The aim is not a larger metric menu. Each geometry family will be paired with a containment control that asks whether it can be compiled into an ordinary representation or score update. Theory will separate exact reparameterization, lower-complexity parameterization of an equivalent class, and genuinely distinct capacity.
A single global metric will be generalized so that the geometry can depend on the input, layer, head or local statistics, through low-rank coordinate maps, kernel mixtures, local metrics, learned curvature and small selectors. Projected-dot and generic learned-score controls will isolate geometry from added projection capacity or search breadth.
Does it survive beyond attention and under compression?
In JEPA-style latent prediction, a fixed distance between predicted and target latents will be replaced by a structured, trainable one. The same framework will be studied on encoder, vision and decoder-only models, with model size, token budget, latent dimension, adaptation budget and BF16 → INT8 → INT4 precision as probes. Stronger representations may give geometry more to exploit, or make it redundant because conventional PEFT absorbs the mismatch.
How it will be judged
Tested, syntheticIdentifiability Can the geometry recover a known relation?
PlannedFunctional necessity Does changing the relation improve prediction when features are frozen or constrained?
PlannedComplementarity Do gains survive equal-budget conventional PEFT, projected-dot, fixed-geometry, exact-containment and generic-score controls?
PlannedRegime dependence How do the answers change with architecture, scale and compression?
Experiments will move from controlled targets to geometry-critical frozen-feature, prototype and retrieval tasks, and then to pretrained Transformer, vision and JEPA systems. Model, split, comparator family, search budget, seeds and success margins will be frozen before final testing, and task quality will be reported with trainable and stored state, wall time, throughput and peak memory.
Geometry is unlikely to help uniformly. Similarity-critical, frozen or compressed regimes may benefit, while flexible networks may absorb the same change through ordinary PEFT. Both outcomes are useful: the intended result is a regime map of where adaptation capacity should be allocated.
Part 3 · Technical details
7Notation and definition
For token states , one attention head forms queries and keys , and scores each pair with the scaled dot product
where is the set of keys that query may attend to (its causal or padding mask). Most PEFT changes and leaves unchanged. GeoAFT adds a structured, trainable residual to the score:
with for and . Here:
are low-dimensional projections into the space where the geometry acts;
is a structured geometry family with parameters , such as a metric or an exponent;
is a fixed calibration scale, estimated once without labels in the implementation, so the branch starts on a logit scale comparable to the base score;
is a per-head gate, initialized at .
GeoAFT can be used on its own, with and frozen, or alongside a conventional Q/K adapter. Comparing those configurations under matched budgets is the point of the experiments.
Development note. The earliest prototype mixed a bank of fixed operators per head through a router initialized at the dot product, then compiled the selection into a static model. Later versions use the gated residual above, which adds a trainable geometry instead of selecting among fixed ones.
8Families, centring and masks
With and , the families used in the controlled experiments are:
Family
Trainable
Relation to dot-product scoring
Learned
exponent (bounded); optionally projections
Not a bilinear form in general. With it can produce centred patterns of maximal rank (§9).
Mahalanobis
factor
Softmax-equivalent to bilinear plus key-quadratic (§9)
Structured nonlinear
compact nonlinear compatibility
a few dozen parameters (46 in the reported run)
Compared against a generic PairMLP scorer
The implementation also includes dot, cosine, L1, squared-L2 and rational-quadratic scores, several of them as reducibility controls rather than candidate contributions. The size of the menu is not the contribution.
Identity at initialization. With , for every pair, so the adapted model computes the pretrained attention exactly, up to floating-point round-off. The research implementation verifies this with tests. This is a property of the implementation, not evidence that geometry adaptation improves prediction.
Support centring. Row-wise softmax ignores a constant added to all valid logits in a row, . Centring the geometry branch over removes exactly this unidentifiable component. Masked positions are excluded from the mean, so centring never mixes valid and invalid keys.
9Q/K versus score adaptation
Q/K adaptation does change attention scores, through the bilinear form . With low-rank updates of rank and ,
which has rank at most . A structured geometry is not restricted in this way: for distinct points on a line, the row-centred L1 score matrix has rank , the maximum possible after centring.
An exact equivalence. Not every geometry is new capacity. Squared Mahalanobis expands as
and the last term is constant within a softmax row, so it cancels. The overlay is softmax-equivalent to a bilinear score plus a key-quadratic bias, a known score family. Squared L2 is the case , and cosine is a dot product of normalized vectors.
These are local statements about one head’s score matrix on fixed representations, not whole-Transformer impossibility results. A score that Q/K cannot reach is not necessarily useful for the task.
10Protocol, controls and full results
The controlled experiments test identifiability: can a method recover a known relation? Each fixes a set of representations and a target compatibility function. Methods are compared in paired cells on held-out synthetic queries and keys, and trainable parameter counts are recorded for every method.
is the loss of the unadapted model and is the oracle reference loss. Normalizing by the gap makes results comparable across targets whose raw KL scales differ.
Comparator
Question it answers
Q/K adaptation (LoRA ranks; full Q/K)
Can conventional representation adaptation reach the same relation by moving and ?
Fixed geometry / geometry bank
Is adaptation needed, or does choosing the right fixed geometry already suffice?
Generic learned scorer (pair-MLP)
Is the gain due to structure, or just to added nonlinear capacity?
Projected-dot
Is the gain due to the extra projections rather than to the geometry acting on them?
Exact structural controls
Does the family add anything beyond its known equivalent score family (§9)?
Target
Comparison
Result
Qualifier
Learned and Mahalanobis
GeoAFT
= 99.983% (); 99.991% (Mahalanobis)
Near-oracle recovery on both targets
vs Q/K-LoRA
GeoAFT ahead by 39.9–41.7 percentage points of
Range across the two targets; at the tested budgets
vs tested pair-MLPs
GeoAFT ahead by 6.4–12.2 percentage points
Positive in all 25 paired cells on each target
vs fixed geometry and exact controls
see qualifiers
The fixed bank nearly exhausted the oracle gap. The exact quadratic control outperformed the Mahalanobis overlay.
Nonlinear
GeoAFT (46 trainable parameters)
= 0.9993429
15/15 paired wins for GeoAFT. The 0.40-percentage-point difference in is below the preregistered materiality threshold. About 189× fewer trainable parameters than the tested PairMLP.
PairMLP (8,705 trainable parameters)
= 0.9953917
Comparison rules and success margins were fixed before final testing. Not all registered superiority gates passed: the three caveats in §4 are the gates that did not.
11Limitations
Synthetic scope. The results recover known relations on fixed representations. They are not natural-task results, and they say nothing about state-of-the-art performance.
Natural tasks. Earlier natural-task experiments with previous versions of the method were negative. On hierarchical text classification and a GLUE MRPC replication, tuned Q/K-LoRA and full Q/K adaptation outperformed GeoAFT. Later coordinate-based variants did not exceed matched continued-training controls. This is why the project now asks when geometry adaptation helps rather than whether it helps in general.
From score to task. A score change that Q/K cannot represent can still be erased by the value and output path, so non-absorbability in the score matrix does not imply task usefulness.
Efficiency. Trainable-parameter counts are not inference cost. No accuracy–compute frontier is claimed until compatible measurements of time, throughput and memory are complete.
12Sources
Accepted Research
Geometric Attention Fine-Tuning Is Representation-Relative: Autonomous ML Research with AI-Native Workflow
The numbers on this page and in the figures come from the project’s current evidence summary. Each quantity is stored once in the figure-generation data, so the page and the figures cannot drift apart.