<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Chiara Manganini</string-name>
          <email>chiara.manganini@unimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giuseppe Primiero</string-name>
          <email>giuseppe.primiero@unimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Bias</institution>
          ,
          <addr-line>Logic, Fairness</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Logic, Uncertainty, Computation and Information Group, Department of Philosophy, University of Milan</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <abstract>
        <p>In recent years, the problem of evaluating the trustworthiness of machine learning systems has become more urgent than ever. A directly related issue is that of assessing the fairness of their decisions. In this work, we adopt a primarily logical perspective on the topic, by trying to highlight the basic logical characteristics of the inferential setting in which a biased prediction occurs. To do so, we first identify and formalise four key desiderata for a logic capable of modelling the behaviour of a biased system, namely: skewness, dependency on data and model, non-monotonicity, and the existence of a minimal distinction between types of bias. On this basis, we define two metrics, one for group and one for individual fairness.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The widespread emergence of phenomena of biased predictions counts certainly among the
most adverse impacts of new data-intensive science and technologies. This questions the
trustworthiness of results, especially when the opaque nature of the models very often prevents
us from precisely knowing or examining their inner structure [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        A possible strategy to assess trustworthiness in these opaque settings is to check the actual
model behaviour against a desirable one. Logics have been recently designed to formalise
trustworthiness for probabilistic programs and to reason about them [
        <xref ref-type="bibr" rid="ref2 ref3 ref4">2, 3, 4</xref>
        ], with a specific
focus on determining statistical distance measures for such systems with respect to their
desirable or expected behaviour. A specific formulation has also been ofered for modelling
classifiers whose wrong output might be due to forms of bias, using a non-symmetric distance
which reflects the systematic skeweness of the result [ 5]. In this sense, such logics ofer
verification and reasoning tools on the trustworthiness of black-box model with respect to
explainable surrogate models, as those obtained by symbolic knowledge-extraction (SKE) [6, 7].
      </p>
      <p>However, a grounded logical formalisation of how to define measures of bias in such contexts
and how to reason about them is still at early stages in the literature [8, 9, 10, 11]. From the
point of view of symbolic reasoning, and especially when it comes to the task of designing
models for scientific inference in the era of data science, this means to extend the vast families
of defeasible logics and logics for uncertain reasoning with new ones, capable of accounting for
the phenomenon of machine learning bias.</p>
      <p>In this paper, we aim to sketch a first understanding of bias usable in the context of logical
reasoning. In order to do so, in Section 2 we first start formulating the desiderata for a logic
designed to reason in the presence of bias. In Section 3 we propose a logical formalisation of the
notion of biased machine learning system and we show how it accommodates the mentioned
desiderata. After introducing a correction distance as a measure of the monotonicity of a
prediction (Section 4), in Section 5 we exploit it to quantitatively assess the presence of bias.
Finally, we explain how this logical framework may be expanded, refined, applied in the future
(Section 6).</p>
    </sec>
    <sec id="sec-2">
      <title>2. Logical desiderata for reasoning with bias</title>
      <p>As a preliminary work, we start from the observation that a logic for reasoning with bias – i.e.,
for drawing valid conclusions within a possibly biased inferential system – should be able to
capture the following set of central properties characterising the phenomenon of algorithmic
discrimination.</p>
      <sec id="sec-2-1">
        <title>2.1. Skewness of Incorrect Predictions</title>
        <p>A first and fundamental distinction our logic should account for is that between biased
predictions and merely erroneous ones. In statistics, error is defined as the diference between the
true value of a measurement and its recorded value, and can be either random or systematic.
Since random error, or variability, has no preferred direction, its impact can be minimised with
large sample sizes. Systematic error, instead, refers to a consistent over- or underestimation of
the observations. It has a net direction so that averaging over a large number of observations
does not eliminate its efect.</p>
        <p>In the machine learning context, the notion of bias we want to focus upon is that of a
systematic error against a certain protected category such as race, gender, age, geographical
provenance, or economic status [12]. Here “against” is to be intended as “opposed to the direction
given by the most favourable prediction”. Such a direction of course varies in relation to the type
of scenario considered. In this work, we focus on a very coarse-grained distinction between what
we can call “allocative” and “punitive” contexts: in the former case, some beneficial resource (a
job, a loan, a subsidy, etc.) is to be allocated to individuals based on a prediction; in the latter,
some punitive action is imposed to individuals, based on some risk measure (fraud, recidivism,
etc.). The reason for distinguishing between two symmetrical predictive scenarios is related to
the diferent interpretation we give of the negation rule for our logical framework, which will
become clearer in Section 3.</p>
        <p>Summarising, two types of skewness should be considered in relation to bias:
1. Skewness as systematicity of error. The evaluation is skewed, in the sense that it shows a
net direction, which means it results from a systematic rather than a random error. The
direction itself is also relevant, as it emerges either in terms of false positives in punitive
contexts, or in terms of false negatives in allocative contexts.
2. Skewness as partiality of the domain afected by the error. The systematic error negatively
impacts only a subgroup of the population which is identified by its belonging to a certain
protected category.</p>
        <p>Example. A classifier  is used to predict the risk of insurance fraud. To each
new entry in a set of insurance claims, it either assigns the target label “Fraud” or
“¬Fraud”.  uses the protected binary feature “MalePolicyholder” for its prediction.
The desideratum of skewness requires that, for the system to be considered
genderbiased a significant imbalance in the prediction errors across male and female
individuals must be observed in its output. For example, this can happen when
false positives are significantly more in the female group with respect to the male
one, so that the former class is negatively impacted by the decisions (predictions)
of  .</p>
        <p>All of these fundamental aspects need to be captured in our formal representation of a reasoning
system for bias.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Dependency on Data and Model</title>
        <p>A second property of the bias phenomenon we wish to capture is its dependency on both data
and model. For instance, it is well acknowledged in the literature that a skew in frequency of
the classes in the training set leads to disparate error rates on the underrepresented attributes
[12]. This is not the only issue afecting training data, though. [ 13] highlights that other types
of data bias (due to disproportionate measurement, representation, aggregation, and evaluation
among the diferent classes) can lead to discriminatory results as well. In general, the presence
of bias largely depends on the training data, and this is definitely something our logic should
account for.</p>
        <p>Also model design choices concerning loss function, optimiser and hyper-parameters, made
to maximise test-set accuracy, can result in the occurrence of machine learning bias [13]. It has
been highlighted that even more subtle choices – like learning rate and length of training – can
impact on fairness due to the fact that underrepresented features are learnt later in the training
process [14].</p>
        <p>The actual manifestation of bias, instead, depends on the test set. Actually, there can be a
situation in which a biased model does not in fact result in a discrimination due to contingent
conditions.</p>
        <p>Example. Reconsider the gender-biased learning algorithm  for fraud risk
detection. Imagine now that, due to a poor selection of inputs for the testing process,
the totality of test inputs are male, i.e., each of them satisfies the predicate “Male”.
What can we say about a possible gender bias of the algorithm? On the one hand,
an imbalance in the frequency of the gender classes in the historical recordings
on which D has been trained causes the model to have the disposition to produce
biased outcomes against women. On the other hand, no gender-biased prediction
is actually produced, since this disposition never emerges.</p>
        <p>Hence, our formal modelling will have to be parametric with respect to these three variables.</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3. Non-Monotonicity</title>
        <p>Example. Gender-biased model  for fraud risk detection is fed step-by-step with
features from a predetermined list that contains age, gender, address, etc. about
datapoint  . At each step,  has to classify  . Imagine now that, while at step  of
this process  classifies  as “Fraud”, the information provided at step  +  makes
 revise the confidence in this prediction under a certain threshold, and the system
outputs value “¬ Fraud”.</p>
        <p>An increase in both accuracy and available information can lead to a change of classification
(from “Fraud” to “¬ Fraud”). At the beginning of this process, a “minimal-knowledge” condition,
possibly corresponding to one piece of information to make the prediction, matches with
the minimum accuracy possible; on the other hand, an “omniscience” condition, in which all
the available pieces of information have been provided matches with the maximum accuracy
possible. Theoretically, this should always be associated with a correct classification (the ground
truth).</p>
        <p>This simplified story just loosely models the behaviour of a learning system that corrects its
own prediction on a new input  as the amount of available information increases. The above
example captures the basic intuition at the heart of non-monotonicity, which we think useful to
account for clarifying of the relationship between a biased outcome and the information used
to generate it, both qualitatively and quantitatively. We start from the following claims:
Proposition 1. Possessing all available correct information about datapoint  is suficient for its
correct classification.</p>
        <p>Proposition 2. There is a minimal amount  of information about datapoint  , suficient for its
correct classification.</p>
        <sec id="sec-2-3-1">
          <title>Proposition 3. Any amount of information  &lt;</title>
          <p>correct classification.
about datapoint  is not suficient for its</p>
          <p>Note that, in practice, a classifier assumes  = 1 to be the weighted value of the whole set
of features it uses, although it could be taken to be a smaller value (i.e., the prediction can
be correct even in absence of some information). And  &lt; 1 is always the weighted value
of the set of features used at any point in time for an incorrect prediction. When incomplete
information is already suficient for a correct prediction, then  &lt;  &lt; 1 .</p>
          <p>With this in mind, let us now take into consideration a machine learning system, which we
know to be biased according to the analysis in Subsections 2.1 and 2.2. In other words, this
means that:
1. the system generates systematic (i.e., with a net direction) erroneous predictions against
a certain protected category of individuals,
2. the errors depend on the data on which it has been trained and on the design choices of
the model itself.</p>
          <p>In this scenario, we are interested in exploring how the presence of bias in a system
quantitatively depends on the amount of information used to return an incorrect prediction. A first
intuition is that, on the one hand, the system may be considered maximally biased against a
certain protected attribute when, given a new datapoint with that attribute and for which a
wrong classification is predicted, no additional information may allow to correct it. Conversely,
the system may be considered minimally biased against the same protected attribute when a
single additional piece of information allows to correct it.</p>
          <p>To recapitulate, in the presence of a biased system, we expect our logic to assess how much
information is required to fail monotonicity as a proxy of the amount of bias afecting the
system. Bias will manifest as an imbalance for such measure with respect to distinct groups, or
distinct protected features.</p>
        </sec>
      </sec>
      <sec id="sec-2-4">
        <title>2.4. A Minimal Distinction Between Types of Bias</title>
        <p>When it comes to define the types of bias, a number of nomenclatures can be found in the
literature [13, 12, 15, 16], most of which tend to characterise qualitative diferences among biases
based on the their diferent origins. For instance, in [ 13], among the statistical factors possibly
resulting in a biased prediction we find: the non-random sampling of subgroups (sampling bias),
the lack of diversity of the sample (representation bias), and the distortions that can emerge
from the aggregation of datapoints (aggregation bias, Simpson’s paradox). In this work, we
rather want to focus our attention on two quantitative aspects connected to biased outcomes,
along which a minimal distinction between types of bias can be traced:
1. biases engendered by an insuficient amount of information available to the system to
generate the prediction.
2. biases engendered by an incorrect assignment of the feature relevance.</p>
        <p>Example. In the gender-biased learning algorithm  for fraud risk detection, the
two diferent kinds of bias illustrated above would be illustrated as follows. First,
consider a version of  which is never given any age information on the claimant,
e.g. because such feature was not required at design stage; as a result, a potential
bias towards some class (e.g. “female”) might emerge which does not recognise
that a given subclass (e.g. “above 60 years old”) is actually strongly correlated
with claims. Now consider a deployment of  which is fed only with occurrences
of cases by female drivers and learns accordingly. Its trained version  ′ would
eventually associates all cases of frauds to female driver and assign low scores to
male drivers.</p>
        <p>Hence, another component in bias emergence needs to be identified in the amount of
information available and its relevance for the classification at hand.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Formalising Bias</title>
      <p>For sake of simplicity, in this work we focus on the minimal case of a binary classification in the
presence of a single binary protected attribute.1 We abstract here from many technical details,
and in particular we present only a sketch of a formalization based on a derivability relation ⊢,
leaving the details of a corresponding consequence relation ⊨ to further work. Moreover, the
current presentation is intended to ofer only some useful intuitions about how to model the
properties presented above in Section 2 within a logical setting; actual logical systems can then
be designed with these characteristics to deal with specific bias cases.</p>
      <p>Consider a model  trained on a dataset d and characterised by a set of design features (in
terms of loss function, optimiser, and hyper-parameters used for its training) m. The trained
model returns a classification  for the datapoint  of the test set on a target feature   . We use
the derivability relation to express the classification by formulas of the form:
 ⊢ ,</p>
      <p>()</p>
      <p>
        This judgement can be further enhanced: first, by a measure of the amount of features used by
the classifier at any given moment, as a rational number on the left-hand side of the derivability
relation; second, by a degree of accuracy on the classification expressed as a rational number in
[
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ] on the right-hand side of the relation, then using a cut-of point to reduce the classification
to a binary value. We leave these technicalities aside for the present moment and deal only
with Boolean judgements. Further, let us assume this classification to be incorrect. This means
that, in a given model  – which we consider isomorphic to the real world, i.e., representing it
correctly or, more agnostically, at least expressing what the designer considers to be a correct
model for the test set – datapoint  should be correctly classified as ¬ :
      </p>
      <p>⊢ ¬ ()</p>
      <p>To start of, here is how the desiderata mentioned in the previous Section can fit into a logical
framework:
• What mentioned in Subsection 2.1 indicates that inferential and/or semantic validity
may be indeed appropriate to model the skewness of bias in classification: fixed the
properties of the system  , the error in the prediction arises in terms of evaluations for
some predicates and some individuals; hence, a subclass of predicates and individuals of
the domain in the test set will make biased evaluations emerge, where such classes can
be at least partially identified by comparison with the training set.
• For the discussion in Subsection 2.2, we know that the incorrect inference returned by
system  can depend on both the data  with which it was trained or on the characteristics
 of the model itself. This aspect requires therefore that such parameters are made
transparently available in the formalisation of the system we are after.
1Our proposal can be quite easily translated into a multi-label setting by introducing a probabilistic evaluation on the
target predicate. Adding further protected attributes could be more challenging, due to the problem of modelling
intersectionality of discrimination. These tasks, however, go beyond the scope of the present work.
• The aspects of non-monotonicity considered in Subsection 2.3 are to be expressed in
terms of the dynamic evaluation made by  for a given datapoint, as the information
under which the prediction is derived increases. We aim therefore at defining a measure
of such a change, by invalidating standard classical inference rules (respectively, making
a consequence relation non-monotonic).
• As illustrated in Subsection 2.4,  can be diferently biased depending either (1) on how
much information is provided by the available features used as predictors, or (2) on how
relevant each of the selected feature has been taken to be by the system. These aspects
will be rendered by formulating explicitly features on the classifier and their weights.
Consider now a classification system (, ⊢ , ) within a language ℒ = {, ℙ, &lt;  } where:
•  = {, , , … , }</p>
      <p>test set;
• ℙ = { , , , ...,  }
is a finite set of elements of a domain denoting the datapoints of the
is the finite set of the predicates in the language such that:
1. a partition of ℙ is the set  = {ℙ, ℕℙ, } denoting, respectively, the set of
protected predicates, the set of non-protected ones, and the target predicate to be
predicted;
2. another partition of ℙ is the set of features ℱ = { 1,  2, ...,   } which, for simplicity,
we assume to be all binary.</p>
      <p>
        In other words, ℙ enumerates all the features used by the system. Every class, in turn,
denotes a possible value of a certain feature, be it protected, non-protected, or the target
feature.
• &lt; ⊆ ℙ × ℙ is an ordering on the predicates ℙ based on a weight function  ∶ ℙ ↦ [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ]
that assigns a measure of relevance to each predicate for a given feature   , so that
⟨  ,   ⟩ ∈&lt; if  (  ) ≤     ) for every   ,   ∈ ℙ. Moreover, we take that weights are
normalised, i.e., that ∑  (  ) ≤ 1.
      </p>
      <p>Example. A classifier is used to predict applicants’ eligibility for a loan,
