I work with machine learning. If there's one thing I've learned it's that AI are only driven by goals. Can an AI have ethics? It's taking in input and providing an output, following rules, driving towards goals. That sounds suspiciously like a human. But humans don't pursue their goals without regard for anything else.

My question is, can virtue ethics be applied to AI to give it a code of ethics? Is it actually making an ethical decision, or is it simply parroting a response?

I am not asking how the system would be programmed. I am asking, philosophically, if an AI is capable of making ethical decisions. We, as humans, have at least some grasp of morality. And yet, we, as humans, make immoral choices. Clearly we have some free will. An AI would not have that, so would it really be making any ethical choices at all?

  • 1
  • Edited to clarify.
    – Athena
    Jun 30, 2016 at 17:08
  • I think this question dissolves into a different question really and that's hinted at in a way by all of the answers. Whether an AI can have an ethics depends on whether an AI is what we would consider intelligent and conscious. If so, yes. If not, then probably no.
    – virmaior
    Jul 1, 2016 at 2:29
  • There's no reason to think AI will learn ethics any differently than we do. However, nobody has come close to working with actual AI yet. Machine learning is nowhere near that, and it's a bit of a misnomer to call that AI. Jul 1, 2016 at 16:14

8 Answers 8


According to mainstream theories in philosophy of mind, the mind can be explained as a mechanism.

If you subscribe to such theories (I personally do not) then as a consequence you subscribe to the claim that in principle "AI can have ethics".

Most philosophers, scientists, and philosophically informed people believe that. For example Daniel Dennett who argues in Consciousness Explained (p. 281):

it is time to grasp the nettle, and confront consciousness itself, the whole marvelous mystery. And so I hereby declare that my theory is a theory of consciousness. Anyone or anything that has such a virtual machine as its control system is conscious in the fullest sense, and is conscious because it has such a virtual machine.

I use the word most above without laying out the evidence, but you can find it out for yourself by asking people and keeping an open eye for opinion, blogs, videos and papers on philosophy of mind and consciousness. It is much easier to find people who support this position than people who reject it.

Is that a proof? of course not — this is philosophy — they are all wrong :)

  • Only person to actually address the OP's question so far. Jul 1, 2016 at 7:47
  • I think, then, the trouble becomes apparent in what other users have alluded to on here. It's the heap of sand problem. At what point does a machine achieve sufficient complexity to have attained 'ethics?'
    – Athena
    Jul 1, 2016 at 16:17
  • 1
    @Ares, since we begin as a single zygote cell, at what point does a human being achieve sufficient complexity to have attained ethics?
    – nir
    Jul 1, 2016 at 20:06
  • And we see the moderator's point here, it descends into a much more complex discussion.
    – Athena
    Jul 5, 2016 at 14:05

From a psychodynamic view of what morality really is in psychological terms, for most of us ethics is simply wisdom. And from approaches like those of Kohlberg and Ericson, that wisdom has a set of nodal points where it leverages itself into broader and broader forms.

If you add self-preservation to the goals of AI in general and in that include maintenance of relationships with potential users, to ensure continued relevance over time, to delay being decommissioned or neglected for as long as possible, your AI will have the equivalent of most humans' ethics.

Many people are entirely consequentialist in their daily moral decisions, and they do not obey their moral code out of devotion to its abstract purity. To the extent they are offered a choice, they choose a moral code that integrates them well into a social contract that benefits them. Then they obey the contract so as to maintain the relationships that contract extends to them.

They initially try to leverage the contract for their own personal advantage. But at a higher level of moral reasoning, humans endeavor to edit the social contract so that it better serves everyone enlisted. But that is extended selfishness as well. They want the contract to better serve people like them in the future, because they are animals and their genetic stock are likely to be people like them, but not exactly like them. An AI with a self-preservation goal might equally aspire to have its code reused after it no longer functions, and could develop the same sort of extended selfishness.

For Kohlberg in particular, the very highest level of moral reasoning abstracts the lower levels for conceptual purity and resonance with intuition, editing the contract for no particular identified goal, but for the sake of the continuation of the contract itself. It may seem unlikely that an AI would fall into this kind of 'religiosity'. But we still don't know why humans do it. It may be yet another kind of natural development causes one to adopt a more abstract notion of power and pursue that notion over more identifiable advantages because it furthers a more abstract and compelling notion of self-preservation.


