Concepts / Feedforward Neural Network Architecture

Feedforward Neural Network Architecture

Neural networks with an appropriate depth-2 structure can represent every Boolean function.

  • Programming

The Representation Question

Consider a task with n inputs. Each input is either -1 or +1, and the task produces one output that is also either -1 or +1. The task is therefore described by a Boolean function. The important question is not whether a neural network can represent some such tasks. It is whether an appropriately structured feedforward network can represent every possible assignment of outputs to the allowed input vectors.

Input Vectors and Assigned Outputs

A Boolean function in this setting is a mapping from {±1}^n to {±1}. Its input is an n-dimensional vector whose entries are each -1 or +1. For every allowed input vector, the function assigns exactly one output sign.

containscontainsfunction assignmentfunction assignment{±1}^n2^n input vectorsinput vectorone allowed pattern+1input vectoranother allowed pattern-1
Which output in {±1} is assigned to each input vector in {±1}^n?

Reading a Boolean function

Imagine a Boolean function with n inputs. Choose one allowed input vector and ask what the function must provide for it.

Identify the domain: The input belongs to {±1}^n, so it is an n-dimensional sign vector.

Identify the codomain: The output belongs to {±1}, so the assigned result is either -1 or +1.

Interpret the rule: The function is an assignment of one output sign to every allowed input vector. Different Boolean functions can make different assignments.

A Boolean function is completely described by the outputs it assigns to the allowed input vectors.

The Depth-2 Data Path

The representation guarantee uses an appropriately selected depth-2 feedforward structure. The input is an n-dimensional sign vector, computation passes through the network structure, and the result is one sign value. The claim concerns the hypothesis class associated with the graph: by choosing the structure appropriately, the class of functions represented by the network includes every function from {±1}^n to {±1}.

forward computationforward computationInput vectorn sign inputsHidden layersufficiently many nodesOutput sign-1 or +1
How does information flow from an n-dimensional sign vector through the hidden layer to one Boolean output?

Depth 2 is a depth guarantee, not a size guarantee. It states that two layers of computation are sufficient when the network is allowed to be sufficiently large.

What Universal Representation Means

A neural network graph determines a hypothesis class: a collection of functions that can be obtained from that graph. Saying that the hypothesis class contains every Boolean function means that, for every possible assignment of outputs to the allowed input vectors, some setting within the appropriately selected depth-2 network represents that assignment. The statement is about the whole collection of possible functions, not about one fixed output rule.

containsincludesDepth-2 hypothesisclassfunctions from one graphAll Boolean functionsfunctions from {±1}^n to{±1}One Boolean ruleone output assignment
How does the set of functions represented by the network relate to the set of all Boolean functions?

Expressiveness Versus Compactness

Universal implementability answers whether every Boolean function can be represented. It does not answer how compact the representation is. In the construction associated with the depth-2 result, the hidden layer may contain exponentially many nodes. Thus, a network can have the required expressive range while still being large.

expressive rangeefficiency questionUniversalrepresentationcontains every BooleanfunctionSeparate guaranteesone does not imply theotherCompactrepresentationsmall network
What is the difference between representing every Boolean function and representing those functions with a compact network?

When interpreting a representation theorem, ask two separate questions: What functions can the hypothesis class contain, and how large must the network be to contain them? The depth-2 result answers the first question universally but warns that the second can have an exponential cost.

Why Input Count Matters

The minimum size s(n) needed for universal Boolean representation is exponential in the number of inputs n. The reason this matters conceptually is that increasing n expands the collection of possible input vectors, and the universal construction may require a hidden layer whose size grows exponentially with n. The depth remains 2, but the network need not remain small.

universal constructionincreases required sizen inputs2^n input vectorss(n)exponential universal sizemore inputsmore possible vectorslarger s(n)exponential growth with n
How does increasing the number of input variables affect the number of possible input patterns and the required universal network size?

Tracing the two guarantees

Suppose the number of inputs increases while the goal remains universal representation of Boolean functions.

Keep the depth fixed: The result still uses an appropriately selected depth-2 network.

Track the input space: With n inputs, the domain is {±1}^n and contains 2^n possible input vectors.

Track the network size: The minimum universal size s(n) is exponential in n, and the hidden layer in the construction may therefore be exponentially large.

Increasing the number of inputs does not invalidate the depth-2 representation guarantee, but it can make the required network very large.

Common Misreadings

  • Interpreting depth 2 as a guarantee of a small network.

    The universal construction may have an exponentially large hidden layer.

    Fix: Treat depth and size as separate properties. The theorem guarantees a shallow structure, not an inexpensive representation.

  • Confusing one representable function with a hypothesis class containing every function.

    The claim concerns the collection of functions associated with an appropriately selected graph.

    Fix: State that the hypothesis class contains all functions from {±1}^n to {±1}; one particular rule is only one member of that class.

  • Assuming the result applies only to a special Boolean operation.

    The universal statement covers every assignment of outputs to the allowed input vectors.

    Fix: Use the full definition: every function mapping {±1}^n to {±1} is included.

Check Your Understanding

MEDIUM

Explain in your own words why the statement “a depth-2 network can represent every Boolean function” does not mean that every Boolean function has a small representation.

Hints
  • Separate the meaning of representational range from the meaning of network size.
  • Mention the possible size of the hidden layer.
  • Relate the required size s(n) to the number of inputs n.
EASY

Complete this reasoning chain: a Boolean function maps ______ to ______; an appropriately selected depth-2 hypothesis class contains ______; the required universal size s(n) is ______ in n.

Hints
  • Use the sign-vector notation for the domain and codomain.
  • The hypothesis class contains all functions of the relevant input-output type.
  • The final relationship describes how size changes as the number of inputs grows.

Key Takeaways

  1. A Boolean function here maps an n-dimensional sign vector in {±1}^n to one sign in {±1}.
  2. An appropriately selected depth-2 feedforward network has a hypothesis class containing every Boolean function of this type.
  3. The guarantee concerns the expressive range of the whole hypothesis class, not one fixed output rule.
  4. Universal representability does not guarantee compactness; the hidden layer in the construction may be exponentially large.
  5. The minimum universal network size s(n) grows exponentially with the number of inputs n.

Key Takeaways

  • Boolean functions assign an output sign to every input vector in {±1}^n.
  • A suitable depth-2 network can have a hypothesis class broad enough to contain every such function.
  • This is a statement about universal representational power, not about the efficiency of each representation.
  • The hidden layer and the minimum required size can grow exponentially with the number of inputs.