4.9 KiB
4.9 KiB
name, description
| name | description |
|---|---|
| translation-quality | Rules for faithful, documented Hy-MT3 translation in Sprachmittler. Load before changing prompts, chunking, protected-token handling, output validation or the evaluation, and when judging whether a translation is correct. |
Translation quality
Sprachmittler translates the user's selection. It does not improve, summarise or rewrite it. The output must be the model's translation under the documented Hy-MT3 prompt, with only the mechanical rules T1–T4.
The contract
- Documented prompts only. Use Tencent's templates from
docs/HYMT3_MODEL.md. The default is:Do not add "be accurate", "use formal German", "preserve formatting", a source-language field or a system message. For structured text, use the documented Structured Data 1 or Delimiters template, not a homemade instruction.Translate the following text into {target_lang}. Note that you should **only output the translated result without any additional explanation**: {source_text} - Exact language names.
{target_lang}is the model card's full English name (German,Chinese,Traditional Chinese,Portuguese,Norwegian Nynorsk,Cyrillic Kazakh). Never use a localised name or a code. - Stable prefix. Only the target language and the source text change. This preserves Ollama's prompt cache; the owner measured 177/178 cached prompt tokens.
- No silent edits. T1 trims outer whitespace and normalises line endings. T2 preserves internal whitespace and markup. T3 forbids spelling, grammar, style, terminology and punctuation edits. T4 forbids stripping a preamble: detect it, warn, keep the text.
- Structure survives. URLs, e-mails,
{{var}},${var},%s,%d, code spans, fenced code, HTML tags and JSON keys must survive. Validate; retry once with the documented Delimiters/Structured prompt; then warn and disable Replace by default. - Long text is chunked, not truncated. Paragraph boundaries first, then sentence, then word; script-aware limits; exact join. Never split a grapheme.
- Fail visibly. Empty, truncated (
done_reason: "length"), looping, preamble-flagged or token-losing output is a warning, not a success. Replace is disabled by default for blocking warnings; Copy remains.
Judging a translation
Check in this order:
- Missing content: whole clauses, sentences, list items, table cells, placeholders.
- Invented content: explanations, added facts, repeated loops.
- Meaning: negation, modality, tense, who does what to whom.
- Numbers and units: every value, decimal/thousands separator, sign, unit.
- Protected tokens: URLs, e-mails, variables, code.
- Structure: paragraph breaks, Markdown, JSON keys, HTML tags.
- Terminology: consistent terms, especially technical and legal text.
- Register: formal/informal as appropriate for the target, without changing meaning.
- Characters: umlauts/ß, ligatures, quotes, dashes, CJK punctuation, RTL order.
Report with the source segment ID, a category and a short quotation of at most 15 words from the output. Never paste a whole private text into a review or issue.
Typical Hy-MT3 failure modes
- Literal compounds on technical English ("thinking tokens" → "Denktokens"). A documented Style or Terminology prompt may help; do not edit silently.
- Preamble on unusual input ("Here is the translation:"). Detect; do not strip.
- Truncation when the input is too long for the 8192 context or
num_predictis too small. Chunk; checkdone_reason. - Repetition loops on dense or noisy input. Cancel early; warn.
- Locale numbers (
1.5→1,5). Validate values, not exact strings. - JSON keys: the default prompt usually preserves them; Structured Data 1 is safer for nested data.
- Same-language input: may be echoed or "improved"; warn and let the user decide.
Prompt cache
- Keep the prefix byte-stable. Do not prepend a timestamp, app name, model name or user preference.
- Changing the target language changes the prefix; that is expected.
- Byte-exact golden tests are mandatory for every prompt string.
Evaluation
- Use
docs/MODEL_EVALUATION.mdandsprachmittler-cli eval. - Primary metric: failure rate and protected-token retention first, then chrF, then human rating, then latency.
- Never mix publisher benchmark numbers into the ranking.
- Report per direction and per category; German↔English is mandatory.
- A model may not be the default if protected-token retention is below 1.0 or failure rate is above 2%.
Common mistakes to reject
- "Just strip the first line if it ends with a colon." No; flag it.
- "Normalise German quotes." No; that is editing.
- "Translate the keys too." No; use the structured prompt and preserve keys.
- "Retry until it looks right." One documented retry for a lost token; otherwise show the failure.
- "Use a higher temperature to make it fluent." No; measure, and keep the publisher default unless the evaluation says otherwise.