The initial setting in Madisonian Chloe Krug Benjamin’s debut novel, a prep school in Northern California, is one familiar to many contemporary and classic coming-of-age novels.

But “The Anatomy of Dreams” quickly veers away from a predictable plot, combining the suspense of a noir thriller and the oddness of science fiction to tell a broader story about the choices we make and the people they help us become.

Sylvie Patterson first encounters Dr. Adrian Keller when she is a student. As headmaster, Keller is distant to most of the students — except those he chooses as special research assistants. Sylvie soon falls for one of these assistants, Gabe, despite his strange behavior and his unexplained late-night visits to Keller’s home on the school grounds.

When Gabe leaves school unannounced, Sylvie is left to pick up the pieces, eventually starting college at UC-Berkeley. Her senior year, Gabe returns, and entices her to quit school and come to work as a research assistant for Keller.

Sylvie and Gabe, young and in love, follow Keller to Martha’s Vineyard to Fort Bragg to the University of Wisconsin-Madison to assist with Keller's research into lucid dreaming and its potential therapeutic use for people with serious sleep disorders.

Combining theories across disciplines, Keller argues that sleep disorders are the result of the subconscious mind being unable to sufficiently resolve the multitude of choices and actions that occur every single day. Patients who come to Keller for help often have violent or dangerous reactions in their sleep. Teaching patients to recognize they are dreaming can help them get in touch with their feelings and address them.

The novel jumps back and forth in time, dropping hints that Sylvie’s carefully organized life with Gabe has unraveled, thanks in part to the actions of a former research subject that causes Sylvie to question the efficacy and ethics of their project.

At the same time, Sylvie grapples with the questions that many young people face about their careers, their relationships and what kind of person they hope to be.

Although the specific research project being headed by Dr. Keller in the novel is invented, the theories behind it and the techniques Keller uses are all inspired by existing research on dreams, Benjamin said in a recent telephone interview.

“As a writer, the tendency toward narrative that exists in dreams is so fascinating to me, as are the lack of control we have in them — the way that they kind of show us for who we are in a way that can be uncomfortable as well as revelatory,” Benjamin said.

The study of lucid dreaming — recognizing that you are in a dream while you are actually dreaming — has entered academia thanks to researcher Stephen LaBerge. And theories that dreaming can be used to regulate disturbing emotions was popularized by Rosalind Cartwright in her 2012 book “The Twenty-four Hour Mind.”

Benjamin’s careful research and specific details on everything from the proper technique to administer a sleep test in a lab to what it is like to live in the Atwood neighborhood of Madison ground the story, especially when the plot asks the reader to suspend disbelief in other areas.

The main locations in the novel — Martha’s Vineyard, Fort Bragg and Madison — are all familiar locations for Benjamin, a native of California who moved to Madison in 2010 to pursue her MFA in creative writing.

She began working on “The Anatomy of Dreams” midway through her program, and finished it while working in Madison, first as an adjunct professor and now at a nonprofit that provides services for victims of domestic violence in Dane County.

When it became clear that “The Anatomy of Dreams” would take place, in part, in a town with a major research institution, Madison was a natural fit, Benjamin said.

“I think when you move to a place, there’s something about it that’s inspiring because it’s all new to you,” said Benjamin. “The longer you live somewhere the harder it is to see it with fresh eyes and see its oddnesses and eccentricities and what makes it unique.”

The book’s careful treading of the line between genres is also indicative of some of the books and authors that Benjamin considers her favorites.

Benjamin said Kazuo Ishiguro’s dystopian science fiction novel “Never Let Me Go,” which was turned into a 2010 feature film starring Keira Knightley, Carey Mulligan and Andrew Garfield, was inspirational while writing “The Anatomy of Dreams.” And she often returns to the work of Alice Monroe and Lorrie Moore.

“I really love authors who nudge at those boundaries between literary and genre fiction — I’m thinking people like Margaret Atwood, Lev Grossman, George Saunders,” said Benjamin.

Benjamin has started on the research for her next novel, which she said will involve divination, Vaudeville, and sex work in 1980s San Francisco. “My Google searches are getting a little bit wacky, but it’s been a really fun project,” she says.