## Ditch Pros and Cons: Use a Utility Function

If you’ve ever met me in person, you know I talk a lot about utility. My close friends are used to answering questions like “does this have net positive utility to you?” and “is that a strongly weighted component of your utility function?”. Every time I make a decision – what to do with my evening, or what to do with my life – I think about it in terms of utility.

I didn’t always do this, but I’ve adopted this way of thinking because it forces me to clarify everything that’s going on in my head and weight all my thoughts appropriately before making a decision. When I decide things this way, I genuinely feel like I’ve made the best possible choice I could, given everything I knew at the time.

## What on earth is utility?

Utility is just a fancy word for “value”. If you enjoy chocolate ice cream, then eating chocolate ice cream has positive utility. If you don’t enjoy carrot cake, then eating carrot cake has negative utility.

One action can have multiple kinds of utility. You can add together all the utility types to get the action’s net utility. For example, if I assign positive utility to eating ice cream but a negative utility to gaining weight, there will be a certain optimal point where I eat as much ice cream as I can without gaining weight. Maybe, if I assign eating ice cream +5 utility, not gaining weight +5 utility, and exercising -5 utility, then it would make sense for me to hit the gym more often so that I can eat more ice cream without gaining weight.

The set of utilities I assign to all outcomes also tells me the optimal possible outcomes, with the highest net utility. In this example, that would be either modifying ice cream so that it doesn’t make me gain weight, or modifying my body’s energy processing system to get it to process ice cream without storing any of it as fat.

Having numbers that are consistent is helpful sometimes, but isn’t strictly necessary. When I need to make quick, relatively straightforward decisions, I typically just make up some utility numbers. Utility calculations in a small isolated system are basically matters of ratios: it doesn’t matter exactly how much utility I assign to something, but if outcome X has 5 more utility points than outcome Y, X is preferable.

Forcing yourself to make up numbers and compare them to each other reveals what you care about. If you initially thought you didn’t care much about something, but then realize that if you calculated net utility with a low number assigned to that thing, you’d be unsatisfied with the result, then you care more than you thought you did.

It might be somewhat unclear, with my super-simple examples so far, what you can assign utility to. So, here are some examples of things that I assign positive utility to:

• Doing new things
• Increasing utility according to the utility functions of people I care about
• Building neat software
• Drawing and painting
• Writing stories and blog posts
• Improving/maintaining my mental and physical health
• Having interesting conversations
• Improving the quality of life of all sentient beings
• Running
• Riding my bike
• Taking walks with my girlfriend
• Eating ice cream

If you enjoy doing it, if you think you should do it, if it makes you happy, if it’s a goal you have for some reason, or anything else like that, you assign it some amount of positive utility.

If you’d like to figure out how much relative utility you assign to different options, compare them: if I had to either give up on improving the quality of life for all sentient beings, or give up on ice cream, the ice cream has gotta go.

You can even assign positive utility to things you don’t end up doing. That’s because the net utility, after accounting for circumstances or mutually exclusive alternate actions. Knowing that you would do something, barring XYZ condition, is a useful thing to know in order to dissect your own thoughts, feelings, goals, and motivations. The converse is true, too: you can assign negative utility to things you end up doing anyway, because the net utility is positive.

## So if that’s utility, what’s a utility function?

A utility function is a comprehensive set of everything that an agent assigns any utility to. “An agent” is anything capable of making decisions: a human, an AI, a sentient nonhuman alien, etc. Your utility function is the set of everything you care about.

The inputs to a utility function are quantities of certain outcomes, each of which are multiplied by their respectively-assigned utility value and then added together to get the total expected utility of a given course of action. In an equation, this is:

`Ax + By + Cz + ...`

Where A, B, C, and so on are individual facets of outcomes, and x, y, z, and so on are utilities.

