Biologist Martin Heisenberg writes an article for Nature which purports to address the issue of free will, but ultimately does nothing of the kind.
Heisenberg describes the actual research around which the article is constructed, as follows:
My lab has demonstrated that fruit flies, in situations they have never encountered, can modify their expectations about the consequences of their actions. They can solve problems that no individual fly in the evolutionary history of the species has solved before. Our experiments show that they actively initiate behaviour. Like humans who can paint with their toes, we have found that flies can be made to use several different motor outputs to escape a life-threatening danger or to visually stabilize their orientation in space.
The 'expectations' of fruit flies?
Let us be generous, and accept that this term is used metaphorically. The problem with Heisenberg's article owes far more to the general thrust of the argument, which is merely to claim that animals are capable of adapting their behaviour, that "behavioural output can be independent of sensory input." Yet, as Heisenberg admits himself, "the idea that animals act only in response to external stimuli has long been abandoned, and it is well established that they initiate behaviour on the basis of their internal states, as we do." But given that this fact is well-established, it is difficult to see what Heisenberg thinks has been newly discovered in his lab.
Let us accept that Heisenberg's lab have correctly interpreted their empirical data, and that fruit lies are indeed capable of adapting to their environment. This would constitute a type of learning, but it is difficult to see how this bears upon the issue of free will. Neural networks, for example, are capable of learning, and there is a body of literature which demonstrates that recurrent neural networks can be trained to behave like deterministic finite-state automata (DFA). Fruit-fly learning and subsequent behaviour could be represented by such a neural network, but a neural network that can be trained to behave like a DFA is hardly considered to be the epitome of freely-willed behaviour. Neural networks themselves can be either deterministic or stochastic (i.e., random), but both types of causation are distinct from Heisenberg's notion of freely-willed behaviour as "self-generated," (i.e., neither determined, nor random).
If fruit flies are indeed capable of adapting to their environment, then this would be inconsistent with a behaviouristic interpretation of fluit fly behaviour (i.e., an interpretation which denies that fruit flies possess internal states), but it is perfectly consistent with a deterministic interpretation of their behaviour (as well as being quite irrelevant to the issue of free will). Without internal states, there can be no variation in the output response to input stimuli, but with internal states, the response to a stimulus can vary depending upon the internal state, and the internal state can be the result of prior learning.
So Heisenberg's lab have perhaps found evidence for the existence of internal states in fruit flies, but such a finding is of no relevance to the issue of free will.