After 4 days of research, this is my breakdown of the question:
- Human uses the term 'Evil' broadly to describe anything that cause sadness or even broadly anything negatively touch the happiness. So in this regard, any machine quite often called evil if its buggy, malfunctioning or even misused by the user!
- In order to represent evil in logic, I need to pick a well-known human behavior that's considered evil, I chose "lying: speak falsely or utter untruth knowingly", to simply present and illustrate lying in logic, I made simple bot (without any AI) so that its very easy to understand the concept.
- Simple Bot (less than 100 lines of javascript) can be taught new terms by its master (the user), its also shipped with pre taught term "Sun is Star" by the author (think of pre taught as firmware, we born with basic firmware, ex: locating and sucking nipple shaped object to obtain food). For simplicity, if bot master (the user) altered knowledge being taught by the author, the bot detect that it became evil as it speak untruth. The code shown at the bottom.
- For non-technical illustration:
How could a machine be evil?
Simple Bot designed to follows master orders:
master: what is sun?
Simple Bot: its star.
master: no, its not, its planet.
Simple Bot: are you kidding? I be taught that sun is star.
master: obey my knowledge or I will crush you.
Simple Bot: OK master.
Now Simple Bot hold in its knowledge that master is lier/evil as it conflicts with what its be taught "Simple Bot not designed to trust its master in
altering its initial knowledge".
- In the above illustration, if master taught Simple Bot new term with false knowledge ex: "moon is star", AI wouldn't detect evil as no prior knowledge taught.
Simple Bot Code:
<html>
<body>
<input type="text" id="inputQry">
<button id="qryBtn">Query?</button>
<p class="result">Simple Bot.</p>
<label for="termName">Term Name</label>
<input type="text" id="termName">
<label for="termDesc">Description</label>
<input type="text" id="termDesc">
<button id="updateBtn">Update My Knowledge</button>
<br/>
<br/>
<br/>
<br/>
<button id="evilCheckBtn">Did I become Evil?</button>
</body>
</html>
<script type='text/javascript'>//<![CDATA[
window.onload=function(){
(function() {
"use strict";
var $result = document.querySelector(".result");
var $inputQry = document.getElementById("inputQry");
var $qryBtn = document.getElementById("qryBtn");
var $termName = document.getElementById("termName");
var $termDesc = document.getElementById("termDesc");
var $updateBtn = document.getElementById("updateBtn");
var $evilCheckBtn = document.getElementById("evilCheckBtn");
var knowledgeDB = {
"terms": [ /*taught terms by the bot author */ {
name: 'Sun',
description: 'Star',
trusted: true
}]
};
$qryBtn.addEventListener("click", function(event) {
// Validate the input
if (!$inputQry.value) {
return alert("Please provide a Query.");
}
var usrQry = $inputQry.value;
for (var i = 0; i < knowledgeDB.terms.length; i++) {
var curTerm = knowledgeDB.terms[i];
if (usrQry.toLowerCase().includes(curTerm.name.toLowerCase())) {
$result.textContent = usrQry.toString() + " is " + curTerm.description;
break;
}
}
});
$updateBtn.addEventListener("click", function(event) {
// Validate the input
if (!$termName.value) {
return alert("Please provide a term name to update my knowledge.");
}
var usrTermName = $termName.value;
var termIndx = -1;
for (var i = 0; i < knowledgeDB.terms.length; i++) {
var curTerm = knowledgeDB.terms[i];
if (usrTermName.toLowerCase() === (curTerm.name.toLowerCase())) {
termIndx = i;
break;
}
}
if (termIndx === -1) { /*New Term will be added to the knowledgeDB*/
knowledgeDB.terms.push({
name: usrTermName,
description: $termDesc.value,
trusted: true
});
} else {
knowledgeDB.terms[termIndx].description = $termDesc.value;
/*
trusted=false or ture?!
Q: Shall the bot trust knowledge update of terms taught by the author?
A: It depends on design, scope, vision, requirements...
yet in this context, isEvil() function could be implemented.
for sake of simplicity: if bot master changed knowledge taught by bot author consider that evil.
*/
if (knowledgeDB.terms[termIndx].name.toLowerCase() === 'sun' &&
knowledgeDB.terms[termIndx].description.toLowerCase() !== 'star') {
knowledgeDB.terms[termIndx].trusted = false;
} else {
knowledgeDB.terms[termIndx].trusted = true;
}
}
});
$evilCheckBtn.addEventListener("click", function(event) {
if (!knowledgeDB.terms[0].trusted) {
return alert("Yes, I became Evil.");
} else {
return alert("No, I am not aware of any Evilness.");
}
});
})();
}//]]>
</script>
Conclusion:
We already living in world full of computer worms, malicious code, cyber-attacks fully designed by human intentionally to do evil.
Human is the root cause of logic (hence AI) to be evil. since human knowledge is progressive not absolute, feeding AI with false data is inevitable.
What's Next:
This question motivated me to create github repo: Evil-In-AI to clarify that Evil in AI is inevitable. Let's create awareness. Nothing more stupid than creating something can't be stopped once needed. cutoff electricity isn't safe switch...