When a model trained on one family of documents, such as English forms or scientific tables, is moved to another family, such as Chinese financial tables or Portuguese forms, two things change. The absolute appearance of every element changes: different words, fonts, and cell borders. The relational structure of the page changes far less: a key still sits beside its value, and a header still governs the column below it. This proposal tests whether few-shot adaptation should explicitly protect that relational structure. The method keeps a frozen copy of the source model as a teacher. On unlabeled target pages, the adapting model is trained to reproduce the teacher's pattern of which nearby elements resemble which. It does not reproduce the teacher's features or predictions. The few labeled target examples are then free to move the absolute features.
The bet behind this is that, under layout shift, "who resembles whom among spatial neighbors" transfers better than "what each element looks like." The bet can be checked directly before any method is built. If it holds, structure preservation should regularize few-shot fine-tuning better than the usual choices: freezing weights, adding low-rank adapters, or self-distilling soft labels. We test this on multilingual forms and cross-domain tables as the main setting. Few-shot satellite object detection is a stress test where the viewpoint shift is far more severe.
Core Claim
The proposal borrows the "local structure preserving" loss from graph distillation and repurposes it. In Distilling Knowledge From Graph Convolutional Networks, a student network learns to match the teacher's distribution of similarities between each node and its graph neighbors. That paper uses the loss to compress a large teacher into a small student within one fixed domain, on protein graphs and point clouds.
We use the same kind of loss for a different purpose: as the regularizer that keeps a model stable while a handful of labels pull it into a new layout domain. The teacher and student have the same architecture. The teacher is the source-domain model, and the graph is built from 2D page geometry.
The claim is falsifiable in two places. First, neighborhood similarity distributions should shift measurably less across domains than absolute embeddings. Second, matching them should beat logit-level and feature-level self-distillation at equal labels and compute. If the first part fails, the method has no reason to work, and we would report that instead of tuning around it.
Mechanism
Every layout element $i$ gets a neighborhood $N(i)$. An element is a word box or entity on a form, a cell in a table, or a detected region in a satellite tile. $N(i)$ contains the $k$ nearest elements by 2D box-center distance, joined with the $k$ nearest under the student's current feature similarity. This "union of edges" trick, also borrowed from Distilling Knowledge From Graph Convolutional Networks, stops the student from escaping the constraint by reshaping its own neighborhoods. The objective is
$$ \mathcal{L} = \mathcal{L}_{\text{sup}}(D_{\text{lab}}) + \lambda \sum_{x \in D_{\text{unl}}} \sum_{i \in x} \mathrm{KL}\!\left(p^{T}_{i} \,\|\, p^{S}_{i}\right), \qquad p^{M}_{i}(j) = \frac{\exp(\cos(h^{M}_i, h^{M}_j)/\tau)}{\sum_{l \in N(i)} \exp(\cos(h^{M}_i, h^{M}_l)/\tau)}. $$
The symbols are as follows. $\mathcal{L}_{\text{sup}}$ is the ordinary task loss on the $k$-shot labeled target set $D_{\text{lab}}$. $D_{\text{unl}}$ is the pool of unlabeled target pages. $h^{M}_i$ is the hidden representation of element $i$ under model $M$, which is either the frozen teacher $T$ or the adapting student $S$. $\tau$ is a temperature, and $\lambda$ weights the structure term.
The loss deliberately leaves each element's position in feature space unconstrained and pins only its relative similarity to its spatial neighbors. Federated Graph Semantic and Structural Learning supports this design choice. It reports that aligning a node's raw features with its neighbors' hurts, because neighbors often belong to different classes, while matching similarity distributions does not. On a form, a key and its value are neighbors with different labels, which is exactly the situation that paper describes.
We also test one variant. It weights each element's term by the inverse entropy of the teacher's neighborhood distribution. This lets the student override teacher structure that the teacher itself is unsure about, which matters where the layout genuinely differs between domains.
Research Program
The program has three stages.
The first stage is diagnostic. We take source-trained models and measure two quantities on paired source and target corpora. The first is the drift of absolute element embeddings, measured as centered kernel alignment between matched element types. The second is the drift of neighborhood similarity distributions, measured as mean KL divergence between the source and target distributions of matched relation types (key→value, cell→same-row cell). We do this for three shifts of increasing severity: English→other languages on XFUND, scientific→financial tables, and natural→overhead imagery. The hypothesis predicts that relational drift is small for the language shift, moderate for the table shift, and possibly not small for the overhead shift. The method should help roughly in proportion to that gap.
The second stage is the adaptation study, at 1, 5, and 20 labeled target examples with a fixed unlabeled pool.
The third stage asks whether a richer notion of structure adds anything. In place of similarity matching, we try the gradient-of-output-with-respect-to-adjacency attribution maps from Amalgamating Knowledge From Heterogeneous Graph Neural Networks, which record which edges the teacher actually relied on. That paper used these maps only for amalgamating teachers on citation graphs and point clouds. They are expensive, so this stage runs only if stage two shows a gain worth refining.
The main testbed is forms. The source model is LayoutXLM fine-tuned on English FUNSD, and the targets are the seven XFUND languages from XFUND. We evaluate both entity labeling and key-value relation extraction. XFUND reports that layout features carry over across languages; that finding motivates the diagnostic but does not settle how to adapt with a few labels. Annotation there is expensive, about 1,500 hours for 1,393 forms, so the few-shot regime is the realistic one.
The second document testbed is table structure. A GFTE-style graph parser from GFTE is trained on SciTSR and adapted to FinTab. GFTE reports noticeable degradation on this transfer and describes the shift as one of vocabulary and formatting.
The stress test is DIOR few-shot detection with GLIP. Region features form the elements, and the neighborhood structure is inter-object spatial context, such as ships beside harbors or airplanes on aprons. Overhead imagery changes perspective, scale, and rotation statistics, as documented by VRSBench. The source teacher's structure may simply be wrong there, and finding out whether it is wrong is itself informative.
Baselines
The naive reference point is the source model applied with no target labels. On XFUND, cross-lingual transfer of LayoutXLM trained on English averages 0.6115 F1 as reported in XFUND. Full-data training reaches 0.8282 F1 for entity labeling and 0.7206 F1 for relation extraction, which bound the gap a few-shot method can close. On DIOR, zero-shot GLIP reaches 0.04 mAP according to How to Efficiently Adapt Foundation Models to Remote Sensing for Object Detection?. For SciTSR→FinTab, no reported result was found on Lacuna for absolute GFTE accuracy, so we will rerun GFTE ourselves for both the naive and fine-tuned reference.
The strongest existing low-label method in this material is full fine-tuning. On DIOR, the same Barbier et al. paper reports 0.37 mAP for full-tuning GLIP at 10 shots, and finds it beats low-rank adapters and prompt tuning in the 2–5 shot range. We therefore run full fine-tuning and low-rank adapters (LoRA) on every testbed, using identical labeled sets, three random draws of the shots, and the same number of optimizer steps. Each gets the same hyperparameter search budget as our $\lambda$ and $\tau$ search: twelve configurations selected on a held-out target validation split of matching size.
The most dangerous competitor is soft-label self-training on the same unlabeled pool, in the style of Self-Training Based Few-Shot Node Classification by Knowledge Distillation. That method distills softened teacher predictions to avoid the confirmation bias of hard pseudo-labels; it was shown on citation graphs, not page layouts. We pair it with a feature-MSE anchor to the frozen teacher. Our method uses exactly the same unlabeled data and teacher, so any gain is attributable to what is matched, not to extra data.
Two ablations isolate the key ingredient. The first keeps the loss but replaces spatial neighborhoods with random elements from the same page. This tests whether 2D locality, rather than generic relational distillation, matters. The second keeps spatial neighborhoods but uses the generic pretrained model, not the source-fine-tuned one, as teacher. This tests whether task-specific structure is what transfers.
Beating the strongest competitor means a gain over the better of full fine-tuning and soft-label self-training that exceeds the spread across shot draws at 1 and 5 shots on XFUND relation extraction. Relation extraction is the metric most directly about structure. A gain of at least 0.02 F1 averaged over languages is what we would treat as worth reporting.
Why not just…?
Why not just fine-tune the whole model, or add low-rank adapters, on the few labeled examples? Full fine-tuning is the real incumbent. It is also the setting where our regularizer is meant to live, not a rival to it. Barbier et al. show adapters collapse at 2–5 shots on overhead detection, but full-tuning is far from the 0.75 mAP full-data result at 10 shots, which leaves a large gap. CAT-SAM complicates the picture. It shows that a tiny decoder-conditioned bridge into a frozen encoder beats low-rank adapters on aerial segmentation at one shot (85.2% versus 79.3% mIoU averaged over its benchmarks). So "freeze and condition" is a credible alternative regularizer, and on DIOR we will include a decoder-conditioned variant where the architecture permits. If plain full fine-tuning with tuned early stopping matches our method, the structure term adds nothing, and the experiments will show that directly.
Why not just self-distill the teacher's soft predictions or features on the unlabeled pages? This is the alternative most likely to work as well, and it is why it is the main baseline rather than a footnote. The case against it is specific. Logit distillation copies the teacher's source-domain label beliefs, which are exactly what is wrong under shift. Feature-MSE pins absolute positions that should move; Federated Graph Semantic and Structural Learning found direct feature alignment harmful for this reason. If stage one shows relational drift is no smaller than feature drift, we expect no advantage. At that point the honest conclusion is that soft-label self-training suffices.
Why not rely on the 2D coordinate embeddings that layout transformers already have? Models such as DocFormer and LayoutXLM already see box coordinates, and we keep them. The question here is not how to represent layout but what to protect during adaptation. Coordinates are inputs, and nothing stops few-shot updates from rewiring how the model uses them. GFTE's 10% and 5% gains from explicit relational edges over positions alone suggest that relational structure is not automatically exploited. The random-neighborhood ablation tests the narrower point that spatial locality is what matters.
Why not generate synthetic target pages instead? Synthetic data needs heavy verification in these domains: VRSBench needed over 1,000 hours of human review. It also presupposes knowing the target layout distribution, which is what is scarce. We treat it as complementary and do not test it here.
Decisive Checks
The first check is the stage-one diagnostic. If neighborhood distributions on XFUND drift as much as absolute embeddings, we stop.
The second check is the head-to-head against soft-label self-training at 1 and 5 shots on XFUND relation extraction, under matched data and tuning. The method must win by more than the variance across shot draws.
The third check is whether the size of the gain tracks measured relational drift across the three shifts. We would expect the largest benefit on language shift, less on SciTSR→FinTab, and possibly none or harm on DIOR. The entropy-weighted variant should recover most of any harm on DIOR. A gain that tracks drift supports the mechanism. A uniform gain across all three would suggest a generic regularization effect that a simpler method could reproduce.
References
- Distilling Knowledge From Graph Convolutional Networks
- Federated Graph Semantic and Structural Learning
- Amalgamating Knowledge From Heterogeneous Graph Neural Networks
- XFUND: A Benchmark Dataset for Multilingual Visually Rich Form Understanding
- GFTE: Graph-Based Financial Table Extraction
- VRSBench: A Versatile Vision-Language Benchmark Dataset for Remote Sensing Image Understanding
- How to Efficiently Adapt Foundation Models to Remote Sensing for Object Detection?
- Self-Training Based Few-Shot Node Classification by Knowledge Distillation
- CAT-SAM: Conditional Tuning for Few-Shot Adaptation of Segment Anything Model
- DocFormer: End-to-End Transformer for Document Understanding