Does Pooling Matter When the Tokenizer Shreds the Language?

Sentence encoders that power cross-lingual search turn a sentence into one vector by averaging (or max-ing) the vectors of its subword pieces. For languages like Zulu, Wolof or Igbo, a multilingual tokenizer chops each word into many small fragments. This happens most to rare words such as names and numbers, so a plain average weights each word by how badly the tokenizer split it, not by how much it matters. This proposal tests a simple, falsifiable account of part of the low-resource retrieval gap. The averaging step behaves like a tokenizer-count artifact. We propose a remedy with two levels: first pool fragments back into words, then pool words into a sentence, with a learnable "hardness" exponent at each level. If the account is right, the gains should grow with how fragmented a language is. They should also show up specifically on hard test cases where a single named entity or number has been swapped.

The work sits where four lines meet. Twin-tower ("Siamese") encoders map each sentence to a vector independently, so millions of sentences can be compared cheaply. Learnable pooling replaces a fixed average with a trainable one. Low-resource languages are the place where pooling is most likely to matter. Recent benchmarking work has shown that easy retrieval tests hide real differences between systems. We treat that last point as the main constraint: a pooling gain counts only if it survives a frozen, matched-budget protocol on hard distractors.

Core Claim

In distilled twin-tower encoders for low-resource languages, the main weakness of standard pooling is that it weights words by their subword count. Fixing that count with a word-normalized, two-level pooling removes most of the defect. A learnable exponent adds a further, smaller gain only where some feature channels need to isolate sparse details such as entities and numbers. We predict three things. The improvement over plain mean pooling should correlate with each language's subwords-per-word rate. It should concentrate on the entity and number substitution categories of the hard-negative benchmark. And it should shrink when a language-specific tokenizer reduces fragmentation in the first place.

Positioning Against Prior Work

The closest systems supply the method, and all of them fix pooling. Sentence-BERT built the twin-tower BERT encoder and compared only fixed choices (CLS token, mean, max), settling on mean, and only for English. LASER3 trains a language-specific student encoder to reproduce a frozen teacher's sentence vectors for 50 African languages, using a fixed pooling step. Soft contrastive alignment matches a teacher's full similarity distribution rather than binary positive/negative labels, but tests only five well-resourced languages with fixed pooling. We keep LASER3's student-teacher recipe intact and change only the pooling module, so any difference can be attributed to it.

Two papers motivate the hypothesis. Subword Pooling Makes a Difference showed that taking the first subword is the worst way to build word vectors in morphologically rich languages, and that attention or LSTM pooling works best. That study covered word-level tagging on frozen intermediate layers, with no sentence retrieval. We move its finding to the subword-to-word stage of a sentence encoder trained end to end. xSIM++ showed that ordinary retrieval error on FLORES-200 saturates. It predicted which of two mining systems gives better translation only 35.48% of the time, against 72.00% for its version with synthetic hard negatives (entity, number and causality alterations). Those hard negatives are exactly the cases where one word's contribution must survive pooling, which is why we use them as the primary test.

Two papers supply the pooling operators. Attentive Pooling with Learnable Norms learns a power $p$ inside attention pooling and stabilizes it in log-exponential form. Its learned powers fell below 1, softer than ordinary averaging, but only in English classification. Generalized-mean pooling, used in vision retrieval such as MinkLoc++, tends to learn harder, max-like powers. The disagreement between them is itself a question we can answer for cross-lingual twin towers. Concatenated p-means showed that several fixed power means, concatenated, make strong cross-lingual sentence vectors, at a cost of up to 3,600 dimensions over static word embeddings.

Two cautions constrain how far we can claim. The APLN gains were small (IMDB accuracy rose from 52.05% to 52.59%). And Revisiting Point Cloud Shape Classification showed that architectural gains often disappear once training is equalized. Both warn that a pooling effect may be tiny or illusory. We therefore make a null result an informative outcome rather than a failure.

Research Program

The student encoder produces subword vectors $h_{w,j}$, for piece $j$ of word $w$. A word has $n_w$ pieces and a sentence has $W$ words. Word boundaries come from whitespace and script-specific rules. The two-level pooling is

$$v_w = \Big(\tfrac{1}{n_w}\textstyle\sum_{j} \phi(h_{w,j})^{q}\Big)^{1/q}, \qquad s = \Big(\tfrac{1}{W}\textstyle\sum_{w} v_w^{\,p}\Big)^{1/p}.$$

Here $\phi$ is a softplus that makes features positive, as power means require. The vectors $q$ and $p$ hold learnable per-channel exponents, applied elementwise. We compute them as $e^{p\log(x+\epsilon)}$ following APLN, and clamp them to a range such as $[0.25, 8]$. The final sentence vector $s$ passes through a linear map to the teacher's dimension.

Setting $q=p=1$ gives the parameter-free word-normalized mean. That variant isolates the "count artifact" part of the claim with no learned parameters at all. Plain mean pooling is the special case where words are weighted by $n_w$.

