Context switching

By Charles Sutton on July 1, 2017

Of the many quirks shared by computer scientists, one that has somewhat entered the popular culture is the use of computing metaphors to speak about how we think. For example, “multitasking” is actually a technical term invented by computer scientists in the 1960s to describe the way a computer pretends to execute many programs at once, even if in reality it can only do one thing at a time. You can see why the term would have been quickly co-opted to metaphorically describe humans who attempt the same trick.

For the benefit of the three or four readers of the blog who are not computer scientists, I’ll digress here in order to comment that the situation on the computing side has gotten more complicated since the 60s, as almost all modern computers can perform many operations at once, but they still use multitasking so that they can pretend to do even more. That probably sounds like some people you know, too.

Professional computer scientists have many more metaphors at their command, though. We speak of “swapping in” and “swapping out” the details of a project from our short-term memories, referring to a technique that allows computers to pretend to have infinitely large memories. We also — and now I come finally to the topic of the post — talk about “context switching”.

A context switch is a necessary result of multitasking. If a computer is pretending to run ten programs at once when it can in reality run only one, then it must switch very quickly back and forth between them, like a chef switching between stirring the sauce and browning the meat. Unlike the chef, on a computer the switching comes with a price. The price comes because computers have many different types of memory, some fast and close to the CPU, others larger and farther away. Every time the computer switches from one program to another, it has to move data about the old program out of the small fast memory, and move the new data in. The work of switching back and forth is what we call context switching. It takes a bit of time.

So it is in your mind. When you switch between different tasks, it takes a while to remember the other context: what it was that you were supposed to be doing on the new task, why you thought it was a good idea, and so on. This is why you’re not as efficient when you first start a new task as when you’ve been thinking about it for a while. This has led to the deluge of self-help articles, some of which I’m sure you’ve seen, about how mental multitasking is a bad idea. It takes time to switch contexts.

But as a professor (in the US sense), especially leading a research group, context switching cannot be avoided. The nature of the job requires us to make progress on many different types of tasks each day, from answering a student question about a problem set, to planning for the curriculum next year, to reading a paper related to one research project, to an impromptu meeting with a colleague about faculty hiring for next spring, to a scheduled meeting with a PhD student about a different research project. One of my mentors liked to joke, “Professors are stateless” (another computing metaphor). The reason that we seem stateless is that it takes some time for us to remember the previous context. Not only does it take time to context switch, but it is also a bit disorienting. A colleague once told me that the part of being a professor that they disliked the most was having to context switch many times a day.

People sometimes ask me how I handle context switching. I have a few strategies. One is a bit embarrassing, but I will tell you anyway. Perhaps I made this a long post to drive people away before I revealed the embarrassing one.

  1. First is not to be afraid to ask questions. This is useful in one-to-one student meetings about a research project. You can say something like: “Sorry, what was the vorpal sort for again?” Of course, if you do this too much, you derail the meeting. But with practice I found that much of the time, simply asking the question silently in my head was enough. Once I had articulated the question clearly, I was able remember the answer, without bothering the student to repeat what we had already discussed. I’m sure this makes me look smarter, but more importantly it saves time.

  2. I keep relevant information easy to search on my computer. This is why I am never without my laptop. I don’t try to remember all that I need to know so much as remember how to find it in my email, in my Evernote, by a Web search that I know will bring up a particular page, or whatever. Then if I’m in a large meeting, for example, where I can’t just stop and ask twenty people to remind me what they said in last week’s meeting, I can search quietly and find the context I need.

  3. When I know I’ll need to make a big context switch, I’ll take a break to clear my head. A ten-minute walk helps, or staring out a window, or something sweet. Coffee doesn’t work here for me; it’s great for energy, of course, but not for context switching.

  4. If I write something down, I know down to my unconscious that it’s OK to stop thinking about it, because now I can come back later. When I have meetings back to back, during the second meeting I might remember something I should have said in the first. If I quickly jot down a note, that helps me to stop thinking about the first meeting, and return to the task at hand. This works within meetings too. Sometimes I think of something that I need to say in a one-on-one meeting, but it’s not as important as what we’re talking about right now. I’ll write that down too. I’ll even say something as I’m doing this, so we both know there’s something to come back to later.

  5. OK, OK, I’ll tell you the embarrassing one. I have some mental imagery that I use. I imagine my focus of attention as the beam of light coming from a huge lamp, like at the top of the lighthouse. When I need to switch focus quickly, like between back to back meetings, I imagine myself grasping the lamp between my hands — it’s several feet around, and heavy, so this takes a real effort — and slowly rotating it to shine onto the new problem that I’m meant to be thinking about. Believe it or not, sometimes this works. I will never tell you when I am doing this, even if you ask.

Where your brain wants to Go

By Charles Sutton on June 6, 2017

Years ago I attended a lecture from a famous master of the game of Go. He is revered not only for the many championships he has won, or even for his daring and distinctive style, but also for his insightful and even witty commentary on the games of other professionals. All of us who attended expected a once-in-a-lifetime treat.

And so it was, but not in the way we expected. Sadly, the translation was not of the same standard as the lecture. As best as I can recall, the translation included such wisdom as: “You should play on the points where you want to play”, “Sometimes you may not want to play where you play, but still it is important to play where you want to play”, and “It is important to review the game after it is finished”. All of us in the audience looked at each other blankly. None of us could understand how this could be the accumulated wisdom of a brilliant lecturer and champion.

Confused, I found a friend who understood the lecture in its original language. A pained look on his face, my friend explained that the flowery and poetic language of the lecture would have been difficult even for an professional translator, let alone a foreign Go enthusiast, however fluent, graciously donating his time to translate. My friend then explained the gist of the lecture, and indeed it contained great wisdom about how to learn the game.

Sometimes when you play Go, there’s a move on the board that you desperately wish to play. I’m not talking about moves that are obviously good, those that claim large territories or capture many stones. Everybody likes to do that. But sometimes, a point on the board calls out, like a tiny but brilliant beam of starlight is shining on one intersection of all the 361 on the board. But in your conscious mind, you cannot explain why that move. Hard as you may try, the move is too complex to read out, and you’re not sure what will happen. A player of your strength does not play only on gut feeling, without thinking. It seems too dangerous. You should play somewhere else.

And what the Go master said is: When a point on the board calls to you like this, you must play there. Not because the move is correct — it almost certainly is not — but because your intuition is telling you that the move is correct, so the only way to improve your intuition is to play the move, in the hope that by so doing, you may discover why it is wrong. Go is too complex for people to understand all consequences in advance, so at some point, no matter how far you look ahead, you have only your own intuition to trust. This is why you also must review your own games afterwards, when the result is more clear. The only way to train your intuition is follow it, understand the consequences, and correct where you were wrong.

Research is like this. There is a feeling that I have learned to recognize when an idea is waiting to form, but I cannot yet articulate it. Whenever I have this feeling, I shut up and wait, until the words come. Usually, after I do find the words and formulae to express my thought, it becomes clear that the idea is bad, has been already published, or — most commonly — both. But it is not important that the idea be often good, because in research the overall success of your career depends not on the worth of your typical idea, but of your best idea. When your unconscious mind is repeatedly telling you to go somewhere, sometimes that alone is reason to Go.

On creating a "companion web site" for talks

By Charles Sutton on December 29, 2016

My last research talk, I tried an experiment during the talk. I created a “companion web site” for the talk, which is an online handout including slides, code, links to papers, and a bullet-point abstract. Here’s my first try at an online handout.

The inspiration was Tufte’s quixotic diatribe against Powerpoint, which recommends written handouts instead of slides. The web site is an attempt to adapt his idea to an all-open all-Internet all-the-time age. Seeing as I have no intention of printing out several hundred paper copies of a handout and carrying them thousands of miles to a research meeting, and that most people have laptops anyway.

Why the handout? Lectures are limited because speech is linear. If we are conversing, when I haven’t understood what you have said, I can ask you to go back. When you lecture, I cannot do that. If I stop a moment to think more deeply about something that you have said, I run the risk of missing your next point.

The handout is designed to help with this. By giving you a written summary, and also my slides, you can “go back” and re-read a point that you may have missed. A second role for the online handout is to help you find more details after the talk, to find exactly which papers, which code, and so on, I was referring to.

If the handout really helps, then it raises an even more interesting question. Why the slides? Tufte argues vehemently against slides as a replacement for written text. Slides have low resolution, which encourages poor statistical graphics, and encourages hiding details which are vital to assessing an argument in science and engineering. Also, most arguments do not fit into bullet points, because bullet points can convey only linear relationships and nesting. The narrative that you are trying to convey in your talk is likely to be more complex.

In research conferences, we already have a handout for each of our talks, the research paper. So maybe we be presenting scientific talks with no slides at all? If not, why not? Sometimes at a conference, I’ll skim the paper during the talk if I am starting to get confused. Sometimes that helps. But papers are information dense, with long sentences full of qualifying statements designed to forestall potential reviewer criticisms. It can be hard to read dense text while also remaining aware about what the speaker is currently saying. Sometimes I think this a blind spot of Tufte’s, that he leans too heavily on information density as a measure of the quality of a display.

We can think of the sequence [ slides, audio of talk, online handout, paper ] as attempting to convey the same information at different levels of density. This allows the reader/viewer to choose the appropriate level. But slides and audio are both low density. Do we really need two low density ways of conveying the information?

Another way of asking the question is: What are slides good for, when they are good? Tufte does seem to accept that good slides are possible. He admits that perhaps the top 10% of presenters aren’t harmed by Powerpoint’s cognitive style, as their own presenting style is strongly enough developed that they impose it on the software, affordances be damned.

In the past couple of years, I’ve been experimenting with different slide designs. I may even starting to understand what principles I am aiming at in my slide designs. But I think that’s a topic for another day.

GTD Made Simple: Why I think the Internet needs one more blog post about "Getting Things Done"

By Charles Sutton on November 21, 2015

