Re-centering Shifted Words Before Averaging Embeddings

A cheap way to represent a sentence or document is to average the vectors of its words. This works well on general text. In specialized domains, though, a minority of everyday words quietly change meaning: "RF" means renal failure in clinical notes, "bank" means a river bank in environmental reports, and "exposure" or "transition" mean something specific in climate disclosures. A word vector learned from web text carries the web meaning into every average it joins. Corpus statistics such as term frequency–inverse document frequency (TF-IDF, which weights a word up when it is frequent in one document but rare across the collection) cannot help. TF-IDF changes how much a word counts. It does not change what the word means.

We propose to detect shifted words without labels and to correct their vectors before averaging. For each word, we average the vectors of the words that surround it, once in a general corpus and once in the target domain corpus, using the same frozen general embedding space for both. If the two context averages point in different directions, the word has shifted. We then move that word's vector by the gap between its two context averages, scaled by how confident we are in the estimate, and compose documents as a TF-IDF-weighted average of the corrected vectors. The claim is narrow and testable. This kind of shift is a matter of meaning, not frequency, so it cannot be repaired by reweighting. Correcting it should help most on short texts and sparse queries that contain shifted words, where the surrounding text gives a model too little to override a general-language prior.

Core Claim

Let $v(w)$ be the general embedding of word $w$. Let $c_G(w)$ and $c_D(w)$ be the averages of its context-word vectors in the general corpus $G$ and the domain corpus $D$. Each context word is weighted by its inverse document frequency in the corpus being read, following the context representation of Russian word sense induction by clustering averaged word embeddings. The shift score and the corrected vector are

$$s(w) = \frac{n_D(w)}{n_D(w)+k}\,\bigl(1-\cos(c_G(w), c_D(w))\bigr), \qquad v'(w) = v(w) + \lambda\, s(w)\,\bigl(c_D(w) - c_G(w)\bigr),$$

where $n_D(w)$ is the number of occurrences of $w$ in $D$, $k$ is a shrinkage constant that discounts words seen only a few times, and $\lambda$ is a single global step size. Both context averages live in the same frozen space, so the two corpora need no alignment step. The update moves only words whose contexts actually moved. A document vector is then $d=\sum_w \text{tfidf}_D(w)\,v'(w)/\sum_w \text{tfidf}_D(w)$.

The new ingredient is the use of a shift estimate built from context averages to change word identity inside an average. Prior work either reweights words or induces senses, but does not do both. Kutuzov averages IDF-weighted context vectors to cluster senses within one general corpus. He never compares corpora and never feeds induced senses back into a document representation. Terminology-based Text Embedding for Computing Document Similarities on Technical Content builds TF-IDF- and keyphrase-weighted averages to resist boilerplate, reaching NDCG@1 of 0.69 on its corpus. It assumes its extracted terms are monosemous. Multifaceted Domain-Specific Document Embeddings combines IDF normalization with embeddings but needs the MeSH taxonomy and supervised training.

The obvious design at this intersection uses a contrastive IDF, the general IDF minus the domain IDF, to flag risky words. We treat it as a baseline. It measures a change in frequency, and words like "bank" can keep similar document frequency while changing their dominant sense, which is the pattern SemEval-2010 Task 17: All-words Word Sense Disambiguation on a Specific Domain documents for environmental text.

Motivation from Prior Work

Three findings motivate the proposal.

The first is from Query Expansion with Locally-Trained Word Embeddings. It showed that global embeddings blend senses and that embeddings retrained on a query's top documents beat global ones (AP 0.563 vs 0.545 on trec12). Its local retraining runs per query, and we ask whether a precomputed, per-word correction captures much of that gain.

The second is SemEval-2010 Task 17, which reports supervised word sense disambiguation falling from 85–87% to 53–62% precision when trained on general rather than target-domain data. That gap is the sense-prior shift we aim to estimate without labels.

The third is Exploiting Task-Oriented Resources to Learn Word Embeddings for Clinical Abbreviation Expansion and Word Embeddings-Based Uncertainty Detection in Financial Disclosures. Both show domain meanings drowned out or displaced in general vectors.

