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.
A demon with high enough shapeshifting skill might actually be able to build a functioning brain and use it to think with. It would need to be a stunningly talented genie for this to work.