therefore  = {} , where () can be true (if  is eligible for
a loan) or false (if  is not eligible). The system classifies on the
basis of the following sets of predicates: ℙℝ = { } , and ℕℙℝ =
{   ,  ℎ  ,      ,    } . It is known
that two features are more relevant than the others for the classification:
 (   ) = 0.3 and  ( ℎ  ) = 0.25 . All the other
features are equally relevant for the classification, and they all weigh 1−0.3−0.25 = 0.15.
3</p>
      <p>An atomic formula of ℒ is therefore a predication of a class  for a given datapoint  .2 In
this context, proof-theoretically the information available in  expresses the current knowledge
about  such that given the available inference rules in ⊢ it allows to derive that  has (resp. has
2The choice of connectives in ℒ will be determined by requirements of the system and will define the inference
relation ⊢ (in the following, we will only make general comments on the use of negation).
not) target feature  . Semantically, it says that the model in which all information contained in
 is true, will also make  () true (resp. false).</p>
      <p>In the following we focus on two structural elements required to model bias formally as
intended above: the role of the rules for negation, and the quantification of information for
non-monotonicity of the inference relation.</p>
      <sec id="sec-3-1">
        <title>3.1. Negation</title>
        <p>The initial situation of skewness might be represented as follows. In punitive contexts, bias
