According to https://www.d20pfsrd.com/classes/core-classes/Druid/animal-companions/#Vermin_Companions and https://www.aonprd.com/ArchetypeDisplay.aspx?FixedName=Companion%20Unexpected%20Intellectual it should be possible to increase the intelligence of a vermin and remove its mindless quality.
However, when I try to increase the intelligence of a spider or centipede companion it does not work. If I increase through raising the ability score I receive the dialog message "Cannot modify a nonability". If I increase during the level 4 level up, it does not return any error but the intelligence score remains unchanged.
Maybe related to https://pcgenorg.atlassian.net/browse/DATA-2019 ?
Windows 10 Home 1903