SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.01404 · EACL Findings · 2024

On Measuring Context Utilization in Document-Level MT Systems

Vlad Niculae, Wafaa Mohammed

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.01404.json · badge: /api/ran/2402.01404.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Wafaa014/context-utilization canonical (classifier label)
classifier basis: census
3 ran · 1 no recorded run
ZurichNLP/ContraPro canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
FunctionStatusWhere it lives
count_errors Ran
ran; our contract draft was wrong, not the code
ZurichNLP/ContraPro/evaluate.py
code served (permissive licence) · get_code("b83486ca6125a529")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
from io import StringIO

# Create a reference JSON file-like object
reference_data = [
    {
        'src pronoun': 'He',
        'ref pronoun': 'She',
        'ante distance': 0,
        'intrasegmental': True,
        'errors': [
            {},
            {}
        ],
        'src segment': 'He went there',
        'ref segment': 'She went there',
        'src ante phrase': 'The man',
        'ref ante phrase': 'The woman'
    },
    {
        'src pronoun': 'It',
        'ref pronoun': 'That',
        'ante distance': 2,
        'intrasegmental': False,
        'errors': [
            {}
        ],
        'src segment': 'It is good',
        'ref segment': 'That is good',
        'src ante phrase': 'The thing',
        'ref ante phrase': 'The item'
    },
    {
        'src pronoun': 'They',
        'ref pronoun': 'Them',
        'ante distance': 5,
        'intrasegmental': True,
        'errors': [],
        'src segment': 'They went away',
        'ref segment': 'Them went away',
        'src ante phrase': 'The people',
        'ref ante phrase': 'The group'
    }
]

reference_json = StringIO(json.dumps(reference_data))

# Create a scores file-like object
# For each sentence: 1 score + number_of_errors scores
scores_content = "0.9\n0.5\n0.6\n0.8\n0.7\n0.95\n"
scores = StringIO(scores_content)

ARGS = {
    'reference': reference_json,
    'scores': scores,
    'maximize': True,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_version Ran
ran; our contract draft was wrong, not the code
Wafaa014/context-utilization/fairseq/release_utils.py
pointer only (licence: NONE) · get_code("d4192f5e85770fdd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Wafaa014/context-utilization when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_scores Ran
ran, honoured the contract we drafted
ZurichNLP/ContraPro/evaluate.py
code served (permissive licence) · get_code("8b884fdc3e1f18c8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects a dict with 'correct' and 'total' keys
# Both should be numeric values (int or float)
category = {
    'correct': 8,
    'total': 10
}

ARGS = {
    'category': category
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
label_smoothed_nll_loss Ran
ran; our contract draft was wrong, not the code
Wafaa014/context-utilization/contextual-mt/contextual_mt/attn_reg_loss.py
pointer only (licence: NONE) · get_code("26da4f92ba56e785")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Wafaa014/context-utilization when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_contrastive Ran
ran; our contract draft was wrong, not the code
Wafaa014/context-utilization/contextual-mt/contextual_mt/docmt_contrastive_eval.py
pointer only (licence: NONE) · get_code("23b62d01c270ed68")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Wafaa014/context-utilization when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_next_version Not yet run
unverified (harvested, no recorded run)
Wafaa014/context-utilization/fairseq/release_utils.py
pointer only (licence: NONE) · get_code("44b6e8848744468f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Wafaa014/context-utilization when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
find_version 12 other papers
9 dated earlier, 3 later
1907.06616 (2019-07)
Facebook FAIR's WMT19 News Translation Task Submission
2022.emnlp-main.663 (2022 (year only))
Learning with Rejection for Abstractive Text Summarization
2210.02592 (2022-10)
CCC-wav2vec 2.0: Clustering aided Cross Contrastive Self-supervised learning of speech representations
and 9 more not named here
get_next_version 12 other papers
9 dated earlier, 3 later
1907.06616 (2019-07)
Facebook FAIR's WMT19 News Translation Task Submission
2022.emnlp-main.663 (2022 (year only))
Learning with Rejection for Abstractive Text Summarization
2210.02592 (2022-10)
CCC-wav2vec 2.0: Clustering aided Cross Contrastive Self-supervised learning of speech representations
and 9 more not named here
label_smoothed_nll_loss 6 other papers
5 dated earlier, 1 later
1610.02424 (2016-10)
Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence Models
2002.06714 (2020-02)
Multi-layer Representation Fusion for Neural Machine Translation
2106.02208 (2021-06)
BERTTune: Fine-Tuning Neural Machine Translation with BERTScore
and 3 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Document-level translation models are usually evaluated using general metrics such as BLEU, which are not informative about the benefits of context. Current work on context-aware evaluation, such as contrastive methods, only measure translation accuracy on words that need context for disambiguation. Such measures cannot reveal whether the translation model uses the correct supporting context. We propose to complement accuracy-based evaluation with measures of context utilization. We find that perturbation-based analysis (comparing models' performance when provided with correct versus random context) is an effective measure of overall context utilization. For a finer-grained phenomenon-specific evaluation, we propose to measure how much the supporting context contributes to handling context-dependent discourse phenomena. We show that automaticallyannotated supporting context gives similar conclusions to human-annotated context and can be used as alternative for cases where human annotations are not available. Finally, we highlight the importance of using discourse-rich datasets when assessing context utilization. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.01404")
get_code_for_paper("2402.01404")
have("2402.01404")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2402.01404.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2402.01404.svg)](https://syntology.ai/paper/2402.01404)

Connect an agent — have() is free.