SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.07187 · ICML · 2024

UPS: Efficiently Building Foundation Models for PDE Solving via Cross-Modal Adaptation

Junhong Shen, Tanya Marwah

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 5 failures of our instrument; 3 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/2403.07187.json · badge: /api/ran/2403.07187.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
sjunhongshen/unifiedpdesolvers canonical (classifier label)
classifier basis: classifier_2025
4 ran · 2 no recorded run
sjunhongshen/UnifiedPDESolvers canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
FunctionStatusWhere it lives
CrossAttention Ran
ran on a synthesized input · constructed an object; no result was computed
sjunhongshen/unifiedpdesolvers/embedder.py
code served (permissive licence) · get_code("ad5b233df0fa6774")
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 an instance of its own class, CrossAttention: the run constructed the object and did not call it, so no result was computed. 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 import einsum
from einops import rearrange, repeat

torch.manual_seed(0)

# Define the CrossAttention class
class CrossAttention(nn.Module):

    def __init__(self, query_dim, context_dim, heads=12, dim_head=64, dropout=0.0):
        super().__init__()
        inner_dim = dim_head * heads
        self.scale = dim_head ** (-0.5)
        self.heads = heads
        self.to_q = nn.Linear(query_dim, inner_dim, bias=False)
        self.to_k = nn.Linear(context_dim, inner_dim, bias=False)
        self.to_v = nn.Linear(context_dim, inner_dim, bias=False)
        self.to_out = nn.Sequential(nn.Linear(inner_dim, query_dim), nn.Dropout(dropout))

    def forward(self, x, context=None, mask=None):
        h = self.heads
        q = self.to_q(x)
        k = self.to_k(context)
        v = self.to_v(context)
        q, k, v = map(lambda t: rearrange(t, 'b n (h d) -> (b h) n d', h=h), (q, k, v))
        sim = einsum('b i d, b j d -> b i j', q, k) * self.scale
        if mask is not None:
            mask = rearrange(mask, 'b ... -> b (...)')
            max_neg_value = -torch.finfo(sim.dtype).max
            mask = repeat(mask, 'b j -> (b h) () j', h=h)
            sim.masked_fill_(~mask, max_neg_value)
        attn = sim.softmax(dim=-1)
        out = einsum('b i j, b j d -> b i d', attn, v)
        out = rearrange(out, '(b h) n d -> b n (h d)', h=h)
        return self.to_out(out)

# Create small tensors for testing
batch_size = 2
query_seq_len = 3
context_seq_len = 5
query_dim = 8
context_dim = 12
heads = 2
dim_head = 4
dropout = 0.1

# x tensor: (batch, query_seq_len, query_dim)
x = torch.randn(batch_size, query_seq_len, query_dim)

# context tensor: (batch, context_seq_len, context_dim)
context = torch.randn(batch_size, context_seq_len, context_dim)

# mask tensor: (batch, context_seq_len) - boolean mask
mask = torch.ones(batch_size, context_seq_len, dtype=torch.bool)

