cs.LGOct 3, 2026

A Hand-Checkable Proof That Two Hidden ReLU Layers Compute the Maximum of Six Numbers

Authors: Dimitrios Myrisiotis

Organizations: Great Bay University China

Abstract

Exactly computing the maximum function is a standard test case for studying depth in ReLU networks. Two hidden layers are known to suffice for up to twelve inputs through computer-assisted constructions. For six real inputs, we give an explicit hexagon identity whose local structure yields a self-contained analytical proof of this depth bound. The identity was found by computer-assisted search; we prove it through explicit cancellations that can be checked entirely by hand, without executing a verification program. The identity also yields an explicit network with hidden widths 1717 and 4141, zero biases, and rational weights.

Explore similar work

Jul 22, 2026

Shallower ReLU Network Representations via Exact Linear Algebra

We study the depth required by ReLU networks to exactly represent piecewise linear functions, focusing specifically on the maximum function. This problem has recently received significant attention in both the ML and TCS literature. We prove that max⁡n(x)=max⁡{x1,…,xn}\max_n(x)=\max\{x_1,\ldots,x_n\} is exactly representable with two hidden layers for every n≤12n\leq 12. Previously, this was only known up to n≤5n\leq5 [Bakaev, Brunck, Hertrich, Stade, Yehudayoff, STOC'26]. We obtain our constructions through an exact computer-assisted search within a space of candidate solutions: After a symmetry reduction, we obtain a finite system of linear equations over Q\mathbb{Q} such that any solution yields a valid representation of the maximum function. The resulting constructions have a structured first hidden layer, which enables recursive substitution into deeper networks. This yields an exact ReLU representation of max⁡n\max_n with at most ⌈log⁡6(n/2)⌉+1\lceil \log_6(n/2) \rceil+1 hidden layers. Consequently, every continuous piecewise-linear function on Rd\mathbb{R}^d admits an exact representation with at most ⌈log⁡6((d+1)/2)⌉+1\lceil\log_6((d+1)/2)\rceil+1 hidden layers; in particular, two hidden layers suffice for d≤11d\leq 11. Again, these results improve upon [Bakaev, Brunck, Hertrich, Stade, Yehudayoff, STOC'26], who proved analogous logarithmic bounds with base three.
Aug 25, 2026

Representing MAX functions using two-hidden-layer ReLU networks

We study exact representations of MAXN(x)=max⁡x1,…,xN\mathrm{MAX}_N(x)=\max{x_1,\ldots,x_N} using two-hidden-layer ReLU neural networks. This problem has been studied in recent years in an attempt to characterize the exact number of hidden layers required to represent continuous piecewise linear functions. The best lower bound is 2, while the current upper bound is logarithmic in NN. It remains completely open if the right answer is a constant number of hidden layers (possibly even 2!) or not. In fact, a recent breakthrough was the representation of MAX5\mathrm{MAX}_5 as a two-hidden-layer ReLU function obtained in [Bakaev et al., 2026], and the case of MAXN\mathrm{MAX}_N was stated as open for N≥6N\geq 6 in that paper. Using a careful computer assisted search, we obtain two-hidden-layer ReLU representations of MAX5,MAX6,MAX7\mathrm{MAX}_5, \mathrm{MAX}_6, \mathrm{MAX}_7, and MAX8\mathrm{MAX}_8. We obtain these by considering rational linear combinations of terms of the form max⁡{∑r=1smax⁡(xar,xbr),∑r=1smax⁡(xcr,xdr)}\max\{\sum_{r=1}^{s}\max(x_{a_r},x_{b_r}),\sum_{r=1}^{s}\max(x_{c_r},x_{d_r})\}, where ar,br,cr,dr∈{1,…,N}a_r,b_r,c_r,d_r\in\{1,\ldots,N\}. Each inner maximum of two coordinates can be computed in a first hidden layer, and the outer maximum of the two side-sums can be computed in a second hidden layer. Consequently, every finite linear combination of these terms has a two-hidden-layer ReLU realization. An identity for MAXN\mathrm{MAX}_N in this form therefore gives an exact two-hidden-layer ReLU representation of MAXN\mathrm{MAX}_N. Very recently, two-hidden-layer representations of MAXN\mathrm{MAX}_N of the above form were obtained for all N≤10N\leq 10 in [Ruess et al., 2026]. Our representations are different and were developed independently. While our techniques share most of the high-level ideas presented in [Ruess et al., 2026], there are also some minor differences which may be of interest for future research on this problem.
Oct 19, 2026

Two hidden layer suffice: the caterpillar net

Every continuous piecewise linear (CPWL) function is a finite signed sum of maxima of affine functions, making maximum representation a central problem in the study of the expressiveness of ReLU networks. A now-disproved conjecture predicted logarithmic depth for maxima. Inspired by the proof by Brunck et al. (2026) that two hidden layers suffice for general CPWL functions, we give the Caterpillar Net, a nonrecursive construction for the maximum of NN inputs with two hidden layers of widths O(N2)O(N^2) and 2O(Nlog⁡N)2^{O(N\log N)}. The construction has a direct geometric interpretation.