You can find the paper here , in which they describe the architecture of a QNN that can be used to learn binary functions and correctly classify unseen data.
They say that for each binary label function $l(z)$ where $l(z) = -1$ or $l(z) = 1$, there exists a unitary $U_l$ such that, for all input strings $z = z_0z_1...z_{n-1}$ (where each $z_i = -1,1)$, $$\langle z,0 | U_l^{\dagger} Y_{n+1} U_l |z,0 \rangle = l(z)$$
If you assume that $U_l = \text{exp}(i\frac{\pi}{4}l(z)X_{n+1})$, then it can be easily proven that $\langle z,0 | U_l^{\dagger} Y_{n+1} U_l |z,0 \rangle = l(z)$
Now let's consider the subset parity problem. Here, $l(z) = 1-2B(z)$, where $B(z) = \oplus^{n-1}_{j=0} \phantom{a} a_j \cdot \frac{1}{2}(1-z_j)$, which, when plugged into $U_l$ gives us $$\text{exp}(i\frac{\pi}{4}X_{n+1}) \prod^{n-1}_{j=0} \text{exp}(-i \frac{\pi}{2}a_j \cdot \frac{1}{2}(1-z_j))$$
Now, for the subset parity problem, what you want to learn is $\frac{\pi}{2}a_j$, which you do not know beforehand.
So, during learning, you assume that $$U_l(\vec\theta) = \text{exp}(i\frac{\pi}{4}X_{n+1}) \prod^{n-1}_{j=0} \text{exp}(-i \theta_j \cdot \frac{1}{2}(1-z_j))$$ (our goal is to update $\vec\theta$ s.t when we compute the estimated label, we get close to the actual label)
This method seems to be working fine for this problem (I get an accuracy of 96%).
Right now, I am trying to use a QNN for another binary classification problem. Contrary to the subset parity problem, I do not actually know $l(z)$ (which I thought was perfect, because the QNN allows me to design a circuit that correctly classifies my strings). Therefore, I assumed that $$U_l(\vec\theta) = \text{exp}(i\frac{\pi}{4}X_{n+1}) \prod^{n-1}_{j=0} \text{exp}(-i \theta_j \cdot \frac{1}{2}(1-z_j))$$, just like the subset parity problem.
It seems to be working fine. I get an accuracy of 76%, which isn't bad. However, I am not sure if I can assume this and I am starting to wonder if my initial assumption about $U_l$ for this new problem is legit or not (it could be a coincidence or an error in my code).