No, that was not a typo. It might seem counterproductive to take caffeine when you need to sleep, but some mice at Boston Children's Hospital would beg to differ.
To test pain medications in mice, you have to surmount a number of challenges. Perhaps the most obvious and yet most challenging is that you can't ask them whether they're in pain. Or rather, you can ask, but you can't blame them when you don't understand their response. In studies about cancer or diabetes, there are measurable impacts that you can see in mice without having to ask them to describe their symptoms. But pain is experiential. You can try to explain what your pain feels like or assign it a number on an arbitrary scale—you still won't ever truly convey what your pain is like to another person. And whether it comes from a measurable source or it's “all in your head” doesn't really matter. If you think you're in pain, you are.
Mice can't tell us whether they're in pain. All we can do is interpret their behaviors and infer a conclusion. If you expose a fully-rested mouse to a heat source and he jumps back after three seconds, but a tired mouse jumps back in just one, we can infer that the tired mouse is more sensitive to pain. And that's exactly how these neuroscientists did it (with some added controls to make sure the mice weren't just generally more sensitive). Most mouse studies on pain that involve sleep deprivation keep the mice up by making them exercise or putting them under stress. These neuroscientists opted for a more realistic approach: they kept them up with entertainment. Just as you might turn on late night TV or stay up reading “one more article” online, mice will stay up far past their bedtimes if given some cotton to chew on or nesting materials to arrange. Do that for 12 hours, and you have a group of very sleepy mousies to perform your pain tests on.
Caffeine and modafinil helped the sleep-deprived mice return to a normal baseline of pain sensitivity, but it's not clear how directly that relates to humans. How much does a full night's sleep help someone with lower back back? Is caffeine just as good as sleep? What if caffeine keeps you up so much that you can't sleep anyway?
We do know that caffeine helps acute pain. That's why some common headache meds have added caffeine—it effectively boosts the analgesic effects of the pill. It can work wonders on acute pain from things like tension headaches. Chronic pain is a different beast, one that may not be so easily conquered. Oftentimes patients are suffering from nonspecific pain, which could be quite different from the specific pain these little mice experienced. If something like caffeine works well, it could help patients avoid the side effects of constantly taking pain medications. But that may be a big if.