# Can neural networks learn to ignore an input datum?

Disclaimer: I'm not a student in computer science and most of my knowledge about ML/NN comes from YouTube, so please bear with me!

Let's say we have a classification neural network, that takes some input data $$w, x, y, z$$, and has some number of output neurons. I like to think about a classifier that decides how expensive a house would be, so its output neurons are bins of the approximate price of the house.

Determining house prices is something humans have done for a while, so let's say we know a priori that data $$x, y, z$$ are important to the price of the house (square footage, number of bedrooms, number of bathrooms, for example), and datum $$w$$ has no strong effect on the price of the house (color of the front door, for example). As an experimentalist, I might determine this by finding sets of houses with the same $$x, y, z$$ and varying $$w$$, and show that the house prices do not differ significantly.

Now, let's say our neural network has been trained for a little while on some random houses. Later on in the data set. it will encounter sets of houses whose $$x, y, z$$ and price are all the same, but whose $$w$$ are different. I would naively expect that at the end of the training session, the weights from $$w$$ to the first layer of neurons would go to zero, effectively decoupling the input datum $$w$$ from the output neuron. I have two questions:

1. Is it certain, or even likely, that $$w$$ will become decoupled from the layer of output neurons?
2. Where, mathematically, would this happen? What in the backpropagation step would govern this effect happening, and how quickly would it happen?

For a classical neural network, the network has no "memory," so it might be very difficult for the network to realize that $$w$$ is a worthless input parameter.

Any information is much appreciated, and if there are any papers that might give me insight into this topic, I'd be happy to read them.

This is a learnable behavior, given enough data. We would expect the an error to backpropagate to $$w$$ whenever its use harmed classification accuracy. In this case, that would be whenever $$|w|>0$$. In general, I'm not sure how long this would take.

However, the speed of $$w$$'s convergence to zero would benefit from regularization, which is often basically a penalty on the magnitude of your network weights added to the loss function you're optimizing. If $$w$$ truly doesn't matter to classification, then regularization will definitely drive it to zero.

I am going to refer to the expected output as "the price of the house" or simply as "price" to make the answer easier to understand but this applies to any other scenario as well.

To answer part 1 of your question, if the correlation between $$w$$ and the price of the house is 0 or negligible, then it is very likely that varying $$w$$ while keeping $$x$$, $$y$$, and $$z$$ constant will result in almost the same price being predicted in a trained network. This certainly seems like a learnable statistical characteristic. There are some caveats though. Firstly, it depends on how complex your network is. How learnable are the correlations between $$x$$, $$y$$, $$z$$ and the price? Assuming most other factors like these fall into place, I would say that it is quite likely that $$w$$ will be decoupled from the output.

Part 2 of your question is a little trickier to explain. Let us consider a simpler scenario where we use logistic regression. Logistic regression is, in essence, a network with sigmoid output and no hidden layer. The output is the sigmoid over a linear combination of all inputs.

Let us consider the example as follows -
Two data points have the same or similar values of $$x$$, $$y$$ and $$z$$ and expected output, but $$w$$ varies considerably. The coefficient of $$w$$ in the linear combination has a finite, non-zero value. Because of this, the input to the sigmoid will differ even though the resultant price in both cases should be the same or similar.
The loss function's value will increase because of the discrepancy between expected and predicted values in the above example.
In general, the change in the value of the coefficient of $$w$$ is a product of learning rate and the differential of the loss function with respect to it. The change in its value will now be such that the magnitude of the coefficient of $$w$$ decreases to enforce the condition noted in the above examples.

It is difficult to predict at what point a more complex network will learn to ignore $$w$$. It could happen that the weights at the input layer itself might converge to zero. Or the weights in successive layers could converge such that their linear combination gives no importance to the input w.

I wanted to address another point. You mentioned that -

For a classical neural network, the network has no "memory," so it might be very difficult for the network to realize that w is a worthless input parameter.

This first part about having no memory is true. However, the network does not need to remember all the past values. The trainable parameters of a network are basically learning the statistical distribution of the input data and map it to the expected output. They are trying to model a mathematical function that satisfies as many such training samples as possible. The network, through these parameters, has stored an abstraction of the behaviour of the training data. So even though it does not remember every training sample, it does remember the general correlation between input and expected output.

An oversimplified analogy would be, you as a human don't remember the multiplication of every number by 2. Yet, if I ask you what is the product of 123 and 2, you can find the product because you just know how the "multiply by 2" function works in general. Similarly, the network builds an intuition of what the expected output should look like in general, by mapping it to a function whose parameters can be modified.