# Shared Graph Neural Network for Channel Decoding
## 2 Preliminary
From the VN to FN, the message \(m_{v_{ij}\to u_{j}}\) is passed in the graph as \[m_{v_{ij}\to u_{j}}\gets f^{F_{n}}([h_{v_{ij}}||h_{v_{ij}}||g_{v_{ij}\to u_{j}}], \theta_{m_{v\to u}}),\] (3) where \(\theta_{m_{v\to u}}\) denotes the parameters of the node, and the symbol \(||\) denotes that the two tensors are concatenation together. The \(f^{F_{m}}\) function maps messages to high-dimensional features by multiplying weights. Simple multilayer perceptrons (MLPs) are used to expand the dimension. 2. Update the FN value \(u_{j}\) as \[h_{u_{j}}\gets f^{F_{n}}([h_{u_{j}}||\frac{1}{\mathcal{V}(u_{j})}\sum_{v_ {ij}\in\mathcal{V}(u_{j})}m_{v_{ij}\to u_{j}}||g_{u_{j}}],\theta_{u}),\] (4) where \(\theta_{u}\) denotes the parameters in FN. We use \(sum\) aggregation similar to min-sum algorithm [24]. We may also use \(mean\), \(max\), and \(min\) operations, and the updated FN value \(u_{j}\) is given by \(h_{u_{j}}\gets f^{F_{n}}([h_{u_{j}}||\Theta_{v_{ij}\in\mathcal{V}(u_{j})} m_{v_{ij}\to u_{j}}||g_{u_{j}}],\theta_{u})\). 3. From the FN to VN, the message \(m_{u_{j}\to v_{j}}\) is passed in the graph as \[m_{u_{j}\to v_{j}}\gets f^{F_{m}}([h_{u_{j}}||h_{v_{ij}}||g_{u_{j}\to v_{ j}}],\theta_{m_{u\to v}}),\] (5) where \(\theta_{m_{u\to v}}\) denotes the trainable parameters in another direction edge. Step 4: Update the VN value \(v_{i}\) as  
\[h_{v_{i}}\gets f^{F_{\text{tr}}}([h_{v_{i}}||\frac{1}{\mathcal{U}(v_{i})} \sum_{u_{ij}\in\mathcal{U}(v_{i})}m_{u_{j}\to v_{i}}||g_{v_{j}}],\mathbf{\theta}_{v}), \tag{6}\]  
where \(\mathbf{\theta}_{v}\) denotes the parameters in VN. The decoding result is also output from this step. We may also use \(mean\), \(max\), and \(min\) operations, and the updated VN value \(v_{i}\) is given by \(h_{v_{i}}\gets f^{F_{\text{tr}}}([h_{v_{i}}||\bigoplus_{u_{ij}\in \mathcal{U}(v_{i})}m_{u_{j}\to v_{i}}||g_{v_{i}}],\mathbf{\theta}_{v})\). ```
input : LLRs of the channel observation \(l_{v}\)  Set of trainable parameters: -FN updates \(\mathbf{\theta}_{u}\) -VN updates \(\mathbf{\theta}_{v}\) -variable-to-factor message updates \(\mathbf{\theta}_{m_{v}\to u}\) -factor-to-variable message updates \(\mathbf{\theta}_{m_{v}\to v}\) -VN attributes \(\left\{g_{v_{i}}\right\}\forall v_{i}\in\mathcal{V}\) -FN attributes \(\left\{g_{u_{j}}\right\}\forall u_{j}\in\mathcal{U}\) -Message attributes \(\left\{g_{m_{v_{i}\to u_{j}}},g_{m_{v_{j}\to v_{i}}}\right\}\), \(\forall(v_{i},u_{j})\in\mathcal{E}\) -Input embedding \(\mathbf{w}\) -Output embedding \(\mathbf{q}\) output :Soft estimated \(l\) from VN nodes
1%Initialize graph nodes for\(v_{i}\in\mathcal{V}\)do \(h_{v_{i}}\gets l_{v_{i}}\cdot\mathbf{w}\)
2 end for
3\(h_{u}\gets 0\)
4 Run decoding iterations for\(t=0,...,T-1\)do
5%Update variable-to-factor node messages for\((v_{i},u_{j})\in\mathcal{E}\)do \(m_{v_{i}\to u_{j}}\gets f^{F_{\text{tr}}}([h_{v_{i}}||h_{u_{j}}||g_{m_{v_ {i}\to u_{j}}}],\mathbf{\theta}_{m_{v\to u}})\)
6 end for
7%Update factor nodes for\(u_{j}\in\mathcal{U}\)do \(h_{u_{j}}\gets f^{F_{\text{tr}}}([h_{u_{j}}||\frac{1}{\mathcal{U}(u_{j})} \sum_{v_{i}\in\mathcal{V}(u_{j})}m_{v_{i}\to u_{j}}||g_{u_{j}}],\mathbf{\theta}_{u})\)
8 end for
9%Update factor node to variable node messages for\((v_{i},u_{j})\in\mathcal{E}\)do \(m_{u_{j}\to v_{i}}\gets f^{F_{\text{tr}}}([h_{u_{j}}||h_{v_{i}}||g_{m_{v_ {j}\to v_{i}}}],\mathbf{\theta}_{m_{v\to v}})\)
10 end for
11%Update variable nodes for\(v_{i}\in\mathcal{V}\)do \(h_{v_{i}}\gets f^{F_{\text{tr}}}([h_{v_{i}}||\frac{1}{\mathcal{U}(v_{i})} \sum_{u_{j}\in\mathcal{U}(v_{i})}m_{u_{j}\to v_{i}}||g_{v_{j}}],\mathbf{\theta}_{v})\)
12 end for
13%Return back variable node values for\(v_{i}\in\mathcal{V}\)do \(l_{i}\leftarrow\mathbf{q}^{t}h_{v_{i}}\). +++ ==WARNING: Truncated because of repetitions==
0



++

Repeat the above Steps 1, 2, 3, and 4 until the conditions of iterations are reached. The recovered binary vector \(\hat{x}\) can be computed by \(h_{v_{i}}\) as

\[l_{i}\leftarrow\mathbf{q}^{\mathbf{t}}h_{v_{i}}. \tag{7}\]

\[\hat{x}_{i}=\left\{ \begin{array}{ll}1,&if\quad l_{i}>0\\ 0,&otherwise.\end{array}