For any $n$, there is an $n$-ary smooth function that is not a composition of smooth functions of lower arity; according to this answer to a very similar questionthis answer to a very similar question, this is due to Vitushkin (at least for $n=3$). Here is a simple but rather inexplicit proof (adapted from this paper of Akashi and Kodama). Suppose that a smooth n-ary function $f$ can be expressed as a composition of smooth functions $g_i$ of lower arity (WLOG, all of arity $n-1$). Then for each $k$, the $k$-jet of $f$ at any point is determined by the $k$-jets of the $g_i$ at corresponding points. But dimension of the space of $n$-ary $k$-jets grows like $k^n$, while the dimension of the space of $(n-1)$-ary $k$-jets grows like $k^{n-1}$. It follows that for any particular way to compose lower arity functions to get an $n$-ary function, most $k$-jets of $n$-ary functions cannot be so obtained for $k$ sufficiently large. Since there are only countably many such ways to compose, we can use bump functions to construct a single $f$ that has jets at different points that fail for all of them. Actually, by a diagonal argument we can find a single $n$-ary $\infty$-jet (i.e., power series) that is not a composition of jets of lower arity, and every $\infty$-jet can be realized by a smooth function.