SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.04104 · ICLR · 2021

Learning the Pareto Front with Hypernetworks

Gal Chechik, Aviv Navon, Ethan Fetaya, Aviv Shamsian

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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 1 has no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-23; 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/2010.04104.json · badge: /api/ran/2010.04104.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
AvivNavon/pareto-hypernetworks canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
LeNetHyper Ran
ran on a synthesized input
AvivNavon/pareto-hypernetworks/experiments/multimnist/models.py
code served (permissive licence) · get_code("e7be498b2e8b5d2c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 torch
from torch import nn

INIT_ARGS = {
    'kernel_size': [3, 3],
    'ray_hidden_dim': 100,
    'out_dim': 10,
    'target_hidden_dim': 50,
    'n_kernels': 10,
    'n_conv_layers': 2,
    'n_hidden': 1,
    'n_tasks': 2,
}

ARGS = {
    'ray': torch.randn(2, 2),
}

if __name__ == '__main__':
    from typing import List
    
    class LeNetHyper(nn.Module):
        """LeNet Hypernetwork"""

        def __init__(self, kernel_size: List[int], ray_hidden_dim=100, out_dim=10, target_hidden_dim=50, n_kernels=10, n_conv_layers=2, n_hidden=1, n_tasks=2):
            super().__init__()
            self.n_conv_layers = n_conv_layers
            self.n_hidden = n_hidden
            self.n_tasks = n_tasks
            assert len(kernel_size) == n_conv_layers, 'kernel_size is list with same dim as number of conv layers holding kernel size for each conv layer'
            self.ray_mlp = nn.Sequential(nn.Linear(2, ray_hidden_dim), nn.ReLU(inplace=True), nn.Linear(ray_hidden_dim, ray_hidden_dim), nn.ReLU(inplace=True), nn.Linear(ray_hidden_dim, ray_hidden_dim))
            self.conv_0_weights = nn.Linear(ray_hidden_dim, n_kernels * kernel_size[0] * kernel_size[0])
            self.conv_0_bias = nn.Linear(ray_hidden_dim, n_kernels)
            for i in range(1, n_conv_layers):
                p = 2 ** (i - 1) * n_kernels
                c = 2 ** i * n_kernels
                setattr(self, f'conv_{i}_weights', nn.Linear(ray_hidden_dim, c * p * kernel_size[i] * kernel_size[i]))
                setattr(self, f'conv_{i}_bias', nn.Linear(ray_hidden_dim, c))
            latent = 25
            self.hidden_0_weights = nn.Linear(ray_hidden_dim, target_hidden_dim * 2 ** i * n_kernels * latent)
            self.hidden_0_bias = nn.Linear(ray_hidden_dim, target_hidden_dim)
            for j in range(n_tasks):
                setattr(self, f'task_{j}_weights', nn.Linear(ray_hidden_dim, target_hidden_dim * out_dim))
                setattr(self, f'task_{j}_bias', nn.Linear(ray_hidden_dim, out_dim))

        def shared_parameters(self):
            return list([p for n, p in self.named_parameters() if 'task' not in n])

        def forward(self, ray):
            features = self.ray_mlp(ray)
            out_dict = {}
            layer_types = ['conv', 'hidden', 'task']
            for i in layer_types:
                if i == 'conv':
                    n_layers = self.n_conv_layers
                elif i == 'hidden':
                    n_layers = self.n_hidden
                elif i == 'task':
                    n_layers = self.n_tasks
                for j in range(n_layers):
                    out_dict[f'{i}{j}.weights'] = getattr(self, f'{i}_{j}_weights')(features)
                    out_dict[f'{i}{j}.bias'] = getattr(self, f'{i}_{j}_bias')(features).flatten()
            return out_dict

    model = LeNetHyper(**INIT_ARGS)
    output = model(**ARGS)
    print("Output keys:", list(output.keys()))
    print("Model created and forward pass successful")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
evaluate Ran
ran; our contract draft was wrong, not the code
AvivNavon/pareto-hypernetworks/experiments/multimnist/trainer.py
code served (permissive licence) · get_code("42e224ceb49416b5")
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) and returned defaultdict. 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 import nn
import numpy as np

torch.manual_seed(0)

# Define a minimal hypernet that takes a ray and outputs weights
class HyperNet(nn.Module):
    def __init__(self, ray_dim=2, weight_dim=8):
        super().__init__()
        self.fc = nn.Linear(ray_dim, weight_dim)
    
    def forward(self, ray):
        return self.fc(ray)

# Define a minimal targetnet that takes images and weights, outputs two logits
class TargetNet(nn.Module):
    def __init__(self, img_dim=4, weight_dim=8, num_classes=3):
        super().__init__()
        self.fc1 = nn.Linear(img_dim, 16)
        self.fc2 = nn.Linear(16 + weight_dim, num_classes)
        self.fc3 = nn.Linear(16 + weight_dim, num_classes)
    
    def forward(self, img, weights):
        x = self.fc1(img)
        x_combined = torch.cat([x, weights.unsqueeze(0).expand(x.shape[0], -1)], dim=1)
        logit1 = self.fc2(x_combined)
        logit2 = self.fc3(x_combined)
        return logit1, logit2

# Create instances
hypernet = HyperNet(ray_dim=2, weight_dim=8)
targetnet = TargetNet(img_dim=4, weight_dim=8, num_classes=3)

# Create a minimal data loader: list of (img, ys) tuples
# img shape: (batch_size, img_dim=4)
# ys shape: (batch_size, 2) where ys[:, 0] is task1 label, ys[:, 1] is task2 label
loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2, 2))),
    (torch.randn(2, 4), torch.randint(0, 3, (2, 2))),
]

# Create rays: list of numpy arrays, each of shape (2,)
rays = [
    np.array([0.7, 0.3], dtype=np.float32),
    np.array([0.4, 0.6], dtype=np.float32),
]

device = torch.device('cpu')

ARGS = {
    'hypernet': hypernet,
    'targetnet': targetnet,
    'loader': loader,
    'rays': rays,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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

Also present in other papers' code

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

Multi-objective optimization (MOO) problems are prevalent in machine learning. These problems have a set of optimal solutions, called the Pareto front, where each point on the front represents a different trade-off between possibly conflicting objectives. Recent MOO methods can target a specific desired ray in loss space however, most approaches still face two grave limitations: (i) A separate model has to be trained for each point on the front; and (ii) The exact trade-off must be known before the optimization process. Here, we tackle the problem of learning the entire Pareto front, with the capability of selecting a desired operating point on the front after training. We call this new setup Pareto-Front Learning (PFL). We describe an approach to PFL implemented using HyperNetworks, which we term Pareto HyperNetworks (PHNs). PHN learns the entire Pareto front simultaneously using a single hypernetwork, which receives as input a desired preference vector and returns a Pareto-optimal model whose loss vector is in the desired ray. The unified model is runtime efficient compared to training multiple models and generalizes to new operating points not used during training. We evaluate our method on a wide set of problems, from multi-task regression and classification to fairness. PHNs learn the entire Pareto front at roughly the same time as learning a single point on the front and at the same time reach a better solution set. Furthermore, we show that PHNs can scale to generate large models like ResNet18. PFL opens the door to new applications where models are selected based on preferences that are only available at run time.

For agents

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

get_harvested_code_for_paper("2010.04104")
get_code_for_paper("2010.04104")
have("2010.04104")

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

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

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

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

Connect an agent — have() is free.