atlas

Research map / Architectures and efficiency / Attention and transformers

Generalized Neural Sorting Networks with Error-Free Differentiable Swap Functions

ICLR 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse and structured attention · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes an error-free differentiable swap function for neural sorting networks (forward pass exact min/max, backward pass via soft gradients) combined with a permutation-equivariant Transformer, evaluated on multi-digit MNIST/SVHN and image-fragment sorting.

Problem

Differentiable sorting networks built from soft swap functions accumulate softening error, so the swapped values drift from originals and degrade learning when mapping high-dimensional inputs (multi-digit images, image fragments) to ordinal scores end-to-end.

Approach

Defines a softening error for monotonic differentiable swap functions and proposes an error-free swap that uses straight-through style stop-gradient so forward values equal exact min/max while gradients come from the soft min/max; pairs it with a permutation-equivariant Transformer (no positional encoding) that scores each input.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace Diffsort's optimal monotonic DSF with the proposed error-free DSF (ablation)CNN sorting network · Four-digit MNIST, sequence lengths 3–32exact-match accuracy: 94.6 -> 95.2; 85.0 -> 87.2; 73.6 -> 76.6; 62.2 -> 64.8; 31.8 -> 34.7; 1.4 -> 2.1Helped
Replace CNN with Transformer-SError-Free DSFs sorting network · Four-digit MNIST, sequence lengths 5–32exact-match accuracy: 87.2 -> 94.8; 76.6 -> 90.8; 64.8 -> 86.9; 34.7 -> 74.3; 2.1 -> 37.8Helped
Replace CNN with Transformer-LError-Free DSFs sorting network · SVHN, sequence lengths 3–15exact-match accuracy: 86.8 -> 88.0; 68.9 -> 74.0; 53.4 -> 63.9; 40.0 -> 50.2; 12.0 -> 21.7Helped
Replace CNN with TransformerError-Free DSFs sorting network · CIFAR-10 image fragments, 2 × 2 and 3 × 3exact-match accuracy: 56.9 -> 58.1; 0.8 -> 0.9Mixed
Set balancing weight λ to 1.000 instead of 0.100 (ablation)Error-Free DSFs, CNN · Four-digit MNIST, sequence lengths 3–32exact-match accuracy: 94.9 -> 94.8; 87.2 -> 86.9; 75.3 -> 74.2; 64.7 -> 62.6; 34.7 -> 12.0; 2.1 -> 0.0Mixed
Use λ = 0.000 instead of λ = 0.100 (ablation)Error-Free DSFs, CNN · Four-digit MNIST, sequence length 32exact-match accuracy: 2.1 -> 0.9Hurt
Use Transformer-Sort rather than the CNN in the proposed methodMNIST image fragments · MNIST fragments 3 × 3 (9 × 9)exact-match accuracy: 5.2 -> 5.6Helped
Use Transformer rather than CNN in the proposed methodMNIST image fragments · MNIST fragments 2 × 2 (14 × 14)exact-match accuracy: 98.4 -> 98.6Helped
Use a hard-permutation cross-entropy objective instead of the Frobenius-norm hard loss (ablation)Proposed neural sorting network · Sorting benchmarkssorting performanceHurt
Use the error-free DSF instead of a conventional monotonic DSF (ablation)Sorting network swap function · Swap outputs / softening errorsoftening error: 100% accuracyHelped

Surprising findings

Limitations

Experimental setup

Datasets: MNIST SVHN CIFAR-10

Benchmarks: four-digit MNIST SVHN multi-digit sorting MNIST image fragments CIFAR-10 image fragments

Metrics: accuracy exact match (acc_em) element-wise accuracy (acc_ew)

Baselines: NeuralSort Sinkhorn Sort Fast Sort & Rank Diffsort (logistic) Diffsort (logistic w/ ART) Diffsort (reciprocal) Diffsort (Cauchy) Diffsort (optimal monotonic)

Builds on: Diffsort NeuralSort Sinkhorn Sort Fast Sort & Rank straight-through estimator

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy