---
title: Bilingual Speech-Text Matryoshka Embedding Model
url: https://www.emergentmind.com/topics/bilingual-speech-text-matryoshka-embedding-model
type: topic
---

# Bilingual Speech-Text Matryoshka Embedding Model

A bilingual speech-text Matryoshka embedding model is a cross-lingual representation system in which speech queries and text documents are mapped into a shared embedding space whose leading coordinates define nested lower-dimensional sub-embeddings. In current arXiv usage, this design appears in two closely related forms: a French–Wolof speech-to-text retrieval model that is described as the first bilingual speech-text Matryoshka embedding model, and a matryoshka audio–text framework for open-vocabulary keyword spotting whose detailed bilingual adaptation is explicitly specified for bilingual keyword spotting [2602.19991], [2601.14012].

## 1. Problem setting and research context

Bilingual speech-text Matryoshka models address a joint language barrier and modality barrier. In the French–Wolof case, the motivating problem is that most online knowledge is in French text, while Wolof is primarily oral; conventional information-retrieval pipelines therefore depend on cascaded ASR→MT systems that are costly and suffer error propagation. The proposed alternative is to retrieve French text documents directly from Wolof speech queries through a cross-lingual speech-text embedding model [2602.19991].

The same representational idea is also relevant to open-vocabulary keyword spotting. In that setting, text-based enrollment replaces fixed-phrase triggers, and audio utterances are matched against keyword text embeddings. Prior utterance-level matching methods learn embeddings at a single fixed dimensionality, whereas Matryoshka Audio-Text Embeddings depart from this design by encoding multiple embedding granularities within a single vector via nested sub-embeddings, or “prefixes” [2601.14012].

The common premise is that a single embedding should support multiple operating points. This supports flexible accuracy–efficiency trade-offs at inference, which is especially relevant in low-resource or deployment-constrained settings. In retrieval, this means selecting a dimension post hoc according to storage and latency constraints. In keyword spotting, this means preserving a full-dimensional operating point for production inference while concentrating salient cues in lower-dimensional prefixes for regularization and analysis [2602.19991], [2601.14012].

## 2. Matryoshka representation principle

The defining operation is nested slicing of a single full vector. In the French–Wolof model, if $z \in \mathbb{R}^{1024}$ is the full vector and $M = \{128, 256, 512, 1024\}$, then the dimension-$m$ representation is

$$
z^{(m)} = z[1:d_m].
$$

Training is performed jointly across dimensions through the Matryoshka loss

$$
L_{MRL} = \sum_{m \in M} L(Q_{:m}, D_{:m}),
$$

and, for retrieval, the per-dimension objective is InfoNCE with in-batch negatives:

$$
L_{InfoNCE}^{(m)} = - \frac{1}{N} \sum_{i=1}^{N} \log \left( \frac{\exp(\mathrm{sim}(q_i^{(m)}, d_i^{(m)})/\tau)}{\sum_{j=1}^{N} \exp(\mathrm{sim}(q_i^{(m)}, d_j^{(m)})/\tau)} \right).
$$

Here $\mathrm{sim}(\cdot,\cdot)$ is cosine similarity, and the paper does not report the value of $\tau$ [2602.19991].

In MATE, the same nesting principle is formulated as prefix extraction from a $D$-dimensional utterance representation. With prefix sizes $\mathcal{D} = \{d_1, d_2, \dots, d_K\}$ and $d_1 < \dots < d_K = D$, the prefixes are

$$
u_a^k = u_a[1:d_k], \qquad u_t^k = u_t[1:d_k].
$$

The design schedule is a power-of-two halving schedule,

$$
d_k = D \cdot 2^{-(K-k)},
$$

so that for $D = 256$ and $K = 5$, $\mathcal{D} = \{16, 32, 64, 128, 256\}$. The stated rationale is that lower-dimensional prefixes concentrate salient keyword cues, while progressively higher dimensions add detail [2601.14012].

A distinctive element of MATE is PCA-guided prefix alignment. The teacher used in the paper is derived from a corpus-wide text inner-dependency matrix $\bar{A}_t^D \in \mathbb{R}^{D \times D}$ estimated each epoch,

$$
\bar{A}_t^D = \mathrm{Softmax}_{row}\!\left( \frac{1}{M} \sum_{j=1}^{M} \frac{(x_t^{(j)} - \mu)(x_t^{(j)} - \mu)^T}{\sqrt{D}} \right),
$$

followed by SVD, $\bar{A}_t^D = U \Sigma V^T$, and the projection

$$
A_t^{d_k} = U_{:,1:d_k}\Sigma_{1:d_k,1:d_k}.
$$

The prefix teacher is then

$$
\tilde{u}_t^k = (A_t^{d_k})^T (u_t - \mu).
$$