I’m naturally disorganised, but I have so much stuff to do that out of necessity I get organized. (Then more stuff comes and I get disorganised again.) The way I get organized is by attempting to follow a system called GTD. GTD comes from a book by David Allen called Getting Things Done. The book is an unusual read, a mix of management-speak, Zen-speak, and tips for organizing your filing cabinet. But for all that, it’s a good book.

GTD has become popular with many different types of people. It is especially popular with tech people on the Internet. It’s a bit of a geek cult, which is strange. Why are computer programmers singing praises for a management consultant? Indeed, why are university professors?

Lots of people on the Internet have been writing about GTD. It can be hard to get started. For one, the book itself, the writing isn’t always succinct. Also, cleaning up your to do list and blogging about it is a good way to procrastinate. So, there are lots of blog posts out there about GTD. Lots.

I have been trying to figure out a way to explain GTD that makes clear how simple it is.

Look, you need a to do list. It will clear your head so that you can concentrate on your work. That’s it. That’s GTD.

But you’ve tried this already. It helped for a little bit, but then it stopped helping. This is where GTD gets interesting. It’s based on an extraordinarily perceptive understanding of why to do lists stop working. They can stop working because:

  1. You haven’t written everything down. To do lists become way better when they contain literally everything that you have to do in life. If they don’t, then deep down in your mind, you will always know that you’ve got stuff to do that isn’t written down, so you spend mental focus trying to remember those things. It’s like if you tried to keep a calendar but only wrote down half of your appointments in it.

  2. Your list is too vague. If you write down something like “Dentist” on your to do list, every time you see it, you need a little mental energy to work out what that meant and plan what you need to do about it. But after you’ve done that planning, you don’t do anything about it, because you were just scanning your to do list and right now you need to do something else instead. This makes you anxious. And if you read “Dentist” without taking that effort, then you still feel anxious because it reminds you that there’s something you need to do and you’re not sure what it is.

  3. Your list is too long. When you’re not sure what to do, you need to be able to scan your list quickly to decide what to do next.

  4. You can’t find items right when you need them. If you’re about to drive past the hardware store, you need to be able to stop in the parking lot and quickly find the list of stuff that you’d been meaning to buy.

  5. You can’t write down items right when you think of them. When you notice you’re running low on toilet paper, you’re not usually in the grocery store at the time. But you still want to record this right then, so you don’t have to remember it until you’re walking past the shop the next day.

  6. Your list doesn’t keep up with your life. Gradually you get more and more things to do that just don’t make it on to your list.

  7. You don’t compare your list to your bigger goals. Urgent things aren’t always important, and it’s easy to let days slip by you. You need to think about what’s most important in your career and your life, and your to do list needs to contain actions that help make the important things happen.

GTD is a system for keeping lists that is designed to avoid these problems. GTD doesn’t care where you keep your lists or how you store them — this is why geeks love GTD, so that they can keep arguing about what software is best. But you don’t need software. Paper works fine. What you need are principles to guide you.

The main principles of GTD are:

  • Record everything. Everything that you need to do.

  • Record everywhere. No matter where you are, you need a way to write things down so that they will end up on your list.

  • Organize by context. You want multiple to do lists, organized so that when you scan a list, it contains only things that you could do right then, if you decided to. You might have a list of people you need to call, a list of things to do at a computer, a list of things to do at home, etc.

  • Specific measurable actions. This the caveat to “record everything”. If it goes on your list, it needs to be something specific, that you could do right away, finish, and tick off. Instead of writing “Dentist”, you should write, “Email Morag to ask for dentist recommendations”. When you read an item on your list, you don’t want to think “Oh, what was that?” — you want to think “Ah, I can do that!”

  • Small specific projects. A project is anything that takes multiple specific actions to accomplish, even if it’s only 2 or 3.

  • Plan naturally. For any project, work out what you need to do on the sheet of paper, and add to your list the actions that you can do right away. Actions that you need to do later down the line, they don’t go on your list.

  • Review weekly. Check your calendar and your notes to see if there’s anything that you need to do that you haven’t written down yet. Think about your longer term projects and goals and make sure your lists have actions that help with them.

How you organise a set of lists, and supporting files, to meet these principles, that’s what the book is about. It may not always seem so from the surface, but the book is full of clever little tricks. That’s another reason why the book can be deceptive: It’s easy to admire the tricks but not understand the system. But if you really understand the principles, then the practice becomes much more clear.

Tags: productivity

Why you should scrunch your face when you think

By Charles Sutton on September 27, 2015

An important skill in any type of creative work is to observe and reflect on your own habits of thought and discover a way of working that suits them. A simple example is the old advice to notice the time of day when you have the most energy, and reserve that time for the most creative aspects of your work. But there are many more examples of this, if you look for them. It helps to be a bit self absorbed.

One habit that I’ve just recently reflected on is that sometimes I close my eyes and scrunch my face into an “I’m thinking hard” face when I’m trying to think hard. In some sense this is an affectation. But I like to think that the goal is more noble, to harness the cognitive dissonance that would result if I make the scrunchy face without thinking hard. To escape this dissonance, the only option for my subconscious is to actually start thinking hard. It feels like this helps, at least sometimes, but I haven’t kept careful records. And at least everyone else can see how hard I’m thinking.