← GeoAFT overview

GeoAFT · Geometric Attention Fine-Tuning · How it works

The idea, the experiments, and the maths

Start with the intuition and the pictures. Then the evidence: controlled synthetic tasks, real few-shot benchmarks, and a mechanism study of where the real-task gains come from. The precise definitions and full tables are at the end.

Lead: Yuhe Sui

Part 1 · The idea

1Why adapt relations?

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, October 2026). About two and a half minutes, silent: the idea and the synthetic results, recorded before the real-task results below.

The working hypothesis was 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. The real-task evidence in Part 2 tests this.

Diagram: attention computes token states, projections, representations q and k, a compatibility score s(q,k), and a softmax. Conventional PEFT edits the projections, which changes scores indirectly. GeoAFT adds a trainable term to the compatibility score itself and leaves q and k unchanged. Token states x Projections WQ, WK Representations q, k Compatibility s(q, k) Attention softmax over keys Conventional PEFT W + ΔW (e.g. LoRA: ΔW = BA) changes how q and k are produced GeoAFT s(q, k) + α gφ(q, k) changes how q and k are compared scores change indirectly
Diagram: attention computes token states, projections, representations q and k, a compatibility score s(q,k), and a softmax. Conventional PEFT edits the projections, which changes scores indirectly. GeoAFT adds a trainable term to the compatibility score itself and leaves q and k unchanged. Token states x Projections WQ, WK Representations q, k Compatibility s(q, k) Attention softmax over keys Conventional PEFT W + ΔW changes how q, k are produced GeoAFT s + α gφ(q, k) changes how q, k are compared Q/K edits still move the scores — indirectly, through q and k.
Figure 1. Two places to adapt attention. Conventional PEFT edits the projections that produce q and k. GeoAFT adds a trainable term to the compatibility function and leaves q and k 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.

Illustration: one query q and seven fixed keys A–G under four compatibility rules. Dot product favours B, the key furthest along q; Euclidean distance favours the nearest key A; the L1 rule favours the axis-aligned neighbour D; an anisotropic Mahalanobis metric favours F along its cheap direction. Bars show the softmax attention weights. Only the rule changes. Dot product s(q, k) = q · k A B 69% C D E F G q A B C D E F G Euclidean distance s(q, k) = −‖q − k‖2 A 51% B C D 29% E F 16% G q A B C D E F G L1 (taxicab) distance s(q, k) = −‖q − k‖1 A 33% B C D 57% E F G q A B C D E F G Anisotropic (Mahalanobis) s(q, k) = −‖q − k‖M A 36% B C D E F 49% G q A B C D E F G
Illustration: one query q and seven fixed keys A–G under four compatibility rules. Dot product favours B, the key furthest along q; Euclidean distance favours the nearest key A; the L1 rule favours the axis-aligned neighbour D; an anisotropic Mahalanobis metric favours F along its cheap direction. Bars show the softmax attention weights. Only the rule changes. Dot product s(q, k) = q · k A B 69% C D E F G q A B C D E F G Euclidean distance s(q, k) = −‖q − k‖2 A 51% B C D 29% E F 16% G q A B C D E F G L1 (taxicab) distance s(q, k) = −‖q − k‖1 A 33% B C D 57% E F G q A B C D E F G Anisotropic (Mahalanobis) s(q, k) = −‖q − k‖M A 36% B C D E F 49% G q A B C D E F G
Figure 2. Try it. Each panel scores the same query q 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:

Sij=sbase(qi,kj)+αhg¯ϕ(Pqqi,Pkkj),Aij=softmaxj∈𝒱(i)(Sij)
Diagram of the GeoAFT score: the pretrained score of query q_i and key k_j is kept. In parallel, low-dimensional projections feed a structured geometry g_phi, whose output is centred over each row’s valid keys and scaled by a per-head gate alpha_h that starts at zero. The two are added, masked, and passed through one softmax, so at initialization the attention equals the pretrained attention. Query, key qi, kj Pretrained score sbase(qi, kj) Projections Pq q, Pk k Structured geometry gφ (Lp, Mahalanobis, …) Centre over valid keys + Mask, softmax Aij × αh αh = 0 at initialization ⇒ exactly the pretrained attention kept as is
Diagram of the GeoAFT score: the pretrained score of query q_i and key k_j is kept. In parallel, low-dimensional projections feed a structured geometry g_phi, whose output is centred over each row’s valid keys and scaled by a per-head gate alpha_h that starts at zero. The two are added, masked, and passed through one softmax, so at initialization the attention equals the pretrained attention. Query, key qi, kj Pretrained score sbase(q, k) Projections Pq q, Pk k Geometry gφ (Lp, Mahal., …) Centre over valid keys × αh + Mask, softmax Aij αh = 0 at init ⇒ exactly the pretrained attention
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 αh 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.
  • Two places to use it. As an attention overlay, on the query-key scores inside a Transformer layer; or as a score-level overlay, on the class scores of a frozen-feature few-shot classifier, where the keys are class prototypes.

Part 2 · The evidence

Tested so far

  • Recovery of three known target relations on synthetic tasks, against Q/K-LoRA, a fixed geometry bank, generic pair-MLP scorers and exact controls
  • Remote-sensing few-shot (RSFS-8) and CLIP few-shot on the 11 CoOp datasets, against published results
  • GLUE MRPC and RTE, domain generalisation and biomedical few-shot
  • A mechanism study on development data: fixed class keys, the last attention layer of CLIP ViT-B/16 with and without Q/K-LoRA, and neighbour graphs for transductive few-shot

