TL;DR
DeepOSets merges Deep Operator Networks (DeepONets) with DeepSets to create a fast, non-autoregressive architecture for in-context learning of supervised learning algorithms. By treating in-context prompts as unordered sets rather than sequential text tokens, DeepOSets slashes parameter counts by orders of magnitude, trains in minutes instead of hours, achieves constant-time per-query inference, and dramatically outperforms standard transformers in noisy conditions.
What Problem Does This Paper Address?
In-context learning (ICL) allows a pre-trained model to adapt to new tasks purely from examples provided in a user prompt, without updating its weights. While popularized by autoregressive transformers in NLP, ICL has recently been studied as a way to "meta-learn" classical machine learning algorithms (such as least-squares linear regression).
However, autoregressive transformers are an awkward fit for standard supervised learning:
- Unnecessary sequential bias: Datasets are unordered sets of input-output pairs $(x_i, y_i)$. Treating them as sequences ignores permutation invariance and wastes model capacity.
- Computational overhead: Transformers suffer from quadratic $O(n^2)$ complexity in prompt length. Because each new query $x_{\text{query}}$ must be appended to the sequence, transformers are effectively "memoryless"—they must recompute attention matrices across the entire prompt for every new evaluation point.
- High resource requirements: They require millions of parameters and hours of training even for simple function-fitting tasks.
Methods
The authors introduce DeepOSets, adapting the DeepONet operator learning framework to support variable-sized, unordered in-context datasets:
- DeepONet Foundation: DeepONets learn operators between function spaces via two sub-networks: a branch network (which encodes input data into coefficients $b_1, \dots, b_p$) and a trunk network (which encodes continuous query locations into adaptive basis functions $t_1, \dots, t_p$). The final output is their inner product: $\sum_{i=1}^p b_i t_i + b_0$.
- DeepSets Branch Integration: Standard DeepONets require fixed-size inputs. DeepOSets replaces the standard branch with a DeepSets module. Each context example $(x_i, y_i)$ is projected linearly and passed through a shared MLP $\phi$. The resulting representations $h_i$ are pooled via a symmetric operation (such as mean pooling: $h = \frac{1}{n}\sum h_i$), providing strict permutation invariance and handling variable prompt lengths $n$.
- $k$-ary Janossy Pooling: To capture interactions between context examples (similar to attention), the authors also explore Janossy pooling. For $k=2$ (binary pooling), the network processes all distinct pairs of context examples before pooling, balancing expressive power with an $O(n^2)$ training cost.
Context Data Dn: {(x1, y1), ..., (xn, yn)}
│
▼
[ Linear Embed + Shared MLP φ ]
│
▼
[ Permutation-Invariant Pooling ] ──► [ Branch MLP ] ──► b(Dn)
│
(Inner Product) ──► y_pred
│
Query Point: x_query ───────────────► [ Trunk MLP ] ──► t(x_query)
Datasets
The authors evaluate DeepOSets on synthetic linear regression benchmarks following the experimental setup of Garg et al. (2022):
- Hypothesis Space: Linear functions $f(x) = w^T x$, where $w \sim \mathcal{N}(0, I_d)$.
- Input Dimensions: Evaluated in 1D ($d=1$) and 5D ($d=5$).
- Training Data: Model weights are trained solely on noiseless synthetic prompts (e.g., $n = 13$ examples for $d=1$).
- Testing Conditions: Evaluated on prompts of differing sample sizes (e.g., $n = 10$) contaminated with varying Gaussian noise scales ($\sigma^2 \in [0, 2.0]$).
Key Insights and Ideas
- Permutation Invariance as a Strong Inductive Bias: Baking set invariance directly into the architecture eliminates the need for the model to spend parameters "learning" that prompt order does not matter.
- $O(1)$ Query Inference via Decoupled Representations: In DeepOSets, the context dataset $D_n$ is encoded by the branch network once. Subsequent query points $x_{\text{query}}$ only pass through the lightweight trunk network, turning per-query inference into an $O(1)$ operation regardless of dataset size.
- Meta-Learned Noise Robustness: Although trained strictly on noiseless data, DeepOSets generalizes remarkably well to noisy prompts at test time. The inductive bias of set pooling acts as an effective regularizer, making it far more robust to noise than overparameterized transformers or ordinary least squares.
Key Results
- Orders-of-Magnitude Parameter Reduction: In 1D regression, baseline DeepOSets uses just 72K parameters compared to the 22M parameters of the GPT-based transformer model (over $300\times$ smaller).
- Massive Speedups:
- Training: DeepOSets converged in 9 minutes, while the transformer baseline required 3 to 4 hours.
- Inference: DeepOSets clocked 0.087 ms per query ($n=10$) versus 7.11 ms per query for the transformer—over $80\times$ faster.
- Lower Error and Noise Tolerance: In 1D regression with moderate noise ($\sigma^2 = 0.2$), DeepOSets achieved a test MSE of 0.0112, an order of magnitude better than the transformer's 0.132. In high-noise regimes ($\sigma^2 = 2.0$), DeepOSets maintained an MSE of 1.113 compared to the transformer's 6.692.
- High Dimensions ($d=5$): The binary Janossy variant ($k=2$, 1.94M parameters) remained competitive with or outperformed the 22M-parameter transformer under noise.
Limitations and Future Work
- Curse of Dimensionality: Like vanilla DeepONets, DeepOSets struggles to scale to higher input dimensions ($d \gg 5$) without specialized modifications. For $d=5$ under zero-noise conditions, the baseline $k=1$ model lagged behind the transformer.
- Janossy Pooling Complexity: Moving beyond independent example pooling ($k > 1$) scales combinatorially ($O(n^k)$), which limits full pairwise/triplet interactions for long prompts.
- Future Directions: The authors suggest integrating dimension-reduction methods (e.g., PCA-Net, separable operator networks, or two-step branch/trunk training), extending the framework to automated machine learning (AutoML hyperparameter selection), and applying DeepOSets to operator learning for partial differential equations (PDEs).
Summary updated