Demons do not think with physical brains (see below), so that 'intelligence' is innate and does not change if a demon shifts into a shape with a bigger head.
Demons are shapeshifters. This isn't just an ability; it defines them. Their attachment to physical matter is not complete. Most of them have low enough shapeshifting skill that they couldn't survive without a body, but some can for varying amounts of time.
In any case, demons' thoughts and memories are not stored in their heads, but in their non-physical aspect. They 'think' with their intangible side.
Most demons are, by most other sapient species' reckoning, stupid.