Next Coming soon

  • Open text keys: remote-sensing image-text retrieval (RSICD, RSITMD)
  • LC-TIM+DINO with the published DINOv3 satellite encoder, once access to the weights is granted
  • Host redundancy and optimisation, on development data

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 R: 0% means no improvement over the base, 100% means matching the oracle. It is not classification accuracy.

Learned Lp

Target: an Lp distance

99.983%

Result. Near-oracle recovery. A fixed bank of ten Lp geometries reached nearly the same.

Mahalanobis

Target: a Mahalanobis metric

99.991%

Result. Near-oracle recovery. An exact bilinear-plus-key-quadratic score, its known equivalent (§12), matched or slightly exceeded it.

Structured nonlinear

Target: a nonlinear compatibility

99.934%

Result. 46 trainable parameters fit about as well as an 8,705-parameter pair MLP (99.539%), winning 15/15 paired cells.

On the Lp and Mahalanobis targets, Q/K-LoRA stays 39.9–41.7 points of R behind GeoAFT at the tested budgets, and the tested pair-MLP scorers 6.4–12.2 points; each range spans both targets.

Chart: for each of the three synthetic targets, every tested method is plotted by trainable parameters and oracle-gap recovery. GeoAFT variants reach the highest recovery among the plotted methods with tens of parameters or fewer; on the L_p target a fixed geometry bank is close behind, on the nonlinear target generic learned scorers come close with hundreds to thousands of parameters, and on the Mahalanobis target the exact bilinear-plus-key-quadratic control, which is not plotted, matched or slightly exceeded GeoAFT in all 25 paired cells. Learned Lp target 0% 90% 99% 99.9% 99.99% 1 10 100 1k 10k Trainable parameters (log scale) Oracle-gap recovery R DiscreteFixedBank — 1 trainable parameters, R = 99.779% DiscreteFixedBank · fixed_lp_2p5 — 1 trainable parameters, R = 95.324% FixedL2 — 1 trainable parameters, R = 95.320% DiscreteFixedBank · fixed_lp_3 — 1 trainable parameters, R = 93.763% FixedSquaredL2 — 1 trainable parameters, R = 92.064% DiscreteFixedBank · fixed_lp_1p5 — 1 trainable parameters, R = 91.829% DiscreteFixedBank · fixed_lp_3p5 — 1 trainable parameters, R = 91.694% DiscreteFixedBank · fixed_lp_4 — 1 trainable parameters, R = 89.607% FixedL1 — 1 trainable parameters, R = 82.185% FixedCosine — 1 trainable parameters, R = 63.508% ExtraQK — 32 trainable parameters, R = 14.473% GenericPairMLP · pair_mlp_h1 — 35 trainable parameters, R = 85.136% QK_LoRA_rank_sweep · lora_r2 — 64 trainable parameters, R = 29.009% BilinearKeyQuadratic — 65 trainable parameters, R = 92.060% ProjectedDot — 65 trainable parameters, R = 58.405% FullQK — 128 trainable parameters, R = 58.418% QK_LoRA_rank_sweep — 128 trainable parameters, R = 58.326% GenericPairMLP — 137 trainable parameters, R = 87.798% GeoAFT · geo_dot — 1 trainable parameters, R = 58.435% GeoAFT · geo_cosine — 2 trainable parameters, R = 63.508% GeoAFT — 3 trainable parameters, R = 99.983% GeoAFT · geo_rq — 3 trainable parameters, R = 95.250% GeoAFT · geo_mahalanobis_r1 — 18 trainable parameters, R = 92.063% GeoAFT · geo_mahalanobis_r2 — 26 trainable parameters, R = 92.063% GeoAFT · geo_mahalanobis_r4 — 42 trainable parameters, R = 92.063% GeoAFT: 99.983% with 3 parameters Best other: DiscreteFixedBank, 99.779% with 1 Mahalanobis target 0% 90% 99% 99.9% 99.99% 1 10 100 1k 10k Trainable parameters (log scale) DiscreteFixedBank — 1 trainable parameters, R = 81.838% FixedL2 — 1 trainable parameters, R = 79.932% DiscreteFixedBank · fixed_lp_1p5 — 1 trainable parameters, R = 78.945% DiscreteFixedBank · fixed_lp_2p5 — 1 trainable parameters, R = 78.324% DiscreteFixedBank · fixed_lp_3 — 1 trainable parameters, R = 75.821% DiscreteFixedBank · fixed_lp_3p5 — 1 trainable parameters, R = 73.229% FixedL1 — 1 trainable parameters, R = 72.544% DiscreteFixedBank · fixed_lp_4 — 1 trainable parameters, R = 70.862% FixedCosine — 1 trainable parameters, R = 55.259% ExtraQK — 32 trainable parameters, R = 30.702% GenericPairMLP · pair_mlp_h1 — 35 trainable parameters, R = 89.728% QK_LoRA_rank_sweep · lora_r2 — 64 trainable parameters, R = 46.668% ProjectedDot — 65 trainable parameters, R = 60.126% FullQK — 128 trainable parameters, R = 60.129% QK_LoRA_rank_sweep — 128 trainable parameters, R = 60.109% GenericPairMLP — 137 trainable parameters, R = 93.564% GenericPairMLP · pair_mlp_h4 — 137 trainable parameters, R = 93.544% GeoAFT · geo_dot — 1 trainable parameters, R = 51.093% GeoAFT · geo_cosine — 2 trainable parameters, R = 55.259% GeoAFT · geo_rq — 3 trainable parameters, R = 81.450% GeoAFT · geo_lp — 3 trainable parameters, R = 80.066% GeoAFT · geo_mahalanobis_r1 — 18 trainable parameters, R = 99.770% GeoAFT · geo_mahalanobis_r2 — 26 trainable parameters, R = 99.875% GeoAFT — 42 trainable parameters, R = 99.991% GeoAFT · geo_mahalanobis_r4 — 42 trainable parameters, R = 99.991% GeoAFT: 99.991% with 42 parameters Best other: GenericPairMLP, 93.564% with 137 Structured nonlinear target 0% 90% 99% 99.9% 99.99% 1 10 100 1k 10k Trainable parameters (log scale) CanonicalLp — 3 trainable parameters, R = 43.212% AxisWarp — 18 trainable parameters, R = 52.019% KernelMixture — 28 trainable parameters, R = 43.768% Mahalanobis — 42 trainable parameters, R = 87.402% BilinearKeyQuadratic — 65 trainable parameters, R = 87.710% FullQK — 128 trainable parameters, R = 61.171% QKLoRA — 128 trainable parameters, R = 61.131% PairMLP · pair_mlp_h16 — 545 trainable parameters, R = 98.248% NonlinearFeatureLp · feature_lp32 — 554 trainable parameters, R = 98.889% NonlinearFeatureLp — 1,062 trainable parameters, R = 99.323% NonlinearFeatureLp · feature_lp64 — 1,098 trainable parameters, R = 99.323% PairMLP · pair_mlp_h64 — 2,177 trainable parameters, R = 99.284% PairMLP — 8,705 trainable parameters, R = 99.539% GeoAFT — 46 trainable parameters, R = 99.934% GeoAFT · warped_open — 46 trainable parameters, R = 99.934% GeoAFT · warped_zero — 46 trainable parameters, R = 99.932% GeoAFT: 99.934% with 46 parameters Best other: PairMLP, 99.539% with 8,705 GeoAFT Generic learned scorer Structured control Fixed geometry or bank Q/K adaptation
Chart: for each of the three synthetic targets, every tested method is plotted by trainable parameters and oracle-gap recovery. GeoAFT variants reach the highest recovery among the plotted methods with tens of parameters or fewer; on the L_p target a fixed geometry bank is close behind, on the nonlinear target generic learned scorers come close with hundreds to thousands of parameters, and on the Mahalanobis target the exact bilinear-plus-key-quadratic control, which is not plotted, matched or slightly exceeded GeoAFT in all 25 paired cells. Learned Lp target 0% 90% 99% 99.9% 99.99% 1 10 100 1k 10k Trainable parameters (log scale) Oracle-gap recovery R DiscreteFixedBank — 1 trainable parameters, R = 99.779% DiscreteFixedBank · fixed_lp_2p5 — 1 trainable parameters, R = 95.324% FixedL2 — 1 trainable parameters, R = 95.320% DiscreteFixedBank · fixed_lp_3 — 1 trainable parameters, R = 93.763% FixedSquaredL2 — 1 trainable parameters, R = 92.064% DiscreteFixedBank · fixed_lp_1p5 — 1 trainable parameters, R = 91.829% DiscreteFixedBank · fixed_lp_3p5 — 1 trainable parameters, R = 91.694% DiscreteFixedBank · fixed_lp_4 — 1 trainable parameters, R = 89.607% FixedL1 — 1 trainable parameters, R = 82.185% FixedCosine — 1 trainable parameters, R = 63.508% ExtraQK — 32 trainable parameters, R = 14.473% GenericPairMLP · pair_mlp_h1 — 35 trainable parameters, R = 85.136% QK_LoRA_rank_sweep · lora_r2 — 64 trainable parameters, R = 29.009% BilinearKeyQuadratic — 65 trainable parameters, R = 92.060% ProjectedDot — 65 trainable parameters, R = 58.405% FullQK — 128 trainable parameters, R = 58.418% QK_LoRA_rank_sweep — 128 trainable parameters, R = 58.326% GenericPairMLP — 137 trainable parameters, R = 87.798% GeoAFT · geo_dot — 1 trainable parameters, R = 58.435% GeoAFT · geo_cosine — 2 trainable parameters, R = 63.508% GeoAFT — 3 trainable parameters, R = 99.983% GeoAFT · geo_rq — 3 trainable parameters, R = 95.250% GeoAFT · geo_mahalanobis_r1 — 18 trainable parameters, R = 92.063% GeoAFT · geo_mahalanobis_r2 — 26 trainable parameters, R = 92.063% GeoAFT · geo_mahalanobis_r4 — 42 trainable parameters, R = 92.063% GeoAFT: 99.983% with 3 parameters Best other: DiscreteFixedBank, 99.779% with 1 Mahalanobis target 0% 90% 99% 99.9% 99.99% 1 10 100 1k 10k Trainable parameters (log scale) Oracle-gap recovery R DiscreteFixedBank — 1 trainable parameters, R = 81.838% FixedL2 — 1 trainable parameters, R = 79.932% DiscreteFixedBank · fixed_lp_1p5 — 1 trainable parameters, R = 78.945% DiscreteFixedBank · fixed_lp_2p5 — 1 trainable parameters, R = 78.324% DiscreteFixedBank · fixed_lp_3 — 1 trainable parameters, R = 75.821% DiscreteFixedBank · fixed_lp_3p5 — 1 trainable parameters, R = 73.229% FixedL1 — 1 trainable parameters, R = 72.544% DiscreteFixedBank · fixed_lp_4 — 1 trainable parameters, R = 70.862% FixedCosine — 1 trainable parameters, R = 55.259% ExtraQK — 32 trainable parameters, R = 30.702% GenericPairMLP · pair_mlp_h1 — 35 trainable parameters, R = 89.728% QK_LoRA_rank_sweep · lora_r2 — 64 trainable parameters, R = 46.668% ProjectedDot — 65 trainable parameters, R = 60.126% FullQK — 128 trainable parameters, R = 60.129% QK_LoRA_rank_sweep — 128 trainable parameters, R = 60.109% GenericPairMLP — 137 trainable parameters, R = 93.564% GenericPairMLP · pair_mlp_h4 — 137 trainable parameters, R = 93.544% GeoAFT · geo_dot — 1 trainable parameters, R = 51.093% GeoAFT · geo_cosine — 2 trainable parameters, R = 55.259% GeoAFT · geo_rq — 3 trainable parameters, R = 81.450% GeoAFT · geo_lp — 3 trainable parameters, R = 80.066% GeoAFT · geo_mahalanobis_r1 — 18 trainable parameters, R = 99.770% GeoAFT · geo_mahalanobis_r2 — 26 trainable parameters, R = 99.875% GeoAFT — 42 trainable parameters, R = 99.991% GeoAFT · geo_mahalanobis_r4 — 42 trainable parameters, R = 99.991% GeoAFT: 99.991% with 42 parameters Best other: GenericPairMLP, 93.564% with 137 Structured nonlinear target 0% 90% 99% 99.9% 99.99% 1 10 100 1k 10k Trainable parameters (log scale) Oracle-gap recovery R CanonicalLp — 3 trainable parameters, R = 43.212% AxisWarp — 18 trainable parameters, R = 52.019% KernelMixture — 28 trainable parameters, R = 43.768% Mahalanobis — 42 trainable parameters, R = 87.402% BilinearKeyQuadratic — 65 trainable parameters, R = 87.710% FullQK — 128 trainable parameters, R = 61.171% QKLoRA — 128 trainable parameters, R = 61.131% PairMLP · pair_mlp_h16 — 545 trainable parameters, R = 98.248% NonlinearFeatureLp · feature_lp32 — 554 trainable parameters, R = 98.889% NonlinearFeatureLp — 1,062 trainable parameters, R = 99.323% NonlinearFeatureLp · feature_lp64 — 1,098 trainable parameters, R = 99.323% PairMLP · pair_mlp_h64 — 2,177 trainable parameters, R = 99.284% PairMLP — 8,705 trainable parameters, R = 99.539% GeoAFT — 46 trainable parameters, R = 99.934% GeoAFT · warped_open — 46 trainable parameters, R = 99.934% GeoAFT · warped_zero — 46 trainable parameters, R = 99.932% GeoAFT: 99.934% with 46 parameters Best other: PairMLP, 99.539% with 8,705 GeoAFT Generic learned scorer Structured control Fixed geometry or bank Q/K adaptation
Figure 4. Every tested method on the three synthetic targets. Each point is one method: its trainable parameters against its oracle-gap recovery R. 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 shown. On the Mahalanobis target the exact bilinear-plus-key-quadratic control is not plotted; it matched or slightly exceeded GeoAFT in all 25 paired cells. Hover a point for its details, or a legend entry to isolate that family. Counts are trainable parameters, not inference cost.

