# 6G Goal-Oriented Communications: How to Coexist with Legacy Systems?
## 3 Coexistence of a Goal-Oriented and a Data-Oriented Communication System
### Edge Inference: Goal Value and Effectiveness
#### 3.2.3 On the Use of Entropy to Define the Goal Value  
We now introduce the metric reflecting inference accuracy, which will be then used to define the goal value. As we are dealing with a classification task, the actual performance metric could be the one of correct pattern classification rate. However, to evaluate this metric, the ground truth, i.e., the true label, would need to be always available, which is not the case, in general. In a practical setting, a metric suitable for evaluating classification tasks as they emerge needs to be characterized by the following features: _(i)_ it must be measurable online without any ground truth; _(ii)_ it should reflect, in the best possible way, the value of the goal, i.e., the classification accuracy. A possible metric fulfilling these requirements is the entropy computed on a posteriori probabilities, which are the typical output of any discriminative or generative classifier, such as a DNN [25; 55; 56]. In particular, the output of a discriminative classifier can be written as a vector \(\mathbf{p}=[p_{1},\ldots,p_{L}]^{H}\) of probabilities, with each probability being associated with one out of the \(L\) possible labels of the data set under investigation. Obviously \(\sum_{l=1}^{L}p_{l}=1\) holds true. Given \(\mathbf{p}\), the entropy associated to a classified pattern \(b\) is  
\[H_{b}=-\mathbf{p}^{H}\log(\mathbf{p}). \tag{12}\]  
The entropy is a scalar measure, which can be interpreted as the classification confidence of an ML model in classifying a pattern. The lower the entropy, the more confident the classifier is. Namely, for a data set with \(L\) labels, the worst case for a single pattern classification is \(p_{l}=\frac{1}{L},\forall l=1\ldots,L\) (i.e., throwing an \(L\) facets dice), which translates into the maximum entropy \(H_{\text{max}}=\log(L)\); also, noting that \(\lim_{p\to 0^{+}}p\log(p)=0\), and that \(p\log(p)=0\) if \(p=1\), the minimum value attained by the entropy in case of a completely sure classifier is 0. Therefore, the entropy is always a bounded metric \(0\leq H\leq H_{\text{max}}=\log(L)\). Since we are considering inference on batches of data (cf. (10)), we can define the _average entropy_\(H_{t}\) on the batch classified during slot \(t\) as  
\[H_{t}=\frac{1}{N_{t}}\sum_{b\in\mathcal{B}_{t}}H_{b,t}, \tag{13}\]  
where \(\mathcal{B}_{t}\) denotes the set of patterns in the batch and \(N_{t}=card(\mathcal{B}_{t})\) (cf. (10)). For simplicity, and for the sake of coherence with the goal-value definition in Section 2, we will use, as goal value, the negative relative average entropy increase (referred to as _NREI_ in the sequel), with respect to the its minimum value, attained on a validation subset of the original data set, i.e., without any communication impairment, i.e., interference from DO user (It can be, for instance, assumed that model training is performed using a radio bandwidth (of same size as in inference phase) exclusively used by the GO system.) This choice is dictated by the fact that, even for the original data set, the average entropy is not actually 0, but it attains a minimum value that depends on the training phase. Therefore, denoting by \(H_{\text{min}}\)the minimum average entropy over the considered data set, we write the NREI (i.e., the goal value) as follows:  
\[\Theta_{t}=-\frac{H_{t}-H_{\text{min}}}{H_{\text{min}}}. \tag{14}\]  
Then, the higher the absolute value of the NREI, the lower the goal value is, and vice versa. A natural question arises on the dependence of this goal value on wireless performance, e.g., on the PER. In this paper, since we consider the PER as a source of classification entropy increase/decrease, we make the following principled and mild assumptions on entropy and accuracy, which we validate by experimental results. **Assumption 1**.