We train students for the ten xSIM++ languages, plus Wolof, using LASER3's distillation, masked-language-modeling and curriculum recipe unchanged. We then analyze two things. The first is the learned exponents per channel and per language, to test whether cross-lingual alignment favors soft, hard, or bimodal pooling. The second is how gains depend on each language's fragmentation rate, measured as subwords per word on the FLORES dev split.

Baselines

The naive reference point is a LASER3-style student with plain mean pooling over subwords. It is trained on identical bitext, with the same teacher, step count, curriculum and seeds. Any pooling variant must beat it on the xSIM++ error rate, measured across three seeds, to count.

The strongest existing method is the published LASER3 recipe itself. That paper reports an average FLORES similarity search error of 0.6% and a Wolof error of 5.93% after curriculum learning, measured with the original metric. We found no reported xSIM++ result on Lacuna for LASER3 per language, so we re-run it under our protocol. We will report both our reproduction and the published figures, and flag any reproduction gap.

Several ablations isolate the key ingredient. The first is the word-normalized mean with $q=p=1$. If learnable exponents do not beat it by more than seed variance, the conclusion becomes "fix the counting, skip the learning." Two simpler learnable alternatives follow: single-level learnable power-mean pooling over subwords, without word grouping, and single-query attention pooling. These separate the benefit of grouping from the benefit of learnability. Finally, we include concatenated fixed p-means ($p \in \{1, 3, \pm\infty\}$), linearly projected back to the teacher dimension. This makes the comparison fair at equal vector size and index cost.

Every arm gets the same small tuning grid on FLORES dev, covering learning rate and the exponent clamp range. Any arm without extra hyperparameters receives the same number of trials on learning rate alone. Beating a baseline means a lower xSIM++ error that holds in at least seven of eleven languages. It also means no regression on original xsim, and agreement on the downstream checks below.

Why not just…?

Why not just keep mean pooling, since self-attention layers above can learn to compensate? This is the main threat. With full end-to-end training, the encoder could spread a rare word's meaning across its fragments. The parameter-free word-normalized arm tests exactly this, because it changes only the weights given to words. If plain mean matches it, especially in the most fragmented languages, our hypothesis is wrong, and we will say so. The prediction that would distinguish them is concrete: plain mean's deficit should grow with subwords per word and concentrate on entity and number swaps.

Why not just concatenate several fixed power means? Concatenated p-means is strong, but it multiplies dimensionality. For billion-sentence mining with nearest-neighbor indexes, that cost matters, which is the reason twin towers are used at all; Sentence-BERT reports going from about 65 hours to 5 seconds for 10,000 sentences. We include a projected version at equal dimension. If it matches learnable exponents, the honest conclusion is that a fixed mixture suffices.

Why not just fix the tokenizer with language-specific subwords? Work such as ViT5 and MultiFiT shows language-specific vocabularies help, and less fragmentation could make pooling irrelevant. This is a genuine competitor, not a strawman. We therefore cross tokenizer type (shared versus language-specific SentencePiece) with pooling type for four languages. If the pooling gain disappears under the language-specific tokenizer, pooling is a cheap patch only for settings where retokenizing is impossible, such as reusing a shared pretrained student. We would report it as that.

Why not just rerank with a cross-encoder that reads both sentences together? Cross-encoders do recover token-level interactions. But they require scoring every pair, which Sentence-BERT shows is infeasible at mining scale. They are also orthogonal to our question: a better first-stage encoder benefits any reranker.

Proposed Experiments and Decisive Checks

The primary metric is the xSIM++ error rate on FLORES-200 for the ten covered languages, broken down by transformation type. We also report original xsim, for comparability with LASER3, and Wolof on FLORES with the original metric. Downstream validity rests on two checks. The first is frozen-embedding sentiment classification on AfriSenti for overlapping languages such as Hausa, Yoruba and Amharic. It uses a SentEval-style protocol from SentEval: logistic regression with only L2 strength tuned on validation. For reference, the shared-task best fine-tuned system scored 71.31 weighted F1 in the monolingual track; that is a ceiling, not a comparable number. The second is a small mining-plus-translation run for two or three languages. We mine with the best and baseline students, train identical translation models, and score with spBLEU from FLORES-101. This checks whether xSIM++ ordering predicts translation ordering in our setting.

Four checks decide the outcome. First, the improvement of word-normalized pooling over plain mean, plotted against subwords per word across the eleven languages, should have a positive rank correlation. A flat line refutes the count-artifact account. Second, the improvement should be largest on entity and number substitutions and near zero on causality alterations. Uniform gains would point to generic regularization instead. Third, learned exponents should be bimodal, with a subset of hard, max-like channels. All-soft exponents, as in APLN, would mean learnability adds nothing beyond normalization. Fourth, the tokenizer cross shows whether the effect survives better tokenization. Together these tell a practitioner whether to change the pooling, the tokenizer, or nothing.