Both audio and text prefixes are aligned to this teacher with a sum of MSE and KL terms:

$$
L_{align,a}^k = \mathrm{MSE}(u_a^k, \tilde{u}_t^k) + \mathrm{KL}(\phi_\tau(u_a^k)\,\|\,\phi_\tau(\tilde{u}_t^k)),
$$

$$
L_{align,t}^k = \mathrm{MSE}(u_t^k, \tilde{u}_t^k) + \mathrm{KL}(\phi_\tau(u_t^k)\,\|\,\phi_\tau(\tilde{u}_t^k)).
$$

The total loss is

$$
L_{total} = L_{main} + \lambda_{align} L_{align},
$$

with delayed activation: $\lambda_{align}(e)=0$ for epochs $1$–$20$, and $\lambda_{align}(e)=0.5$ for epoch $\geq 21$ [2601.14012].

## 3. Architectural realizations

The current literature contains two principal realizations: a bilingual retrieval model centered on a frozen text Matryoshka encoder with speech fusion, and a dual-encoder audio–text model for keyword spotting that includes an explicit bilingual adaptation path.

| Realization | Core components | Matryoshka dimensions |
|---|---|---|
| Late-Fusion bilingual retrieval | Qwen3-0.6-Embedding, 12-layer Wolof HuBERT, CNN downsampler, projection matrix $W$ | $\{128, 256, 512, 1024\}$ |
| Dual bilingual retrieval | Wolof HuBERT, attention pooling with learnable query $q$, dimension-specific projections $W_d$, frozen text LLM | $\{128, 256, 512, 1024\}$ |
| MATE audio–text KWS | ECAPA-TDNN audio encoder, G2P front-end, 2-layer bi-LSTM text encoder, CCSP pooling | typically $\{16, 32, 64, 128, 256\}$ for $D=256, K=5$ |

In the French–Wolof Late-Fusion model, the text backbone is Qwen3-0.6-Embedding, an MRL text-embedding LLM capable of emitting embeddings at dimensions $32$, $64$, $128$, $256$, $512$, and $1024$, though the paper uses $\{128, 256, 512, 1024\}$. The text-only model is first fine-tuned on bilingual text data using InfoNCE with in-batch negatives. Speech is then integrated by taking features from all $12$ Wolof HuBERT layers, concatenating them, reducing the speech sequence length with a CNN by a factor of $2$, mapping the result into the LLM embedding space with a learned matrix $W$, concatenating the projected speech sequence with prompt token embeddings, and forwarding the combined sequence through the frozen text Matryoshka LLM. Only the CNN and $W$ are trained; HuBERT and the text LLM are frozen [2602.19991].

The alternative bilingual Dual architecture pools speech features $X \in \mathbb{R}^{s \times d}$ into a single vector through attention pooling with a learnable query $q \in \mathbb{R}^{1 \times d}$,

$$
\mathrm{softmax}\!\left(\frac{qX^T}{\sqrt{d}}\right) X,
$$

and then applies dimension-specific linear projections $W_d$. In this setup, HuBERT is unfrozen. Two training variants are reported: Dual–Retrieval, which uses InfoNCE on speech→document retrieval, and Dual–Query Alignment, which distills speech to match its own transcription embedding via cosine similarity and L1 losses [2602.19991].

MATE uses a more classical dual-encoder KWS architecture. The audio encoder $f_a$ is ECAPA-TDNN with $256$ channels, approximately $1.8$M parameters, taking $40$-d log-Mel filterbanks with a $25$ ms window and $10$ ms shift, plus utterance-level mean normalization, and producing a phoneme-level sequence $E_a^{phn} \in \mathbb{R}^{T_a \times D}$. Channel- and context-dependent statistics pooling produces an utterance vector $u_a \in \mathbb{R}^D$. The text encoder $f_t$ consists of a G2P front-end to phoneme tokens, a trainable $256$-d embedding lookup, a $2$-layer bi-LSTM with $256$ hidden units, global average pooling, and a linear layer to produce $u_t \in \mathbb{R}^D$. Both embeddings are $\ell_2$-normalized before metric learning and inference, with $D = 256$ by default [2601.14012].

For bilingual keyword spotting, the paper gives explicit adaptation options rather than experimental results. Option A is multilingual G2P into a shared phoneme or IPA inventory while retaining the bi-LSTM encoder and adding a learned language-ID token or embedding to the text sequence. Option B is to replace the text encoder with a pretrained multilingual sentence encoder such as LaBSE, XLM-R, or mBERT adapters, followed by projection to $D=256$. The audio encoder is kept unchanged, while training pairs include within-language positives, cross-lingual positives via translations or transliterations, and hard negatives across languages [2601.14012].