5Real tasks

On real tasks GeoAFT was used mostly as a score-level overlay: a frozen vision-language model and a strong few-shot classifier (the host) produce class scores, and GeoAFT adds a learned, gated residual to them. The test is whether this beats published results and, separately, whether the gain needs the geometry.

Remote-sensing few-shot

RSFS-8 · GeoRSCLIP ViT-B/32 · ProKeR host

84.48% at 1 shot

Result. 84.48 / 88.20 / 91.47 at 1/2/4 shots, above the best published rows over the same 8 datasets (82.33 / 86.58 / 89.53: TaskRes, CLIP-LoRA, CLIP-LoRA). A projected-dot control, which has no geometry, also cleared all three (84.17 / 87.99 / 90.81); under the rule fixed in advance the overlay led it by +0.27 points.

CLIP few-shot

CoOp, 11 datasets · CLIP ViT-B/16

0.33 to 0.44 points below

Result. The finalist overlay beat our in-harness reproductions of seven methods, but stayed below the published cached-feature bars on every registered endpoint (per shot 1/2/4/16: 0.82 / 0.32 / 0.06 / 0.36 points below).

Other tasks

Language, domain shift, biomedical

−0.611 pp on MRPC

Result. On GLUE MRPC an attention overlay on top of Q/K-LoRA scored below Q/K-LoRA alone (82.001 against 82.611). Domain generalisation and biomedical few-shot were also negative. On GLUE RTE the comparator could not be reproduced, so no comparison was run.

