Paper · 2602.08976 · 2026
Distributionally Robust Optimization via Generative Ambiguity Modeling
Jianyi Yang, Jiaqi Wen
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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure 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.
- 1 ran with no instrument failure
1 honoured the contract we drafted, 0 violated it, 0 have no contract verdict
- 1 ran where Syntology's instrument failed
failures of Syntology's instrument, not of the code: 1 where our contract draft was wrong, 0 where the contract check could not run
- 0 have no recorded run
- 0 of those that ran constructed an object rather than computing a result
an executed sample whose run returned an instance of its own class (fixture_out_type equals the entry name): the run built an object and did not compute a result
- 0 are pointer only: the body is not served under this paper's link
"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/2602.08976.json · badge: /api/ran/2602.08976.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.
| Repository | Role | Ran |
|---|
| CIGLAB-Houston/GAS-DRO |
canonical (classifier label) classifier basis: census |
2 ran · 0 no recorded run |
| Function | Status | Where it lives |
|---|
| normalize_rows |
Ran ran, honoured the contract we drafted |
CIGLAB-Houston/GAS-DRO/Utils/utils.py code served (permissive licence) · get_code("b5caf6c15103b657") How it ranRan 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 2, dtype family float, shape (3, 4) 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
# The function normalize_rows takes a single parameter X
# which should be array-like (something that np.array can convert)
# It performs row-wise normalization by subtracting mean and dividing by std
# Create a small test matrix with distinct dimensions (3 rows, 4 columns)
X = np.array([
[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0],
[9.0, 10.0, 11.0, 12.0]
], dtype=np.float32)
ARGS = {
"X": X
}
- 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 2, dtype family float, shape (3, 4) — shape (3, 4) 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
|
| timer_with_memory |
Ran ran; our contract draft was wrong, not the code |
CIGLAB-Houston/GAS-DRO/Utils/utils.py code served (permissive licence) · get_code("a065ed18b2b4e7c9") How it ranRan 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 function. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
torch.manual_seed(0)
# The timer_with_memory function is a decorator.
# It takes a function as input and returns a wrapped version.
# We need to create a simple function to decorate.
def simple_function(x):
"""A simple function that does some computation"""
return x * 2
def method_with_device(self):
"""A method that will have a device attribute"""
return torch.tensor([1.0, 2.0, 3.0])
# Create a simple class with a device attribute
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.device = torch.device('cpu')
self.linear = nn.Linear(4, 3)
def forward(self, x):
return self.linear(x)
# Create the decorator function itself
def timer_with_memory(func):
import os
import time
import psutil
import threading
import tracemalloc
from functools import wraps
@wraps(func)
def wrapper(*args, **kwargs):
device = None
if args and hasattr(args[0], 'device'):
device = args[0].device
if torch.cuda.is_available():
if device is not None:
if isinstance(device, torch.device):
torch.cuda.set_device(device)
elif isinstance(device, int):
torch.cuda.set_device(device)
elif isinstance(device, str) and device.startswith('cuda'):
torch.cuda.set_device(torch.device(device))
else:
torch.cuda.set_device(torch.cuda.current_device())
if args and hasattr(args[0], '__class__'):
cls_name = args[0].__class__.__name__
func_name = f'{cls_name}.{func.__name__}'
else:
func_name = func.__name__
stop_flag = False
cpu_samples = []
gpu_samples = []
process = psutil.Process(os.getpid())
def monitor_memory():
while not stop_flag:
cpu_rss = process.memory_info().rss / 1024 ** 2
cpu_samples.append(cpu_rss)
if torch.cuda.is_available():
torch.cuda.synchronize()
gpu_mem = torch.cuda.memory_allocated() / 1024 ** 2
else:
gpu_mem = 0
gpu_samples.append(gpu_mem)
time.sleep(0.5)
monitor_thread = threading.Thread(target=monitor_memory, daemon=True)
monitor_thread.start()
tracemalloc.start()
start_time = time.time()
torch.cuda.reset_peak_memory_stats() if torch.cuda.is_available() else None
torch.cuda.synchronize() if torch.cuda.is_available() else None
gpu_start_alloc = torch.cuda.memory_allocated() if torch.cuda.is_available() else 0
result = func(*args, **kwargs)
end_time = time.time()
current, _ = tracemalloc.get_traced_memory()
tracemalloc.stop()
torch.cuda.synchronize() if torch.cuda.is_available() else None
gpu_end_alloc = torch.cuda.memory_allocated() if torch.cuda.is_available() else 0
gpu_peak_alloc = torch.cuda.max_memory_allocated() if torch.cuda.is_available() else 0
stop_flag = True
monitor_thread.join()
cpu_avg = sum(cpu_samples) / len(cpu_samples) if cpu_samples else 0
cpu_peak = max(cpu_samples) if cpu_samples else 0
gpu_avg = sum(gpu_samples) / len(gpu_samples) if gpu_samples else 0
gpu_peak = max(gpu_samples) if gpu_samples else 0
print(f' | {func_name} Runtime | {end_time - start_time:.2f} s')
print(f' | {func_name} Max CPU Usage | {cpu_peak:.2f} MB')
print(f' | {func_name} Avg CPU Usage | {cpu_avg:.2f} MB')
print(f' | {func_name} GPU Memory Usage | {(gpu_end_alloc - gpu_start_alloc) / 1000000.0:.2f} MB')
print(f' | {func_name} Max GPU Usage | {gpu_peak:.2f} MB')
print(f' | {func_name} Avg GPU Usage | {gpu_avg:.2f} MB')
print(f' | {func_name} Peak GPU Allocated | {gpu_peak_alloc / 1024 ** 2:.2f} MB')
return result
return wrapper
# Decorate a function
@timer_with_memory
def decorated_function(model, x):
return model(x)
# Create test inputs
model = SimpleModel()
x = torch.randn(2, 4)
ARGS = {
'func': decorated_function
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- psutil, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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-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
This paper studies Distributionally Robust Optimization (DRO), a fundamental framework for enhancing the robustness and generalization of statistical learning and optimization. An effective ambiguity set for DRO must involve distributions that remain consistent to the nominal distribution while being diverse enough to account for a variety of potential scenarios. Moreover, it should lead to tractable DRO solutions. To this end, we propose generative model-based ambiguity sets that capture various adversarial distributions beyond the nominal support space while maintaining consistency with the nominal distribution. Building on this generative ambiguity modeling, we propose DRO with Generative Ambiguity Set (GAS-DRO), a tractable DRO algorithm that solves the inner maximization over the parameterized generative model space. We formally establish the stationary convergence performance of GAS-DRO. We implement GAS-DRO with a diffusion model and empirically demonstrate its superior Out-of-Distribution (OOD) generalization performance in ML tasks. 1
For agents
The same record, over MCP at https://syntology.ai/mcp:
get_harvested_code_for_paper("2602.08976")
get_code_for_paper("2602.08976")
have("2602.08976")
The run record, dated, one paper per request, free:
curl https://syntology.ai/api/ran/2602.08976.json
A badge for a README (the split and the date, never a ratio):
[](https://syntology.ai/paper/2602.08976)
Connect an agent — have() is free.