## 4. Training data, supervision, and inference procedures

The French–Wolof retrieval model is built on large-scale bilingual text and speech curation. The text-only training set combines French mMARCO with queries translated to Wolof, Senegalese French webpages with synthetic French queries translated to Wolof, and French QA datasets with questions translated to Wolof, together with Wolof–French translation pairs for cross-lingual transfer. The resulting scale is $1{,}176{,}908$ Wolof query–French document pairs and $593{,}284{,}495$ French document tokens [2602.19991].

Speech queries are collected from $1.4$ TB of natural, spontaneous speech from podcasts and radio, excluding read content. The filtering pipeline uses source separation with UVR-MDX-NET, diarization with pyannote, VAD with Silero-VAD, and retains only $3$–$30$ s utterances with DNSMOS quality $> 3.2$, yielding $860$ hours of high-quality Wolof speech queries. For synthetic French documents, the speech is transcribed with a Wolof Speech Language Model, filtered by perplexity and lexical diversity, retaining approximately one quarter of the original $860$ h speech-text pairs, then translated to French and expanded into synthetic French documents with Gemini-2.5-Flash. An instruction-following dataset is then organized around document retrieval, speech-translation retrieval, and transcription retrieval so that the model can be prompted at inference [2602.19991].

All French–Wolof models use Sentence-Transformers and are trained for $1$ epoch with batch size $16$, max length $2048$, and learning rate $3 \times 10^{-4}$. The text-only model uses joint InfoNCE over Matryoshka dimensions. The Late-Fusion model uses the same joint InfoNCE loss on the instruction-following speech–text dataset. The Dual–Retrieval model also uses InfoNCE, whereas Dual–Query Alignment uses a joint cosine similarity loss and L1 loss to align speech query vectors with text query vectors [2602.19991].

In MATE, the training configuration is different because the target task is utterance-level KWS. Training uses King-ASR-066, approximately $4.6$k hours of word-level segments and approximately $210$k word classes, with RIR convolution and MUSAN noises as augmentation. The optimizer is AdamW with learning rate $1 \times 10^{-4}$, weight decay $1 \times 10^{-5}$, and $100$ epochs. Batch composition is $500$ utterances from $250$ keywords, two utterances per keyword. Per-epoch recomputation of $\mu$, $\bar{A}_t^D$, and its SVD supplies the PCA-like teachers used for prefix alignment [2601.14012].

Inference follows the training design. In French–Wolof retrieval, Wolof speech queries and French documents are encoded at the chosen dimension and ranked by cosine similarity. In MATE KWS, text-based enrollment produces a normalized full-dimensional keyword vector, runtime scoring computes the audio vector and uses

$$
s = \mathrm{sim}(u_a, u_t) = u_a^T u_t,
$$

with acceptance if $s \geq \theta$. For segment-level KWS, a sliding window is applied and the maximum similarity across windows is thresholded. Although optional prefix-level scoring can be computed, all reported MATE results use only the full-dimensional score [2601.14012].

## 5. Empirical behavior across retrieval, keyword spotting, and transfer

The strongest published bilingual results are obtained by the French–Wolof Late-Fusion model. On Kallaama-Retrieval-Eval, Late-Fusion at $d=1024$ achieves nDCG@5 $69.85$ and nDCG@10 $74.49$; at $d=512$, $66.86$ and $71.04$; at $d=256$, $61.58$ and $67.05$; and at $d=128$, $56.13$ and $62.30$. The pipelined baseline at $d=1024$ reaches $57.09$ and $62.82$, NLLB-LLM2Vec at $d=4096$ reaches $57.98$ and $61.53$, Dual–Retrieval at $d=1024$ reaches $46.96$ and $53.70$, and Dual–Query Alignment at $d=1024$ reaches $41.56$ and $47.42$. On Fleurs-Retrieval-Eval, Late-Fusion at $d=1024$ reaches nDCG@5 $57.89$ and nDCG@10 $61.19$, compared with $55.98$ and $59.43$ for NLLB-LLM2Vec, $41.28$ and $45.54$ for Dual–Retrieval, and $38.07$ and $41.82$ for Dual–Query Alignment [2602.19991].

The same French–Wolof model generalizes beyond document retrieval. On Urban Bus keyword spotting, Late-Fusion beats Dual across dimensions; for Late-Fusion, F1/Recall at $d=1024$ is $88.79/89.79$, at $d=512$ is $84.85/86.49$, at $d=256$ is $79.80/81.98$, and at $d=128$ is $76.86/79.88$. On WolBanking77 speech intent detection, a SetFit-style contrastive stage followed by a classifier head yields $0$-shot F1/Recall of $44.79/50.64$ at $d=1024$, and $16$-shot performance of $96.11/96.10$. The paper states that higher dimensions adapt faster in low-shot regimes, while smaller dimensions catch up with more examples [2602.19991].

In the monolingual KWS setting, MATE provides complementary evidence for the effectiveness of speech–text Matryoshka representations. On WSJ at $D=256$, MATE improves Average Precision over baselines across multiple deep metric learning objectives: Proxy-BD $69.76 \rightarrow 72.95$, Proxy-MS $70.18 \rightarrow 73.12$, CLAT $70.52 \rightarrow 73.53$, AsyP $71.66 \rightarrow 73.98$, AdaMS $73.87 \rightarrow 75.68$, and RPL $78.66 \rightarrow 80.94$. On LibriPhrase, MATE with RPL and $K=3$ reports EER/AUC of $1.38/20.06$ and $99.86/88.70$, compared with $1.54/22.45$ and $99.84/85.31$ for RPL, and the gains are stated to be especially notable on LP_H [2601.14012].

Ablation results clarify what the Matryoshka mechanism is and is not doing. Under RPL on WSJ, Full-only RPL gives $78.66$, Per-prefix RPL gives $79.49$, Per-prefix RPL + PCA-guided alignment gives $78.01$, and MATE gives $80.94$. The reported interpretation is that applying $L_{main}$ to all prefixes conflicts with PCA-guided compression, whereas using compression-guided alignment as a prefix regularizer while keeping $L_{main}$ only at full dimension is best. For the number of prefixes, $K=3$ with $\{64,128,256\}$ peaks on WSJ at $81.03$, while $K=5$ with $\{16,32,64,128,256\}$ reaches $80.94$. For alignment composition, MSE-only gives $79.96$, KL-only gives $80.04$, and $1\!:\!1$ MSE:KL gives $81.03$ [2601.14012].

## 6. Efficiency, limitations, and open research questions

The principal efficiency claim of Matryoshka designs is that one encoder can serve multiple dimensional budgets. In French–Wolof retrieval, smaller dimensions reduce storage and query-time latency, while larger dimensions provide stronger retrieval and low-shot adaptation. In MATE, a single forward pass per modality and a single $D$-dimensional similarity score are sufficient at inference; evaluating prefixes requires only slicing the already computed vector, so runtime complexity remains $O(D)$ per embedding, and MATE adds no inference overhead [2602.19991], [2601.14012].

At the same time, current results do not support the misconception that arbitrary truncation preserves all useful information. The French–Wolof paper analyzes cumulative energy ratio,

$$
R(k) = \frac{\sum_{i=1}^{k} \lambda_i}{\sum_{j=1}^{d} \lambda_j},
$$

where $\lambda_i$ are eigenvalues of the covariance of embeddings sorted in descending order. The reported finding is that higher dimensions are lower-rank and reach full energy with a small fraction of components, yet still outperform small dimensions in retrieval, suggesting that compression via naive slicing may discard critical information at small $d$. The same analysis reports that documents have higher rank than queries, and that at $d=128$ and $256$ vectors are effectively full-rank, potentially limiting representation of document information at small dimensions [2602.19991].

Limitations are task- and language-specific. The French–Wolof study focuses on Wolof–French and notes that generalization to other under-represented languages with different phonologies or scripts is untested. It also relies heavily on synthetic training documents, which may limit robustness and presumes availability of reasonable ASR and MT systems. MATE, by contrast, is evaluated on English-only datasets with English G2P, so generalization to other languages and scripts is not validated. The paper also notes that pronunciation quality and acoustic variability for rare words still matter, and that low-dimensional prefixes may increase false positives on short, phonetically similar distractors if they become over-concentrated [2602.19991], [2601.14012].

Several research directions are already explicitly formulated. For bilingual KWS, MATE proposes adding cross-lingual alignment terms of the form

$$
L_{xl} = - \sum_i \log \left( \frac{\exp(\mathrm{sim}(a_i^{(L1)}, t_i^{(L2)})/\tau)}{\sum_j \exp(\mathrm{sim}(a_i^{(L1)}, t_j^{(L2)})/\tau)} \right),
$$

with a symmetric term for $(L2,L1)$ and total objective

$$
L_{total} = L_{main} + \lambda_{align} L_{align} + \alpha_{xl} L_{xl}.
$$

It further distinguishes shared PCA, language-specific PCA, and hybrid PCA for prefix supervision, and suggests investigating whether low-dimensional prefixes remain language-agnostic while higher dimensions capture language-specific detail. The French–Wolof paper, from a different angle, identifies dynamic structured sparsity and alternative compression schemes as future work because the present rigid slicing strategy appears suboptimal at small dimensions [2601.14012], [2602.19991].

Source: https://www.emergentmind.com/topics/bilingual-speech-text-matryoshka-embedding-model