Two results constrain the design. Blind synonym expansion from lexical resources cut MAP by 14–16% in NLEL at CLEF 2009 Robust WSD Task, and A Re-examination of Query Expansion Using Lexical Resources traces this to sense noise. We therefore never add vocabulary. We only move existing words. Kutuzov also reports that clustering quality drops sharply on fine-grained polysemy (ARI around 0.21–0.24 versus 0.71 for homonyms). This tells us to expect the correction to work on coarse, homonym-like shifts and to degrade on subtle ones, and we measure that split explicitly.

Research Program

The first stage builds the shift lexicon. We compute $c_G$ from a general corpus matching the embedding's training data, and $c_D$ from the unlabeled domain collection of each benchmark: CORD-19 for TREC-COVID, the 30 sustainability reports for ClimRetrieve, and clinical and biomedical text for the sentence-similarity sets. We validate $s(w)$ intrinsically before any downstream use. On SemEval-2010 Task 17, we take words with gold sense annotations in both the general corpus (SemCor) and the environmental corpus. We correlate $s(w)$ with the change in their gold sense distribution, measured as Jensen–Shannon divergence. The comparison detectors are contrastive IDF, raw frequency ratio, and the distance between general and domain-trained word vectors after Procrustes alignment.

The second stage is in-domain disambiguation at test time. A single domain context average fixes the domain prior but still blends senses that coexist inside the domain. As an optional step, we cluster a word's domain contexts with Affinity Propagation, following Kutuzov, which yields several candidate domain sense averages. For each occurrence of the word, we pick the cluster nearest to the current document's uncorrected average and apply the correction from that cluster. This turns Kutuzov's sense induction into a re-weighting step at test time, which he left open. It is ablated separately, because Kutuzov's own results predict it will often fail on fine-grained senses.

The third stage tests whether the correction survives contextual encoders. A natural objection is that contextual transformers already disambiguate. For open encoders such as Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks with mean pooling, we apply the same translation to token hidden states before pooling. Here $c_G$ and $c_D$ are computed from averaged contextual states of each word in the two corpora. If the corrected pooled vector still improves results, contextual models carry a residual general-language prior. If it does not, the method's value is confined to cheap static pipelines, and we will report it that way.

Baselines

The naive reference is the plain unweighted average of general word vectors. We also run the same average weighted by domain TF-IDF. The weighted version is close to the TWA and TDE_iw variants in Terminology-based Text Embedding for Computing Document Similarities on Technical Content and is the direct "reweight, don't correct" competitor. Our method must beat the TF-IDF-weighted average with the same vectors and the same weights, differing only by the correction term. This is the central ablation that isolates the key ingredient.

Three further ablations sit around it. In the first, high-shift words are simply down-weighted, with $\text{tfidf}\cdot(1-s)$ and no translation; this tests whether removing shifted words is enough. In the second, contrastive IDF replaces $s(w)$, testing whether frequency contrast is a sufficient shift detector. In the third, the translation is replaced by a random direction of equal norm, testing that the specific direction matters.

The strongest unsupervised representation competitor is a word2vec model trained on the domain corpus alone. We also test general vectors fine-tuned on the domain corpus. These are run with the same domain text and tuned on the same development split, and they are the closest analogue to Diaz et al.'s local training.

For retrieval, the strongest systems are BM25 and BM25-plus-neural hybrids. On TREC Product Search, OVERVIEW OF THE TREC 2023 PRODUCT PRODUCT SEARCH TRACK reports BM25 at NDCG@10 = 0.6540 and the SPLADE+BM25 hybrid at 0.7505. On ClimRetrieve, ClimRetrieve: A Benchmarking Dataset for Information Retrieval from Corporate Climate Disclosures reports text-embedding-3-large at F1 = 0.167 with the raw query and 0.179 with expert definitions. For TREC-COVID under BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models, there is no reported result on Lacuna for BM25 or dense NDCG@10 in the file, so we rerun both ourselves.

For clustering on the Integrated Qualifications Register (IQR) Polish benchmark, Text Document Clustering: Wordnet vs. TF-IDF vs. Word Embeddings reports AMI = 0.536 for WordNet Wu-Palmer and 0.529 for adjective-only TF-IDF on the ALL split. For BIOSSES and Med-STS, there is no reported result on Lacuna for numeric FDE, BioSentVec, or BioWordVec scores, so we rerun available baselines.

