Pagine

giovedì 24 febbraio 2022

Norms, Algorithms, and Programs

by Enrico Nardelli

(versione italiana qua)

Periodically, when something goes wrong in the use of computer systems in procedures subject to public scrutiny (this being the most recent case), the media talk about "algorithmic discrimination," "algorithmic dictatorship," and similar expressions coined by journalists hunting for a headline that cuts through — though, unfortunately, with a rather limited grasp of the subject matter. As evidence, please consult figure 2.5 (p.24) of the AGCOM document "Observatory on Journalism" dated November 23, 2020, and read the related press release, which states, verbatim, that "media professionals lack a sufficient level of specialist knowledge (understood in particular in terms of academic training) to cover economic, financial, scientific, and technological events and issues". "Don't shoot the messenger", as they say — I hope my friends and colleagues in that field won't hold it against me; I do respect them.

Having clarified this point, I would like to note that in the digital world the term "algorithm" is open to slightly ambiguous interpretation. This is because, historically speaking, algorithms were invented as a method by mathematicians (for the few who still may not know, I should mention that the term algorithm derives from the epithet al-Khuwārizmī of the ninth-century Arab mathematician Muḥammad ibn Mūsa, who was a native of Khwarizm, a region of Central Asia) to describe with precision, to other mathematicians, the procedures to be followed in solving problems.

In informatics, this term was borrowed to describe a problem-solving procedure in a way entirely independent of any specific implementation in the form of a computer program written in a given programming language. The critical issue — and the resulting ambiguity — arises from the fact that it is the computer program (and not the algorithm from which it is derived) that is actually executed by the computer (technically, by the automaton). And in the transition from algorithm to program, which is a genuine act of translation, much like the translation of literary texts, there is always a risk of betraying the original.

Coming back to where we started, it is essential to bear in mind that legal norms are already algorithms — and in particular, they are the algorithms that regulate and organize social life: if you break this rule, then you receive this punishment. Their executors are jurists — I use this term loosely to refer to legal professionals. Seen this way, a perfectly proportional parallel emerges: the algorithm is to the mathematician what the norm is to the jurist. It is no coincidence that both in academia and in the professional world, hybrid profiles combining informatics and law are becoming increasingly common. This mirrors a similar process that has been underway for much longer at the intersection of informatics and biology. But that is a different story.

In law, this social superstructure of written norms and their interpreters — much like mathematics — has functioned perfectly well for millennia: law based on written statutes has been in use in the "Bel Paese" for many centuries before it became a nation. In other, more ancient civilizations, its history stretches back even further. By and large, there have been no major problems, beyond the natural human tendency — which we might consider inseparable from human nature — of some individuals to regard themselves or others as "more equal than the rest". As is often said of democracy, a social system grounded in a written body of law and well-trained interpreters, for all its imperfections, remains better than any alternative.

Therefore, when legal norms — which are already algorithms — are translated into computer programs and something goes wrong in their execution, it is not accurate to speak of an "algorithmic error". One should instead speak of a "programming error". The device that runs the program, operating in a purely mechanical and entirely predetermined fashion, never makes mistakes. If the result produced by execution does not match what the algorithm intended, the error lies in the computer program. To continue the parallel with what happens when the executors are human: it is akin to a jurist misinterpreting a norm. Except that, in the vast majority of cases, being a human being endowed with intelligence, common sense, and experience, the jurist has a series of "safety nets" and "guardrails" that prevent them from distorting the norms they are called upon to interpret.

Far more common, however, is the case where a set of norms, once translated into a set of computer programs, becomes something subtly different. Sometimes this is because the conversion is typically carried out by informatics professionals who do not possess deep expertise in the subject matter and who are not provided with sufficient information by those requesting the translation. Other times it is because the norms themselves, having been written with human executors in mind — executors endowed with intelligence and experience — do not account for every possible scenario. Nor do they need to, just as when we ask a child to walk toward someone, we do not need to tell them to avoid tripping over obstacles, because they can figure that out on their own. The executors in informatics — PCs, tablets, smartphones and the like — simply do not figure things out on their own.

The problem increasingly afflicting the automated execution of administrative procedures through computer programs is nothing other than the latest manifestation of the difficulty of building a computer system that fully meets its specifications — the greatest unsolved problem in software engineering.

Yet, since these administrative procedures are now woven into all of our daily lives, these challenges — once confined to domain experts — are now something we all have to contend with.

Paraphrasing one of the most famous closing lines in cinema history, we might say: "This is informatics, sweetheart, informatics. And there's nothing you can do about it. Nothing". In reality, there is something we can — and must — do. We need to start teaching informatics in schools as a scientific discipline, just as we do with mathematics, so as to raise generations of citizens capable of understanding the difference between algorithms and programs, and the difficulties and pitfalls lurking in the process of translation.

--
The original version (in italian) has been published by "Key4Biz" on 21 February 2022.

Norme, algoritmi e programmi

di Enrico Nardelli

(english version here)

Periodicamente, quando qualcosa va storto nell'utilizzo dei sistemi informatici in procedure sottoposte a pubblico scrutinio (questo il caso più recente), i media parlano di “discriminazione algoritmica”, “dittatura degli algoritmi” e simili espressioni che inventano giornalisti in cerca di un titolo che buca, ma con una, purtroppo, bassa preparazione nella specifica materia. A conferma, consultate per favore la figura 2.5 (p.24) del documento AGCOM “Osservatorio sul giornalismo” del 23 novembre 2020 e leggete il relativo comunicato di avvio della consultazione che recita, testualmente, «ai professionisti dell’informazione manca un livello di conoscenza specialistica (inteso in particolare in termini di formazione accademica) adeguato alla copertura di fatti ed eventi economici, finanziari, scientifici e tecnologici». “Ambasciator non porta pena” si dice: spero non me ne vorranno gli amici e le amiche di questo settore, che comunque rispetto.