Chart: mean accuracy over the 8 RSFS datasets at 1, 2 and 4 shots. GeoAFT overlay 84.48, 88.20, 91.47; projected-dot control 84.17, 87.99, 90.81; best published row 82.33 (TaskRes), 86.58 (CLIP-LoRA), 89.53 (CLIP-LoRA). 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% Mean accuracy, 8 datasets (axis starts at 80%) 1-shot 82.33 TaskRes 84.48 84.17 2-shot 86.58 CLIP-LoRA 88.20 87.99 4-shot 89.53 CLIP-LoRA 91.47 90.81 GeoAFT overlay Projected-dot control Best published row
Chart: mean accuracy over the 8 RSFS datasets at 1, 2 and 4 shots. GeoAFT overlay 84.48, 88.20, 91.47; projected-dot control 84.17, 87.99, 90.81; best published row 82.33 (TaskRes), 86.58 (CLIP-LoRA), 89.53 (CLIP-LoRA). 80% 82% 84% 86% 88% 90% 92% Mean accuracy, 8 datasets (axis starts at 80%) 1-shot 82.33 TaskRes 84.48 2-shot 86.58 CLIP-LoRA 88.20 4-shot 89.53 CLIP-LoRA 91.47 GeoAFT overlay Projected-dot control Best published row
Figure 5. Remote-sensing few-shot, mean accuracy over 8 datasets. The GeoAFT overlay (teal), the projected-dot control without a geometry (grey) and the best published row at each shot (ochre line). The published rows use the benchmark authors’ own splits; ours are re-drawn.

6Mechanism study development data

The real-task gains raise an obvious question: is the geometry doing the work, or would something simpler do the same? Three studies with designs fixed in advance compared each arm with the simplest control that could explain it. They ran on development splits only, and their results are descriptive. No geometry-specific improvement was demonstrated in the tested settings, and the mechanisms behind the remaining increments were not identified.

Fixed class keys

CoOp core-8 · CLIP ViT-B/16 and L/14 · CMPt host

Control. A class bias, one number per class.

Result. The bias alone came within 0.08 pp (B/16) and 0.04 pp (L/14) of the finalist overlay, whose total gains were +0.54 and +0.36 pp. The projected-dot increment over the bias lay within ±0.30 pp.

Attention path

Last layer of CLIP ViT-B/16 · DTD and EuroSAT

Control. Random coordinates, the dot product at the same projection, and Q/K-LoRA.

Result. An L1 overlay trained alone gained +5.32 pp (DTD) and +30.31 pp (EuroSAT) over zero-shot. Random coordinates removed 91% of the gain; replacing L1 by the dot removed 15%. On top of Q/K-LoRA no overlay gain was observed.

Neighbour graphs

Remote-sensing few-shot · LC-TIM graph

Control. A sum of the two encoders’ similarities instead of their product.

Result. With a DINOv2 second view, the product graph minus the sum graph was −0.05 pp [−0.10, +0.01], short of the registered +0.30 pp product advantage.

Chart: Projected dot over a class bias (ViT-B/16) +0.08 pp, 95% interval -0.07 to +0.23; Projected dot over a class bias (ViT-L/14) +0.04 pp, 95% interval -0.12 to +0.20; L1 overlay on top of Q/K-LoRA (DTD) +0.35 pp, 95% interval -1.66 to +2.37; L1 overlay on top of Q/K-LoRA (EuroSAT) +0.21 pp, 95% interval -0.58 to +1.01; Product minus sum graph (RS-sel) -0.05 pp, 95% interval -0.10 to +0.01; Product graph minus LC-TIM (RS-sel) +0.36 pp, 95% interval -0.45 to +1.17; L1 overlay alone minus Q/K-LoRA (DTD) -3.72 pp, 95% interval -10.03 to +2.58; L1 overlay alone minus Q/K-LoRA (EuroSAT) -2.49 pp, 95% interval -10.32 to +5.33.Increment over the simpler control −2 −1 0 +1 +2 Projected dot over a class bias ViT-B/16 · fixed class keys Projected dot over a class bias ViT-L/14 · fixed class keys L1 overlay on top of Q/K-LoRA DTD · attention, last layer L1 overlay on top of Q/K-LoRA EuroSAT · attention, last layer Product minus sum graph RS-sel · neighbour graph, DINOv2 proxy Product graph minus LC-TIM RS-sel · neighbour graph, DINOv2 proxy Against equal-parameter Q/K-LoRA −10 −5 0 +5 L1 overlay alone minus Q/K-LoRA DTD · post hoc L1 overlay alone minus Q/K-LoRA EuroSAT · post hoc Arm minus control, pp of accuracy · dot: mean · bar: 95% interval
Chart: Projected dot over a class bias (ViT-B/16) +0.08 pp, 95% interval -0.07 to +0.23; Projected dot over a class bias (ViT-L/14) +0.04 pp, 95% interval -0.12 to +0.20; L1 overlay on top of Q/K-LoRA (DTD) +0.35 pp, 95% interval -1.66 to +2.37; L1 overlay on top of Q/K-LoRA (EuroSAT) +0.21 pp, 95% interval -0.58 to +1.01; Product minus sum graph (RS-sel) -0.05 pp, 95% interval -0.10 to +0.01; Product graph minus LC-TIM (RS-sel) +0.36 pp, 95% interval -0.45 to +1.17; L1 overlay alone minus Q/K-LoRA (DTD) -3.72 pp, 95% interval -10.03 to +2.58; L1 overlay alone minus Q/K-LoRA (EuroSAT) -2.49 pp, 95% interval -10.32 to +5.33.Increment over the simpler control −2 −1 0 +1 +2 Projected dot over a class bias ViT-B/16 Projected dot over a class bias ViT-L/14 L1 overlay on top of Q/K-LoRA DTD L1 overlay on top of Q/K-LoRA EuroSAT Product minus sum graph RS-sel Product graph minus LC-TIM RS-sel Against equal-parameter Q/K-LoRA −10 −5 0 +5 L1 overlay alone minus Q/K-LoRA DTD L1 overlay alone minus Q/K-LoRA EuroSAT Arm minus control, pp of accuracy · dot: mean · bar: 95% interval
Figure 6. Each arm minus its control, in percentage points of accuracy. Dots are means and bars are 95% intervals. Top: increments over the simpler control; the shaded band behind the two fixed-key rows is their ±0.30 pp equivalence margin, fixed in advance; no equivalence test was run for the other rows. Bottom: the L1 overlay trained alone against Q/K-LoRA with the same number of trainable parameters, computed after the main results were read and with no registered threshold; the overlay more often stopped at its step budget (§8). The graph rows study LC-TIM’s neighbour graph, not a GeoAFT overlay.