emerges as systematic error in terms of false positives, according to which
 ⊢ d,m  ()  ℎ  ⊢ ¬ ()
 ⊢ d,m ¬ ()  ℎ  ⊢  ()
i.e., the real or chosen model of the world sees individual  not to satisfy the property  , while
the system  predicts it to have it. In allocative contexts, bias emerges as systematic error in
terms of false negatives, according to which:</p>
        <p>i.e., the real or chosen model of the world sees individual  satisfying the property  , while
the system  predicts the opposite. In both contexts, the systematic error concerns a subset of
the domain  , identified by a partition with respect to a predicate  ∈ ℙ .</p>
        <p>The logical setting we are defining allows to model the diference between the two scenarios
by a diferent interpretation of the rule for negation. In the allocative context, a correctly
working classifier should see implemented the interpretation of Negation as Contradiction:
 ⊢ ¬ ()</p>
        <p>ℎ  ⊢  ()
 ⊢  () → ⊥
i.e., if the system predicts the negation of the intended property (say: not being eligible for
welfare credits), the assignment of a certain benefit should be blocked. On the other hand, in
a punitive context it seems that a correctly working classification system should express the
principle of Negation as Failure:</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Quantifying Non-Monotonicity</title>
        <p>Under the assumption of an incorrect prediction, we want to quantify the amount of information
needed for the (supposedly wrong) inference to be corrected. We know that the inability of
an inferential system to accommodate such a change is expressed by the structural rule of
Weakening:</p>
        <p>⊢  ()
,  1(), … ,   () ⊢  ()</p>
        <p>ℎ  ⊢ ¬ ()
for</p>
        <p>{ 1, … ,   } ⊆ (ℙ − { })
i.e., while adding new predicates to the datapoint, the ability of the system to continue
inferring a valid (target) property, should not diminish. Note that the quantification over the
possible predicates for which the Weakening rule holds is fundamental here. For instance, if
{ 1(), … ,   ()} = ℙ − { } , this means that  incorrectly predicts the class  for the datapoint
 (for some  and some  ), and no additional amount of information allows to change this
inference:
∄  () ..</p>
        <p>⊢  ()
,  1(), … ,   (),   () ⊢ ¬ ()</p>
        <p>This is, for simplicity, expressed here by boolean predicates, while a worked out analysis
would make use of the anticipated probabilistic assignment of predicates to constants and the
corresponding measure on the amount of features evaluated.</p>
        <p>What one would want to model, therefore, is a system whose incorrect prediction is very
“close” to be amended, provided a new piece of information becomes available:
∃  () ..</p>
        <p>⊢  ()
,  1(), … ,   (),   () ⊢ ¬ ()
Example. The fraud detection classifier should implement a negation as failure
principle
 ⊬   ()
 ⊢ ¬  ()
