Hedging Toward the Ancestor: Hyperbolic Dialect Embeddings for Diglossic and Code-Switched Speech

Spoken Arabic dialect classifiers do very well on clean broadcast speech and badly on real conversation. Real conversation is a mixture: Modern Standard Arabic (MSA, the formal shared written standard), a regional dialect, and often English or French, sometimes inside a single word. A flat classifier must still name one country for every clip, even when the clip contains almost no dialect-specific material. We propose to embed speech in hyperbolic space. This is a curved geometry in which the distance from the center naturally encodes how specific something is, and the direction encodes which branch of a hierarchy it belongs to. We place the dialect tree (Arabic, then region, then country) inside this space and train only with country labels. The model should then learn two behaviors without extra supervision. First, how far a clip lands from the center should track how dialectal it is. Second, when a clip is ambiguous, its embedding should drift toward the correct region rather than land on a wrong neighboring country.

The two-sentence version is this. Hyperbolic geometry gives a dialect classifier a principled place to put "I am not sure which Gulf country, but this is Gulf." On spontaneous, code-switched speech, that place should be worth more than a sharper leaf classifier. We test that claim against the obvious Euclidean shortcuts and state in advance what would refute it.

Core Claim

Train a hyperbolic embedding head on a pretrained speech encoder with country-level labels from broadcast audio. On out-of-domain conversational speech, it should beat a matched Euclidean model on two measures. The first is the trade-off between accuracy and abstention when the model backs off up the tree. The second is the correlation between embedding radius (distance from the center) and human-annotated dialectness. In-domain flat F1 should not suffer.

The mechanism comes from the geometry, not from added labels. Suppose the posterior is split between sibling countries and the model outputs the point that minimizes expected squared distance to the candidate prototypes. Prototypes are fixed reference points, one per class. In hyperbolic space this optimal point is pulled toward the origin, because shortest paths between points near the boundary bend toward the center. It therefore lands near the shared parent region. In Euclidean space the same average sits on the straight chord between the siblings, and it lands near a parent only if the parent prototype was placed there by hand.

Learning the Predictability of the Future supplies this method. It shows the effect for video action prediction, where uncertain predictions hedge toward broad action classes and hierarchical accuracy rises from 52.00% to 66.64% over Euclidean on FineGym. Our proposal moves that effect to speech. There, the "uncertain" cases are not about the future. They are clips dominated by shared material: MSA, English, or loanwords.

What Exists and What Is Missing

The closest work splits into two camps, and neither has the ingredient we propose.

The first camp combines dialect identification with hierarchy or code-switching, but always in Euclidean space and mostly in text. Toward Micro-Dialect Identification in Diaglossic and Code-Switched Environments classifies tweets across 319 cities using multi-task heads for city, state and country, plus auxiliary MSA-versus-dialect and code-switching tasks. It reaches 9.9% macro F1. It is text-only, and its hierarchy lives in loss heads rather than in the representation. Hierarchical Deep Learning for Arabic Dialect Identification cascades a region classifier into city classifiers on MADAR text. Hierarchical Aggregation of Dialectal Data for Arabic Dialect Identification builds Region→Country→City n-gram language models. That paper also constrains our design: it reports that feeding all levels' features to one flat classifier hurt accuracy, which warns against solving hierarchy by stacking features. In speech, Staircase Network gates dialect predictions with language-family predictions on NIST LRE17 and North Sami. It evaluates only monolingual speech, and its hierarchy is enforced by hand-designed gating rather than by the metric.

The second camp supplies the geometry but has never touched speech. Hyperbolic Neural Networks and Hyperbolic Neural Networks++ provide the layers and classifiers we reuse. HNN++ also supplies our main warning: hyperbolic gains shrink as dimension grows. Learning Mixed-Curvature Representations in Product Spaces offers a fallback for structures that are not tree-like.

