Filter Equivariant Functions: A symmetric account of length-general extrapolation on lists

Owen Lewis, Neil Ghani, Andrew Joseph Dudzik, Christos Perivolaropoulos, Razvan Pascanu, Petar Veličković · DOI

TL;DR

This paper introduces "filter equivariant functions" (FEs) as a principled way to define list functions that can reliably extrapolate to longer lists. By requiring functions to behave predictably when elements are removed (via filtering), the authors show that FEs are fully determined by their behavior on lists with just two unique elements, leading to a powerful "amalgamation" algorithm for constructing their outputs.

What Problem Does This Paper Address?

The core problem is length-general extrapolation: how do we design functions (especially for list-based data) that can reliably predict outputs for inputs much longer than those they were trained or observed on? This is a notorious challenge in machine learning, where models often fail to generalize beyond the length of their training data. The philosophical problem of induction, as highlighted by Kripke, also points out that any function matching observed examples can be a valid extrapolant, making it hard to define what a "good" extrapolation means. This paper tackles this by proposing a specific symmetry criterion – filter equivariance – that captures a desirable form of predictable behavior for list functions.

Methods

The paper introduces filter equivariance as a key property for list functions. A function $f$ is filter equivariant if applying a filter operation (removing elements based on a predicate) before or after applying $f$ yields the same result: $\forall \phi: a \to \text{Bool}. (\text{filter } \phi) \circ f = f \circ (\text{filter } \phi)$. This is a monoid-based symmetry, not requiring invertibility of the transformation.

They also define map equivariance, where a function commutes with element-wise transformations: $\forall \psi: a \to b. (\text{map } \psi) \circ f = f \circ (\text{map } \psi)$. Functions that are both map and filter equivariant are called natural filter equivariants (NFEs).

A crucial insight is that FEs can be characterized by their behavior on lists with at most two unique elements. This leads to the amalgamation algorithm, which reconstructs the output of an FE on a longer list by combining its outputs on all sublists containing only two unique elements. For NFEs, this simplifies further: their behavior on any list is determined by a single length-two input.

The paper also uses simplicial algebra and category theory (specifically, the category of bags) to formalize these concepts and provide a geometric interpretation.

Datasets

Not discussed in the paper. The paper focuses on theoretical properties of functions and does not present empirical evaluations on specific datasets.

Key Insights and Ideas

  • Filter Equivariance as a Principle for Extrapolation: The core idea is that requiring a function to be invariant under element removal (filtering) provides a strong, principled constraint that enables length-general extrapolation. This is a more robust criterion than simply matching observed examples.
  • Determinism from Small Sublists: A surprising and powerful result is that filter-equivariant functions are fully determined by their behavior on lists with at most two unique elements. This drastically reduces the complexity of understanding and constructing such functions.
  • Amalgamation Algorithm: This algorithm provides a concrete method to compute the output of an FE on any list, leveraging its behavior on these small sublists. It's a constructive proof of concept for the extrapolation power of FEs.
  • NFEs as Permutations: Natural filter equivariants (NFEs) are shown to be closely related to permutations of list elements, particularly when elements are unique. This connects the abstract symmetry to concrete list manipulations.
  • Monoid Symmetries: The paper frames these symmetries in terms of monoids rather than groups, acknowledging that operations like filtering are not necessarily invertible. This is a more general and practical approach for certain computational contexts.

Key Results

  • Characterization of FEs: Filter-equivariant functions are fully determined by their behavior on sublists containing at most two unique elements.
  • Characterization of NFEs: Natural filter-equivariant functions are determined by a single length-two input.
  • Amalgamation Algorithm: A constructive algorithm is presented that uses the behavior of FEs on two-unique-element sublists to compute their output on any list.
  • Examples of FEs/NFEs: The paper identifies reverse, sort, and inflate as examples of FEs/NFEs, while demonstrating that functions like triangle (which depends on absolute position) are not FEs.
  • Quantitative Count for k-NFEs: The number of k-NFEs is shown to be $2 \times 3^{k-1}$ for $k > 1$.

Limitations and Future Work

  • Monoid vs. Group Symmetries: While practical, using monoid symmetries (like filter) means that standard group-theoretic tools from geometric deep learning might not directly apply. More advanced techniques are likely needed for neural network implementations.
  • Generalizing to More Unique Elements: The paper focuses on FEs determined by two unique elements. Future work could explore characterizing functions determined by three or more unique elements.
  • Broader Symmetry Classes: The authors suggest exploring other symmetry classes beyond map and filter, such as those related to "nub" (unique elements) or functions that treat inputs as undifferentiated blocks.
  • Practical ML Applications: While the paper lays theoretical groundwork, future work is needed to translate these filter-equivariant symmetries into practical inductive biases for machine learning models to improve length-generalization.
  • Functions with Input Multiplicity Dependence: The paper acknowledges that functions where output multiplicity depends on input multiplicity (like ripple-carry addition) are not captured by the current FE framework and require further investigation.

Summary updated

BibTeX
@misc{lewis2025filter,
  author = {Owen Lewis and Neil Ghani and Andrew Joseph Dudzik and Christos Perivolaropoulos and Razvan Pascanu and Petar Veličković},
  title = {{Filter Equivariant Functions: A symmetric account of length-general extrapolation on lists}},
  year = {2025},
  eprint = {2507.08796},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.08796},
}
Figure