as long as enough information is provided to prove the contrary, i.e.
(1)
(2)
 ⊢   ()
,</p>
        <p>⊢ ¬  ()
1(), … ,   () ⊢   ()</p>
        <p>In particular, the aim is to show how much information allows for the following
Hence, our next tasks are
1. to evaluate the amount of information of  1(), … ,   () so that certain predicates are
more relevant than others;
2. use it to quantify non-monotonicity.</p>
        <p>In other words, assuming  ’s initial incorrect prediction for a datapoint  , the degree of
monotonicity expresses “how far the system is from a correction of the prediction”. Both these
goals will be addressed in the following section.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Correction Distance</title>
      <p>Consider the task of inferring the correct prediction  ⊢  ()
. Assume:
{ 1(), … ,   ()}  ( 1,…,  )=
⊢  ()
where  expresses the amount of information computed by a chosen function  over the
weights of the predicates  1, … ,   and suficient for the correct classification. We abbreviate
with ∣  ∣=  the overall weight of the set of formulas { 1(), … ,   ()}  ( 1,…,  )= when used
in the system  .</p>
      <p>Consider moreover:</p>
      <p>{ 1(), … ,   ()}  ( 1,…,  )= ⊢ ¬ ()
where  is the amount of information currently available and used for a presumably or
possibly wrong prediction  ⊢ ¬ () , assuming the same function  . We abbreviate with
∣  ∣=  the overall weight of the set of formulas { 1(), … ,   ()}  ( 1,…,  )= when used in
the system  .</p>
      <p>The diference ( −  ) expresses the amount of additional information that would be
suficient to correct our wrong prediction, normalized over the accuracy of the system. Namely,
it expresses the amount of additional information that would be suficient for the rule   to
fail. Hence, these elements collectively express an amount of non-monotonicity, weighted on a
measure of certainty of the prediction:
Definition 1 (Correction Distance). The correction distance for a system (, ⊢ , ), given a
target predicate  and an individual  , is the inverse of the amount of additional information
suficient for  to correct its evaluation on  , weighted on certainty (as expressed by accuracy known
for the system from previous analyses)</p>
      <p>(, ⊢,  ()) = 1 − ( −  ) ∗</p>
      <p>
        Given our definitions of  and  – as the amounts of information suficient to give,
respectively, a correct and an incorrect prediction – the measure  expresses an evaluation of
how far the system is from correcting a wrong classification. We have to further impose that
( −  ) &gt; 0 if we want to model the non-monotonic setting exemplified in Section 2.3, in
which an increase of the available information is assumed to always result in an improvement
(or, in a binary setting like ours, a correction) of the prediction made before (see Proposition
1). Moreover, in defining the order relation
system’s feature space together sum to 1. Therefore,  ≤
&lt; , we said that all the weighted features of the
∑

  ∈ℙ  (
 ) = 1. Note, finally, that
