Backpackers and diet

I hike and backpack, with a summer average of 5-7 bag nights a month and at least one strenuous day hike every weekend. I used to pack on the calories to match anticipated expenditure, from a nominal 2000 daily to roughly 3500-4000 calories a day. The last two trips of two nights each, I actually gained 1-2 pounds on return. I blame the bad diet from the road trip portion of these outings.
I am still 20 pounds above my goal and am being monitored as possibly pre-diabetic.
I prepare most of my own back pack food but use way too much processed snacks for day hiking.
Who has experience as a backpacker and hiker?