Enrolling in a PhD program is, from an economic perspective, a terrible decision. But that doesn’t mean you shouldn’t do it. Just don’t let it ruin your life.

Here’s how that could happen: After nearly 10 years in graduate school and substantial debt, you still end up a part-time or adjunct professor (and still in debt). According to the Chronicle of Higher Education, these jobs make up 76% of the academic labor force, pay less than $3,000 a class, and lack benefits and job security.

Here’s how to avoid that predicament: Contrary to what they tell you in graduate school, the world outside the ivory tower isn’t so bad. And so the minute you get the PhD, you must leave academia.

I’d have earned more money if I did an MBA, but going to graduate school was the best thing I ever did. I went in ambivalent about a career in academia, but I wanted a PhD simply because I loved economics and wanted to learn everything about it. Somewhere along the way, I let myself be convinced that I wanted an academic career. I was repeatedly told that academic research is the only thing I’d find intellectually fulfilling, no one would appreciate me on the outside because people weren’t as smart, industry work was empty and soulless, and I’d have to wake up early everyday. Most scary: Leaving meant I could never come back.

I bought into it because it was necessary for my survival. Dedication to academia motivated me to write the best dissertation I could and maintain my committee’s interest in me. But then I went on the jobs market, and I realized what I really loved about academia: the intellectual rigor, exploring new ideas, constantly learning from my peers, and sharing what I had learned with others. But these were all things I could, and did, find on the outside. I think I understand economics better as a result of leaving academia. Applying my research to real-world problems and re-orienting my focus to a different field, financial economics, deepened my understanding of the economy.

It was a hard transition even though leaving academia isn’t unusual in economics. In 2011, only 56% of new economic PhDs with jobs stayed in academia, in 2012 more than 80% of humanities PhDs, who had jobs, did. That may be because economics has many direct applications. But when it comes to what’s been more valuable to me, my economics knowledge comes second to other skills I learned in a PhD program: self-direction, an ability to translate complicated ideas, communicate them clearly, and the ability come up with novel, creative approaches to problems. These skills are skills universal to all PhDs. These are also traits the new economy values.

According to Tyler Cowen’s book, Average is Over, and Erik Brynjolfsson and Andrew McAfees’ The Second Machine Age, technology is changing the labor market. The most successful will be people with advanced cognitive skills who can augment machines. The thinking and technical skills (for some fields) you learn on a PhD gives you the tools to thrive in the modern labor market.

But nothing about the PhD process educates you on how to find a non-academic job, apply your skills, or sell yourself to employers. The PhD process involves a long, intense, and often fraught, mentorship with your adviser. At the end, the adviser places you in your first job (or abandons you entirely), her opinion of you determines the course of your career. Enduring this dynamic for half a dozen years leaves many PhD students an emotional wreck, convinced they can’t do anything without their advisers’ approval and help. It also leaves them totally ignorant of how the mainstream job market works.

The transition out of academia is very hard and will probably take several months, especially if you are highly credentialed but lack traditional experience. But the longer you delay getting a job, the harder the transition will be. I repeat: If you don’t graduate with a solid academic job or compelling post-doc, give up on the dream as quickly as possible.

The shortage of academic jobs relative to PhD candidates leads some to say fewer people should do a PhD. But that is a complete misunderstanding of the purpose of higher education. One objective of education is to gain the skills required for a job, but higher education isn’t a trade school. Besides assuming any degree guarantees a particular job isn’t realistic any more. That’s not true for lawyers, MBAs, architects, journalists, or PhDs. Technology changes so quickly you can’t rely on the tangible skills you learn in school anymore. Instead, the most valuable skills are intangible: how you process and present information, work well with others, and learn new things.

The fact that there are more PhD candidates than academic jobs isn’t necessarily a market failure; it can potentially suit both sides. As a PhD student, for several years you’re paid to study something you care about and learn how to think creatively. In return, the university gets cheap teaching labor. That may be a reasonable trade. The failure happens at the end when many skilled, smart people feel trapped in the lowest tier of academia. The process could work better if universities acknowledged the realities, stopped brainwashing students, and did more to prepare them for jobs outside of academia.

Take a PhD it for what it is—a fulfilling intellectual experience. And then move on.