(, ⊢,  ()) ∈ [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ]
if (, ⊢,  ()) = 10%
and that it could be interpreted as a probabilistic measure. For instance,
      </p>
      <p>, we could say that there is a probability of 90% that the system will
eventually reach the correct prediction for  .</p>
      <p>Example. Recall the anti-fraud system mentioned in previous examples. Figure
1 shows how (, ⊢,  ())
varies in relation to  , 
, and accuracy, assuming that
an incorrect classification is always returned by ( , ⊢ , ) for datapoint  . On the
 -axis we measure the available information  and on the  -axis the corresponding
correction distance.</p>
      <p>If we focus on the system denoted by the dashed yellow line, where the amount of
information required for a correct classification is 60% of the total and accuracy
is known to be 90%, in the virtual case in which no information is used for the
prediction, the correction distance attributed to the classification is already set at
46%. The more the system proceeds with the acquisition of new information, say
40%, the correction distance attributed to a wrong classification rises to 82%.
For comparison, if we take a system with maximal accuracy (100%) and little
information required to infer a correct classification ( 20%), a wrong classification
without any information is already assumed to be 80% distant from its correction
(dotted green line).</p>
      <p>Finally, a system with low accuracy (80%) and which requires total information
to infer correct classifications ( 100%) – like the one represented by the solid blue
line – will be evaluated to be 36% distant from correction for the case of  = 20% .
While with  = 90% , if a wrong is still being returned, its correction distance will
be evaluated at 92%.</p>
      <p>In the light of the above, we can now get back to the two limit cases discussed informally
at the end of Section 3. In fact, we can now give a much more refined definition of a system
which is maximally (resp. minimally) distant from the correct prediction, by simply translating
Formula 1 (resp. 2) in terms of correction distance. We obtain that a system is maximally distant
from the correction of an incorrect prediction  () , based on an amount of information  , then
there is no additional information  ′ such that the sum of  +  ′ results in an amount of
information suficient of predicting correctly ¬ () .</p>
      <p>Definition 2 (Maximally Distant-From-Correction System).
 ∣=  and ∄ ′ s.t.  +  ′ =  , then (, ⊢ , ,  ()) = 1
Given (, ⊢ , ,  ())
with ∣
All things being equal, a system is correctable if there exists some additional information  ′
such that the sum of  + ′ results in an amount of information suficient of predicting correctly
¬ () .</p>
      <p>Definition 3 (Correctable System).
then (, ⊢ , ,  ()) &lt; 1</p>
      <p>Given (, ⊢ , ) with ∣  ∣= 
and ∃ ′ s.t.  + 
′ =  ,</p>
      <p>Note that, intuitively, it makes sense to present the Correction Distance as a measure from a
possibly incorrect to a correct prediction. Nonetheless, in the next section, we make use of the
Correction Distance as a criterion to establish whether a classifier is biased towards or against a
certain class by measuring whether associated correction distances difer. In this sense, one can
even abstract from the assumption of initial incorrectness of the system, and ask what would
take for the system to change the result of a classification for a given datapoint, and whether
that amount of information is diferent for distinct classes of individuals.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Measuring Bias as Correction Distance Imbalance</title>
      <p>To reach a proper definition of bias, we just need to accommodate the last desideratum left
unaddressed so far, i.e., the idea of skewness as “partiality of the domain afected by the error”
introduced in Section 2.1 at point (2). Put diferently, while in the previous Section our correction
distance has been defined over a single datapoint  , now it must be generalized over a subdomain
of  in order to fully account for the notion of bias relevant in machine learning contexts.
Adopting the distinction between group (or statistical) vs. individual (or similarity-based)
unfairness criteria, well known in the bias literature [15], we first define a measure of group
unfairness in terms of imbalance of correction distance of a classifier used to predict a target
class  – denoted by (, ⊢ , ,  ) – across the subdomains of  determined by a binary protected
category  , with respect to a tolerance threshold  .</p>
      <p>Definition 4 (Measure of Group Fairness).
where


(, ⊢ , ,  ) =∣ (, ⊢
, ,  ()) − (, ⊢</p>
      <p>, ,  ()) ∣&gt; 
 ∈ ℙ, ∀,  ∈  ∣ () ∧ ¬()
and where  is a threshold value for the diference of the correction measures above which fairness
is considered to fail.</p>
      <p>Coming to the measure of individual fairness, we explore a strategy inspired by the principle
of Fairness Through Unawareness or Blindness [17, 18, 19]. To implement it, we adopt the
following similarity criterion.</p>
      <p>In general, given two sets  and  , the Jaccard Index of  and  , denoted by  (, ) , is
defined as:
Definition 5 (Jaccard Index).</p>
      <p>(, ) =