Say I’m with my sister and we’re going to get food. I personally assign a strong net positive to getting burgers and a weak net negative for anything else. I also assign a positive utility to making my sister happy, regardless of where we go for food. If she has a strong net negative for getting burgers, and a weak net positive for sushi, I can evaluate that situation in my utility function and decide that my desire to make her happy overpowers the weak negative I have for anything besides burgers, so we go get sushi.

When evaluating more complex situations (such as moving to a job across the country, where positives include career advancement and increased income, and negatives include having to leave your home and make new friends), modeling your own utility function is an excellent way to parse out all the feelings that come from a choice like that. It’s better than a simple list of pros and cons because you have (numeric, if you like) weights for all the relevant actions.

## How to use your utility function

I don’t keep my entire utility function in my head at one time. I’ve never even written it down. But I make sure I understand large swaths of it, compartmentalized to situations I often find myself in. However, if you decide to actually write down your utility values, proceed to make them all consistent, and actually calculate utility when you make decisions, there’s nothing stopping you.

In terms of the optimal way to think about utility calculations, I have one piece of advice. If you come out of a utility calculation thinking “gotcha, I can do this”, “alright, this seems reasonable”, or even “ugh, okay, I don’t like it but this is the best option”, then that’s good. That’s the utility function doing its job. But, if you come out of one thinking “hmmm… I guess, but what about XYZ contingency? I really don’t want to do ABC…”, or otherwise lingering on the point of decision, then you’ve forgotten something.

Go back and ask “what’s wrong with the ‘optimal’ outcome?”. It might be something you don’t want to admit to yourself, but you don’t gain anything by having an inaccurate perception of your own utility function. Remember that, in absence of a verbal reason, “I don’t wanna” is still a perfectly valid justification for assigning negative utility to an action or outcome. In order for this process to work, you need to parse out your desires/feelings/goals from your actions, without beating yourself up for it. Your utility function already is what it is, and owning up to it doesn’t make it worse.

Once you have a pretty good handle on your own utility function, you can go ahead and mentally model other peoples’. Humans are calculating utility all the time in the form of preferences and vague intuitions, so even if other people don’t know their utility functions, you can learn them by a combination of watching their actions and listening to their words.

The discrepancy between those two, by the way, is indicative of one of two things: either the person is choosing an action with suboptimal utility, or they don’t actually assign utility to the things they say they do aloud (perhaps for social reasons). You can point out this discrepancy politely, and perhaps help them to make better decisions in the future.

Once you begin to use utility functions for both yourself and others, you might be surprised at how much easier it is to make decisions. When considering possible courses of action for yourself, you’ll be able to choose the best option and know it was the best. And, in a group, having an accurate model of other peoples’ utility functions can let you account for their preferences, perhaps even better than they themselves do.

## How to Be Happy

Growing up, my mom used to tell my siblings and I that when we were upset and didn’t want to be, we could choose to be happy instead. The whole concept seemed ridiculous to me. “I can’t just flip my emotions on and off like a light switch,” I remember telling her.

But the problem was, she was right. It’s entirely possible to “flip your emotions on and off like a light switch”. There’s a lot of research backing up that statementâ€”not surprising, my mom graduated with a Master’s in psychology, I should have known she didn’t pull this idea out of nowhere. Further, though it took me longer than I would care to admit, I did personally realize the wisdom in her two-word advice, “choose happy”.

Many experiments show that if you smile, you’ll feel happier. It’s not even entirely about the conscious decision to feel happy – merely moving your facial muscles or even forcing a smile using chopsticks can do the trick. Your brain just has an association between smiles and happiness and so smiling can make you happy.

So the research says. But I doubted it. For years, until I realized the truth of it independently. Today, I’m going to dissect the reasons I doubted it, because I feel many people probably have the same doubts when reading articles like this one.

I had two reasons to doubt “choose happy”. The first was that I was afraid people would look at me weird if I went from crying to laughing in the span of less than two minutes. The unaltered procession of human emotions is a slow ebb and flow, and a drastic change would make people ask uncomfortable questions.

