We investigated the mechanisms leading to the formation of tunnel valleys in the Swiss foreland near Bern. We proceeded through producing 3D maps of the bedrock topography based on drillhole information and a new gravimetric survey combined with modelling. In this context, the combination of information about the densities of the sedimentary fill and of the bedrock, together with published borehole data and the results of gravity surveys along 11 profiles across the valleys, served as input for the application of our 3D gravity modelling software referred to as PRISMA. This ultimately allowed us to model the gravity effect of the Quaternary fill of the overdeepenings and to produce cross-sectional geometries of these troughs. The results show that 2-3 km upstream of the city of Bern, the overdeepenings are approximately 3 km wide. They are characterized by steep to oversteepened lateral flanks and a wide flat base, which we consider as a U-shaped cross-sectional geometry. There, the maximum residual gravity anomaly ranges between - 3 to - 4 mGal for the Aare valley, which is the main overdeepening of the region. Modelling shows that this corresponds to a depression, which reaches a depth of c. 300 m a.s.l. Farther downstream approaching Bern, the erosional trough narrows by c. 1 km, and the base gets shallower by c. 100 m as revealed by drillings. This is supported by the results of our gravity surveys, which disclose a lower maximum gravity effect of c. - 0.8 to - 1.3 mGal. Interestingly, in the Bern city area, these shallow troughs with maximum gravity anomalies ranging from - 1.4 to - 1.8 mGal are underlain by one or multiple inner gorges, which are at least 100 m deep (based on drilling information) and only a few tens of meters wide (disclosed by gravity modelling). At the downstream end of the Bern area, we observe that the trough widens from 2 km at the northern border of Bern to c. 4 km approximately 2 km farther downstream, while the bottom still reaches c. 300 to 200 m a.s.l. Our gravity survey implies that this change is associated with an increase in the maximum residual anomaly, reaching values of - 2.5 mGal. Interestingly, the overdeepening's cross-sectional geometry in this area has steeply dipping flanks converging to a narrow base, which we consider as V-shaped. We attribute this shape to erosion by water either underneath or at the snout of a glacier, forming a gorge. This narrow bedrock depression was subsequently widened by glacial carving. In this context, strong glacial erosion upstream of the Bern area appears to have overprinted these traces. In contrast, beneath the city of Bern and farther downstream these V-shaped features have been preserved. Available chronological data suggest that the formation of this gorge occurred prior to MIS 8 and possibly during the aftermath of one of the largest glaciations when large fluxes of meltwater resulted in the fluvial carving into the bedrock., Supplementary Information: The online version contains supplementary material available at 10.1186/s00015-023-00447-y., Competing Interests: Competing interestsThe authors have no competing interests., (© The Author(s) 2023.)