Sound doesn't travel in a straight line- it's a pressure wave, and some amount will bleed around the edges of an incomplete enclosure no matter how absorptive or reflective it is. Thing of a water wave propogating orthogonal to a jetty- the brunt of the wave on the sheltered is attenuated the further in you get from the end, but there's still a signficant amount of wave near the tip. The further to the sheltered side you get, the less difference there is between being 5' from the tip vs. 50', but the whole wave is much attenuated. For a wall to do the job it has to be pretty tall, and must resist direct transmission of the wave through the wall.
The amount of direct transmission through the wall is a function of how much of the energy in the wave that it can dissipate as heat (mechanical absorption), and how much it can reflect away. A bamboo & low-density paper wall will reflect a little, and absorb a little. Making it more rigid on the side facing the source makes it reflect more, and adding density to the wall will limit how how much the side facing you can move. If there's a way to grind up the egg cartons so that they pack more densely you'll get both increased mechanical absorption and an increased mass. Building an earthen wall probably works even better, but may be a lot more work. If it's open at the top you'll still get the edge-bleed, so unless you're going to enclose it completely it may not be worth building a more massive & permanent structure just for sound-abatement. If it can be reasonably installed in a pit deep enough that it's all below-grade, with no line-of-sight from the edge of the pit to your apartment the earth can be your primary acoustic shell, and an absorptive wall above grade wall around the pit can take it down another few dB without being 15' tall
Mounting the generator on vibe-absorbing materials will cut down on the low-frequency stuff, much of which will be ground-transmitted. There may be ways of better muffling the exhaust as well, but whether & how that's done would be specific to the equipment.