7What 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.

  1. Schematic: two different score formulas produce identical attention after softmax. −(q−k)ᵀM(q−k) 2qᵀMk − kᵀMk same attention

    Exact reparameterization

    Established analytically

    The geometry describes a function a conventional scorer already represents. Mahalanobis is the example.

  2. Schematic: a 46-parameter structured geometry and an 8,705-parameter generic scorer fit the same target almost equally well. 46 8,705 near-identical fit

    Economical parameterization

    Supported in controlled experiments

    The same useful interaction, or a close approximation, with far fewer trained parameters.

  3. Schematic: a compatibility pattern produced by a structured geometry that a restricted low-rank Q/K family may not reach. geometry ≠ rank-r Q/K out of reach?

    Distinct adaptation capacity

    Not shown on real tasks

    Changes a restricted conventional family cannot reach. On the real tasks tested so far, this was not demonstrated.

8Limitations and what didn’t work

Scope

  • Synthetic tasks. The results recover known relations on fixed representations. The nonlinear teacher favours the matching geometry by construction, and flexible generic learners also approximated it well. They are not natural-task results.
  • Remote-sensing result. A scoped result relative to the original published rows under a protocol fixed in advance: 8 of the 10 RSFS datasets, re-drawn splits (the authors’ splits cannot be reproduced), 1, 2 and 4 shots only, and one backbone. It compares point estimates with published numbers, with no interval. Our zero-shot accuracy sat +2.93 points above the published zero-shot, inside the ±3.0 sanity gate by 0.07 and larger than the 2- and 4-shot margins. The +2.08-point gain over the host is also produced by generic controls. Under the rule fixed in advance the overlay led the projected-dot control by +0.27 points, a small margin from one benchmark, and the matched pair with the same projection was not superior.
  • Mechanism study. Development data only, and descriptive. It ran one test look: a reproduction of five published baselines on the already-used RSFS-8 test splits. No GeoAFT method was scored on a test split, and no confirmation was run.

What the evidence does not show

  • Superiority on synthetic targets. None of the pre-registered superiority gates passed. The learned Lp overlay beat the ten-member fixed bank by 0.20 rather than the required 2 points of gap closure (20 of 25 paired cells). The exact quadratic control matched or slightly exceeded the Mahalanobis overlay in 25 of 25 paired cells. On the nonlinear target the 0.40-point lead over the pair MLP is below the registered 2-point gate: economy, not superiority.
  • Published bars on CLIP few-shot. The finalist did not exceed the published cached-feature bars; it was 0.33 to 0.44 points below them on the registered endpoints, and below at every shot (1/2/4/16: 0.82 / 0.32 / 0.06 / 0.36).
  • Fixed class keys. For the in-sample CMPt host, the projected-dot increment over a class bias was equivalent to zero within ±0.30 pp (TOST, 90% bounds [−0.04, +0.20] and [−0.09, +0.17], against total gains of +0.54 and +0.36 pp). The margin is about the size of the effect being split, and the statement does not extend to other hosts. Projected L1 had no positive point estimate above +0.03 pp over the projected dot on the three hosts tested; 6 of 12 strata are not resolved, for one geometry at rank 16 and a training recipe selected for the dot family.
  • Attention path. The L1 overlay’s gain was coordinate-specific, not geometry-specific, under the rule fixed in advance. These are interventions at a fixed trained endpoint, not a comparison of the best solutions each geometry could reach. Post hoc, with no registered threshold, an equal-parameter Q/K-LoRA (12,288 against 12,300 trainable parameters) was ahead in point estimate: L1 overlay minus Q/K-LoRA −3.72 pp [−10.03, +2.58] on DTD and −2.49 pp [−10.32, +5.33] on EuroSAT. The overlay stopped at its 300-step budget in 3 of 6 cells against 1 of 6 for Q/K-LoRA, so under-training of the overlay is not excluded. On top of Q/K-LoRA every per-dataset interval spans zero, with point gains between −0.29 and +0.41 pp; the smallest detectable effect is above 0.30 pp, so “not observed” is not “no effect”. Only the last layer and two datasets were tested.
  • Neighbour graphs. Under the descriptive rule, adopted after earlier results on the same development data and the native test look had been read, the product-compatibility criterion was not met: product minus sum graph −0.05 pp [−0.10, +0.01] (no equivalence test was run; −0.04 [−0.11, +0.02] when the two RSICB datasets count as one). The product graph’s increment over LC-TIM, +0.36 pp [−0.45, +1.17] (5/10 datasets positive), is not resolved. The DINOv2 proxy neither reproduces nor refutes the published LC-TIM+DINO, which uses satellite-pretrained DINOv3 weights that are gated and were not obtained.
  • Other natural tasks. On GLUE MRPC the overlay on a fixed Q/K-LoRA endpoint scored below it (difference −0.611 pp, [−1.069, −0.152], 0 of 5 wins), and calibration did not rescue it. Domain generalisation (no gain over the native ProKeR host) and biomedical few-shot (below BiomedCoOp) were negative. On GLUE RTE the strongest located attention-map comparator could not be reproduced in three reconstructions (the first collapsed to majority-class prediction); that is a reproduction blocker, not a GeoAFT result. Earlier versions of the method lost to tuned Q/K-LoRA on hierarchical text classification.
  • 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.