On the speech side, ADI-20 provides the training data and the strongest baselines. It uses a flat 20-way softmax. It also documents the two failures we target: systematic confusion among adjacent Levantine dialects, and a drop to 62.74% F1 on out-of-domain TV drama audio. ZAEBUC-Spoken provides the evaluation probe. Its spontaneous Gulf, Egyptian, MSA and English conversations are annotated on a five-level dialectness scale. 40.7% of utterances are pure MSA, 16.2% are pure dialect, and about 19% contain Arabic-English switching. The corpus has no modeling results.

The idea is not simply "put a hyperbolic head on Whisper for ADI-20." ADI-20 has only about twenty leaves under a two-level tree. A 1280-dimensional Euclidean space embeds that tree with almost no distortion, so a distortion argument alone would predict little gain there. We therefore do not claim that hyperbolic space fixes crowding among twenty classes. We claim that it gives a useful position to clips that should not be assigned to any leaf, and that this matters most on the diglossic, code-switched speech of ZAEBUC-Spoken and Casablanca.

Research Program

The backbone is the Whisper-large encoder with attention pooling, following the ADI-20 recipe. The pooled vector is projected into a $D$-dimensional Poincaré ball through the exponential map, which carries a flat vector onto the curved space.

The dialect tree is fixed before training. Its root is "Arabic." Its first level holds a near-root MSA node and the regional groups (Gulf, Levantine, Nile Valley, Maghrebi, Iraqi, Yemeni). Countries sit at the leaves. We embed the tree once with a low-distortion Poincaré embedding to obtain one prototype $p_v$ for each node $v$, so internal nodes have explicit locations. The encoder is trained with a distance-based softmax over leaf prototypes:

$$ \mathcal{L}(x,y) = -\log \frac{\exp\left(-d_{\mathbb{B}}(z_x, p_y)^2/\tau\right)}{\sum_{c \in \text{leaves}} \exp\left(-d_{\mathbb{B}}(z_x, p_c)^2/\tau\right)} $$

Here $z_x$ is the embedding of clip $x$, $y$ its country label, $d_{\mathbb{B}}$ the Poincaré distance and $\tau$ a temperature. At test time the model outputs two things. The first is the nearest node at any depth, which gives a prediction that can back off to an ancestor. The second is the radius $\lVert z_x \rVert$, used as an unsupervised dialectness score. MSA-heavy clips should fall near the MSA node close to the origin. English-heavy code-switched clips, which have no leaf, should fall near the origin rather than on a country.

Optimization follows Hyperbolic Neural Networks++. We use Riemannian SGD on the head, norm clipping to keep points inside the ball, and a standard optimizer on the encoder.

A second stage is conditional. It runs only if analysis shows that adjacent dialects form contact clusters rather than clean branches; the Levantine confusions in ADI-20 suggest they might. In that case we replace the ball with a hyperbolic-times-spherical product space following Learning Mixed-Curvature Representations in Product Spaces. The spherical factor would absorb geographic contact. We treat this as a diagnostic, not a headline.

Baselines

The naive reference is a frozen Whisper-large encoder with a flat linear softmax over ADI-20 classes. It tells us how much any trained head adds.

The strongest existing method is the fine-tuned Whisper-large flat classifier from ADI-20. It reports 95.66% weighted F1 on ADI-17 and 62.74% F1 zero-shot on Casablanca (the ADI-20-53h variant with freezing and augmentation). The file gives no ADI-20 test-set number. We will rerun it on ADI-20 with the same data, the same layer freezing, augmentation and step budget as our model, and the same hyperparameter search size. To beat it, we must at least match in-domain F1 and clearly exceed 62.74% F1 on Casablanca under full coverage, or dominate its accuracy-coverage curve.

The main competitor on our specific question is the same flat Whisper model with tree marginalization. Leaf probabilities are summed into region probabilities, and the model backs off to the region (or abstains) when the top leaf probability falls below a threshold. Softmax entropy serves as its dialectness score. This is the cheapest way to "hedge to the ancestor," so it is the baseline the proposal must beat.

We also reimplement Staircase Network-style gating on top of Whisper features as the existing Euclidean method that enforces hierarchy through architecture. No reported result on Lacuna exists for it on Arabic speech; its reported numbers are 16.88 $C_{primary}$ on LRE17 and 6.81% error on DigiSami, which are not comparable.