ARGS = {
    'query_dim': query_dim,
    'context_dim': context_dim,
    'heads': heads,
    'dim_head': dim_head,
    'dropout': dropout
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CrossAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CrossAttention 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
FNO2d Ran
ran on a synthesized input · constructed an object; no result was computed
sjunhongshen/unifiedpdesolvers/embedder.py
code served (permissive licence) · get_code("c2df9c8b854a6590")
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 an instance of its own class, FNO2d: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Define ARGS dict with all parameters for FNO2d
ARGS = {
    'num_channels': 4,
    'modes1': 12,
    'modes2': 12,
    'width': 32,
}
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 FNO2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FNO2d 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
SpectralConv2d_fast Ran
ran on a synthesized input · constructed an object; no result was computed
sjunhongshen/unifiedpdesolvers/embedder.py
code served (permissive licence) · get_code("8219a22583198ce5")
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 an instance of its own class, SpectralConv2d_fast: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class SpectralConv2d_fast(nn.Module):

    def __init__(self, in_channels, out_channels, modes1, modes2):
        super(SpectralConv2d_fast, self).__init__()
        '\n        2D Fourier layer. It does FFT, linear transform, and Inverse FFT.    \n        '
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.modes1 = modes1
        self.modes2 = modes2
        self.scale = 1 / (in_channels * out_channels)
        self.weights1 = nn.Parameter(self.scale * torch.rand(in_channels, out_channels, self.modes1, self.modes2, dtype=torch.cfloat))
        self.weights2 = nn.Parameter(self.scale * torch.rand(in_channels, out_channels, self.modes1, self.modes2, dtype=torch.cfloat))

    def compl_mul2d(self, input, weights):
        return torch.einsum('bixy,ioxy->boxy', input, weights)

    def forward(self, x):
        batchsize = x.shape[0]
        x_ft = torch.fft.rfft2(x)
        out_ft = torch.zeros(batchsize, self.out_channels, x.size(-2), x.size(-1) // 2 + 1, dtype=torch.cfloat, device=x.device)
        out_ft[:, :, :self.modes1, :self.modes2] = self.compl_mul2d(x_ft[:, :, :self.modes1, :self.modes2], self.weights1)
        out_ft[:, :, -self.modes1:, :self.modes2] = self.compl_mul2d(x_ft[:, :, -self.modes1:, :self.modes2], self.weights2)
        x = torch.fft.irfft2(out_ft, s=(x.size(-2), x.size(-1)))
        return x

ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'modes1': 2,
    'modes2': 2,
}
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 SpectralConv2d_fast — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SpectralConv2d_fast 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
create_position_ids_from_inputs_embeds Ran
ran; our contract draft was wrong, not the code
sjunhongshen/unifiedpdesolvers/embedder.py
code served (permissive licence) · get_code("34ac151823914ada")
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 int, shape (2, 5) 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 inputs_embeds tensor
# Shape: (batch_size, sequence_length, embedding_dim)
# Using distinct sizes: batch=2, seq_len=5, embed_dim=4
inputs_embeds = torch.randn(2, 5, 4)

ARGS = {
    "inputs_embeds": inputs_embeds,
    "padding_idx": 1,
}
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 int, shape (2, 5) — shape (2, 5) 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
denormalize Ran
ran; our contract draft was wrong, not the code
sjunhongshen/UnifiedPDESolvers/utils.py
code served (permissive licence) · get_code("ffb8f206fe96f08a")
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 3, 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)

# Create small tensors for pred and target
# pred and target are tensors that will be multiplied and added to
pred = torch.randn(2, 4)
target = torch.randn(2, 4)

# Create mean and std tensors
# These should have shape that broadcasts with pred/target
mean = torch.randn(4)
std = torch.randn(4)

ARGS = {
    "pred": pred,
    "target": target,
    "mean": mean,
    "std": std,
}
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 3, 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
load_pde Ran
ran; our contract draft was wrong, not the code
sjunhongshen/UnifiedPDESolvers/data_loaders.py
code served (permissive licence) · get_code("365bb29fbf2088fd")
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
import os
import tempfile
from torch.utils.data import DataLoader

torch.manual_seed(0)
np.random.seed(0)

# Create a temporary directory structure with mock data files
temp_dir = tempfile.mkdtemp()

# Create training data structure
train_dir = os.path.join(temp_dir, 'mixed_data_train')
os.makedirs(train_dir, exist_ok=True)

# Create subdirectories for each dataset type
for dataset_name in ['SW', 'DS', 'Burgers', 'ADV', '1DCFD', '2DCFD', 'NS']:
    ds_dir = os.path.join(train_dir, dataset_name)
    os.makedirs(ds_dir, exist_ok=True)
    
    # Create shape.npy (2 elements: num_samples, sequence_length+1)
    shape_data = np.array([4, 6])  # 4 samples, 5 timesteps (6-1)
    np.save(os.path.join(ds_dir, 'shape.npy'), shape_data)
    
    # Create grid.npy (small spatial grid: 3 spatial dims)
    grid_data = np.random.randn(3).astype(np.float32)
    np.save(os.path.join(ds_dir, 'grid.npy'), grid_data)
    
    # Create base_embeddings.npy
    embeddings_data = np.random.randn(7).astype(np.float32)
    np.save(os.path.join(ds_dir, 'base_embeddings.npy'), embeddings_data)
    
    # Create mask.npy
    mask_data = np.random.randint(0, 2, size=(2,)).astype(np.float32)
    np.save(os.path.join(ds_dir, 'mask.npy'), mask_data)
    
    # Create sample data files (0.npy, 1.npy, etc.) with sequence data
    # Each file contains multiple timesteps
    for file_idx in range(2):
        data = np.random.randn(6, 4).astype(np.float32)  # 6 timesteps, 4 features
        np.save(os.path.join(ds_dir, f'{file_idx}.npy'), data)