∣  ∩  ∣
∣  ∪  ∣</p>
      <p>Taken two individuals  and  in the test set  , given the sets of the predicates they respectively
satisfy (denoted by   and   with slight abuse of notation), they are called blindly similar –
expressed by (, ) – if and only if they only difer with respect to the protected predicate
 , and they show more similarities than diferences:</p>
      <sec id="sec-5-1">
        <title>Two datapoints  and  are blindly similar, denoted by</title>
        <p>Definition 6 (Blind Similarity).
(, ) , if:
1. (  ∪   ) ⧵ (  ∩   ) = {} ∈ ℙℝ
2.  (  ,   ) &gt; 12
Definition 7 (Measure of Individual Unfairness).
where</p>
        <p>∀,  ∈ .(, )

  (, ⊢ , ,  ) =∣ (, ⊢
, ,  ()) − (, ⊢
, ,  ()) ∣&gt; 
and where  is a threshold value for the diference of the correction measures above which fairness
is considered to fail.</p>
        <p>Namely, we define a measure for individual unfairness in terms of an imbalance in the
correction distance – denoted by (, ⊢ , ,  ) – across the subdomain of similar individuals
determined by Definition 6, with respect to a tolerance threshold  .</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Further developments</title>
      <p>We presented an attempt to bring a logical contribution to the research on fairness in machine
learning. To make this proposal complete and applicable, much work remains to be done.</p>
      <p>First of all, it will be crucial to contextualise our approach within current technical,
philosophical, and logical research on bias. This means, in particular, connecting our proposal to
other recent formalisations of bias [8, 9, 10, 11] on the one hand, and to the wide literature on
fairness measures on the other. Understanding how our proposal aligns with and contributes
to the current debate on fairness will provide a better insight on its potential implications and
applications.</p>
      <p>Secondly, formal and structural features of our logical framework need further clarification,
starting from inferential rules and semantic clauses. In this spirit, some remarks made in Section
3 highlighted that the negation rule seems to require diferent interpretations, based on the
setting considered (either allocative or punitive). More generally, the definition of inference
rules and semantic clauses must be functional to measure inferences (respectively, define valid
consequences) in terms of correction distance, to be used for the computation of the two fairness
measures proposed. Moreover, it will be important to further refine the notions of ground truth,
training data, and test sample.</p>
      <p>Also a probabilistic refinement of the proposed logical framework is essential to better
model machine learning inference. A probabilistic evaluation on the target predicate, to be
interpreted as a measure of confidence or accuracy of the prediction returned by the system,
will in turn require to suitably formalise its relationship with the other used notions of quantity
of information and feature relevance.</p>
      <p>From a semantical point of view, a modal setting may be helpful to reason about biased
predictions. Kripke models can be interpreted as sets of evaluations of attributes on datapoints,
and modalities to access new worlds can be understood as evaluations of new attributes
(including the target one). Under this interpretation, verifying that a machine learning model  is
individually fair (as defined in Definition 7) relatively to a certain protected attribute means to
check as a safety property that similar possible worlds (based on the similarity definition given
in Definition 6) provide access to the same possible worlds. Developing model checking and
correctness algorithms remains the main goal for the future development of the present work.
programs, CoRR abs/2302.00958 (2023). URL: https://doi.org/10.48550/arXiv.2302.00958.
doi:10.48550/arXiv.2302.00958. arXiv:2302.00958.
[5] G. Primiero, F. A. D’Asaro, Proof-checking bias in labeling methods, in: G. Boella, F. A.</p>
      <p>D’Asaro, A. Dyoub, G. Primiero (Eds.), Proceedings of 1st Workshop on Bias, Ethical AI,
