Due to natural and anthropogenic disturbances, natural gas hydrates with morphologies of nodules and chunks dissociate and release massive free gas, creating large cavities within fine-grained marine sediments. However, it is still a challenge to quantify the impact of gas cavities on mechanical properties of cavitied fine-grained marine sediments as there is a lack of efforts focusing on the inner structure visualization. In this study, an oedometer test and X-ray computed tomography scans are jointly conducted on marine clayey silt with gas cavities, and the confined compressibility as well as the inner structure change under an undrained condition are explored, followed by development of a theoretical model depicting the void ratio change. The results show that vertical loading induces a void ratio reduction, and the reduced void ratio can fully recover after being unloaded. Although being fully recovered, unrecovered changes of the inner structure still remain after being unloaded. Examples include closed cracks in the lower matrix, new occurring cracks in the upper matrix, and the fragmented gas cavity. In addition, the void ratio linearly increases with the increasing inverse of normalized pore gas pressure, while the coefficient of the effective stress linearly decreases with the increasing inverse of normalized vertical loading stress. The proposed theoretical model captures the essential physics behind undrained confined deformation of fine-grained marine sediments with gas cavities when subjected to loading and unloading.