Benedict Cumberbatch’s fastidious portrayal of Alan Turing opens “The Imitation Game” with a question: “Are you paying attention?” It begins as he delivers the preface to the Turing test, which can distinguish whether something is human or not, through narration.

The introduction to the experiment also doubles metaphorically as the conversation between the film and its audience, as it often demands the viewer’s full participation. In a film so crisply paced and reliably involving, there is little room for passivity.

Confident direction by Norwegian Morten Tyldum and Cumberbatch’s finest performance to date assure that the fascinating, tragic life of Turing and his staggering accomplishments are done absolute justice. The film’s narrative slides back and forth between Turing’s troubled youth and his secret work with the British government during World War II decoding Enigma, the theoretically unbreakable German code, and then culminates in the tragic aftermath of his classified contributions to ending the global conflict.

With a biopic subject so interesting, it almost seems hard to mess up, but Norwegian director Tyldum goes further by creating something with both nuanced craftsmanship and mass audience appeal. With tight editing tethering together the different fragments of Turing’s life, “The Imitation Game” straddles the fine line between complex emotional artistry and its status as a gripping, yet crowd-pleasing, historical thriller. It is restlessly entertaining.

Cumberbatch’s new position as a member of the Hollywood A-list makes him the center of attention, but Keira Knightley is commendable as Joan Clarke, who is hired to join Turing’s elite team of mathematically savvy minds. Matthew Goode provides a great deal of the film’s welcome and unexpectedly witty humor as Hugh Alexander, the most charismatic of the code-breakers. Mark Strong, though only in a few scenes, makes the most of his onscreen time as MI6 Chief Stewart Menzies.

The story, which was unfortunately oversimplified and bullet-pointed in the film’s main trailer, is littered with twists, palpable drama and a sense of wonder at intellectual discovery. The film also avoids condescension by refusing to dumb down the sciences and depicting Turing’s struggles in later life — as a homosexual forced by the British government to take hormonal medicine — with tact, identifying themes that are even more relevant today with the LGBTQ movement’s modern progress.

Not enough can be said of Cumberbatch, who brings an uncompromising amount of strangeness and sophistication to his difficult role. This is something deeper than any of his similar modes of unsociable geniuses, such as in BBC’s “Sherlock.” Turing was a once-in-a-generation mind, saving millions of lives in World War II and just happening to invent computers along the way. His life deserves to be immortalized in film, and Cumberbatch unquestionably rises to the occasion.

A taut thriller and an emotionally satisfying biopic, “The Imitation Game” cares just as much about respecting its story as it does about keeping eyes glued to the screen. We are, indeed, paying attention.