Concepts / Feedforward Neural Network Architecture

Feedforward Neural Network Architecture

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.

  • 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

Definition

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.

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

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.

  1. 1
    Identify the domain

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

  2. 2
    Identify the codomain

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

  3. 3
    Interpret the rule

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

Result

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}.

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

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.

Depth-2 hypothesisclassfunctions from one graphAll Boolean functionsfunctions from {±1}^n to{±1}One Boolean ruleone output assignmentcontainsincludes
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.

Universalrepresentationcontains every BooleanfunctionSeparate guaranteesone does not imply theotherCompactrepresentationsmall networkexpressive rangeefficiency question
What is the difference between representing every Boolean function and representing those functions with a compact network?
Best practice

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.

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

Tracing the two guarantees

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

  1. 1
    Keep the depth fixed

    The result still uses an appropriately selected depth-2 network.

  2. 2
    Track the input space

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

  3. 3
    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.

Result

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

Common Misreadings

  • Common mistake

    Interpreting depth 2 as a guarantee of a small network.

    What it looks like

    A learner hears that every Boolean function can be implemented with depth 2 and concludes that the network is automatically compact.

    Why it fails

    The universal construction may have an exponentially large hidden layer.

    Do this instead

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

  • Common mistake

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

    What it looks like

    A learner describes one output rule produced by one setting of a network as the entire universal result.

    Why it fails

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

    Do this instead

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

  • Common mistake

    Assuming the result applies only to a special Boolean operation.

    What it looks like

    A learner believes the construction works for one named rule but not for arbitrary assignments of outputs.

    Why it fails

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

    Do this instead

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

At a glance

  • 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.

Related concepts

More concepts starting with F