SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.19941 · ACL · 2025

Alleviating Distribution Shift in Synthetic Data for Machine Translation Quality Estimation

Hao Yang, Shujian Huang, Jiajun Chen, Xiang Geng, Zhejian Lai

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 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; 0 honoured the contract we drafted, 0 violated it and 11 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2502.19941.json · badge: /api/ran/2502.19941.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
NJUNLP/njuqe canonical (classifier label)
classifier basis not recorded on the link
11 ran · 0 no recorded run
FunctionStatusWhere it lives
args_update Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/modules/qe_detector.py
code served (permissive licence) · get_code("e9324ea7d15a909c")
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 Namespace. 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 argparse
import torch

torch.manual_seed(0)

# The function iterates over vars(args).items() and looks for keys ending with '_extractor'
# It extracts those keys (removing the '_extractor' suffix) and their values
# Then constructs a new Namespace from them

# Create args with some attributes, including some ending with '_extractor'
args = argparse.Namespace(
    model_extractor='bert',
    tokenizer_extractor='gpt2',
    data_extractor=[1, 2, 3],
    learning_rate=0.001,
    batch_size=32,
    other_param='value'
)

ARGS = {'args': args}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
filter_indices_by_diff Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/tasks/curriculum_task.py
code served (permissive licence) · get_code("686b04b4de4e7912")
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 ndarray, ndim 1, dtype family int, shape (3,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

class DiffDataset:
    def __init__(self, diff_values):
        self.diff_dataset = diff_values

# Create a small dataset with diff_dataset attribute
diff_values = np.array([0.5, 0.3, 0.8, 0.1, 0.6, 0.2])
dataset = DiffDataset(diff_values)

# Create indices to filter
indices = np.array([0, 1, 2, 3, 4, 5])

# Set competence level (fraction of indices to keep)
competence = 0.5

ARGS = {
    "dataset": dataset,
    "indices": indices,
    "competence": competence
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (3,) — shape (3,) as a later run recorded it
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
filter_indices_by_length Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/tasks/curriculum_task.py
code served (permissive licence) · get_code("2456857cfcfb2b2a")
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 list, ndim 1, dtype family int; 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - dataset: not used in the function body
# - indices: indexed with [:idx], so needs to support slicing (list or array-like)
# - competence: multiplied by len(indices), so needs to be numeric

# Create a simple dataset (not used but required parameter)
dataset = [1, 2, 3, 4, 5]

# Create indices as a list that supports slicing
indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

# Create competence as a float between 0 and 1
competence = 0.5

ARGS = {
    "dataset": dataset,
    "indices": indices,
    "competence": competence
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list 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
fscore Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/utils.py
code served (permissive licence) · get_code("afe05e8787d26825")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 fscore function takes three parameters: tp, fp, fn
# These appear to be true positives, false positives, and false negatives
# They are used in arithmetic operations (addition, division)
# So they should be numeric values (int or float)

tp = 10
fp = 3
fn = 2

ARGS = {
    "tp": tp,
    "fp": fp,
    "fn": fn
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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 on a synthesized input
NJUNLP/njuqe/njuqe/criterions/qe_loss.py
code served (permissive licence) · get_code("aeee078a872841dc")
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
import copy

torch.manual_seed(0)

# Build arguments for label_smoothed_nll_loss
batch_size = 2
num_classes = 4
seq_len = 3

# lprobs: log probabilities, shape (batch_size, seq_len, num_classes)
# These should be log-softmax outputs
lprobs = torch.log_softmax(torch.randn(batch_size, seq_len, num_classes), dim=-1)

# target: class indices, shape (batch_size, seq_len)
target = torch.randint(0, num_classes, (batch_size, seq_len))

# epsilon: label smoothing parameter
epsilon = 0.1

# weight: optional per-class weights, shape (num_classes,)
weight = torch.ones(num_classes)

# ignore_index: index to ignore (e.g., padding token)
ignore_index = 3

# reduce: whether to reduce the loss to a scalar
reduce = True

ARGS = {
    "lprobs": lprobs,
    "target": target,
    "epsilon": epsilon,
    "weight": weight,
    "ignore_index": ignore_index,
    "reduce": reduce,
}
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
precision Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/utils.py
code served (permissive licence) · get_code("463dec4b9e606031")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 precision(tp, fp, fn) computes precision as tp / (tp + fp)
# tp, fp, fn are likely numeric values (true positives, false positives, false negatives)
# The function uses:
# - tp + fp (addition)
# - tp / (tp + fp) (division)
# - comparison with 0
# So we need numeric types (int, float, or scalar tensors)

ARGS = {
    "tp": 15,
    "fp": 5,
    "fn": 3
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
precision Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/criterions/qe_metric.py
code served (permissive licence) · get_code("758494073a00f760")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
import numpy as np

torch.manual_seed(0)

# The function `precision` takes two parameters: tp (true positives) and fp (false positives)
# It performs simple arithmetic operations on them (addition and division)
# So we can pass integers, floats, or numeric tensors

# Using integers for simplicity
tp = 8
fp = 2

ARGS = {
    "tp": tp,
    "fp": fp
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
precision_recall_fscore_support Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/criterions/qe_metric.py
code served (permissive licence) · get_code("1ac84079458cd9bf")
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 list, ndim 2, 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 numpy as np

# Create sample data for the function
# y: true labels (shape: n_samples,)
# y_hat: predicted labels (shape: n_samples,)
# n_classes: number of classes

np.random.seed(0)

# Create small sample predictions and ground truth
n_samples = 10
n_classes = 3

y = np.array([0, 1, 2, 0, 1, 2, 0, 1, 2, 0], dtype=int)
y_hat = np.array([0, 1, 1, 0, 1, 2, 0, 2, 2, 0], dtype=int)

ARGS = {
    "y": y,
    "y_hat": y_hat,
    "n_classes": n_classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list 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
recall Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/utils.py
code served (permissive licence) · get_code("a10d395718b0825a")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
import numpy as np

torch.manual_seed(0)

# The recall function takes three numeric arguments: tp, fp, fn
# These represent true positives, false positives, and false negatives
# The function computes recall = tp / (tp + fn) if tp + fn > 0, else 0

# Create simple numeric values for the three parameters
tp = 15  # true positives
fp = 5   # false positives
fn = 10  # false negatives

ARGS = {
    "tp": tp,
    "fp": fp,
    "fn": fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
scores_for_class Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/criterions/qe_metric.py
code served (permissive licence) · get_code("4cb708962c259bca")
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
import numpy as np

torch.manual_seed(0)

# Construct a confusion matrix (4x4 for 4 classes)
# Each row represents true labels, each column represents predicted labels
# Values are counts of samples
matrix = torch.tensor([
    [50, 5, 2, 3],      # True class 0: 50 correct, 5 predicted as 1, 2 as 2, 3 as 3
    [4, 45, 3, 2],      # True class 1: 4 predicted as 0, 45 correct, 3 as 2, 2 as 3
    [2, 3, 48, 1],      # True class 2: 2 predicted as 0, 3 as 1, 48 correct, 1 as 3
    [3, 2, 1, 44]       # True class 3: 3 predicted as 0, 2 as 1, 1 as 2, 44 correct
], dtype=torch.float32)

class_index = 0

ARGS = {
    "class_index": class_index,
    "matrix": matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
select_positions Ran
ran on a synthesized input
NJUNLP/njuqe/njuqe/models/xlmqe.py
code served (permissive licence) · get_code("597e001a2b1cb7b2")
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 Tensor, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create a small tensor with shape (2, 4)
# batch_size=2, feature_dim=4
tensor = torch.randn(2, 4)

# Create indices tensor with shape (2, 3)
# For each of 2 samples, we select 3 positions
indices = torch.tensor([[0, 1, 2], [1, 2, 3]])

ARGS = {
    "tensor": tensor,
    "indices": indices,
}
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 Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
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

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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.

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

Quality Estimation (QE) models evaluate the quality of machine translations without reference translations, serving as the reward models for the translation task. Due to the data scarcity, synthetic data generation has emerged as a promising solution. However, synthetic QE data often suffers from distribution shift, which can manifest as discrepancies between pseudo and real translations, or in pseudo labels that do not align with human preferences. To tackle this issue, we introduce DCSQE, a novel framework for alleviating distribution shift in synthetic QE data. To reduce the difference between pseudo and real translations, we employ the constrained beam search algorithm and enhance translation diversity through the use of distinct generation models. DCSQE uses references-i.e., translation supervision signals-to guide both the generation and annotation processes, enhancing the quality of token-level labels. DCSQE further identifies the shortest phrase covering consecutive error tokens, mimicking human annotation behavior, to assign the final phrase-level labels. Specially, we underscore that the translation model can not annotate translations of itself accurately. Extensive experiments demonstrate that DCSQE outperforms SOTA baselines like CometKiwi in both supervised and unsupervised settings. Further analysis offers insights into synthetic data generation that could benefit reward models for other tasks. The code is available at https://github.com/NJUNLP/njuqe. * Equal contribution, in random order.

For agents

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

get_harvested_code_for_paper("2502.19941")
get_code_for_paper("2502.19941")
have("2502.19941")

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

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

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

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

Connect an agent — have() is free.