Chiarito questo punto, vorrei ricordare che nel mondo digitale il termine algoritmo è di interpretazione lievemente ambigua. Questo perché da un punto di vista storico gli algoritmi sono stati inventati, come metodo, dai matematici (per quei pochi che ancora non lo sanno, ricordo che il termine algoritmo deriva dall’appellativo al-Khuwārizmī del matematico arabo del IX secolo Muḥammad ibn Mūsa, che era nativo di Khwarizm, regione dell’Asia Centrale) per descrivere in modo preciso ad altri matematici i procedimenti che dovevano essere utilizzati per la risoluzione dei problemi.

Nell'informatica, questo termine è stato mutuato per descrivere un procedimento risolutivo in modo completamente indipendente da ogni sua realizzazione sotto forma di un programma informatico scritto in un certo linguaggio di programmazione. Il punto di criticità (e la conseguente ambiguità) nasce dal fatto che è il programma informatico (e non l’algoritmo da cui esso viene derivato) quello che viene eseguito dal calcolatore (tecnicamente, dall'automa) e nel passaggio dall'algoritmo al programma, che è una vera e propria traduzione, come accade per i testi letterari, si corre il rischio di “tradire”.

Tornando al punto iniziale, è fondamentale tener presente che le norme giuridiche sono già degli algoritmi e, in particolare, sono gli algoritmi che regolamentano ed organizzano la vita sociale: se trasgredisci questa prescrizione allora ricevi questa punizione. Le loro macchine esecutrici sono i giuristi: uso liberamente questo termine per parlare dei professionisti della giurisprudenza. In quest'ottica sussiste un parallelo di perfette proporzioni: l'algoritmo sta al matematico come la norma sta al giurista. Non è un caso che sia nel mondo accademico che in quello professionale stanno diventando sempre più numerose figure con una preparazione ibrida tra l’informatica e la giurisprudenza. È un processo analogo a quello che sta già avvenendo da molto più tempo nell’intersezione tra l’informatica e la biologia. Ma questo è un altro discorso.

Nel diritto, tale sovrastruttura sociale di norme scritte e loro esecutori (come la matematica) ha funzionato perfettamente per millenni: il diritto basato su leggi scritte è in uso nel Bel Paese da molti secoli prima che diventasse Nazione. In altre più antiche civiltà ha una storia ancora più lunga. Non ci sono generalmente stati problemi, al di là della naturale tendenza – che possiamo considerare inestricabile dalla natura umana – di alcuni a considerarsi o a valutare il prossimo “più uguale degli altri”. Come si dice per la democrazia, anche un sistema sociale basato su un corpus giuridico scritto e su suoi “interpreti” ben preparati, per quanto imperfetto, è migliore di ogni altro sistema.

Quindi, quando norme giuridiche (che sono già algoritmi) vengono trasformate in programmi informatici e nella loro esecuzione qualcosa va storto non è corretto parlare di “errore dell’algoritmo” ma bisognerebbe parlare di “errore di programmazione”. Infatti chi esegue il programma informatico, essendo un dispositivo che agisce in modo assolutamente meccanico e completamente predeterminato, non sbaglia mai. Se il risultato ottenuto dall’esecuzione non corrisponde alle aspettative previste nell’algoritmo, l’errore è nel programma informatico. Per continuare nel parallelo con ciò che accade quando gli esecutori sono umani, è come un errore di interpretazione di una norma da parte di un giurista. Solo che, nella stragrande maggioranza dei casi, essendo costui un essere umano dotato di intelligenza, buon senso ed esperienza, possiede una serie di “paracadute” e “cinture di sicurezza” che gli impediscono di stravolgere le norme da interpretare.

È invece molto frequente il caso in cui un insieme di norme, trasformate in un insieme di programmi informatici, diventano qualcosa di lievemente diverso. Vuoi perché questa conversione è fatta in genere da informatici che non posseggono un’approfondita competenza sul tema e ai quali, da parte di chi richiede questa trasformazione, non vengono fornite sufficienti informazioni. Vuoi perché in altri casi le norme, essendo state scritte pensando ad esecutori umani dotati di intelligenza ed esperienza, non esauriscono tutti i casi possibili. Non ce n’è bisogno, esattamente come accade se chiediamo ad un bambino di andare verso qualcuno: non dobbiamo specificargli di evitare di inciampare in eventuali ostacoli perché è in grado di pensarci da solo. Ecco, gli esecutori dell’informatica, cioè PC, tablet, smarphone e simili, “non ci pensano da soli”.

Il problema che sta affliggendo in misura sempre maggiore l’esecuzione automatica tramite programmi informatici di procedure amministrative non è niente altro che l’esempio più recente della difficoltà di realizzare un sistema informatico completamente rispondente alle specifiche, che è il maggior problema ancora aperto dell’ingegneria informatica.

Però, dal momento che tali procedure amministrative sono ormai nella vita quotidiana di tutti noi, queste problematiche – prima ristrette agli esperti di dominio – le stiamo soffrendo ormai tutti.

Parafrasando uno dei finali più famosi della storia del cinema potremmo dire: “Questa è l’informatica, bellezza, l’informatica. E non puoi farci niente. Niente”. In realtà, qualcosa possiamo (e dobbiamo) fare. Iniziare ad insegnare l’informatica nella scuola come disciplina scientifica, come si fa per la matematica, per formare generazioni di cittadini in grado di comprendere la differenza tra algoritmi e programmi, e le difficoltà e le insidie che si nascondono nel processo di traduzione.

--
Versione originale pubblicata su "Key4Biz" il 21 febbraio 2022.