Last week it was revealed that Edinburgh University’s David Purdie had discovered a letter from Albert Einstein in which the great scientist notes the importance of 18th-century Scottish philosopher David Hume in developing his theory of special relativity.

Without having reading Hume’s A Treatise of Human Nature, Einstein wrote: “I cannot say that the solution would have come.”

Historians have, in fact, long known about Einstein’s debt to Hume, and indeed about that letter. They’ve known, too, about the influence on Einstein of many other philosophers, from Ernst Mach to Arthur Schopenhauer. Part of what many find intriguing about the story is the idea that scientific theories should be shaped by philosophical ideas. It has become common for scientists to dismiss philosophy as irrelevant to their work. The “insights of philosophers”, the physicist and Nobel laureate Steven Weinberg suggests, are “murky and inconsequential compared with the dazzling successes of physics and mathematics”.

The irony is that in dismissing the worth of philosophy, they are making a philosophical claim. They are taking a philosophical stance on how science should be done. Science is not simply the accumulation of empirical data. It is also about the questions we ask, the methods we employ to answer those questions, the conceptual frameworks within which we fit the facts.

Whether talking of space-time or human nature, it is inevitable that scientists have to think philosophically as well as empirically.

Philosophy, the physicist Carlo Rovelli has observed, brings to science “conceptual analysis, attention to ambiguity, accuracy of expression, the ability to detect gaps in standard arguments, to devise radically new perspectives, to spot conceptual weak points, and to seek out alternative conceptual explanations”.

Or, as Einstein put it, philosophical thinking makes for the “distinction between a mere artisan or specialist and a real seeker after truth”.

• Kenan Malik is an Observer columnist