They probably would have done that. But I wish someone had told me that there are things much more important in life than seeming strange. Spending a majority of my time feeling depressed and anxious for no reason was dramatically worse than it would have been to have some people think I was odd. I should have weighed the pros and cons of feeling the emotion versus letting it go.

The second reason I doubted the wisdom of “choose happy” was that I thought all emotions were important. I thought that they were always there for a reason, even if I couldn’t find what that reason was. It was a gradual realization that led me to the simple fact that some emotions don’t make sense – they’re the result of hormonal imbalances, meaningless stressors, mental overstimulation, and many other things which don’t need to be dwelled on.

Nowadays, I think about emotions in the context of net utility. Is feeling this emotion useful to me? If I’m feeling embarrassed about a stupid mistake, that feeling can be useful, to prompt me to fix the mistake immediately. But after I’ve done everything I can to fix the mistake, including making the appropriate social reparations, I can let the emotion go, because it’s served its purpose. Continuing to feel embarrassed even when I can no longer do anything about the mistake, including learn from it, is pointless.

And if the emotion didn’t have any purpose to begin with – say, if I’m feeling angry because I’ve had a long difficult day at work, which is not even slightly connected to any particular problem that can be solved – I can analyze the cause, decide it’s pointless, and let go of the emotion.

How do you let go of emotions? After your brain stops intuitively holding on because it thinks they’re important, or that it would be weird to let go, it’s typically as simple as focusing on something else. If just passively thinking about something else doesn’t completely fix it, try smiling, putting on a fun or silly song, deliberately focusing on happy thoughts, or even closing your eyes and imagining a pleasant location to hang out for a while. (I’m deliberately giving advice that doesn’t require getting up, because I personally don’t like advice that says “get up! stretch! jog! sweat!” – it does genuinely work, but it’s always delivered in a very pushy way. That being said, if you haven’t already heard this advice from a hundred thousand people, being outside and/or exercising does in fact make you healthier and happier, so try it if you feel inclined.)

So the list of question to ask when you feel any emotion is:

1. What emotion is it? Is that really what I’m feeling? Emotions are frequently very transparent, but they can become tangled. Further, some emotions can mask others: a lot of men have a tendency to express anger when they’re truly sad, for example. If your emotions are unclear, sort them out.
2. What probably caused this emotion? Go over salient events in your mind and find the proximate cause. It doesn’t have to be anything major and it frequently isn’t. You’re looking for a cause, not a good reason.
3. Does this emotion have net positive utility? Feeling negative emotions has inherent negative utility, but that may be outweighed by the positive utility of the action it makes you take: learning from a mistake, apologizing for a misdeed, fixing an internal or external problem, etc. Figure out if the emotion is prompting you to do anything useful, and if it isn’t, if you really need to keep it. Compute the net utility.
4. An important note about these utility evaluations: A common trap I’ve seen many people fall into is where they keep a negative emotion around because they believe it prompts them to do something good which, in fact, they would do anyway. In particular, a lot of high-achievers end up with the misconception that being miserable is what prompts them to achieve things, when in fact, they would achieve more if they were happier. Therefore, strongly doubt any utility evaluation that leads you to the belief that you need to be miserable all the time in order to get things done.
5. If you determined that the emotion has net positive utility, keep it around, but only as long as it continues to be useful. As soon as you’ve done everything useful that the emotion was prompting you to do, throw it away. There is no reason to be miserable longer than necessary.
6. If you determined that the emotion has net negative utility, toss it immediately, using any of the tricks described above.

A final note about the utility of positive emotions: feeling good is a good thing. I’ve seen people be happy but wonder whether they really should be feeling happy. You can dissect the emotion and what actions it makes you take to figure this out, but don’t decide you need to be unhappy because it’s uncommon to see sane adults who visibly care about anything. Emotions are good to keep if they’re useful, and being happy uniformly makes your life better, so ceteris paribus, happiness is useful, and therefore, happiness is almost always good to keep.

In conclusion:
Choose Happy.