Asking Old Questions: Query Distillation for Federated Continual Extraction

Hospitals, law firms, and companies each hold private documents that they would like to mine for entities, clauses, and relations. They cannot pool that text. Each one also annotates a different set of labels, and each keeps adding new labels and new document types over time. Current federated extraction systems predict one label per token. That design has a known failure. When a client never annotated "Disease", its disease mentions are trained as "not an entity", and that silent contradiction must be repaired afterward with pseudo-labels from a teacher model, with class prototypes, and with detectors for when a client's task has changed.

This note proposes a different route. It rewrites extraction as reading comprehension. The model receives a natural-language question, such as the annotation guideline's definition of "Disease", together with a passage, and points to the start and end of each answer span. Under this formulation, a client that never annotated a label simply never asks that question, so its missing labels create no contradiction. Remembering old labels also becomes cheap. The questions are public text, so any client can pose last year's questions to last year's global model on this year's private documents and train the current model to give the same answers. No stored data, feature prototypes, or domain identifiers are needed. We call this query distillation. The central question is whether the query formulation alone, or with query distillation added, removes most of the forgetting that current federated extraction methods fight with heavier machinery.

Core Claim

Forgetting in federated continual extraction has two separable sources. Schema forgetting comes from label inventories that differ across clients and grow over time. Domain forgetting comes from drift in the text itself. The claim has two parts. First, a query-conditioned span extractor trained with plain federated averaging and a loss restricted to each client's own questions should remove most schema forgetting on its own. Second, the domain forgetting that remains can be controlled without growing the architecture, by distilling the previous global model's start and end distributions on past questions over current local text.

Concretely, client $c$ with locally annotated question set $Q_c$ and previously seen question set $Q_{old}$ minimizes

$$ \mathcal{L}_c = \sum_{q \in Q_c} \mathrm{CE}\big(y_q,\ p_\theta(\cdot \mid q, x)\big) + \lambda \sum_{q \in Q_{old} \setminus Q_c} \mathrm{KL}\big(p_{\theta_{t-1}}(\cdot \mid q, x)\ \|\ p_\theta(\cdot \mid q, x)\big). $$

Here $x$ is a local passage and $y_q$ is its gold span for question $q$. $p_\theta$ is the current model's pair of start and end distributions, and $\theta_{t-1}$ is the frozen global model from the previous stage. $\mathrm{CE}$ is cross-entropy, $\mathrm{KL}$ is Kullback–Leibler divergence, and $\lambda$ weights retention. The server can see which questions exist, because schemas are public even when data is not. It therefore knows exactly when the schema changes and does not need to infer task changes from prediction entropy.

Relation to Prior Work

Four papers motivate the gap. Federated Incremental Named Entity Recognition handles new classes arriving at federated clients with three components: an entropy-based server detector for task change, pseudo-labeling guided by class prototypes, and distillation of relations between prototypes. All of these sit on a token-level head, and its own ablations show pseudo-labeling is load-bearing, with up to 14.41% Micro-F1 lost without it. Federated Domain Adaptation for NER via Distilling with Heterogeneous Tag Sets handles clients with disjoint tag sets by having a global teacher fill in missing annotations. On OntoNotes 5.0 its average F1 is 61.22 with distillation and 47.91 without.

We read that 13-point gap as the cost of the background-label contradiction. Under our hypothesis, the gap should largely disappear once extraction is posed as questions. If it does not, the hypothesis is wrong, and the experiments below are built to show that either way. SpanKL supplies the closest mechanism. It replaces token tagging with independent per-type binary span classifiers plus a Bernoulli KL distillation loss, and nearly closes the gap to joint training in centralized continual NER. We move that idea to a federated setting, replace exhaustive span enumeration with question conditioning, and distill pointer distributions per question.

Continual Domain Adaptation for Machine Reading Comprehension constrains the proposal. It shows that reading-comprehension models still forget under domain drift, with up to a 15.1% F1 drop. Its best fix, ProgBERTQA, avoids forgetting by adding one adapter per domain, which grows parameters linearly and needs the domain identity at test time. This is why we do not claim the query formulation fixes domain forgetting. We add query distillation for that part and compare it directly against adapter growth.

Two lines of work supply the query design. Improving biomedical NER using entity definition information found that guideline definitions used as questions raise PharmaCoNER micro-F1 to 0.9137, a significant gain of about 1 point over the same model without definitions. CUAD poses 41 legal clause types as questions. FedQAS shows that federated averaging of an extractive QA model is workable, but only on an independently and identically distributed split of SQuAD. Its reported Exact Match of 0.81 alongside an F1 of 0.33 violates the usual rule that F1 is at least Exact Match, so we use standard SQuAD-style scoring and do not treat its numbers as a reference.

The multi-task literature is used here as a diagnostic lens rather than as the core method. Each question is a task sharing one encoder. RotoGrad attributes negative transfer to tasks with unequal gradient sizes and to gradients pointing in opposing directions. It fixes these with magnitude rescaling and task-specific rotations, but only in centralized vision settings.

Research Program

We will build one query-conditioned span extractor. It uses a BERT-base encoder, to match ProgBERTQA and FedQAS, with a small trainable adapter so that each communication round carries a parameter budget comparable to the roughly 7% communicated by LightNER. Every label is represented by its guideline definition as the question. Each client trains only on its own questions. The server runs federated averaging over adapter weights and, at each stage boundary, freezes the previous global model to serve as a teacher.