Implementation and reproducibility

  • Efficiency. Trainable-parameter counts are not inference cost. No accuracy–compute trade-off is claimed until compatible measurements of time, throughput and memory exist.
  • Splits and data. The authors’ splits for 9 of the 10 RSFS datasets are not recoverable, so ours are re-drawn instances. Much of the raw evidence of the mechanism study is stored outside the code repository, under a hashed manifest, and some historical prediction archives are not available locally.

9Next studies and future directions

The mechanism study narrows where to look next. It tested fixed class keys, one attention layer and neighbour graphs; it did not test open keys, mid-layer placements or other training recipes.

  1. Do geometries matter where the keys are open? Coming soon

    In image-text retrieval every document is a new key and ranking is the score, so a pair geometry has room to differ from a projected dot product. The first study is remote-sensing retrieval on RSICD and RSITMD, after a leakage audit (one benchmark’s images come from the other, and RemoteCLIP was trained on both training splits) and with a per-document bias control, the analogue of the class bias above.

  2. Can a graph metric reach the oracle’s headroom?

    On remote-sensing few-shot development data, oracle neighbour graphs leave several points of headroom over cosine neighbours, and no label-free metric reached it. A label-efficient metric, such as a support-fitted whitening, is the next arm, tested against two-encoder and dose-matched controls. LC-TIM+DINO with the published satellite encoder has a design fixed in advance and runs once the weights are available Coming soon.

  3. Would other placements or recipes change the reading?

    Only the last attention layer was tested, and the fixed-key study used one inherited recipe in which the gated terms start with little gradient. Mid-layer placements and recipes that train the geometry from the first step remain open, as does a study of host redundancy and optimisation that is already designed.

Longer term, the programme asks the same question across richer geometry families (spherical, hyperbolic, mixed-curvature, local-metric and learned-kernel), geometries that depend on the input, layer or head, and latent-prediction and compressed models, each paired with a control that asks whether it compiles into an ordinary representation or score update.

How it is judged

  1. Tested, syntheticIdentifiability Can the geometry recover a known relation? Yes, almost exactly.
  2. Tested, real tasksFunctional necessity Does changing the relation improve prediction on frozen features? Gains over the host appeared; margins over controls without the geometry were small (RSFS-8) or not demonstrated (mechanism study).
  3. Tested, developmentComplementarity Does a gain survive equal-budget Q/K-LoRA? No overlay gain on top of Q/K-LoRA was observed.
  4. Partly testedRegime dependence Overlay gains were largest on the zero-shot and untuned hosts; architecture, scale and compression are untested.

Part 3 · Technical details

10Notation and definition

For token states xi, one attention head forms queries qi=WQxi and keys kj=WKxj, and scores each pair with the scaled dot product

sbase(qi,kj)=qi⊤kjd,Aij=softmaxj∈𝒱(i)sbase(qi,kj),

where 𝒱(i) is the set of keys that query i may attend to (its causal or padding mask). Most PEFT changes (WQ,WK)→(WQ+ΔWQ, WK+ΔWK) and leaves s unchanged. GeoAFT adds a structured, trainable residual to the score:

Sij=sbase(qi,kj)+αhc(gϕ(Pqqi,Pkkj)−1|𝒱(i)|∑j′∈𝒱(i)gϕ(Pqqi,Pkkj′)),j∈𝒱(i),

with Sij=−∞ for j∉𝒱(i) and Aij=softmaxjSij. Here:

  • Pq,Pk∈ℝm×d are low-dimensional projections into the space where the geometry acts;
  • gϕ is a structured geometry family with parameters ϕ, such as a metric or an exponent;
  • c>0 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;
  • αh is a per-head gate, initialized at 0.