# Create test data structure
test_dir = os.path.join(temp_dir, 'mixed_data_test', 'Burgers')
os.makedirs(test_dir, exist_ok=True)

# Create test data files
shape_data = np.array([3, 6])
np.save(os.path.join(test_dir, 'shape.npy'), shape_data)

grid_data = np.random.randn(3).astype(np.float32)
np.save(os.path.join(test_dir, 'grid.npy'), grid_data)

embeddings_data = np.random.randn(7).astype(np.float32)
np.save(os.path.join(test_dir, 'base_embeddings.npy'), embeddings_data)

mask_data = np.random.randint(0, 2, size=(2,)).astype(np.float32)
np.save(os.path.join(test_dir, 'mask.npy'), mask_data)

stats_data = np.array([0.5, 0.3]).astype(np.float32)
np.save(os.path.join(test_dir, 'stats.npy'), stats_data)

for file_idx in range(2):
    data = np.random.randn(6, 4).astype(np.float32)
    np.save(os.path.join(test_dir, f'{file_idx}.npy'), data)

ARGS = {
    'root': temp_dir,
    'batch_size': 2,
    'num_workers': 0,
    'subset': 'Burgers',
    'size': 'base'
}
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
nrmse Ran
ran; our contract draft was wrong, not the code
sjunhongshen/UnifiedPDESolvers/utils.py
code served (permissive licence) · get_code("8eb303c46320cda1")
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 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 with distinct dimensions
# batch size = 2, flattened dimension = 12 (4x3)
batch_size = 2
spatial_dims = (4, 3)

# pred: predictions with shape (2, 4, 3)
pred = torch.randn(batch_size, *spatial_dims)

# target: targets with same shape as pred (2, 4, 3)
target = torch.randn(batch_size, *spatial_dims)

ARGS = {
    "pred": pred,
    "target": target,
}
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 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
nrmse_loss Ran
ran; our contract draft was wrong, not the code
sjunhongshen/UnifiedPDESolvers/utils.py
code served (permissive licence) · get_code("bab6ececcaf7788c")
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 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 pred and target
# The function expects:
# - pred: tensor that can be reshaped to [nb, -1]
# - target: tensor with .size() method, that can be reshaped to [nb, -1]
# Both should have the same total number of elements after reshaping

# Batch size = 2, feature dimension = 4
nb = 2
feature_dim = 4

# Create prediction tensor: shape (2, 4)
pred = torch.randn(nb, feature_dim)

# Create target tensor: shape (2, 4)
target = torch.randn(nb, feature_dim)

ARGS = {
    "pred": pred,
    "target": target,
}
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 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
PDEEmbeddings Not yet run
unverified (harvested, no recorded run)
sjunhongshen/unifiedpdesolvers/embedder.py
code served (permissive licence) · get_code("a106e1107565631e")
How it ran

no invocation recorded.

conv_init Not yet run
unverified (harvested, no recorded run)
sjunhongshen/unifiedpdesolvers/embedder.py
code served (permissive licence) · get_code("bbdc3af4c8b92c6b")
How it ran

no invocation recorded.

simple_normalize Not yet run
unverified (harvested, no recorded run)
sjunhongshen/UnifiedPDESolvers/generate_data.py
code served (permissive licence) · get_code("6ace5bc7c81379a4")
How it ran

no invocation recorded.

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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
SpectralConv2d_fast
brick of this paper's assembly: model
1 other paper
1 dated earlier · 1 only as an assembly brick
2010.08895 (2020-10)
Fourier Neural Operator for Parametric Partial Differential Equations

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

We present Unified PDE Solvers (UPS), a data-and compute-efficient approach to developing unified neural operators for diverse families of spatiotemporal PDEs from various domains, dimensions, and resolutions. UPS embeds different PDEs into a shared representation space and processes them using a FNO-transformer architecture. Rather than training the network from scratch, which is data-demanding and computationally expensive, we warm-start the transformer from pretrained LLMs and perform explicit alignment to reduce the modality gap while improving data and compute efficiency. The cross-modal UPS achieves state-of-the-art results on a wide range of 1D and 2D PDE families from PDEBench, outperforming existing unified models using 4 times less data and 26 times less compute. Meanwhile, it is capable of few-shot transfer to unseen PDE families and coefficients. 1 This work was done at the same time as ours.

For agents

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

get_harvested_code_for_paper("2403.07187")
get_code_for_paper("2403.07187")
have("2403.07187")

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

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

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

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

Connect an agent — have() is free.