Remapping after experiencing ambiguityRing attractor dynamics ensures a single heading representation at any given time even for complex scenes, but under some circumstances this can be unstable4. For example, a scene with two identical stripes at diagonally opposite locations (Extended Data Fig. 3a) makes orientation within the scene inherently ambiguous3. Our model predicts that, upon prolonged exposure to this two-stripe scene, the plasticity mechanism creates a visual map with two potential offset angles. If a single-stripe scene is then presented, this results in two competing heading representations, with the ring attractor network selecting one of them at any particular time (Extended Data Fig. 3b, c). We found a similar effect experimentally in some probe trials after just 5 min of in vivo closed-loop experience with a two-stripe scene in the absence of any optogenetic manipulation (Extended Data Fig. 3d–i, Supplementary Video 4). A companion study37 to this Article finds electrophysiological and imaging signatures of offset switches in a larger fraction of experiments after walking flies experience such ambiguous scenes for longer durations. These results demonstrate how exposure to an ambiguous visual scene can, through the interactive influence of plasticity and ring attractor dynamics, affect the reliability of an otherwise-stable heading representation.Building a full map from partial viewsIn our remapping experiments thus far, the fly performed multiple complete rotations to establish a stable heading representation in a novel setting, which seems unlikely under natural conditions. Drosophila can see nearly 320° of the visual scene from a single orientation38 and the E–PG bump typically activates more than 90° of the ellipsoid body3; this suggests that even limited experience of a scene should trigger Hebbian plasticity that affects a large sector of the ellipsoid body. In the model, we found that full mapping of a visual scene could occur even if the bump was rotated only by 180° or less during optogenetic manipulation (Fig. 4a, b, Extended Data Fig. 4). We directly tested this prediction by imposing an angular relationship between a vertical stripe and an artificial compass-neuron bump, but this time limiting the range of bump positions to 180°. Indeed, we found that—in the majority of flies (6 out of 10)—experiencing this limited range of bump positions was sufficient to induce a stable heading that matched the imposed offset in the probe period of the trial (Extended Data Fig. 4d, e). We could successfully induce a full remapping of the single-stripe scene in a few flies even in a more-constrained situation in which the range of bump positions spanned only 60° (in 7 out of 20 flies) (Extended Data Fig. 4i–k). Further analysis revealed that successful remapping was more likely when the stripe and the bump started inside the newly mapped region in the probe trial, consistent with simulations (Extended Data Fig. 4f–h, j, k). This probably occurred because the internally generated angular velocity signal could move the bump into regions that were not previously traversed while still preserving the new offset, thereby allowing the new heading representation to stabilize. We also observed full remapping after limited-angle exposure in experiments with a natural scene (Fig. 4a, c, d). These results provide insights into how Hebbian plasticity combined with ring attractor dynamics enables the fly to convert information gathered from limited views of a novel scene into a complete heading representation within that scene.