The analysis has three parts. First, we decompose forgetting by constructing streams that change only the schema, streams that change only the domain, and streams that change both. This shows how much of each kind the query formulation removes on its own. Second, we measure the cosine similarity between gradients of different questions, both within a client and across clients. This tells us whether conflict between questions is actually a bottleneck. We will add RotoGrad-style magnitude homogenization across questions only if the measured conflict is frequently negative. Third, we report the cost that sceptics raise first: asking $K$ questions takes $K$ encoder passes per passage. We will measure wall-clock inference against the token-level baselines and test one mitigation, which is batching all questions against a shared passage.

Baselines

The naive reference point is a query-conditioned extractor trained with plain federated averaging, loss restricted to local questions, and no distillation. This is also the key ablation. If it matches the full method, then the reformulation, not query distillation, carries the result, and we will report exactly that. A second naive point is sequential federated fine-tuning with no retention mechanism, the analogue of the BASE model in the continual reading-comprehension paper, which scored an F1 sum of 478.78 on CDA-Q.

The strongest competitor for heterogeneous tag sets is the teacher-distillation method of Federated Domain Adaptation for NER. It is the most direct attack on the same problem, and it reports an average F1 of 61.22 over six OntoNotes 5.0 domain partitions. We will rerun it on the same partitions. We will also rerun its distillation and instance weighting on our BERT-base encoder, so that a win cannot be credited to the backbone difference between BART and BERT. Beating it means exceeding its F1 on identical partitions, with the same communicated parameter fraction and the same number of rounds.

For incremental classes, the strongest competitor is FSL from Federated Incremental NER. The file reports only its margin over the strongest earlier baselines on I2B2 (+2.95% Micro-F1, +2.69% Macro-F1 over ExtendNER and CPFD), not an absolute score. We will therefore rerun FSL on its protocol of 8 base types plus 1–2 new types per step and compare final-step Micro-F1 and Macro-F1 directly.

For domain drift, the competitor is ProgBERTQA from Continual Domain Adaptation for MRC, run federated with one adapter per domain and given oracle domain identities. It reports an F1 sum of 570.76 on CDA-Q. Matching it within a few F1 points using constant parameters and no domain identity counts as a win. Beating it is not required.

Centralized SpanKL and centralized joint training over all questions serve as upper bounds, not competitors. All methods receive the same tuning budget over learning rate and $\lambda$, or its equivalent. We report three seeds.

Why not just…?

Why not just run plain federated averaging on the query model? This is the real threat, and the proposal is built around testing it. On schema-only streams we expect it to come close to the full method, since the background contradiction is gone. Domain forgetting is a separate matter: Continual Domain Adaptation for MRC documents a 15.1% F1 loss for reading-comprehension models under domain drift, and nothing in the query formulation addresses that. The decomposed streams will show where plain averaging breaks. If it never breaks, the contribution becomes the finding that the reformulation alone suffices, and query distillation is dropped.

Why not just keep token tagging and use teacher pseudo-labels? This is what Federated Domain Adaptation for NER and FSL do, and they work. However, they need a teacher pass to invent labels, prototypes that its authors acknowledge are costly and unstable under client drift, and an entropy heuristic to detect task change. Tagging also cannot represent nested spans. The head-to-head comparisons on OntoNotes and I2B2 on a shared backbone settle whether the extra machinery buys anything that questions do not.

Why not just grow an adapter per domain? ProgBERTQA eliminates forgetting. But its storage grows with the number of domains, it needs the domain label at inference, and in a federated setting every client would have to download every adapter. We include it with oracle domain labels precisely to measure how much accuracy constant-size query distillation gives up for these savings.

Why not just apply gradient surgery such as RotoGrad? RotoGrad was validated only on centralized vision tasks. Its rotations are also expensive, scaling quadratically with feature width. We measure conflict between questions first and add magnitude homogenization only if that measurement justifies it.

Proposed Experiments

The first decisive check uses the six-domain OntoNotes 5.0 partitions with heterogeneous tag sets. The prediction is that plain federated averaging on the query model recovers most of the 13-point gap between 61.22 and 47.91 that token-level models close only with distillation.

The second check is the I2B2 incremental protocol, comparing final-step Micro-F1 and Macro-F1 against a rerun of FSL.

The third check is domain drift on CDA-C and CDA-Q, run as federated streams where each stage's data is split across five non-identically distributed clients. We report the F1 sum and backward transfer, meaning the change in F1 on earlier domains after later training, against federated ProgBERTQA. The file gives no numeric CDA-C result, so CDA-C comparisons rely entirely on our own reruns.

The fourth check is a combined stream that changes both schema and domain. We build it by ordering OntoNotes genres into stages and adding new entity types at each stage. We also ask whether ordering stages from least to most similar domain, as Sajjad found best in translation, changes forgetting.

A PharmaCoNER probe, split by clinical case across simulated clients, tests whether definition questions keep their reported gain under federated training. The reference is 0.9137 micro-F1 in centralized training. We will also check whether confusion between closely defined labels such as NORMALIZABLES and NO_NORMALIZABLES worsens when those labels live on different clients.

Throughout, we report inference cost per question alongside accuracy, so the results show both what the query formulation gains and what it costs.