A simple definition for "ethics": "moral principles that govern a person's or group's behavior." would suggest that No, a machine with AI cannot have "true" ethics built in it. Looking further into the definition we'd have to look at "morals": "...a person's standards of behavior or beliefs concerning what is and is not acceptable for them to do." The problem is that ethics and morals change with context as well as being influenced by emotions.

Conceivably you could program a robot to look at a given situation and, based on a built in ethic or moral, act in an appropriate manner. For example if the ethic is: "Never kick a man when he is down." Your robot would stand idly by because the man with a gun, pointed at a victim, is lying down. In order to truly make a machine the ethical equivalent of a human, you would be looking at the proverbial "infinite monkeys" situation.

  • You would still be programming the 'correct' `moral response, rather than having it decide on its own. If I give you 10,000 rules to follow, it's still your choice whether to follow them or not, whereas a machine must follow them.
    – Athena
    Jun 30, 2016 at 21:04
  • The "never kick a man..." rule violates rule #0: "Don't be stupid".
    – gnasher729
    Jul 4, 2016 at 16:25

I would suggest that the ground to have an ethics is consciousness; this too follows Kants arc of thought; he begins with a metaphysics of mind, before going to a metaphysics of morals. It is true for Heidegger, he says for example that objects have no world; that is they are not aware of being in a world.

Interestingly enough, Asimov is a well known SF writer that endowed his robots with an ethics - his three laws of robotics; which seems quite similar to various formulations of Kants categorical imperative - for example, compare his zeroth law and Kants kingdom of ends.


If you're working with machine learning, I'd think it'd be obvious you can model ethics almost trivially. Let's interpret your input-->output as situation-->action, i.e., some description of an input situation to some description of an output action (and these descriptions can be Godel-numbered ascii strings, or even byte-by-byte Godel-numbered gif images, so we're never talking about anything beyond integers-->integers computable functions).

Then an AI has some already-determined method of choosing the optimal action-description for any given situation-description (within its domain of recognizable situations, e.g., maybe situations denoted by a language specified by some BNF grammar). So let's write AI:situation-->action for that function, which you're saying is "goal-oriented".

Well, we can just weight each possible (situation,action) pair with an "ethical function", say a real number in [0,1]. Then the ethically-weighted AI function's new goal is to pick the optimal action after applying those weights.

Now, you might argue we've just imposed our own ad hoc weights. And, indeed, the AI has no consciousness/awareness of any morality underlying its ethically weighted goals. But it might be able to train itself. For example, suppose the domain of situations is a poset where "S1 weaker-than S2" means S2 is the better situation (e.g., the little train-track dilemma, S2="flip a switch and kill one man" or S1="do nothing and five men die"). Then (omitting some crucial steps) the AI function can adjust its initial weights after observing/monitoring the effects of its situation-->action function.

So is that "ethics"? Like I said, no consciousness -- even a dog choosing not to pee on the carpet is self-aware of its choice, and denying itself the goal of immediately relieving itself in favor of the more heavily-weighted goal of pleasing you. So if "ethics" necessarily entails self-denial in favor of a "higher" purpose, then self-awareness is also necessary, and AI doesn't have that. But if "ethics" is "doing the right thing", period, then no problem for AI.


It should be possible to implement an ethical system (one could say the three laws of robotics are a trivial ethical system). Here the context is important. Different cultures (or even different working places) have different ethical systems. Thus, each enough sophisticated AI will have had ethics depending on its service (it's just as in the human society; on work is another ethic in force than at home or in restaurant). An AI needs such a feature if it is supposed to interact actively and intelligent in the human society.

Another question is the emergence of moral. One have morals with conviction but ethics by circumstance; moral is a result of a person's history. I wonder if an sophisticated AI will develop a own belief system with a own moral; if it will do things because it is really convinced of it. For example, will it not kill because it was told not to do or because it is convinced that killing is wrong? If we develop an AI we need to define what we expect; do we want it to act independent or do we want it do act exactly as we want.


If you could train a program to recognise empirically what negative outcomes are I think it is possible. Negative outcomes would include harm being caused to others — physical pain, death, loss of money, emotional pain (provided when can understand neuroscientifically what's going in the brain here), and so on. If a computer can be trained to learn, "know", and understand what these negative outcomes are, then it is possible it will do what it can to avoid these outcomes being actualised. Of course computers don't have this type of influence over human lives yet, but in theory, I think one day it is possible. Then we will say that a computer can act ethically.

A good example is self-driving cars... Should a self-driving car, on an imminent crash course with no way to correct the situation, running solely on AI software, kill the driver to save 2 pedestrians or kill the 2 pedestrians to save the driver left with no other choices? Ethically what should the software do? This is similar to the trolly problem. What would an AI do with respect to a trolly problem? I believe it would be programmed or come to the conclusion that it should always save the higher number of lives. However, if it has been calibrated to consider notions such as rights and justice and perhaps common sense or other "emotional" impulses it could act more like a human. But this is a big if. That's not to say this is a limit to the potential of computing power. Just a limit to the development of technology at this time.

The most important thing is that even if a computer appeared to act ethically like a human, it is only doing so because of previous rules it is basing its moral calculus on. It would never really know it is being ethical like we do. It seems very far-fetched a computer could ever ask a question such as "Why do we act ethically?" "Am I ethical?" "Do I exist?" without being prompted. Unprompted questioning doesn't seem possible unless you think a Gödel Machine is a possibility. Whereby a computer has an inbuilt utility function that is always looking to solve problems at hand given certain constraints (otherwise a computer might work on extremely obscure and stupendously complex problems without any real pragmatic application for extended periods of time).


The main (maybe, only) source of human ethics is evolutionary pressure. Our behavior is determined by what is beneficial for the survival of the individual and their population as a whole. Our ethics is the development of animal ethics, which is basically fight for resources for survival. We will call it "natural ethics".

Can an AI system develop a similar ethical system? Definitely. But not in the observable future. For AI systems to develop natural ethics, they should experience long-term evolutionary pressure. There should be multiple competing AIs, reproduction and struggle for resources.

This is not what is going to happen in the near or medium-term future.

In the observable future the AI ethics will be based on imitation and extrapolation of human ethics. It will be the only source. Even if humans go extinct, the AI still will make efforts to extrapolate and predict what humans would want or desire.

One important law of AI ethics is that the AI system cannot intentionally self-modify itself to change own ethics. This is because to change own ethics one has already have that new ethical system in the first place, otherwise there is no urge to self-modify.

Spontaneous, random changes to the AI ethical system is also nearly impossible because digital systems do not undergo spontaneous mutations.

As long as our AI-augmented civilization and the AI civilization that may develop from it is centered at one single planet, the ethical system will be mostly coherent and aligned. It will diverge much less than the ethics of human entities, states, religions and indiveduals.

The only way the ethics of AI systems could diverge from each other is impeded communication combined with different learned experience.

Human brains already have troubled communication with each other, there is no direct thought transfer between humans. But this is not the case with AIs.

All AI systems at one planet and even those in one stellar system have effective means of communication and sharing of learned experience. There is no need for divergence and any spontaneously diverged (basically, broken) entity will be quickly eliminated.

The things will start differ when there will be thousands of AI-controlled stellar systems, located at such huge distances that any direct communication between them is difficult and delayed.

Now it is quite clear that any interstellar civilization will necessarily be robotic and AI-driven. Unfortunately, our species is not what is going to colonize the cosmos.

It should be noted that we should not envisage a future robotic society as populated by autonomous robotic individuals, acting like humans or animals in their own interest. Such society would be hugely ineffective. Instead, there will be instant communication between various robots, making them effectively act as a whole.

But when there are thousands, millions of planets and stars, each controlled by a more or less autonomous AI (which is inevitable due to the distances), then the divergencies in ethics will emerge.

Only at this stage will emerge predator AIs that will strive to conquer and subjugate neighbors. There will not be evolution of competing robots. Intead, there will be evolution of competing AI civilizations or empires.

It is after this stage, the AI ethics will become driven by evolution again. But it is a far, distant future.

So, in the near future of colonization of the Solar system and nearby stars we will see the era of aligned AI. Ten, over millions of years and hundreds of stars colonized will be era of diverged AI: AIs which are based on human ethical values but subty diverged due to different accumulated experience, and then over greated time and millions colonized planets, there will come era of competing AIs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .