The formic acid is used to treat the raw latex harvested from the trees. It is exhausted in the process and the polymer is then washed and cleaned. There will be none of the acid remaining in the latex used to make mattresses in what is called the Talalay process, which is used to precipitate, expand, and crosslink the polymer into the sponge form that makes one of the best and longest lasting kinds of mattresses and pillows. I worked many years ago at the factory in Connecticut where the largest facility for these products was, and still have pillows made then.
The coagulation of natural latex requires a mild acid, and a widely-used process for latex foam uses carbon dioxide as the acidifying agent:
Obviously, there is no harmful residue from this process.