The ablation that isolates curvature is the identical prototype model in Euclidean space. It uses the same tree, prototypes from a Euclidean tree embedding, the same loss with Euclidean distance, and the same backbone and budget. Hyperbolic and Euclidean heads are compared at $D \in \{16, 64, 256, 1280\}$ with five seeds each.

Why not just…?

Why not just threshold the flat softmax and sum probabilities up the tree? This is the real threat. If marginalized softmax matches our accuracy-coverage curves on Casablanca and ZAEBUC-Spoken, and its entropy correlates with dialectness as well as our radius does, then curvature adds nothing and we will report that. Our expected advantage is specific. Softmax backoff only knows that probability mass is spread out. The hyperbolic embedding places spread-out clips at a location tied to the right ancestor. That location should handle clips with no matching leaf, such as English-heavy speech or a held-out country, better than a renormalized distribution over wrong leaves. The held-out-dialect experiment below targets exactly this difference.

Why not just use more Euclidean dimensions? Learning the Predictability of the Future found 64-dimensional hyperbolic embeddings beating 256-dimensional Euclidean ones. However, Hyperbolic Neural Networks++ reports shrinking margins at high dimension, and our tree is small. The dimension sweep in the curvature ablation settles this directly. If the hyperbolic advantage vanishes by $D=256$ on every out-of-domain metric, the honest conclusion is that the benefit is a low-dimension effect only.

Why not just transcribe and run a character n-gram classifier, since those beat neural models on dialect text? On MADAR text, a Naive Bayes and Random Forest voting classifier scored 63.02% F1, against 0.58 for a hierarchical BiLSTM (Hierarchical Deep Learning for Arabic Dialect Identification). Spontaneous dialectal speech, however, has no standard orthography and degrades automatic tools (ZAEBUC-Spoken). We give this route its best chance. On ZAEBUC-Spoken we train an n-gram classifier on the gold CODA transcripts and treat it as an upper bound for any pipeline that runs speech recognition first. If our audio model approaches that bound, the text route offers no practical advantage.

Why not just train a supervised dialectness regressor? ZAEBUC-Spoken has only about 6,000 labeled utterances from 27 speakers, and no comparable labels exist for other dialects. A regressor trained there is our ceiling for the radius-dialectness correlation. It is evaluated with speaker-disjoint cross-validation, and the question is how much of that ceiling the label-free radius recovers.

Proposed Experiments

In-domain, we report weighted F1 and a tree-distance-weighted error on the ADI-20 test set. Confusing Jordan with Syria should count as a smaller error than confusing Jordan with Morocco.

The first decisive check runs on out-of-domain speech: Casablanca, TunSwitch (no reported result found on Lacuna for TunSwitch), and the Gulf and Egyptian portions of ZAEBUC-Spoken. On each we plot accuracy against coverage when the model may back off to a region. We compare hyperbolic, Euclidean-prototype and marginalized-softmax models at matched dimension. The hyperbolic curve must dominate both Euclidean variants beyond seed variance.

The second decisive check uses ZAEBUC-Spoken's L0–L4 annotations. We compute Spearman correlation between dialectness and three scores: hyperbolic radius, Euclidean embedding norm, and softmax entropy. We also report where the roughly 19% of code-switched utterances land. Our prediction is that English-heavy utterances sit nearer the origin than pure-dialect ones, and that MSA-dominant (L0) utterances cluster around the MSA node.

The third decisive check holds out one country per region from training. For each held-out country we measure ancestor accuracy: how often its clips' nearest internal node is the correct region. Marginalized softmax gets the same chance by summing region probabilities. This test speaks directly to the gap ADI-20 notes for varieties absent from its data, such as Somali and Eritrean Arabic.

The proposal succeeds if the hyperbolic model wins all three checks at moderate dimension and does not lose in-domain F1. It fails, cleanly, if the Euclidean-prototype ablation ties it, in which case the gain belongs to prototypes rather than to curvature.