SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.00270 · ICLR · 2025

DUET: OPTIMIZING LLM TRAINING DATA MIXTURES VIA NOISY FEEDBACK FROM UNSEEN EVALUATION TASKS

Bryan Kian, Hsiang Low, Chuan-Sheng Foo, Gregory Kang, Ruey Lau, Zhiliang Chen

arXiv · PDF · Open in the Atlas

Code that ran

8 of 14 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; 7 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2502.00270.json · badge: /api/ran/2502.00270.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
pmsdapfmbf/duet marked official in Papers with Code
Papers with Code archive
8 ran · 6 no recorded run
FunctionStatusWhere it lives
calculate_accuracy Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("4970ddf6ddc8fd27")
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)

# Create small tensors for testing
# outputs: logits with shape (batch_size, num_classes)
# labels: class indices with shape (batch_size,)
batch_size = 2
num_classes = 4

outputs = torch.randn(batch_size, num_classes)
labels = torch.tensor([0, 2])

ARGS = {
    "outputs": outputs,
    "labels": labels,
}
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
evaluate_model Ran
ran, honoured the contract we drafted
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("2642938bca13a388")
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 torch.nn as nn

torch.manual_seed(0)

# Define a minimal model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # input_dim=4, num_classes=3
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = SimpleModel()

# Create a simple dataloader as a list of (inputs, labels) tuples
# Each batch: inputs shape (2, 4), labels shape (2,)
dataloader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 0])),
]

# Create a criterion (loss function)
criterion = nn.CrossEntropyLoss()

# Set device to CPU
device = torch.device('cpu')

ARGS = {
    'model': model,
    'dataloader': dataloader,
    'criterion': criterion,
    'device': device
}
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
remove_lowest_influence_then_sample_based_on_IF Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("1f936e2e8a935b8f")
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 Subset. 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 torch
import numpy as np
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Create a small dataset with 5 samples, each with 4 features
x = torch.randn(5, 4)
y = torch.randn(5, 1)
dataset = TensorDataset(x, y)

# Create a DataLoader from the dataset
original_data_loader = DataLoader(dataset, batch_size=2)

# Create influences list with 5 values (one per sample)
influences = torch.tensor([-2.5, -1.0, 0.5, 1.5, 2.0], dtype=torch.float32)

# Number of datapoints to sample
num_datapoints = 3

# Seed for reproducibility
seed = 42

ARGS = {
    "original_data_loader": original_data_loader,
    "num_datapoints": num_datapoints,
    "influences": influences,
    "seed": seed,
}
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 Subset — a Subset output has no array shape of its own; none is 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
remove_lowest_influence_then_sample_uniformly Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("f0b4db4a5d861b88")
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 Subset. 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 torch
from torch.utils.data import DataLoader, TensorDataset, Subset
import numpy as np

torch.manual_seed(0)

# Create a small dataset with 8 samples
X = torch.randn(8, 4)
y = torch.randint(0, 2, (8,))
dataset = TensorDataset(X, y)

# Create a DataLoader from the dataset
original_data_loader = DataLoader(dataset, batch_size=2)

# Create influences tensor matching the number of datapoints in the dataset
influences = torch.tensor([-2.0, -1.5, -0.5, 0.2, 0.8, 1.2, 1.5, 2.0])

# Number of datapoints to sample
num_datapoints = 5

# Seed for reproducibility
seed = 42

ARGS = {
    "original_data_loader": original_data_loader,
    "num_datapoints": num_datapoints,
    "influences": influences,
    "seed": seed
}
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 Subset — a Subset output has no array shape of its own; none is 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
sample_from_dataloader Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("0ae03fc766877a9c")
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 TensorDataset. 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 torch
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Create small sample tensors
inputs = torch.randn(6, 4)  # 6 samples, 4 features
labels = torch.randint(0, 2, (6,))  # 6 binary labels

# Create a TensorDataset
dataset = TensorDataset(inputs, labels)

# Create a DataLoader
original_data_loader = DataLoader(dataset, batch_size=2)

ARGS = {
    "original_data_loader": original_data_loader,
    "seed": 42,
    "num_batches": 3,
    "contaminate": False,
}
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 TensorDataset — a TensorDataset output has no array shape of its own; none is 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
sample_from_influence Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("ce824445c33ab2e4")
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 Subset. 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 torch
import numpy as np
from torch.utils.data import DataLoader, TensorDataset, Subset

torch.manual_seed(0)

# Create a small dataset with 5 samples, each with 4 features
X = torch.randn(5, 4)
y = torch.randint(0, 2, (5,))
dataset = TensorDataset(X, y)

