instruction-nmt-eval
On Instruction-Finetuning Neural Machine Translation Models — Raunak et al. (2024) (arXiv:2410.05553, 2024)
What this evaluates
Evaluates whether neural machine translation models can follow diverse natural language instructions (e.g., formality, voice, casing, simplification) without task-specific retraining, while maintaining general translation quality.
Datasets
- WMT'20 News Translation (EN-DE) — total ?; splits: test (-1)
- Multi-30K — total 29000; splits: train (29000)
- Custom Instruction Dataset — total 30000; splits: finetune (27000), eval (3000)
Metrics
RR (%) (primary) — range: percent
- Resolution Rate (RR) measures the percentage of test instances where the model's output successfully satisfies the given natural language instruction constraint.
ChrF_instruction — range: [0, 1]
- Character n-gram F-score computed on the instruction-modified translation output to evaluate stylistic and constraint adherence.
BLEU — range: [0, 1]
- Standard n-gram precision-based metric for general translation quality, computed via SacreBLEU.
ChrF2 — range: [0, 1]
- Character n-gram F-score (order 2) for general translation quality.
TER — range: [0, 1]
- Translation Edit Rate measuring the number of edits required to transform the hypothesis into the reference.
COMET — range: [0, 1]
- Reference-based neural metric that scores translation quality using a pretrained model.
Formal Accuracy — range: percent
- Percentage of translations correctly classified as formal by an external evaluator or classifier.
Informal Accuracy — range: percent
- Percentage of translations correctly classified as informal by an external evaluator or classifier.
Input / output format
Input: Source sentence concatenated with a natural language instruction (or image tokens for multimodal tasks) prepended to the source text.
Output: Translated target sentence that adheres to the specified instruction constraints.
Scoring recipe
def compute_metrics(predictions, instructions, references):
rr_correct = sum(1 for p, i in zip(predictions, instructions) if satisfies_constraint(p, i))
rr = (rr_correct / len(predictions)) * 100
chrf_inst = sacrechrf(predictions, references).score
return {'RR (%)': rr, 'ChrF_instruction': chrf_inst}
Common pitfalls
- The instruction evaluation uses a separate 10% held-out split of the custom 30-task dataset, not the WMT'20 test set.
- Zero-shot composition is evaluated on instruction combinations never seen during the 90% finetuning phase.
- General translation metrics (BLEU/ChrF2) are measured on WMT'20, while instruction-specific metrics (RR/ChrF_instruction) are measured on the task-specific 1K-sample test sets.
Evidence (verbatim from paper)
The metrics BLEU, ChrF2, TER Papineni et al. ([2002]); Popović ([2015]); Snover et al. ([2006]) for the trained model on the WMT’20 validation and test sets (under beam size of $1$) as measured using SacreBLEU Post ([2018]) are presented in Appendix B, alongside reference-based COMET Rei et al. ([2020]) scores.
Citation
@misc{raunak2024instructionfinetuning,
title={On Instruction-Finetuning Neural Machine Translation Models},
author={Raunak et al. (2024)},
year={2024},
note={arXiv:2410.05553}
}
1---2name: instruction-nmt-eval3description: Evaluates whether neural machine translation models can follow diverse natural language instructions (e.g., formality, voice, casing, simplification) without task-specific retraining, while maintaining general translation quality. Use when the user wants to benchmark on WMT'20 News Translation (EN-DE), Multi-30K, Custom Instruction Dataset, or asks about evaluating this task. Reports RR (%).4metadata:5 source: https://skillmd.com/skills/qhjqhj00/instruction-nmt-eval6 skill_kind: dataset_eval7 source_arxiv: 2410.055538 bibtex_key: raunak2024instructionfinetuning9 confidence: high10---1112# instruction-nmt-eval1314> On Instruction-Finetuning Neural Machine Translation Models — Raunak et al. (2024) (arXiv:2410.05553, 2024)1516## What this evaluates1718Evaluates whether neural machine translation models can follow diverse natural language instructions (e.g., formality, voice, casing, simplification) without task-specific retraining, while maintaining general translation quality.1920## Datasets2122- **WMT'20 News Translation (EN-DE)** — total ?; splits: test (-1)23- **Multi-30K** — total 29000; splits: train (29000)24- **Custom Instruction Dataset** — total 30000; splits: finetune (27000), eval (3000)2526## Metrics2728- `RR (%)` **(primary)** — range: percent29 - Resolution Rate (RR) measures the percentage of test instances where the model's output successfully satisfies the given natural language instruction constraint.30- `ChrF_instruction` — range: [0, 1]31 - Character n-gram F-score computed on the instruction-modified translation output to evaluate stylistic and constraint adherence.32- `BLEU` — range: [0, 1]33 - Standard n-gram precision-based metric for general translation quality, computed via SacreBLEU.34- `ChrF2` — range: [0, 1]35 - Character n-gram F-score (order 2) for general translation quality.36- `TER` — range: [0, 1]37 - Translation Edit Rate measuring the number of edits required to transform the hypothesis into the reference.38- `COMET` — range: [0, 1]39 - Reference-based neural metric that scores translation quality using a pretrained model.40- `Formal Accuracy` — range: percent41 - Percentage of translations correctly classified as formal by an external evaluator or classifier.42- `Informal Accuracy` — range: percent43 - Percentage of translations correctly classified as informal by an external evaluator or classifier.4445## Input / output format4647**Input**: Source sentence concatenated with a natural language instruction (or image tokens for multimodal tasks) prepended to the source text.4849**Output**: Translated target sentence that adheres to the specified instruction constraints.5051## Scoring recipe5253```python54def compute_metrics(predictions, instructions, references):55 rr_correct = sum(1 for p, i in zip(predictions, instructions) if satisfies_constraint(p, i))56 rr = (rr_correct / len(predictions)) * 10057 chrf_inst = sacrechrf(predictions, references).score58 return {'RR (%)': rr, 'ChrF_instruction': chrf_inst}59```6061## Common pitfalls6263- The instruction evaluation uses a separate 10% held-out split of the custom 30-task dataset, not the WMT'20 test set.64- Zero-shot composition is evaluated on instruction combinations never seen during the 90% finetuning phase.65- General translation metrics (BLEU/ChrF2) are measured on WMT'20, while instruction-specific metrics (RR/ChrF_instruction) are measured on the task-specific 1K-sample test sets.6667## Evidence (verbatim from paper)6869> The metrics BLEU, ChrF2, TER Papineni et al. ([2002]); Popović ([2015]); Snover et al. ([2006]) for the trained model on the WMT’20 validation and test sets (under beam size of $1$) as measured using SacreBLEU Post ([2018]) are presented in Appendix B, alongside reference-based COMET Rei et al. ([2020]) scores.7071## Citation7273```bibtex74@misc{raunak2024instructionfinetuning,75 title={On Instruction-Finetuning Neural Machine Translation Models},76 author={Raunak et al. (2024)},77 year={2024},78 note={arXiv:2410.05553}79}80```8182- arXiv: 2410.05553