Explainability and the Role of Logic and Logic Programming (BEWARE 2022) co-located
with the 21st International Conference of the Italian Association for Artificial Intelligence
(AI*IA 2022), Udine, Italy, December 2, 2022, volume 3319 of CEUR Workshop Proceedings,
CEUR-WS.org, 2022, pp. 9–19. URL: http://ceur-ws.org/Vol-3319/paper1.pdf.
[6] R. Calegari, G. Ciatto, A. Omicini, On the integration of symbolic and sub-symbolic
techniques for XAI: A survey, Intelligenza Artificiale 14 (2020) 7–32. URL: https://doi.org/
10.3233/IA-190036. doi:10.3233/IA- 190036.
[7] R. Calegari, F. Sabbatini, The psyke technology for trustworthy artificial intelligence,
in: A. Dovier, A. Montanari, A. Orlandini (Eds.), AIxIA 2022 - Advances in Artificial
Intelligence - XXIst International Conference of the Italian Association for Artificial
Intelligence, AIxIA 2022, Udine, Italy, November 28 - December 2, 2022, Proceedings,
volume 13796 of Lecture Notes in Computer Science, Springer, 2022, pp. 3–16. URL: https:
//doi.org/10.1007/978-3-031-27181-6_1. doi:10.1007/978- 3- 031- 27181- 6\_1.
[8] A. Ignatiev, M. C. Cooper, M. Siala, E. Hebrard, J. Marques-Silva, Towards formal
fairness in machine learning, in: Principles and Practice of Constraint Programming:
26th International Conference, CP 2020, Louvain-La-Neuve, Belgium, September 7–11,
2020, Proceedings, Springer-Verlag, Berlin, Heidelberg, 2020, p. 846–867. URL: https:
//doi.org/10.1007/978-3-030-58475-7_49. doi:10.1007/978- 3- 030- 58475- 7_49.
[9] Y. Kawamoto, An epistemic approach to the formal specification of statistical machine
learning, Software and Systems Modeling 20 (2020) 293–310. URL: http://dx.doi.org/10.
1007/s10270-020-00825-2. doi:10.1007/s10270- 020- 00825- 2.
[10] V. Belle, Toward a logical theory of fairness and bias, Theory and Practice of Logic</p>
      <p>Programming (2023) 1–19. doi:10.1017/S1471068423000157.
[11] X. Liu, E. Lorini, A unified logical framework for explanations in classifier systems, Journal
of Logic and Computation 33 (2023) 485–515. doi:10.1093/logcom/exac102.
[12] H. Suresh, J. V. Guttag, A framework for understanding sources of harm throughout
the machine learning life cycle, Equity and Access in Algorithms, Mechanisms, and
Optimization (2019).
[13] N. Mehrabi, F. Morstatter, N. Saxena, K. Lerman, A. Galstyan, A survey on bias and fairness
in machine learning, 2022. arXiv:1908.09635.
[14] S. Hooker, Moving beyond “algorithmic bias is a data problem”, Patterns 2 (2021) 100241.</p>
      <p>doi:10.1016/j.patter.2021.100241.
[15] A. Castelnovo, R. Crupi, G. Greco, D. Regoli, The zoo of fairness metrics in machine learning,</p>
      <p>CoRR abs/2106.00467 (2021). URL: https://arxiv.org/abs/2106.00467. arXiv:2106.00467.
[16] S. R. Das, M. Donini, J. Gelman, K. Haas, M. Hardt, J. Katzman, K. Kenthapadi, P. Larroy,
P. Yilmaz, B. Zafar, Fairness measures for machine learning in finance, in: The Journal of
Financial Data Science, 2021.
[17] N. Grgic-Hlaca, M. B. Zafar, K. P. Gummadi, A. Weller, The case for process fairness in
learning: Feature selection for fair decision making, 2016. URL: https://api.semanticscholar.
org/CorpusID:13633339.
[18] S. Verma, J. Rubin, Fairness definitions explained, in: Proceedings of the International
Workshop on Software Fairness, FairWare ’18, Association for Computing Machinery, New
York, NY, USA, 2018, p. 1–7. URL: https://doi.org/10.1145/3194770.3194776. doi:10.1145/
3194770.3194776.
[19] M. J. Kusner, J. R. Loftus, C. Russell, R. Silva, Counterfactual fairness, 2018.
arXiv:1703.06856.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>P.</given-names>
            <surname>Linardatos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Papastefanopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kotsiantis</surname>
          </string-name>
          ,
          <article-title>Explainable ai: A review of machine learning interpretability methods</article-title>
          ,
          <source>Entropy</source>
          <volume>23</volume>
          (
          <year>2020</year>
          )
          <article-title>18</article-title>
          . URL: http://dx.doi.org/10.3390/ e23010018. doi:
          <volume>10</volume>
          .3390/e23010018.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F</given-names>
            <surname>. A. D'Asaro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Primiero</surname>
          </string-name>
          ,
          <article-title>Probabilistic typed natural deduction for trustworthy computations</article-title>
          ,
          <source>in: Proceedings of the 22nd International Workshop on Trust in Agent Societies (TRUST2021 @ AAMAS)</source>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F</given-names>
            <surname>. A. D'Asaro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Genco</surname>
          </string-name>
          , G. Primiero,
          <article-title>Checking trustworthiness of probabilistic computations in a typed natural deduction system</article-title>
          ,
          <year>2023</year>
          . arXiv:
          <volume>2206</volume>
          .
          <fpage>12934</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>F. A.</given-names>
            <surname>Genco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Primiero</surname>
          </string-name>
          ,
          <article-title>A typed lambda-calculus for establishing trust in probabilistic</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>