Fairness rules apply throughout. We do not claim to beat a learned hybrid as a standalone retriever. The test is whether adding our corrected-average score to BM25 plus a dense encoder, through reciprocal rank fusion, beats the same fusion using the uncorrected TF-IDF average. All fusion weights get the same development-set tuning budget. "Beating" means a paired-significant gain, measured by bootstrap over queries or pairs, of the corrected over the uncorrected variant within each pipeline. On IQR, beating means matching Wu-Palmer's 0.536 without WordNet, at a runtime near doc2vec's under-6-minute cost rather than WordNet's 570 minutes.

Why not just…?

Why not just use BM25 or a sparse–dense hybrid? On attribute-heavy search, these are the right tools. The TREC Product hybrid at 0.7505 is unlikely to move, and we treat Product Search as a negative control where shifted word meaning is rare and we predict no gain. ClimRetrieve is different. There, relevant passages share few tokens with the questions, F1 stays near 0.18, and the gain from expert definitions suggests the bottleneck is domain meaning rather than term matching. The fusion experiment settles this directly. If the corrected average adds nothing on top of a hybrid on ClimRetrieve and TREC-COVID, the idea fails.

Why not just train or fine-tune word embeddings on the domain corpus? This is the most serious threat, and we take it seriously. Retraining moves every word, including the many that did not shift. On small corpora like 30 sustainability reports, retraining gives poor vectors for rare words. Our correction leaves unshifted words at their general vectors and shrinks the update for rarely seen words. We will plot both methods against domain corpus size, subsampling CORD-19 from a few thousand documents to the full set. We expect domain retraining to overtake the correction at some size. Locating that crossover is a stated deliverable, not a hidden weakness.

Why not just fine-tune the dense encoder or add a learned adapter? Search-Adaptor: Embedding Customization for Information Retrieval improves embedding APIs by over 5% nDCG@10 on BEIR. It needs labeled query–document pairs, however, and it treats each vector as a whole, with no way to touch individual words. Our method needs no labels, so the two are complementary rather than rivals. Where labels exist, we will also apply the correction underneath an adapter to see whether the gains add up.

Why not just reweight words by contrastive IDF? It is the obvious design and is cheaper than ours. The intrinsic test on SemEval-2010 Task 17 decides between them. If contrastive IDF correlates with gold sense-prior change as well as $s(w)$ does, and the down-weighting ablation matches the translation, then reweighting is enough and our extra machinery is unjustified.

Proposed Experiments

The first decisive check is intrinsic. On SemEval-2010 Task 17 English, $s(w)$ must correlate with gold sense-distribution change, measured by Spearman correlation, significantly better than contrastive IDF and frequency ratio. Without this, every downstream gain would be uninterpretable.

The second check covers sentence similarity on BIOSSES and Med-STS. We measure Spearman correlation for the corrected TF-IDF average versus the uncorrected one, using general static vectors and mean-pooled Sentence-BERT token states. We stratify by whether a pair contains a word in the top shift decile. The prediction is that gains concentrate in shift-containing pairs and are near zero elsewhere. Med-STS, with its clinical abbreviations, should show larger gains than BIOSSES.

The third check covers retrieval on TREC-COVID (NDCG@10) and ClimRetrieve (F1 under the dataset's protocol), with fusion as specified above. We also run the same pipeline on TREC Product Search as the negative control. We stratify queries by shift content, and we report whether automatically corrected raw questions on ClimRetrieve close part of the gap to the expert-definition result.

The fourth check is IQR clustering by AMI against the 0.536 and 0.529 references, with Polish general vectors and the IQR text as the domain corpus.

Across all settings, we report the second-stage sense selection as a separate ablation, split by coarse versus fine-grained shifted words, along with the corpus-size crossover against domain retraining. The proposal succeeds if the correction beats pure reweighting in the intrinsic test, beats it on shift-containing items in at least two domains, and leaves Product Search unchanged. It fails if pure reweighting or domain retraining matches it at every corpus size.