GeoAFT can be used on its own, with WQ and WK frozen, or alongside a conventional Q/K adapter. In the score-level overlay the queries are image features and the keys are class prototypes, and the native score is the host classifier’s logit.

Earlier version. 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.

11Families, centring and masks

With u=Pqq and v=Pkk, the families used in the controlled experiments are:

Familygϕ(u,v)Trainable ϕRelation to dot-product scoring
Learned Lp−‖u−v‖pexponent p (bounded); optionally projectionsNot a bilinear form in general. With p=1 it can produce centred patterns of maximal rank (§12).
Mahalanobis−(u−v)⊤LL⊤(u−v)factor LSoftmax-equivalent to bilinear plus key-quadratic (§12)
Structured nonlinearcompact nonlinear compatibilitya few dozen parameters (46 in the reported run)Compared against a generic pair-MLP 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 αh=0, Sij=sbase(qi,kj) 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, softmaxj∈𝒱(i)(Sij+bi)=softmaxj∈𝒱(i)(Sij). Centring the geometry branch over 𝒱(i) removes exactly this unidentifiable component. Masked positions are excluded from the mean, so centring never mixes valid and invalid keys.

12Q/K versus score adaptation

Q/K adaptation does change attention scores, through the bilinear form WQ⊤WK. With low-rank updates of rank rQ and rK,

(WQ+ΔWQ)⊤(WK+ΔWK)−WQ⊤WK=WQ⊤ΔWK+ΔWQ⊤WK+ΔWQ⊤ΔWK,

which has rank at most rQ+rK. A structured geometry is not restricted in this way: for N distinct points on a line, the row-centred L1 score matrix [−|xi−xj|] has rank N−1, the maximum possible after centring.

An exact equivalence. Not every geometry is new capacity. Squared Mahalanobis expands as

−(q−k)⊤M(q−k)=2q⊤Mk−k⊤Mk−q⊤Mq,

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 M=I, and cosine is a dot product of normalized vectors. With fixed class keys the same expansion turns a key-only term into a per-class bias, which is why the mechanism study compares every overlay with a class-bias arm.

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.

13Protocol, 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.

R=Lbase−LmethodLbase−Loracle,L=𝔼iKL(Ai·target‖Ai·method).

Lbase is the loss of the unadapted model and Loracle is the oracle reference loss. Normalizing by the gap makes results comparable across targets whose raw KL scales differ. The real-task studies fix the model, splits, comparators, seeds and decision rule before any result is read, select on validation data, and report equal-dataset means with random-dataset intervals.

ComparatorQuestion it answers
Q/K adaptation (LoRA ranks; full Q/K)Can conventional representation adaptation reach the same relation by moving q and k?
Fixed geometry / geometry bankIs 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-dotIs the gain due to the extra projections Pq,Pk rather than to the geometry acting on them?
Class biasWith fixed class keys, does the overlay do more than shift each class’s score by a constant?
Exact structural controlsDoes the family add anything beyond its known equivalent score family (§12)?
TargetComparisonResultNote
Learned Lp and MahalanobisGeoAFTR = 99.983% (Lp); 99.991% (Mahalanobis)Near-oracle recovery on both targets
vs Q/K-LoRAGeoAFT ahead by 39.9–41.7 points of RRange across the two targets; at the tested budgets
vs tested pair-MLPsGeoAFT ahead by 6.4–12.2 pointsRange across the two targets
vs fixed geometry and exact controls0.20 points over the Lp bank; below the exact quadratic control in 25 of 25 cellsSuperiority gates not met (§8)
NonlinearGeoAFT (46 trainable parameters)R = 0.999342915/15 paired wins for GeoAFT; the 0.40-point difference in R is below the registered 2-point gate. About 189× fewer trainable parameters than the pair MLP.
Pair MLP (8,705 trainable parameters)R = 0.9953917
RSFS-8, mean accuracy (%)1 shot2 shots4 shots
GeoAFT overlay on ProKeR (selected arm)84.4888.2091.47
Projected-dot control84.1787.9990.81
Best published row82.33 (TaskRes)86.58 (CLIP-LoRA)89.53 (CLIP-LoRA)

Results by study, with every interval, are listed in §8. In the native-baseline reproduction look (GeoRSCLIP ViT-B/32), our 8-dataset means of TIM++ and LC-TIM lay within 0.34 and 1.39 pp of the published means at every shot, on a re-drawn split instance.

Summary

14In brief

Design

A gated residual adds a trainable distance, such as L1, learned Lp or Mahalanobis, to the score a model already uses to match queries with keys. Its gate starts closed, so the adapted model begins as the pretrained one, and queries and keys are left untouched.

Results

On synthetic tasks with a known target relation, the overlay closed more than 99.9% of the gap to the oracle. On remote-sensing few-shot, in a scoped comparison, the overlay passed the best published rows at 1, 2 and 4 shots, and so did the same overlay with a plain dot product in place of the geometry.

Open questions

Whether a geometry carries information where keys are open, as in retrieval, whether mid-layer placements or other training recipes behave differently, and what produces the increments that remain. Details are under Limitations and what didn’t work.

15Sources

Accepted Research

Related projects

AI Native Workflow, GeoAttention

The real-task and mechanism results come from the project’s second manuscript draft, its claim ledger and the study reports of November 2026, which are not yet public. The synthetic results come from the project’s controlled-task reports of October 2026.

Back to top ↑