🌐 Translation Quality Estimator — Embedding Alignment Live
Score machine-translated sentence pairs for quality using real cross-lingual embedding alignment, watching the confidence score track subtle meaning drift in real time.
About this simulation
Machine translation systems produce output in milliseconds, but knowing whether that output is trustworthy is a separate, harder problem — one usually solved by translation quality estimation (QE), which scores a translation without needing a human reference. This simulation builds a small, fully transparent QE pipeline: source and translated words are placed in a shared synthetic embedding space where true translation pairs sit close together, sentence vectors are formed by averaging word (and word-pair) embeddings, and the quality score is the real cosine similarity between the two sentence vectors — exactly the comparison real embedding-based QE metrics perform.
🔬 What it shows
Six source/translation sentence pairs, each word mapped to a deterministic 20-dimensional vector. A word and its correct translation are noisy copies of the same shared "concept" vector — a toy stand-in for cross-lingual embedding alignment. The live PCA scatter projects every word vector down to its two directions of greatest variance; the dashed line between the two larger centroid dots is the sentence-level alignment distance, and the lower chart tracks the resulting 0–100 quality score over time.
🎮 How to use
Choose a sentence pair, then drag the Drift amount slider while a drift mode — Substitute, Reorder, or Omit — is selected, and watch the quality score, cosine similarity, and PCA scatter respond instantly. Reroll drift pattern re-randomises which words are affected at each drift level; Animate drift sweeps the amount up and down automatically so you can watch the score trend chart build a full history.
💡 Did you know?
Because the sentence vector is a bag-of-embeddings average, pure reordering (keeping every word but shuffling their positions) degrades the score far less than substituting or deleting content words — the same asymmetry seen in real embedding-based MT metrics, which are much better at catching mistranslated meaning than at penalising word order on their own.
Frequently asked questions
What is translation quality estimation (QE)?
Translation quality estimation predicts how good a machine translation is without access to a human reference translation. Real QE systems (like COMET-QE or OpenKiwi) feed the source sentence and the machine translation through a multilingual encoder and compare the resulting embeddings — sentences that mean the same thing land close together in the shared embedding space, while mistranslations drift apart. This simulation builds a small, transparent version of that same idea: synthetic word embeddings, a shared cross-lingual concept space, and a real cosine-similarity score.
How does the synthetic embedding space work here?
Every word concept gets a deterministic 20-dimensional vector generated from a seeded hash of its name. A source-language word and its correct translation are both built by adding independent small noise to that same shared concept vector — mimicking how real cross-lingual embedding alignment (e.g. MUSE, LASER, or a bilingual dictionary-induced mapping) places true translation pairs near each other despite being different surface words. An unrelated distractor word gets its own independent vector, so substituting the wrong word makes the translation vector drift away from the source.
How is the sentence vector computed from word vectors?
Each sentence vector is a weighted average of its word vectors (80%) and its adjacent word-pair, or bigram, vectors (20%). Averaging word vectors is the classic bag-of-embeddings sentence representation; adding bigram vectors gives the representation some sensitivity to word order, since reordering words changes which bigrams appear even though the same words are still present. This is the same trade-off real fastText- or SIF-style sentence embeddings make between simplicity and order sensitivity.
What does the quality score actually measure?
The quality score is the cosine similarity between the source sentence vector and the translation sentence vector, rescaled from its typical −0.5…0.9 range onto a 0–100 scale. Cosine similarity measures the angle between two vectors regardless of their length, which is exactly what embedding-based QE metrics use to compare meaning while ignoring superficial scale differences. A faithful translation keeps this angle small (high score); substituting, omitting, or reordering enough words widens the angle and the score falls in real time as you move the drift slider.
Why do substitution, reordering, and omission affect the score differently?
Substituting a word swaps its vector for an unrelated one, pulling the average sharply away from the source — a few substitutions already show a large drop. Omitting words shrinks the sentence average toward whatever remains, which also degrades the score once enough content is missing, but a single missing function-like word matters less. Reordering keeps every word's vector in the sentence average unchanged, so it only shows up through the bigram component — a real reflection of why bag-of-words-style metrics are less sensitive to word order than to actual mistranslation of content.
What is the PCA projection showing in the top panel?
The top panel takes every word vector in the current source and translation sentences (all 20-dimensional) and projects them down to the 2 directions of greatest variance using principal component analysis, computed live via power iteration on the covariance matrix. This is the same dimensionality-reduction technique used to visualise real word and sentence embeddings (e.g. plotting BERT or word2vec vectors). The two larger dots are the sentence centroids; the dashed line between them is the visual analogue of the alignment distance shown in the stats panel.
Is this how production machine-translation QE systems really work?
The core mechanism — comparing source and translation embeddings with cosine similarity in a shared cross-lingual space — is genuinely how reference-free QE and cross-lingual retrieval systems operate. What's simplified here is the embedding itself: production systems use deep multilingual transformer encoders trained on billions of words, while this simulation uses small deterministic pseudo-random vectors so the whole pipeline stays inspectable and reproducible in the browser. The mathematics of alignment, averaging, and cosine comparison, however, are the real thing.
Source and translation words map to a shared synthetic 20-D embedding space; sentence vectors are unigram+bigram weighted averages, and the quality score is a real cosine similarity, live-updated as you substitute, reorder, or omit words.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install