# Create a DataLoader from the dataset
original_data_loader = DataLoader(dataset, batch_size=2)

# Create influences list with 5 elements (one per sample)
influences = np.array([0.1, 0.3, 0.2, 0.15, 0.25])

# Number of datapoints to sample
num_datapoints = 3

# Seed for reproducibility
seed = 42

ARGS = {
    "original_data_loader": original_data_loader,
    "num_datapoints": num_datapoints,
    "influences": influences,
    "seed": seed,
}
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 Subset — a Subset output has no array shape of its own; none is 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
take_highest_influence Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("1b4323888c739ff2")
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 Subset. 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 torch
from torch.utils.data import DataLoader, TensorDataset, Subset

torch.manual_seed(0)

# Create a small dataset
x = torch.randn(10, 4)
y = torch.randint(0, 2, (10,))
dataset = TensorDataset(x, y)

# Create a DataLoader from the dataset
original_data_loader = DataLoader(dataset, batch_size=2)

# Create influence scores for each datapoint
influences = [0.1, 0.5, 0.3, 0.9, 0.2, 0.7, 0.4, 0.6, 0.8, 0.15]

# Number of datapoints to select
num_datapoints = 3

# Seed for reproducibility
seed = 42

ARGS = {
    "original_data_loader": original_data_loader,
    "num_datapoints": num_datapoints,
    "influences": influences,
    "seed": seed
}
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 Subset — a Subset output has no array shape of its own; none is 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
train_model Ran
ran; our contract draft was wrong, not the code
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("868ca549016fe2b9")
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. 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 torch
import torch.nn as nn
from torch.optim import SGD
from torch.nn import CrossEntropyLoss

torch.manual_seed(0)

# Define a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.fc(x)

model = MinimalModel()

# Create minimal dataloaders (list of (inputs, labels) tuples)
train_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,)))
]

val_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,)))
]

# Create optimizer and criterion
optimizer = SGD(model.parameters(), lr=0.01)
criterion = CrossEntropyLoss()

device = 'cpu'
num_epochs = 2
seed = 42

ARGS = {
    'model': model,
    'train_loader': train_loader,
    'val_loader': val_loader,
    'num_epochs': num_epochs,
    'criterion': criterion,
    'optimizer': optimizer,
    'device': device,
    'seed': seed,
    'printout': True
}
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 — a tuple output has no array shape of its own; none is 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
get_data_from_mixing_ratio Not yet run
unverified (harvested, no recorded run)
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("d758a97f264ee7d7")
How it ran

no invocation recorded.

get_vgg_model Not yet run
unverified (harvested, no recorded run)
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("d8095a305d1d358e")
How it ran

no invocation recorded.

iterative_loop Not yet run
unverified (harvested, no recorded run)
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("71b085d95680b369")
How it ran

no invocation recorded.

remove_tail_ends_then_uniform Not yet run
unverified (harvested, no recorded run)
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("3669cc3711a78acf")
How it ran

no invocation recorded.

sample_from Not yet run
unverified (harvested, no recorded run)
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("6b669daa78ab827e")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
pmsdapfmbf/duet/BO.py
code served (permissive licence) · get_code("cc175e23e0a2d108")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 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 14 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-23.

Repositories linked to this paper

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

Abstract

The performance of an LLM depends heavily on how well the training data matches the downstream evaluation task. However, in many practical settings, we typically do not know the data in the evaluation task (e.g., conversations between a chatbot and users are end-to-end encrypted). We refer to such tasks as unseen evaluation tasks. We can only deploy the LLM on these unseen evaluation tasks to gather multiple rounds of feedback on how well the model performs (e.g., gathering user ratings from a chatbot). In addition, this feedback can be noisy. How can we exploit such noisy feedback efficiently to optimize the LLM training data-mixture? Our paper presents DUET, a novel global-to-local algorithm that optimizes training data mixtures by interleaving data selection with Bayesian optimization to exploit coarse and noisy feedback from a downstream evaluation task. DUET is flexible enough to incorporate different data selection methods, each with different performancecompute tradeoffs. By analyzing DUET's cumulative regret, we theoretically show that DUET converges to the optimal training data mixture even without any finegrained data information from an unseen task. Finally, our experiments across a variety of language tasks demonstrate that DUET attains substantial performance improvements over existing data selection and mixing methods in the unseen-task setting. Our library, which is flexible enough to optimize different LLM training ingredients, can be found at https://github.com/chenzhiliang94/ BO-for-LLMs.

For agents

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

get_harvested_code_for_paper("2502.00270")
get_code_for_paper("2502.00270")
have("2502.00270")

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

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

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

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

Connect an agent — have() is free.